:root {
  --bg: #14120e;
  --surface: #1c1914;
  --surface-2: #252118;
  --text: #ebe4d6;
  --muted: #9b9386;
  --accent: #e5a319;
  --accent-hover: #f0b832;
  --accent-soft: rgba(229, 163, 25, 0.12);
  --line: rgba(235, 228, 214, 0.1);
  --bg-rgb: 20, 18, 14;
  --radius: 12px;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  overflow-x: clip;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--accent-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

/* ── Header ───────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding:
    0.85rem
    max(1.25rem, env(safe-area-inset-right))
    0.85rem
    max(1.25rem, env(safe-area-inset-left));
  background: rgba(var(--bg-rgb), 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text) !important;
}

.brand img {
  border-radius: 7px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
  align-items: center;
  justify-content: flex-end;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.site-header nav a[aria-current="page"] {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ── Home ─────────────────────────────────────────── */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.75fr);
  gap: 2.5rem 3rem;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding:
    3.5rem
    max(1.25rem, env(safe-area-inset-right))
    4rem
    max(1.25rem, env(safe-area-inset-left));
}

.kicker {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro h1,
.panel h2,
.download-card h2 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-points {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.intro-points li {
  position: relative;
  padding-left: 1.1rem;
}

.intro-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.intro-shot {
  margin: 0;
  justify-self: center;
  width: min(100%, 280px);
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.intro-shot img {
  border-radius: var(--radius);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn.primary {
  background: var(--accent);
  color: #1a1408 !important;
}

.btn.primary:hover {
  background: var(--accent-hover);
  color: #1a1408 !important;
}

.btn.secondary {
  border-color: var(--line);
  color: var(--text) !important;
  background: var(--surface);
}

.btn.secondary:hover {
  border-color: rgba(229, 163, 25, 0.35);
  color: var(--accent) !important;
}

.panel {
  max-width: 72rem;
  margin: 0 auto;
  padding:
    3.5rem
    max(1.25rem, env(safe-area-inset-right))
    3.5rem
    max(1.25rem, env(safe-area-inset-left));
}

.panel-muted {
  background: var(--surface);
  border-block: 1px solid var(--line);
  max-width: none;
}

.panel-muted > * {
  max-width: 72rem;
  margin-inline: auto;
}

.panel-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.panel-head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.shot-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.shot-card img {
  width: 100%;
  max-width: 220px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.shot-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.shot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.feature-grid h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.download-panel {
  padding-bottom: 4.5rem;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(200px, 0.8fr);
  gap: 2rem;
  padding: 1.75rem;
  border: 1px solid rgba(229, 163, 25, 0.22);
  border-radius: calc(var(--radius) + 2px);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface-2);
}

.spec-list {
  margin: 0;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.spec-list div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.spec-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.spec-list dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.spec-list dd {
  margin: 0;
  font-weight: 500;
}

.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding:
    2rem
    max(1.25rem, env(safe-area-inset-right))
    max(3rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.fine {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ── Docs ─────────────────────────────────────────── */

.docs-body {
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, var(--accent-soft), transparent 50%),
    var(--bg);
}

.docs-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 42rem);
  gap: 2.5rem;
  max-width: 64rem;
  margin: 0 auto;
  padding:
    6rem
    max(1.25rem, env(safe-area-inset-right))
    4rem
    max(1.25rem, env(safe-area-inset-left));
}

.docs-layout-wide {
  max-width: 68rem;
}

.docs-nav {
  position: sticky;
  top: 5rem;
  align-self: start;
  display: grid;
  gap: 0.4rem;
}

.docs-nav-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.docs-nav a:hover {
  color: var(--accent);
}

.docs-main .eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.docs-main h1 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.1;
}

.docs-main h1 em {
  font-style: italic;
  color: var(--accent);
}

.docs-main h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.55rem;
  scroll-margin-top: 5rem;
}

.docs-main p,
.docs-main li,
.docs-main dd {
  color: var(--muted);
}

.docs-main ul,
.docs-main ol {
  padding-left: 1.2rem;
}

.docs-main li + li {
  margin-top: 0.35rem;
}

.docs-main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0 1.5rem;
  display: block;
  overflow-x: auto;
}

.docs-main th,
.docs-main td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-main th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.faq dt {
  margin-top: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.faq dd {
  margin: 0.35rem 0 0;
}

.docs-end {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.hide-sm {
  display: inline;
}

/* ── Legacy helpers (docs copy buttons) ───────────── */

.terminal {
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.copy-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  border-radius: 6px;
}

.copy-btn:hover,
.copy-btn.copied {
  color: #1a1408;
  background: var(--accent);
  border-color: var(--accent);
}

.terminal pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

.terminal code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text);
  white-space: pre;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 0.85rem
      max(0.75rem, env(safe-area-inset-left));
    background: rgba(var(--bg-rgb), 0.98);
    border-bottom: 1px solid var(--line);
  }

  .site-header nav.is-open {
    display: flex;
  }

  .site-header nav a {
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }

  .site-header nav a:last-child {
    border-bottom: 0;
  }

  .hide-sm {
    display: none;
  }

  .intro {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }

  .intro-shot {
    order: -1;
    width: min(100%, 240px);
  }

  .shot-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    grid-template-columns: 1fr;
  }

  .docs-layout,
  .docs-layout-wide {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 5.5rem;
  }

  .docs-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
  }

  .docs-nav-title {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
