/*
 * The landing page's stylesheet: the designer's five stylesheets, concatenated in the order
 * the page loaded them (tokens, base, hero, sections, paper), under one @font-face block.
 * It shares nothing with the app's theme (`themes/cai/static/cai.css`) on purpose: the page
 * is its own shell, and neither stylesheet should be able to move the other.
 *
 * The @font-face rules are written here, not taken from the designer's build, whose faces
 * carry no `unicode-range` (each reports U+0-10FFFF). Chromium still draws Persian from the
 * Arabic face there — measured on cai-landing-final.html, the headline and the lead are
 * Vazirmatn, not a system font — because it falls back between faces of one family for a
 * glyph the later one lacks. Other engines were not tried, so the ranges are declared and
 * nothing here leans on that fallback. Latin comes first and Arabic last, so where the two
 * ranges overlap (U+200C, the ZWNJ that Persian compounds need) the Arabic face is the one
 * used.
 */
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/landing/fonts/vazirmatn-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/landing/fonts/vazirmatn-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/landing/fonts/vazirmatn-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/landing/fonts/vazirmatn-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/landing/fonts/vazirmatn-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/landing/fonts/vazirmatn-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/landing/fonts/jetbrains-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== tokens.css (designer, retinted to the app's v4 palettes) =====
 * The designer drew this page as deep navy with one mint accent. The app has since taken the
 * designer's v4 refresh (flat neutral surfaces, one blue accent, a light and a dark palette),
 * and a visitor who signs in should not step from one look into another, so the tokens below
 * are v4's: the names are the handoff's and the values are the app's (themes/cai/static/cai.css).
 * Light is the default; dark follows the device, and <html data-theme> (the reader's appearance
 * cookie, written by the server) overrides it. The layout and the copy are the designer's;
 * this retint is ours, and v4 does not draw a landing page.
 */
:root {
  /* Ground */
  --navy-950: #f5f7fc;
  --navy-900: #ebeff6;
  --navy-850: #ffffff;
  --navy-800: #e3e8f2;

  /* Text on the ground */
  --ink: #182230;
  --ink-2: #526174;
  --ink-3: #59667a;
  --rule: rgba(24, 34, 48, 0.12);
  --rule-strong: rgba(24, 34, 48, 0.22);
  --wash: rgba(24, 34, 48, 0.06);
  --wash-strong: rgba(24, 34, 48, 0.1);
  --glow: rgba(36, 89, 211, 0.1);
  --pop-shadow: 0 18px 40px -24px rgba(16, 24, 40, 0.28);

  /* Accent (kept under its old name: it is the page's one action colour) */
  --mint: #2459d3;
  --mint-hover: #1d4cb8;
  --mint-ink: #ffffff;
  --mint-wash: rgba(36, 89, 211, 0.1);
  --mint-line: rgba(36, 89, 211, 0.5);

  /* Paper — the report surface */
  --paper: #ffffff;
  --paper-shade: #ebeff6;
  --paper-ink: #182230;
  --paper-ink-2: #526174;
  --paper-ink-3: #59667a;
  --paper-rule: rgba(24, 34, 48, 0.12);
  --paper-mint: #1d4cb8;
  --paper-mint-wash: rgba(36, 89, 211, 0.1);
  --paper-amber: #8f5700;
  --paper-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 60px -28px rgba(16, 24, 40, 0.3),
    0 12px 24px -16px rgba(16, 24, 40, 0.18);

  color-scheme: light;

  /* Type */
  --sans: Vazirmatn, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-3: clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);
  --step-4: clamp(2.25rem, 1.5rem + 3.4vw, 4.25rem);

  /* Space and shape */
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(80px, 9vw, 136px);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --nav-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 160ms;
  --slow: 420ms;

}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy-950: #0b0e13;
    --navy-900: #11151b;
    --navy-850: #1a2029;
    --navy-800: #242d39;
    --ink: #eef2f7;
    --ink-2: #abb7c7;
    --ink-3: #96a2b4;
    --rule: rgba(238, 242, 247, 0.12);
    --rule-strong: rgba(238, 242, 247, 0.22);
    --wash: rgba(238, 242, 247, 0.08);
    --wash-strong: rgba(238, 242, 247, 0.14);
    --glow: rgba(138, 180, 255, 0.1);
    --pop-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    --mint: #8ab4ff;
    --mint-hover: #a3c4ff;
    --mint-ink: #101c30;
    --mint-wash: rgba(138, 180, 255, 0.12);
    --mint-line: rgba(138, 180, 255, 0.5);
    --paper: #1a2029;
    --paper-shade: #242d39;
    --paper-ink: #eef2f7;
    --paper-ink-2: #abb7c7;
    --paper-ink-3: #96a2b4;
    --paper-rule: rgba(238, 242, 247, 0.12);
    --paper-mint: #8ab4ff;
    --paper-mint-wash: rgba(138, 180, 255, 0.12);
    --paper-amber: #f0b54a;
    --paper-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7), 0 12px 24px -16px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy-950: #0b0e13;
  --navy-900: #11151b;
  --navy-850: #1a2029;
  --navy-800: #242d39;
  --ink: #eef2f7;
  --ink-2: #abb7c7;
  --ink-3: #96a2b4;
  --rule: rgba(238, 242, 247, 0.12);
  --rule-strong: rgba(238, 242, 247, 0.22);
  --wash: rgba(238, 242, 247, 0.08);
  --wash-strong: rgba(238, 242, 247, 0.14);
  --glow: rgba(138, 180, 255, 0.1);
  --pop-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --mint: #8ab4ff;
  --mint-hover: #a3c4ff;
  --mint-ink: #101c30;
  --mint-wash: rgba(138, 180, 255, 0.12);
  --mint-line: rgba(138, 180, 255, 0.5);
  --paper: #1a2029;
  --paper-shade: #242d39;
  --paper-ink: #eef2f7;
  --paper-ink-2: #abb7c7;
  --paper-ink-3: #96a2b4;
  --paper-rule: rgba(238, 242, 247, 0.12);
  --paper-mint: #8ab4ff;
  --paper-mint-wash: rgba(138, 180, 255, 0.12);
  --paper-amber: #f0b54a;
  --paper-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7), 0 12px 24px -16px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/*
 * Optical label centring. Vazirmatn's line box is taller above the baseline
 * (ascent 1.03em, descent 0.54em), so centred Latin capitals sit visibly high.
 * Controls add twice this value as top padding, which moves the label down by
 * the nudge itself. Persian glyph bodies sit lower and need far less.
 */
