/* SondeFox — sondefox.com design system
   Dark-first "field mission control" aesthetic: deep navy, fox orange, signal teal. */

:root {
  --bg: #0a1220;
  --bg-2: #0d1728;
  --surface: #121d30;
  --surface-2: #182740;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);

  --text: #e7eef8;
  --text-dim: #9fb0c7;
  --text-faint: #7286a0;

  --fox: #f97316;
  --fox-bright: #fb923c;
  --fox-deep: #c2410c;
  --teal: #2dd4bf;
  --teal-dim: #14b8a6;
  --cream: #fef3e2;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1100px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle radar-grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(249, 115, 22, 0.07), transparent 60%),
    radial-gradient(900px 480px at 8% 0%, rgba(45, 212, 191, 0.05), transparent 55%),
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--fox-bright); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.22rem; font-weight: 700; margin-top: 1.8em; }
p { margin: 0.7em 0; }
.lede { font-size: 1.16rem; color: var(--text-dim); max-width: 46em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
small { color: var(--text-faint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 18, 32, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 26px; height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.14rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; display: block; }
.brand .fox { color: var(--fox-bright); }
.site-nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.site-nav a {
  color: var(--text-dim); padding: 7px 12px; border-radius: 8px; font-weight: 550; font-size: 0.97rem;
}
.site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--fox-bright); }
.nav-toggle { display: none; }

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 0.99rem;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--fox); color: #1a0d02; }
.btn-primary:hover { background: var(--fox-bright); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 7px 14px; font-size: 0.9rem; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--text-dim); font-family: var(--mono);
}
.badge-beta { border-color: rgba(249, 115, 22, 0.5); color: var(--fox-bright); background: rgba(249, 115, 22, 0.08); }
.badge-ok { border-color: rgba(74, 222, 128, 0.4); color: var(--green); background: rgba(74, 222, 128, 0.07); }
.badge-wip { border-color: rgba(251, 191, 36, 0.4); color: var(--amber); background: rgba(251, 191, 36, 0.07); }
.badge-plan { border-color: var(--line-strong); color: var(--text-faint); }
.badge-exp { border-color: rgba(45, 212, 191, 0.4); color: var(--teal); background: rgba(45, 212, 191, 0.07); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 .accent { color: var(--fox-bright); }
.hero .ctas { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero .meta-row { display: flex; gap: 18px; margin-top: 26px; flex-wrap: wrap; color: var(--text-faint); font-size: 0.92rem; font-family: var(--mono); }
.hero .meta-row span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Phone frame (live demo embed) ---------- */
/* Wraps an iframe of /demo/app/?embed (412×892 content) and provides the bezel. */
.phone-frame {
  position: relative;
  width: 302px; height: 652px;
  border-radius: 32px;
  background: #05080f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(148, 163, 184, 0.06);
  overflow: hidden;
  margin: 0 auto;
}
.phone-frame iframe {
  border: 0; width: 100%; height: 100%; display: block;
}
.phone-frame.lg { width: 342px; height: 738px; border-radius: 36px; }
.demo-hint { text-align: center; color: var(--text-faint); font-size: 0.88rem; margin-top: 14px; font-family: var(--mono); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.card:hover { border-color: var(--line-strong); }
.card .icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.25);
  font-size: 20px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 1.07rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.card.teal .icon { background: rgba(45, 212, 191, 0.08); border-color: rgba(45, 212, 191, 0.25); }

/* ---------- Sections ---------- */
.section { padding: 46px 0; }
.section-head { max-width: 640px; margin-bottom: 30px; }
.section-head .kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fox-bright); font-weight: 700;
}
.section-head h2 { margin-top: 0.3em; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 14px; counter-reset: step; padding: 0; margin: 1.4em 0; list-style: none; }
.steps li {
  counter-increment: step;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px 16px 62px; position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 15px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.4);
  color: var(--fox-bright); font-weight: 800; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center; font-size: 0.92rem;
}
.steps li strong { display: block; margin-bottom: 2px; }
.steps li p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
td .badge { font-size: 0.7rem; padding: 3px 9px; }

