/* ============================================================
   Dunebox website — shared stylesheet (Dunebox design system)
   Sections: 0 Fonts · 1 Tokens · 2 Reset · 3 Layout · 4 Nav · 5 Buttons
   6 Hero · 7 Sections · 8 Cards · 9 How-it-works · 10 Download
   11 Footer · 12 Docs page · 13 Responsive · 14 Compare · 15 Download popup
   Colours, type and radii come from the tokens in §1 only (same values as the app);
   the dark theme follows the visitor's system setting and is defined once, in §1.
   ============================================================ */

/* ---------- 0. Fonts (self-hosted, latin + latin-ext; SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500 600;
  src: url("/assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --surface: #ffffff;            /* page background */
  --surface-1: #fafafa;          /* soft cards, callouts */
  --surface-2: #ededed;          /* bands (how-it-works), table heads — app "chrome" */
  --surface-hover: #e4e4e4;
  --border: #e3e3e3;             /* cards, dividers, table rows */
  --border-control: #8a8a8a;     /* secondary button / chip outline (3:1 on the page) */

  /* Text */
  --ink: #181818;                /* headings and primary text */
  --text: #2e2e2e;               /* running text */
  --text-soft: #666666;          /* secondary text, descriptions */

  /* Accent: dune yellow — fills only; readable variants for text and marks */
  --accent: #f6b53c;
  --on-accent: #2a1d00;
  --accent-ink: #8a5800;         /* links, eyebrows, inline code, focus */
  --accent-soft: #fcefc7;        /* sand tint: icon tiles, highlighted column, brand tag */
  --accent-lead: #3d2a00;        /* secondary text on --accent */

  /* Primary action: solid ink */
  --action: #181818;
  --on-action: #ffffff;

  /* States */
  --success: #178a43;
  --success-ink: #157a3b;

  /* Hero scene (sky → sand) and dunes */
  --sky-1: #a9d6ee;
  --sky-2: #cfe8f2;
  --sky-3: #f3ecda;
  --sky-4: #ffffff;
  --hero-text: #4a4a4a;
  --dune-1: #f7dca0;
  --dune-2: #f3c364;
  --dune-3: #e89a2c;
  --glass: rgba(255, 255, 255, 0.82); /* badge / ghost button on the sky */

  /* Always-dark surfaces: code blocks, feature card, footer */
  --code-bg: #1d1a16;
  --code-text: #e9dcc4;
  --code-comment: #9a8e78;
  --code-string: #9fd39f;
  --deep: #1d1a16;               /* dark feature card */
  --deep-text: #c5bba8;
  --footer: #161412;
  --footer-text: #c5bba8;
  --footer-muted: #9a9184;
  --footer-line: #2e2a24;

  --overlay: rgba(0, 0, 0, 0.42);
  --shadow-float: 0 18px 48px rgba(0, 0, 0, 0.18);
  --shadow-shot: 0 30px 70px -30px rgba(60, 40, 5, 0.45);

  /* Type */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Layout */
  --maxw: 1200px;
  --pad: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #1c1c1c;
    --surface-1: #252525;
    --surface-2: #202020;
    --surface-hover: #2a2a2a;
    --border: #333333;
    --border-control: #757575;

    --ink: #fafafa;
    --text: #dcdcdc;
    --text-soft: #a8a8a8;

    --accent-ink: #f6b53c;
    --accent-soft: #3b3020;

    --action: #fafafa;
    --on-action: #181818;

    --success: #23c45d;
    --success-ink: #4ad07b;

    --sky-1: #141a26;
    --sky-2: #1c2230;
    --sky-3: #2a2218;
    --sky-4: #1c1c1c;
    --hero-text: #b4b4b4;
    --dune-1: #5a4320;
    --dune-2: #7a5622;
    --dune-3: #9a6a22;
    --glass: rgba(37, 37, 37, 0.85);

    --deep: #252525;
    --footer: #121212;
    --footer-line: #2a2a2a;

    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-float: 0 18px 48px rgba(0, 0, 0, 0.55);
    --shadow-shot: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- 2. Reset & base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