:lang(en) {
  --label-nudge: 0.16em;
}
:lang(fa) {
  --label-nudge: 0.04em;
}

/* Lining figures (Latin and Persian digits) in round markers sit high the same way. */
:root {
  --figure-nudge: 0.12em;
}

/* Persian reads best with more leading and no tracking. */
:root[lang="fa"] {
  --body-leading: 1.95;
  --head-leading: 1.4;
  --display-tracking: 0;
}
:root[lang="en"] {
  --body-leading: 1.65;
  --head-leading: 1.12;
  --display-tracking: -0.025em;
}

/* ===== base.css (designer) ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: var(--body-leading);
  color: var(--ink);
  background: var(--navy-950);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: inherit;
}
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure,
pre {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
::selection {
  background: color-mix(in srgb, var(--mint) 30%, transparent);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}
main:focus,
[tabindex="-1"]:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: 12px;
  z-index: 60;
  transform: translateY(-160%);
  background: var(--mint);
  color: var(--mint-ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus {
  transform: none;
}

.wordmark {
  /* Optically centre the Latin wordmark against the logo (see --label-nudge). */
  padding-top: calc(var(--label-nudge) * 2);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}
.mark {
  flex: none;
}

/* ── Buttons ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
  line-height: 1.2;
  padding-block: calc(var(--label-nudge) * 2) 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
/* Icons centre on the box; lift them by the same nudge the label was lowered by. */
.btn > svg {
  margin-top: calc(var(--label-nudge) * -2);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-sm {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 0.875rem;
  border-radius: 10px;
}
.btn-md {
  min-height: 44px;
  padding-inline: 18px;
  font-size: 0.9375rem;
}
.btn-lg {
  min-height: 54px;
  padding-inline: 26px;
  font-size: 1.0625rem;
}
.btn-primary {
  background: var(--mint);
  color: var(--mint-ink);
}
.btn-primary:hover {
  background: var(--mint-hover);
}
.btn-primary:disabled {
  background: var(--wash-strong);
  color: var(--ink-3);
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.text-action span {
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color var(--fast) var(--ease);
}
.text-action:hover span {
  border-color: var(--mint);
}
.text-action .arrow {
  margin-top: calc(var(--label-nudge) * -2);
  transition: transform var(--fast) var(--ease);
}
.text-action:hover .arrow {
  transform: translateX(3px);
}
.text-action-quiet {
  color: var(--ink-2);
  font-size: 0.9375rem;
}
[dir="rtl"] .arrow {
  transform: scaleX(-1);
}
[dir="rtl"] .text-action:hover .arrow {
  transform: scaleX(-1) translateX(3px);
}

/* ── Small controls ───────────────────────────────────── */

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.lang a {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding-block: calc(var(--label-nudge) * 2) 0;
  min-width: 40px;
  min-height: 32px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.lang a[lang="en"] {
  letter-spacing: 0.04em;
}
.lang a:hover {
  color: var(--ink);
}
.lang a[aria-current="true"] {
  background: var(--wash-strong);
  color: var(--ink);
}

.theme-switch {
  display: inline-flex;
  flex: none;
}
.theme-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--ink-3);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.theme-switch a:hover {
  color: var(--ink);
  background: var(--wash-strong);
}
/* Nothing pinned: both links are in the page and the device's scheme picks one. */
.theme-switch a[data-scheme="dark"] {
  display: none;
}
@media (prefers-color-scheme: dark) {
  .theme-switch a[data-scheme="light"] {
    display: none;
  }
  .theme-switch a[data-scheme="dark"] {
    display: inline-flex;
  }
}

.choice {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.choice button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: calc(9px + var(--label-nudge)) 14px calc(9px - var(--label-nudge));
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  text-align: start;
  transition:
    border-color var(--fast) var(--ease),
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}
.choice button:hover {
  border-color: var(--rule-strong);
}
.choice button[aria-checked="true"] {
  border-color: var(--mint);
  background: var(--mint-wash);
}
.choice-label {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}
.choice-hint {
  font-size: var(--step--1);
  color: var(--ink-3);
  line-height: 1.35;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--wash-strong);
  transition: background-color var(--fast) var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: inset-inline-start var(--fast) var(--ease);
}
.switch[aria-checked="true"] {
  color: var(--ink);
}
.switch[aria-checked="true"] .switch-track {
  background: var(--mint);
}
.switch[aria-checked="true"] .switch-thumb {
  inset-inline-start: 19px;
  background: var(--mint-ink);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.icon-btn:hover {
  color: var(--ink);
  background: var(--wash);
}

.field-label {
  font-size: var(--step--1);
  color: var(--ink-3);
  line-height: 1.5;
}
:root[lang="en"] .field-label {
  letter-spacing: 0.02em;
}

/* ── Nav ───────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color var(--slow) var(--ease), border-color var(--slow) var(--ease);
}
.nav[data-scrolled="true"] {
  background: color-mix(in srgb, var(--navy-950) 86%, transparent);
  border-bottom-color: var(--rule);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
/* Three columns: identity at the start, sections centred, actions at the end. */
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  gap: 16px;
}
.nav-links ul {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
}
.nav-links a,
.nav-menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-top: calc(var(--label-nudge) * 2);
  font-size: 0.9375rem;
  line-height: 1.2;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--fast) var(--ease);
}
.nav-links a:hover,
.nav-menu a:hover,
.nav-links a[aria-current],
.nav-menu a[aria-current] {
  color: var(--ink);
}
/* The current section gets a short mint rule under its label, nothing louder. */
.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 8px;
  height: 1px;
  background: var(--mint);
  transform: scaleX(0);
  transition: transform var(--slow) var(--ease);
}
.nav-links a[aria-current]::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.nav-menu {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--navy-950);
  box-shadow: var(--pop-shadow);
}
.nav-menu[hidden] {
  display: none;
}
.nav-menu ul {
  display: grid;
  padding-block: 6px 10px;
}
.nav-menu li + li {
  border-top: 1px solid var(--rule);
}
.nav-menu a {
  display: flex;
  min-height: 48px;
  font-size: 1rem;
}
.nav-menu a[aria-current]::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-end: 10px;
  border-radius: 50%;
  background: var(--mint);
}

