/* ============================================================
   Sond — sond.dev
   Design system: one accent (Sonda Teal), light + dark,
   code is the hero, instrument-precise, no hype.
   ============================================================ */

:root {
  /* Neutrals — light */
  --bg:        #ffffff;
  --bg-soft:   #f6f7f8;
  --fg:        #111114;
  --fg-muted:  #5a6472;
  --border:    #e3e6ea;

  /* Accent — Sonda Teal (from the logo) */
  --accent:      #2A6A6F;
  --accent-hov:  #215357;
  --accent-ink:  #ffffff;   /* text on accent fills */

  /* Oracle states */
  --ok:      #2A6A6F;
  --reject:  #d33a3f;

  --code-bg: #f6f7f8;
  --term-bg: #14181d;
  --term-fg: #e8ecf1;

  --radius:   12px;
  --radius-s: 8px;
  --maxw:     1120px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg:        #0b0b0d;
  --bg-soft:   #131519;
  --fg:        #f5f5f3;
  --fg-muted:  #9aa4b2;
  --border:    #242830;

  --accent:      #3ABFAD;
  --accent-hov:  #5ACDBE;
  --accent-ink:  #06181a;

  --ok:      #3ABFAD;
  --reject:  #ff6169;

  --code-bg: #101317;
  --term-bg: #0f1216;
  --term-fg: #e8ecf1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0b0d;
    --bg-soft:   #131519;
    --fg:        #f5f5f3;
    --fg-muted:  #9aa4b2;
    --border:    #242830;
    --accent:      #3ABFAD;
    --accent-hov:  #5ACDBE;
    --accent-ink:  #06181a;
    --ok:      #3ABFAD;
    --reject:  #ff6169;
    --code-bg: #101317;
    --term-bg: #0f1216;
    --term-fg: #e8ecf1;
  }
}

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hov); text-decoration: underline; }

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

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.accent-text { color: var(--accent); }

code, pre { font-family: var(--mono); }
code.inline {
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--fg);
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark path, .brand-mark rect { fill: var(--accent); }
.brand-word { font-size: 1.15rem; letter-spacing: 0.02em; }

.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--fg-muted); font-size: 0.94rem; font-weight: 500; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-sponsor { color: var(--accent) !important; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }
.theme-toggle svg { stroke: currentColor; fill: none; }
.icon-moon { fill: currentColor; stroke: none; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

/* ============ HERO ============ */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-muted);
  margin: 0 0 18px;
}
.eyebrow .tick { color: var(--accent); font-weight: 800; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); font-weight: 800; margin-bottom: 20px; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--fg-muted); max-width: 40ch; margin: 0 0 30px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.98rem;
  padding: 12px 24px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hov); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