/* Inline SVG icons inherit the text colour of their container (overrides the
   stroke/fill attributes written in the markup). */
.btn svg,
.link-arrow svg,
.card-ico svg,
.dl-modal-x svg {
  stroke: currentColor;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 3. Layout ---------- */
.wrap {
  /* clip (not hidden) so it doesn't become a scroll container and break the
     sticky docs sidebar, while still preventing horizontal overflow */
  overflow-x: clip;
}

/* ---------- 4. Nav ---------- */
.nav-hero {
  position: relative;
  z-index: 20;
}

.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  display: block;
  border-radius: 9px;
}

.brand-wordmark {
  display: block;
  height: 40px;
  width: auto;
}

/* The nav wordmark is the dark one: switch to the white one in the dark theme.
   (The footer is always dark and already uses the white wordmark.) */
@media (prefers-color-scheme: dark) {
  .nav-bar .brand-wordmark {
    content: url("/assets/dunebox-wordmark.svg");
  }
}

.brand-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  margin-left: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
}

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

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

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}

.btn--lg {
  font-size: 16px;
  padding: 14px 26px;
  border-radius: var(--radius-lg);
  gap: 10px;
}

/* Primary: solid ink, as in the app. */
.btn--primary {
  background: var(--action);
  color: var(--on-action);
}

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

/* Secondary: outlined, readable on the sky and on plain surfaces. */
.btn--ghost {
  background: var(--glass);
  color: var(--ink);
  border-color: var(--border-control);
}

.btn--ghost:hover {
  background: var(--surface);
}

/* On the yellow download block: deep brown fill, light text (both themes). */
.btn--dark {
  background: var(--on-accent);
  color: #fdf6e9;
}

.btn--dark:hover {
  opacity: 0.9;
}

.btn--light {
  background: rgba(255, 255, 255, 0.85);
  color: var(--on-accent);
  border-color: rgba(42, 29, 0, 0.35);
}

.btn--light:hover {
  background: #ffffff;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 16px;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 34%, var(--sky-3) 70%, var(--sky-4) 100%);
}

.hero-copy {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 64px var(--pad) 0;
  text-align: center;
}

/* Compact hero for the sub-pages (compare / vs-*): without the .shot-stage below,
   the cta-row would sit flush with the bottom edge → bottom padding. */
.hero--compact .hero-copy {
  padding-bottom: 72px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 26px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.hero-title {
  font-size: 64px;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--hero-text);
  margin: 0 auto 36px;
  max-width: 640px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.note-mono {
  font-size: 13px;
  color: var(--hero-text);
  margin: 18px 0 0;
  font-family: var(--mono);
}

.shot-stage {
  position: relative;
  margin-top: 54px;
  padding-bottom: 46px;
}

.shot-dunes-back {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 260px;
  z-index: 2;
}

.shot-dunes-back path:nth-child(1) {
  fill: var(--dune-1);
}

.shot-dunes-back path:nth-child(2) {
  fill: var(--dune-2);
}

.shot-wrap {
  position: relative;
  z-index: 5;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.shot-frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-shot);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-dune-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 180px;
  z-index: 8;
}

.shot-dune-front path {
  fill: var(--dune-3);
}

/* ---------- 7. Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px var(--pad) 20px;
  scroll-margin-top: 24px;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  margin: 0 0 12px;
}

.h2 {
  font-size: 42px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.section-intro {
  max-width: 680px;
  margin: 0 0 48px;
}

.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
}

/* version strip */
.strip {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px var(--pad) 8px;
}

.strip-label {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  font-family: var(--mono);
  font-size: 14px;
}

.chip {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
  color: var(--ink);
}

.chip--soft {
  font-weight: 400;
  color: var(--text-soft);
  background: var(--surface-1);
}