@media (min-width: 861px) {
  .nav-menu {
    display: none !important;
  }
}
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-inner {
    grid-template-columns: 1fr auto;
  }
  .nav-toggle {
    display: inline-grid;
  }
}
@media (max-width: 400px) {
  .nav-end {
    gap: 8px;
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}
.nav-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Sections ──────────────────────────────────────────── */

.section {
  padding-block: var(--section) 0;
}
/* Anchor jumps land on the section's opening rule, not on its top padding;
   html's scroll-padding-top already clears the sticky header. */
.section[id] {
  scroll-margin-top: calc(var(--section) * -1 + 8px);
}
.section-head {
  margin-bottom: clamp(40px, 6vw, 72px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--step--1);
  color: var(--ink-3);
  padding-bottom: 20px;
  margin-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--rule);
}
.eyebrow-num {
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}
:root[lang="en"] .eyebrow-num {
  font-family: var(--mono);
  font-size: 0.75rem;
}
.section-head-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
}
.section-head h2 {
  font-size: var(--step-3);
  font-weight: 700;
  line-height: var(--head-leading);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}
.lead {
  font-size: var(--step-1);
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 34em;
}
.quiet {
  color: var(--ink-3);
}

@media (max-width: 860px) {
  .section-head-row {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 28px;
  margin-top: var(--section);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.footer p {
  color: var(--ink-3);
  font-size: 0.875rem;
  flex: 1 1 auto;
}
.trust-seal img {
  display: block;
  height: 72px;
  width: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ===== hero.css (designer) ===== */
/* ── Hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(28px, 5vw, 72px) clamp(16px, 3vw, 40px);
  isolation: isolate;
}
/* One quiet field of depth behind the visual; no orbs, no glow. */
.hero::before {
  content: "";
  position: absolute;
  inset: calc(var(--nav-h) * -1) 0 0;
  z-index: -1;
  --field-x: 22%;
  background: radial-gradient(70% 80% at var(--field-x) 30%, var(--glow), transparent 70%);
}
[dir="ltr"] .hero::before {
  --field-x: 78%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mint);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.hero-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  font-size: min(var(--step-4), 7.4vh);
  font-weight: 700;
  line-height: var(--head-leading);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
  max-width: 11.5em;
}
:root[lang="fa"] .hero h1 {
  line-height: 1.32;
}

.hero-lead {
  margin-top: 24px;
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 31em;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 36px;
}

/* ── Question → report visual ─────────────────────────── */

.q2r {
  position: relative;
  min-width: 0;
}
.q2r-visual {
  position: relative;
}

.q2r-question {
  position: relative;
  z-index: 2;
  width: 88%;
  padding: 16px 20px 18px;
  background: var(--navy-850);
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  box-shadow: var(--pop-shadow);
}
.q2r-label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-3);
  margin-bottom: 4px;
}
.q2r-question p {
  font-size: var(--step-1);
  line-height: 1.75;
  font-weight: 500;
}
.q2r-ghost {
  opacity: 0;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-end: -2px;
  vertical-align: -0.18em;
  background: var(--mint);
  animation: caret 1s steps(2, start) infinite;
}
@keyframes caret {
  to {
    visibility: hidden;
  }
}