/* ============ CODE CARDS ============ */
.code-card {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 10px 30px -18px rgba(0,0,0,.25);
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--code-bg) 60%, var(--bg));
}
.code-head-note { margin-left: auto; font-family: var(--sans); font-size: 0.8rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.badge { margin-left: auto; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 20px; }
.badge-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

pre.code, pre.terminal {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  tab-size: 4;
}
pre.code code { color: var(--fg); white-space: pre; }
/* A grid/flex child defaults to min-width:auto, so a wide code block stretches its track and
   breaks the mobile layout instead of scrolling. Let every code container shrink below the code
   width so the long line scrolls inside its own overflow-x:auto element and the page stays
   responsive. `.cmd code` (the install commands) is the flex-item case; the cards are the grid one. */
.code-card, .hero-grid > *, .oracle-grid > *, .feature > *, .feature-code, .hero-code,
.cmd, .cmd code { min-width: 0; }
pre.code, pre.terminal, .cmd code { max-width: 100%; }
/* Long inline code (paths, flags) wraps instead of forcing the line wider than the screen. */
code.inline { overflow-wrap: anywhere; }
/* Last-resort guard: nothing may push the page wider than the viewport. `clip` (not `hidden`)
   so it does not create a scroll container that would break the sticky nav. */
html { overflow-x: clip; }

/* syntax tokens */
.code .k  { color: var(--accent); font-weight: 600; }   /* keyword */
.code .t  { color: #8250df; }                            /* type */
.code .fn { color: #0969da; font-weight: 600; }          /* function name */
.code .n  { color: #b5560d; }                            /* number */
.code .c  { color: var(--fg-muted); font-style: italic; }/* comment */
:root[data-theme="dark"] .code .t  { color: #c297ff; }
:root[data-theme="dark"] .code .fn { color: #6cb6ff; }
:root[data-theme="dark"] .code .n  { color: #f0a675; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .code .t  { color: #c297ff; }
  :root:not([data-theme="light"]) .code .fn { color: #6cb6ff; }
  :root:not([data-theme="light"]) .code .n  { color: #f0a675; }
}

/* terminal block */
pre.terminal {
  background: var(--term-bg);
  color: var(--term-fg);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
pre.terminal code { color: var(--term-fg); white-space: pre; }
.term-err { color: #ff6169; font-weight: 700; }
.term-caret { color: #ff6169; }
.term-prompt { color: #3ABFAD; user-select: none; }
.terminal .c { color: #7a8290; font-style: italic; }

/* ============ SECTIONS ============ */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 68ch; margin: 0 auto clamp(32px, 5vw, 52px); text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; margin-bottom: 16px; }
.section-sub { color: var(--fg-muted); font-size: 1.05rem; margin: 0; }
.section-sub .inline { font-size: 0.86em; }

/* Oracle grid */
.oracle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.code-card.is-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.code-card.is-reject { border-color: color-mix(in srgb, var(--reject) 40%, var(--border)); }
.verdict { font-family: var(--sans); font-weight: 700; font-size: 0.9rem; }
.verdict-ok { color: var(--ok); }
.verdict-reject { color: var(--reject); }

/* Features */
.feature {
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(28px, 4vw, 44px) 0;
}
.feature + .feature { border-top: 1px solid var(--border); }
.feature-reverse .feature-text { order: 2; }
.feature-reverse .feature-code { order: 1; }
.feature-text h3 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 700; margin-bottom: 14px; }
.feature-text p { color: var(--fg-muted); margin: 0 0 12px; font-size: 1.02rem; }
.feature-note { font-size: 0.92rem !important; padding-top: 4px; border-top: 1px dashed var(--border); }

.pull-quote {
  margin: 0; padding: 28px 30px;
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.25rem; font-weight: 500; line-height: 1.5;
}
.pull-quote cite { display: block; margin-top: 16px; font-size: 0.92rem; font-style: normal; color: var(--fg-muted); }

/* ============ COMMAND / COPY ============ */
.cmd {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  font-family: var(--mono); font-size: 0.9rem;
  border: 1px solid var(--border);
}
.cmd code { color: var(--term-fg); overflow-x: auto; white-space: pre; flex: 1; }
.cmd-block { align-items: flex-start; }
.cmd-block code { line-height: 1.7; }
.copy-btn {
  flex-shrink: 0;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  color: var(--term-fg);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: rgba(255,255,255,.16); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* ============ INSTALL TABS ============ */
.install-wrap { max-width: 760px; }
.tabs { margin-top: 8px; }
.tab-row { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  color: var(--fg-muted); background: none; border: none;
  padding: 10px 16px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.install-note { color: var(--fg-muted); font-size: 0.92rem; margin-top: 22px; text-align: center; line-height: 1.8; }
.install-note .inline { font-size: 0.85em; }

/* ============ STATUS ============ */
.status-wrap { max-width: 68ch; margin: 0 auto; text-align: center; }
.status-wrap h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 800; margin-bottom: 22px; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  font-family: var(--mono); font-size: 0.85rem;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg-muted);
}
.chip-link { color: var(--accent); }
.chip-link:hover { border-color: var(--accent); text-decoration: none; }
.status-desc { color: var(--fg-muted); font-size: 1.05rem; margin: 0; }

/* ============ FOOTER ============ */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-tag { color: var(--fg-muted); font-size: 0.9rem; max-width: 30ch; margin: 0; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--fg); font-size: 0.94rem; margin-bottom: 10px; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-fine { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 0.85rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .lede { max-width: none; }
  .oracle-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 22px; }
  .feature-reverse .feature-text { order: 0; }
  .feature-reverse .feature-code { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .nav-links { gap: 14px; }
  .nav-sponsor { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 2.1rem; }
}