.chip-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 6px;
}

/* ---------- 8. Cards ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-3+.grid-3 {
  margin-top: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px;
}

.card h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

.card--soft {
  background: var(--surface-1);
  padding: 26px;
}

.card--soft h3 {
  font-size: 17px;
  margin: 0 0 9px;
}

.card--soft p {
  font-size: 14.5px;
  line-height: 1.55;
}

.card--dark {
  background: var(--deep);
  border-color: var(--deep);
}

.card--dark h3 {
  color: #fdf6e9;
}

.card--dark p {
  color: var(--deep-text);
}

.card--dark code {
  color: var(--accent);
}

.card-ico {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.card--dark .card-ico {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- 9. How it works ---------- */
.how {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  margin-top: 80px;
  scroll-margin-top: 24px;
}

.how-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px var(--pad);
}

.how-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 52px;
}

.how-head .h2 {
  margin: 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
}

.step-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}

.step p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
}

.how-cta {
  text-align: center;
  margin-top: 40px;
}

/* ---------- 10. Download ---------- */
/* The one big block of dune yellow: same fill in both themes, dark text on it. */
.download {
  position: relative;
  overflow: hidden;
  background: var(--accent);
}

.download-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
}

/* the wave continues the section above it (the how-it-works band) */
.download-wave path {
  fill: var(--surface-2);
}

.download-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 120px var(--pad) 96px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.download-logo {
  border-radius: 15px;
  margin-bottom: 24px;
}

.download h2 {
  font-size: 46px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--on-accent);
  margin: 0 0 16px;
}

.download-lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--accent-lead);
  margin: 0 auto 34px;
  max-width: 540px;
}

.download .note-mono {
  color: var(--accent-lead);
}

/* ---------- 11. Footer (always dark) ---------- */
.footer {
  background: var(--footer);
  color: var(--footer-text);
}

.footer a:hover {
  color: #fdf6e9;
}

.footer-top {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.footer-about {
  max-width: 320px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.footer-about p {
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.footer-note {
  font-size: 13px;
  color: var(--footer-muted);
  margin: 0;
  font-family: var(--mono);
}

.footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--footer-muted);
  margin: 0 0 14px;
}

.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
}

.footer-bottom {
  border-top: 1px solid var(--footer-line);
}

.footer-bottom>div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--footer-muted);
}

.footer-bottom .mono {
  font-family: var(--mono);
}

/* ---------- 12. Docs page ---------- */
.doc-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad) 8px;
}

.doc-hero h1 {
  font-size: 48px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.doc-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
  max-width: 720px;
}

.docs-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--pad) 100px;
}

.docs-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 48px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Same look as the app sidebar: rounded items, sand fill on the active one. */
.toc a {
  padding: 7px 12px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
}

.toc a:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.toc a.active {
  color: var(--accent-ink);
  font-weight: 600;
  background: var(--accent-soft);
}

.doc-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.doc-section {
  scroll-margin-top: 80px;
}

.doc-section h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.doc-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}

.doc-section p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 14px;
}

.doc-section ol,
.doc-section ul {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
}

.doc-section a {
  color: var(--accent-ink);
  font-weight: 600;
}

.doc-section a:hover {
  text-decoration: underline;
}

.doc-section a.btn {
  color: var(--on-action);
  text-decoration: none;
}

.doc-section strong {
  color: var(--ink);
}

.doc-section .opt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.sub-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 10px;
}

/* tables */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 0 18px;
}