.q2r-trail {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding-block: 18px;
  padding-inline-start: 44px;
  font-size: var(--step--1);
  color: var(--ink-3);
}
.q2r-trail::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 27px;
  width: 1px;
  background: linear-gradient(var(--mint-line), color-mix(in srgb, var(--mint) 15%, transparent));
}
.q2r-trail li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--slow) var(--ease);
}
.q2r-trail li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--ink-3);
  transition: background-color var(--slow) var(--ease), border-color var(--slow) var(--ease);
}
.q2r-trail li[data-lit="true"] {
  color: var(--ink-2);
}
.q2r-trail li[data-lit="true"]::before {
  background: var(--mint);
  border-color: var(--mint);
}

.q2r-paper {
  position: relative;
  z-index: 1;
  width: 94%;
  margin-inline-start: auto;
  padding: clamp(20px, 2.6vw, 30px) clamp(20px, 2.8vw, 34px) 18px;
}
.q2r-paper-head {
  margin-bottom: 14px;
}
.q2r-kind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--paper-ink-3);
  margin-bottom: 6px;
}
.q2r-state {
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
  padding: calc(1px + var(--label-nudge) * 2) 10px 1px;
  border-radius: 999px;
  background: var(--paper-shade);
  color: var(--paper-ink-2);
  transition: background-color var(--slow) var(--ease), color var(--slow) var(--ease), opacity var(--slow) var(--ease);
}
.q2r-state[data-ready="true"] {
  background: var(--paper-mint-wash);
  color: var(--paper-mint);
}
.q2r[data-phase="question"] .q2r-state {
  opacity: 0;
}
.q2r-paper-head h3 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.45;
}

.swap {
  display: grid;
}
.swap > * {
  grid-area: 1 / 1;
  transition: opacity var(--slow) var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
/* The outline's sections come in one after another. `--i` was set per item by a style attribute
 * in the markup, which kept `style-src-attr 'unsafe-inline'` in the policy for four numbers; the
 * outline is at most four long (`outline[:4]`), so the position says it. */
.q2r-sections li:nth-child(2) { --i: 1; }
.q2r-sections li:nth-child(3) { --i: 2; }
.q2r-sections li:nth-child(4) { --i: 3; }
.swap-bar {
  align-self: center;
}
.bar {
  display: block;
  height: 0.62em;
  width: 62%;
  border-radius: 4px;
  background: var(--paper-shade);
}
.bar-title {
  height: 0.7em;
  width: 70%;
}
.bar-body {
  width: 84%;
  height: 0.5em;
}
.swap-text {
  opacity: 0;
}

.q2r-sections li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding-block: 9px;
  border-top: 1px solid var(--paper-rule);
}
.q2r-num {
  font-size: var(--step--1);
  color: var(--paper-ink-3);
  font-variant-numeric: tabular-nums;
  line-height: 1.9;
}
.q2r-title {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.7;
}
.q2r-body {
  font-size: var(--step--1);
  color: var(--paper-ink-2);
  line-height: 1.7;
}
.q2r-sections li:not(:first-child) .q2r-body .swap-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q2r-sections li:first-child {
  position: relative;
}
.q2r-sections li:first-child .q2r-body {
  font-size: 0.9375rem;
  color: var(--paper-ink);
}
/* The note beside the first title, in a row that wraps: where both do not fit, on a phone
   and up to a narrow laptop, the note goes to its own line under the title. Laid over the
   row's end, it was drawn on top of the title. */