/* ---------- Code ---------- */
code, kbd {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.12em 0.42em; color: var(--cream);
}
pre {
  background: #0b1526; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; line-height: 1.55; font-size: 0.88rem;
}
pre code { background: none; border: 0; padding: 0; color: #cfe3f5; }
pre .c { color: var(--text-faint); }

/* ---------- Callouts ---------- */
.callout {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--teal);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 1.4em 0; font-size: 0.97rem;
}
.callout.warn { border-left-color: var(--amber); }
.callout.danger { border-left-color: var(--red); }
.callout.fox { border-left-color: var(--fox); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .title { font-weight: 750; display: block; margin-bottom: 2px; }

/* ---------- Docs layout ---------- */
.docs-layout { display: grid; grid-template-columns: 230px 1fr; gap: 44px; padding: 40px 0 60px; align-items: start; }
.docs-sidebar { position: sticky; top: 84px; }
.docs-sidebar .group { margin-bottom: 20px; }
.docs-sidebar .group-title {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 6px; font-weight: 700;
}
.docs-sidebar a { display: block; color: var(--text-dim); padding: 5px 10px; border-radius: 7px; font-size: 0.94rem; border-left: 2px solid transparent; }
.docs-sidebar a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.docs-sidebar a[aria-current="page"] { color: var(--fox-bright); border-left-color: var(--fox); background: rgba(249, 115, 22, 0.06); border-radius: 0 7px 7px 0; }
.docs-content { min-width: 0; }
.docs-content h1 { font-size: 2.1rem; }
.docs-content img { max-width: 100%; border-radius: var(--radius-sm); }
.doc-next { display: flex; justify-content: space-between; gap: 14px; margin-top: 3rem; flex-wrap: wrap; }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 650; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▸"; color: var(--fox-bright); transition: transform 0.15s; font-size: 0.85em; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq details .a { padding: 0 18px 15px 40px; color: var(--text-dim); }
.faq details .a p:first-child { margin-top: 0; }

/* ---------- Screen chips (five screens strip) ---------- */
.screens { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.screen-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
}
.screen-chip .em { font-size: 24px; display: block; margin-bottom: 6px; }
.screen-chip b { display: block; font-size: 0.95rem; }
.screen-chip span { font-size: 0.82rem; color: var(--text-faint); }

/* ---------- CTA band ---------- */
.cta-band {
  margin: 60px 0 30px;
  border: 1px solid rgba(249, 115, 22, 0.35); border-radius: var(--radius);
  background:
    radial-gradient(600px 200px at 85% 0%, rgba(249, 115, 22, 0.14), transparent 60%),
    var(--surface);
  padding: 40px; text-align: center;
}
.cta-band h2 { margin-top: 0; }
.cta-band .ctas { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 70px; padding: 44px 0 34px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .col-title { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 10px; }
.site-footer a { display: block; color: var(--text-dim); padding: 3px 0; font-size: 0.94rem; }
.site-footer a:hover { color: var(--text); }
.site-footer .blurb { color: var(--text-faint); font-size: 0.92rem; max-width: 30em; }
.footer-bottom {
  max-width: var(--maxw); margin: 30px auto 0; padding: 20px 22px 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--text-faint); font-size: 0.86rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .screens { grid-template-columns: repeat(3, 1fr); }
  .docs-layout { grid-template-columns: 1fr; gap: 8px; }
  .docs-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface); }
  .docs-sidebar .group { margin: 0; display: contents; }
  .docs-sidebar .group-title { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .screens { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 44px; }
  .cta-band { padding: 28px 20px; }

  .nav-toggle {
    display: flex; margin-left: auto; background: none; border: 1px solid var(--line-strong);
    border-radius: 8px; color: var(--text); padding: 7px 11px; font-size: 1rem; cursor: pointer;
  }
  .site-nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; margin: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; }
  .site-nav .btn { justify-content: center; margin-top: 8px; }
}
