/* ─── Reset & Base ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root,
[data-theme="dark"] {
  --bg:            rgb(34, 37, 43);
  --bg-alt:        rgb(29, 32, 38);
  --surface:       rgb(41, 44, 51);
  --border:        rgb(55, 58, 66);
  --text:          rgb(231, 231, 231);
  --text-secondary:rgb(155, 156, 160);
  --text-muted:    rgb(100, 101, 106);
  --accent:        rgb(231, 231, 231);
  --accent-fg:     rgb(34, 37, 43);
  --code-bg:       rgb(26, 28, 33);
  --nav-bg:        rgba(34, 37, 43, 0.90);
  --code-kw:       #C586C0;  /* keyword - purple */
  --code-fn:       #DCDCAA;  /* function - yellow */
  --code-str:      #CE9178;  /* string - orange */
  --code-num:      #B5CEA8;  /* number - green */
  --code-at:       #DCDCAA;  /* decorator - yellow */
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --max-width:     1120px;
  --radius:        4px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:            #FFFFFF;
  --bg-alt:        #F6F6F7;
  --surface:       #EBEBED;
  --border:        #E5E5E8;
  --text:          #0B0B0C;
  --text-secondary:#4A4A50;
  --text-muted:    #7A7A82;
  --accent:        #1A1A1C;
  --accent-fg:     #FFFFFF;
  --code-bg:       #F0F0F2;
  --nav-bg:        rgba(255, 255, 255, 0.90);
  --code-kw:       #8B5CF6;  /* keyword - purple (darker for light bg) */
  --code-fn:       #1F51B6;  /* function - blue (instead of yellow) */
  --code-str:      #A04900;  /* string - dark orange */
  --code-num:      #2B7A00;  /* number - dark green */
  --code-at:       #1F51B6;  /* decorator - blue */
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
}

img, svg {
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}


/* ─── Navbar ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.25s;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--accent);
  user-select: none;
}

/* Logo image variant */
.logo-img {
  display: flex;
  align-items: center;
}

.logo-mark {
  height: 24px;
  width: auto;
  display: block;
  color: var(--text);
  /* SVG uses currentColor, automatically adapts to theme */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-btn {
  background: var(--accent);
  color: var(--accent-fg) !important;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  transition: opacity 0.15s;
}

.nav-btn:hover {
  opacity: 0.85;
}

.mobile-toggle {
  display: none;
  background: var(--accent);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-fg);
  font-family: var(--font);
  line-height: 1;
}

/* Groups theme toggle + hamburger on the right of the navbar */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile theme toggle labels */
.show-dark  { display: inline; }
.show-light { display: none; }
html[data-theme="light"] .show-dark  { display: none; }
html[data-theme="light"] .show-light { display: inline; }

/* Theme toggle in mobile dropdown */
.nav-theme-btn {
  display: none;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font);
  text-align: left;
  width: 100%;
  margin-top: 4px;
}

.nav-theme-btn:hover {
  color: var(--text);
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.theme-toggle svg {
  display: block;
}

/* Dark mode (default): show moon, hide sun */
.icon-sun  { visibility: hidden; width: 0; }
.icon-moon { visibility: visible; }

/* Light mode: show sun, hide moon */
html[data-theme="light"] .icon-sun  { visibility: visible; width: auto; }
html[data-theme="light"] .icon-moon { visibility: hidden; width: 0; }


/* ─── Hero ─── */
.hero {
  padding: 160px 0 100px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 440px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.hero-code pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 28px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
}

.hero-code .kw { color: var(--code-kw); }
.hero-code .fn { color: var(--code-fn); }
.hero-code .str { color: var(--code-str); }
.hero-code .cm { color: var(--text-muted); }
.hero-code .num { color: var(--code-num); }
.hero-code .at { color: var(--code-at); }


/* ─── Sections ─── */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 48px;
  max-width: 500px;
}


/* ─── Features Grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 48px;
}

.feature {
  padding: 36px 32px;
  background: var(--bg);
}

.feature-icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.feature h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}


/* ─── Steps ─── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 48px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.step:first-child {
  border-top: 1px solid var(--border);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.step-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.step-body .kw { color: var(--code-kw); }
.step-body .fn { color: var(--code-fn); }
.step-body .str { color: var(--code-str); }


/* ─── Code Examples ─── */
.code-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.code-label {
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.code-block pre {
  padding: 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
}

.code-block .kw { color: var(--code-kw); }
.code-block .fn { color: var(--code-fn); }
.code-block .str { color: var(--code-str); }
.code-block .cm { color: var(--text-muted); }
.code-block .num { color: var(--code-num); }
.code-block .at { color: var(--code-at); }


/* ─── CTA ─── */
.cta-section {
  padding: 80px 0 100px;
}

.cta {
  text-align: center;
  padding: 60px 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-alt);
}

.cta h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.cta p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}


/* ─── Legal Pages ─── */
.legal-page {
  padding: 104px 0 80px;
  min-height: 80vh;
}

.legal-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-page .legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 10px;
  color: var(--text);
}

.legal-page h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 6px;
  color: var(--text);
}

.legal-page p,
.legal-page li {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legal-page ul,
.legal-page ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-page a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page a:hover {
  color: var(--text-secondary);
}

.legal-page .placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}


/* ─── Comparison table ─── */
.compare-section {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 40px;
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
}

.compare-table thead th:first-child {
  border-radius: 8px 0 0 0;
}

.compare-table thead th:last-child {
  border-radius: 0 8px 0 0;
}

.compare-table thead th.col-ravn {
  color: var(--accent);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody tr:hover {
  background: var(--surface);
}

.compare-table td:first-child {
  color: var(--text-muted);
  font-size: 13px;
}

.compare-table td .check {
  color: var(--accent);
  font-weight: 600;
}

.compare-table td .cross {
  color: var(--text-muted);
  opacity: .5;
}

/* Comparison hero (sentry-alternative page) */
.compare-hero {
  padding: 100px 0 60px;
  text-align: center;
}

.compare-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 20px;
}

.compare-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.compare-intro {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 15px;
}

.compare-intro p + p {
  margin-top: 16px;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
}

.footer-brand {
  max-width: 260px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}


/* ─── Animations ─── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }


/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero {
    padding: 88px 0 48px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero-sub {
    max-width: 100%;
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions a {
    width: 100%;
    text-align: center;
  }

  /* Code blocks: horizontal scroll on mobile */
  .hero-code pre,
  .code-block pre {
    font-size: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide desktop theme toggle icon from header on mobile */
  .theme-toggle {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 16px;
    z-index: 100;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  /* "Get Started" button in dropdown: centered, with padding, no border below */
  .nav-links .nav-btn {
    border-bottom: none;
    margin-top: 4px;
    text-align: center;
    padding: 8px 20px;
  }

  /* Show theme toggle row in dropdown */
  .nav-theme-btn {
    display: block;
  }

  .section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.4rem;
  }

  /* Keep border-trick (gap:1px + bg:border) working on single column */
  .features-grid {
    grid-template-columns: 1fr;
  }

  .code-examples {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  /* Footer: stack centered */
  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
  }

  .footer-brand {
    max-width: 100%;
  }

  .footer-links {
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-bottom {
    text-align: center;
  }

  .cta {
    padding: 40px 20px;
  }

  .cta h2 {
    font-size: 1.35rem;
  }

  .container {
    padding: 0 20px;
  }
}