.q2r-sections li:first-child > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
}
.q2r-sections li:first-child .q2r-title {
  flex: 0 1 auto;
  min-width: 0;
}
.q2r-sections li:first-child .q2r-body {
  flex: 1 1 100%;
  order: 2;
}
.q2r-estimate {
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
  order: 1;
  margin-inline-start: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--paper-amber);
  opacity: 0;
  transition: opacity var(--slow) var(--ease) 300ms;
}

/* Phase states */
.q2r[data-phase="question"] .q2r-sections .bar {
  opacity: 0.55;
}
.q2r[data-phase="outline"] .q2r-title .swap-bar,
.q2r[data-phase="outline"] .q2r-paper-head .swap-bar,
.q2r[data-phase="report"] .swap-bar {
  opacity: 0;
}
.q2r[data-phase="outline"] .q2r-title .swap-text,
.q2r[data-phase="outline"] .q2r-paper-head .swap-text,
.q2r[data-phase="report"] .swap-text {
  opacity: 1;
}
.q2r[data-phase="report"] .q2r-estimate {
  opacity: 1;
}

.q2r-paper-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-rule);
  font-size: 0.75rem;
  color: var(--paper-ink-3);
}
.q2r-exports {
  color: var(--paper-mint);
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--slow) var(--ease) 500ms;
}
.q2r[data-phase="report"] .q2r-exports {
  opacity: 1;
}

.q2r-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  justify-content: flex-end;
}
.q2r-phases {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.q2r-phases button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding-block: calc(var(--label-nudge) * 2) 0;
  min-height: 34px;
  padding-inline: 14px;
  border-radius: 999px;
  font-size: var(--step--1);
  color: var(--ink-3);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.q2r-phases button:hover {
  color: var(--ink);
}
.q2r-phases button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--wash-strong);
}
.q2r-replay {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.q2r-replay:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero h1 {
    max-width: 13em;
  }
}
@media (max-width: 560px) {
  .hero-actions {
    margin-top: 28px;
  }
  .hero-actions .btn-primary {
    flex: 1 1 100%;
  }
  .q2r-question {
    width: 100%;
  }
  .q2r-paper {
    width: 100%;
  }
  .q2r-sections li:nth-child(n + 5) {
    display: none;
  }
  .q2r-controls {
    justify-content: space-between;
  }
}

.q2r-more {
  padding: 10px 0 12px 0;
  padding-inline-start: 32px;
  border-top: 1px solid var(--paper-rule);
  font-size: 0.75rem;
  color: var(--paper-ink-3);
}

/* ===== sections.css (designer) ===== */
/* ── 01 · How it works ─────────────────────────────────── */

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.rail {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}
.rail ol {
  position: relative;
}
.rail ol::before {
  content: "";
  position: absolute;
  inset-block: 24px;
  inset-inline-start: 17px;
  width: 1px;
  background: var(--rule);
}
.rail button {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  padding-block: 14px;
  text-align: start;
  border-radius: var(--radius-sm);
}
.rail button:disabled {
  cursor: default;
}
.rail-num {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--navy-950);
  font-size: 0.875rem;
  line-height: 1;
  padding-top: calc(var(--figure-nudge) * 2);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: all var(--fast) var(--ease);
}
.rail-copy {
  display: grid;
  gap: 2px;
  padding-top: 4px;
}
.rail-title {
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.5;
  transition: color var(--fast) var(--ease);
}
.rail-hint {
  font-size: var(--step--1);
  color: var(--ink-3);
  line-height: 1.6;
}
.rail li[data-state="done"] .rail-num {
  border-color: var(--mint-line);
  color: var(--mint);
}
.rail li[data-state="done"] .rail-title,
.rail button:not(:disabled):hover .rail-title {
  color: var(--ink-2);
}
.rail li[data-state="active"] .rail-num {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--mint-ink);
}
.rail li[data-state="active"] .rail-title {
  color: var(--ink);
}
.rail li[data-state="active"] .rail-hint {
  color: var(--ink-2);
}