.table-wrap.scroll {
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.doc-table th {
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  background: var(--surface-2);
  color: var(--ink);
}

.doc-table td {
  padding: 11px 16px;
  color: var(--text);
}

.doc-table tbody tr {
  border-top: 1px solid var(--border);
}

.doc-table--plain tbody tr:first-child {
  border-top: 0;
}

.td-key {
  font-weight: 600;
}

.td-mono {
  font-family: var(--mono);
}

.td-accent {
  font-family: var(--mono);
  color: var(--accent-ink);
}

.td-muted {
  color: var(--text-soft);
}

.nowrap {
  white-space: nowrap;
}

/* code blocks (always dark) */
.codeblock {
  margin: 0 0 16px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
}

.codeblock .k {
  color: var(--accent);
}

.codeblock .cm {
  color: var(--code-comment);
}

.codeblock .s {
  color: var(--code-string);
}

/* callouts & in-doc CTA */
.callout {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.callout p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}

.cta-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.cta-box h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
}

.cta-box p {
  font-size: 14.5px;
  color: var(--text-soft);
  margin: 0;
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 980px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    max-height: none;
    margin-bottom: 10px;
  }

  .toc a {
    border: 1px solid var(--border);
  }
}

@media (max-width: 860px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 46px;
  }

  .h2 {
    font-size: 32px;
  }

  .doc-hero h1 {
    font-size: 36px;
  }

  .download h2 {
    font-size: 34px;
  }
}

@media (max-width: 560px) {

  /* tighter side gutters everywhere (nav, hero, sections, docs, footer all
     derive their horizontal padding from --pad) */
  :root {
    --pad: 18px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 34px;
  }

  .footer-cols {
    gap: 28px;
  }

  /* any table can scroll horizontally instead of being clipped */
  .table-wrap {
    overflow-x: auto;
  }

  /* docs: smaller hero + headings, less vertical padding */
  .doc-hero {
    padding-top: 40px;
  }

  .doc-hero h1 {
    font-size: 28px;
    overflow-wrap: break-word;
  }

  .doc-hero p {
    font-size: 16px;
  }

  .docs-wrap {
    padding-top: 28px;
    padding-bottom: 64px;
  }

  .doc-body {
    gap: 40px;
  }

  .doc-section h2 {
    font-size: 22px;
  }

  /* in-doc CTA stacks instead of squeezing button beside the text */
  .cta-box {
    padding: 22px 20px;
  }

  .codeblock {
    padding: 14px 15px;
    font-size: 13px;
  }
}

/* ============================================================
   14. Comparison table (compare.html)
   ============================================================ */
.cmp td,
.cmp th {
  text-align: center;
  vertical-align: middle;
}

.cmp th:first-child,
.cmp td:first-child {
  text-align: left;
}

/* highlight the Dunebox column (2nd) */
.cmp th:nth-child(2),
.cmp td:nth-child(2) {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.cmp thead th:nth-child(2) {
  color: var(--accent-ink);
}

.cmp-yes {
  color: var(--success-ink);
  font-weight: 700;
}

.cmp-no {
  color: var(--text-soft);
}

.cmp-part {
  color: var(--accent-ink);
  font-weight: 600;
}

.cmp-sub {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
}

/* ---------- 15. Download popup (emitted by includes/footer.php when STORE_URL is set) ---------- */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
}

.dl-modal[hidden] {
  display: none;
}

.dl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.dl-modal-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-float);
}

.dl-modal-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.dl-modal-lead {
  color: var(--text-soft);
  font-size: 14.5px;
  margin: 0 0 18px;
}

.dl-modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
}

.dl-modal-x:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.dl-opt {
  display: block;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  text-decoration: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  transition: background 0.12s ease, opacity 0.12s ease;
}

.dl-opt+.dl-opt {
  margin-top: 10px;
}

.dl-opt:hover {
  background: var(--surface-hover);
}

.dl-opt--primary {
  background: var(--action);
  border-color: var(--action);
}

.dl-opt--primary:hover {
  background: var(--action);
  opacity: 0.9;
}

.dl-opt-title {
  display: block;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
}

.dl-opt--primary .dl-opt-title {
  color: var(--on-action);
}

.dl-opt-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
}

.dl-opt--primary .dl-opt-sub {
  color: color-mix(in srgb, var(--on-action) 78%, var(--action));
}