.stage {
  background: var(--navy-900);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.2vw, 40px);
  min-height: 520px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.stage-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 16px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.stage-count {
  grid-column: 1 / -1;
  font-size: var(--step--1);
  color: var(--ink-3);
}
.stage-head h3 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.4;
}
.stage-progress {
  display: flex;
  gap: 4px;
  padding-bottom: 10px;
}
.stage-progress span {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--rule-strong);
  transition: background-color var(--slow) var(--ease);
}
.stage-progress span[data-on="true"] {
  background: var(--mint);
}
.stage-body {
  animation: stage-in var(--slow) var(--ease);
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.stage-note {
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-top: 20px;
  max-width: 40em;
}
.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}
.stage-actions .stage-note {
  margin-top: 0;
}
.stage-actions-split {
  justify-content: space-between;
}

.prompt {
  padding: 18px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--navy-950);
}
.prompt-text {
  font-size: var(--step-1);
  font-weight: 500;
  margin-top: 4px;
}
.run-settings {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px 32px;
  margin-top: 28px;
}
.run-settings .field-label {
  margin-bottom: 10px;
}

.exchange {
  display: grid;
  gap: 28px;
}
.turn {
  display: grid;
  gap: 12px;
  animation: stage-in var(--slow) var(--ease);
}
.turn-who {
  color: var(--mint);
  font-size: 0.75rem;
}
.turn-ask {
  font-size: var(--step-1);
  max-width: 32em;
}
.choice-chips button {
  border-radius: 999px;
  padding-inline: 16px;
}

.outline-head {
  margin-bottom: 16px;
}
.outline-for {
  font-size: var(--step-1);
  font-weight: 500;
}
.outline-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-block: 12px;
  border-top: 1px solid var(--rule);
}
.outline-list li:last-child {
  border-bottom: 1px solid var(--rule);
}
.outline-num {
  color: var(--ink-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.outline-title {
  font-weight: 500;
  line-height: 1.6;
}
.outline-text {
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.7;
}
.outline-list li[data-removed="true"] .outline-title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-3);
  color: var(--ink-3);
}
.outline-list li[data-removed="true"] .icon-btn {
  color: var(--mint);
}

.stage-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
}
.mini-exports {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink-2);
  font-size: 0.875rem;
}

@media (max-width: 860px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
  }
  .rail ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .rail ol::before {
    inset-block: auto;
    top: 17px;
    inset-inline: 12%;
    width: auto;
    height: 1px;
  }
  .rail button {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    padding-block: 0;
    text-align: center;
  }
  .rail-copy {
    padding-top: 0;
  }
  .rail-title {
    font-size: 0.75rem;
    line-height: 1.45;
  }
  .rail-hint {
    display: none;
  }
  .stage {
    min-height: 0;
  }
  .stage-progress {
    display: none;
  }
}
@media (max-width: 560px) {
  .run-settings {
    grid-template-columns: 1fr;
  }
  .stage {
    margin-inline: calc(var(--gutter) * -0.5);
  }
  .stage-actions .btn-primary {
    flex: 1 1 100%;
  }
}

/* ── 02 · Compare ──────────────────────────────────────── */

.fork {
  display: grid;
  justify-items: center;
}
.fork-question {
  display: grid;
  gap: 2px;
  max-width: 40em;
  padding: 14px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--navy-850);
  text-align: center;
  font-weight: 500;
}
.fork-lines {
  position: relative;
  width: calc(50% + 16px);
  height: 64px;
  margin-top: 28px;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}
.fork-lines::before {
  content: "";
  position: absolute;
  bottom: 100%;
  inset-inline-start: 50%;
  width: 1px;
  height: 28px;
  background: var(--rule-strong);
}
.fork-lines span {
  position: absolute;
  bottom: 12px;
  font-size: var(--step--1);
  color: var(--ink-2);
  padding-inline: 14px;
}
.fork-lines span:first-child {
  inset-inline-start: 0;
}
.fork-lines span:last-child {
  inset-inline-end: 0;
}

.compare-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-block: 8px 20px;
}
.version-switch {
  display: none;
}

.versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}
.version {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.6vw, 32px);
  transition: opacity var(--slow) var(--ease), box-shadow var(--slow) var(--ease);
}
.version-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--paper-rule);
}
.version-model {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-ink);
}
.version-angle {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.7;
  padding-block: 18px;
}
.version-sections li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  margin-inline: -10px;
  border-top: 1px solid var(--paper-rule);
  border-radius: 4px;
  transition: background-color var(--slow) var(--ease), color var(--slow) var(--ease);
}
.version-title {
  line-height: 1.6;
}
.diff-tag {
  font-size: 0.75rem;
  color: var(--paper-ink-3);
  opacity: 0;
  transition: opacity var(--slow) var(--ease);
}
.versions[data-diff="true"] .diff-tag {
  opacity: 1;
}
.versions[data-diff="true"] li[data-unique="true"] {
  background: var(--paper-mint-wash);
  border-top-color: transparent;
}
.versions[data-diff="true"] li[data-unique="true"] .diff-tag {
  color: var(--paper-mint);
  font-weight: 500;
}
.versions[data-diff="true"] li[data-unique="false"] .version-title {
  color: var(--paper-ink-3);
}
.version-take {
  margin-block: 18px 22px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-rule);
}
.version-take .field-label {
  color: var(--paper-ink-3);
}
.version-take p:last-child {
  font-weight: 500;
  line-height: 1.8;
  margin-top: 2px;
}

.compare-notes {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px clamp(32px, 6vw, 96px);
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.compare-notes .quiet {
  font-size: 0.875rem;
}

@media (max-width: 860px) {
  .fork-lines {
    display: none;
  }
  .fork-question {
    text-align: start;
    justify-self: stretch;
    max-width: none;
  }
  .compare-controls {
    justify-content: space-between;
    margin-top: 20px;
  }
  .version-switch {
    display: inline-flex;
  }
  .versions {
    grid-template-columns: 1fr;
  }
  .version[data-shown="false"] {
    display: none;
  }
  .compare-notes {
    grid-template-columns: 1fr;
  }
}

/* ── 03 · Report ───────────────────────────────────────── */

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.margin-notes {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  display: grid;
  gap: 28px;
  padding-top: 72px;
}
.margin-notes li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
}
.margin-title {
  font-weight: 500;
  line-height: 1.6;
}
.margin-text {
  color: var(--ink-2);
  font-size: 0.9375rem;
  margin-top: 4px;
}
.note-key {
  color: var(--mint);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 20px;
}
.export-row ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.export-row li {
  font-size: 0.9375rem;
  color: var(--ink-2);
  padding-inline: 12px;
  border-inline-start: 1px solid var(--rule-strong);
}
.export-row li:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

@media (max-width: 960px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .margin-notes {
    position: static;
    padding-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    order: 2;
  }
}
@media (max-width: 640px) {
  .margin-notes {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ── 04 · Answers ──────────────────────────────────────── */

.answers {
  border-bottom: 1px solid var(--rule);
}
.answer {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 8px clamp(32px, 6vw, 96px);
  padding-block: 24px;
  border-top: 1px solid var(--rule);
}
.answer dt {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.6;
}
.answer dd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 24px;
}
.answer dd p {
  color: var(--ink-2);
  max-width: 36em;
}
.answer .text-action {
  flex: none;
  min-height: 0;
  padding-top: 2px;
}
@media (max-width: 760px) {
  .answer {
    grid-template-columns: 1fr;
  }
  .answer dd {
    flex-direction: column;
  }
  /* Under the answer here, as beside it on a wider screen: hidden, a phone lost the way
     from each answer to the part of the page it points at. Tall enough for a finger. */
  .answer .text-action {
    min-height: 44px;
    padding-top: 0;
  }
}

/* ── Get CAI ───────────────────────────────────────────── */

.section-get {
  padding-bottom: 0;
}
.get-inner {
  display: grid;
  justify-items: start;
  gap: 24px;
}
.get-inner::before {
  content: "";
  justify-self: stretch;
  height: 1px;
  margin-bottom: clamp(24px, 5vw, 72px);
  background: var(--rule);
}
.get-inner h2 {
  font-size: var(--step-4);
  font-weight: 700;
  line-height: var(--head-leading);
  letter-spacing: var(--display-tracking);
  max-width: 13em;
  text-wrap: balance;
}
:root[lang="fa"] .get-inner h2 {
  line-height: 1.35;
}
.get-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 12px;
}

/* ===== paper.css (designer) ===== */
/* ── Paper: every surface that stands for the deliverable ── */

.paper {
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 6px;
  box-shadow: var(--paper-shadow);
}
.paper :focus-visible {
  outline-color: var(--paper-mint);
}
.paper .field-label {
  color: var(--paper-ink-3);
}
.paper-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: var(--step--1);
  color: var(--paper-ink-3);
}
.paper-title {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.45;
  margin-top: 4px;
}
.paper-num {
  color: var(--paper-ink-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
/* Editorial annotation for an unverified figure: a hairline, a small label in
   the uncertainty colour, then plain text. Colour lives only on the label. */
.doc-note {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-rule);
  max-width: 38em;
}
.doc-note-label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--paper-amber);
}
:root[lang="en"] .doc-note-label {
  letter-spacing: 0.02em;
}
.doc-note-text {
  margin-top: 2px;
  font-size: 0.9375rem;
  line-height: var(--body-leading);
  color: var(--paper-ink-2);
}

/* Mini report inside the workflow demo */
.mini-report {
  padding: clamp(20px, 3vw, 32px);
}
.mini-report header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--paper-rule);
}
.mini-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 6px;
}
.mini-sections li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding-block: 8px;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 0.9375rem;
  opacity: 0.32;
  transition: opacity var(--slow) var(--ease);
}
.mini-sections li[data-written="true"] {
  opacity: 1;
}
.mini-body {
  margin-top: 20px;
  transition: opacity var(--slow) var(--ease);
}
.mini-body[data-visible="false"] {
  opacity: 0;
  visibility: hidden;
}
.mini-finding {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.8;
}
.mini-progress {
  min-height: 1.6em;
  margin-top: 10px;
  font-size: var(--step--1);
  color: var(--paper-mint);
}
.mini-progress:empty {
  display: none;
}

/* The full sample report */
.doc {
  padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 72px);
}
.doc-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--paper-rule);
}
.sample-tag {
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
  padding: calc(1px + var(--label-nudge) * 2) 10px 1px;
  border-radius: 999px;
  border: 1px solid var(--paper-rule);
  color: var(--paper-ink-2);
}
.doc-title {
  margin-top: 14px;
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}
.doc-block {
  margin-top: 32px;
}
.doc-block h4 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
}
.doc-block p {
  line-height: var(--body-leading);
  max-width: 38em;
}
.doc-summary p {
  font-size: var(--step-1);
}
/* Keys that tie the margin notes to the document: superscript letters, like footnotes. */
.note-ref {
  margin-inline-start: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 0;
  vertical-align: super;
  color: var(--paper-mint);
}
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  padding-block: calc(var(--figure-nudge) * 2) 0;
  line-height: 1;
  margin-inline-start: 2px;
  vertical-align: 0.15em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--paper-mint);
  background: var(--paper-mint-wash);
  transition: background-color var(--fast) var(--ease);
}
.cite:hover,
.cite[aria-pressed="true"] {
  background: color-mix(in srgb, var(--paper-mint) 22%, transparent);
}
.doc-list {
  display: grid;
  gap: 6px;
}
.doc-list li {
  position: relative;
  padding-inline-start: 18px;
}
.doc-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.9em;
  width: 6px;
  height: 1px;
  background: var(--paper-ink-2);
}
.doc-sources ol {
  border-top: 1px solid var(--paper-rule);
}
.doc-sources li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px;
  margin-inline: -10px;
  border-bottom: 1px solid var(--paper-rule);
  border-radius: 4px;
  font-size: 0.9375rem;
  transition: background-color var(--fast) var(--ease);
}
.doc-sources li[data-cited="true"] {
  background: var(--paper-mint-wash);
}
.source-kind {
  font-size: 0.75rem;
  color: var(--paper-ink-3);
}
.doc-fine {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--paper-ink-3);
}

/* ── Additions for the server-rendered page ────────────────── */

/* A rule that sets `display` outranks the browser's `[hidden]`, and the script hides list
   items, stages and the caret with the attribute. */
[hidden] {
  display: none !important;
}

/* The menu toggle and the outline's remove/restore button swap their glyph from their own
   state, so the markup carries both and no script has to redraw an icon. */
.nav-toggle .icon-close,
.icon-btn .icon-restore {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-open,
.icon-btn[aria-pressed="true"] .icon-remove {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-close,
.icon-btn[aria-pressed="true"] .icon-restore {
  display: inline;
}

/* Which models write the report is a setting, so the demo shows it and does not ask. */
.run-writers {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

/* The report the models are read into: marked as the one that is delivered. */
.combined {
  margin-top: 32px;
  padding: clamp(22px, 2.6vw, 32px);
  box-shadow: 0 0 0 2px var(--mint), var(--paper-shadow);
}
.combined .version-angle {
  padding-bottom: 8px;
}

.export-share {
  flex-basis: 100%;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* ---- the explainer video, between the hero and the demo ---- */
.video-frame {
  margin: 0;
  max-width: 960px;
  margin-inline: auto;
}
.video-title {
  margin: 0 0 20px;
  font-size: var(--step-2);
  font-weight: 500;
}
.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--navy-900);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}
.video-frame figcaption {
  margin-top: 12px;
  font-size: var(--step--1);
  color: var(--ink-3);
}
