:root {
  /* LIGHT is the default theme: warm ivory ground, near-black maroon ink, a deepened
     amber/ochre accent (darker than the dark-theme accent -- plain gold fails AA contrast
     on a light ground, see docs/how-it-works.md light/dark note). Toggled to dark via
     [data-theme="dark"] below, persisted in localStorage by script.js. */
  --bg: #faf1e7;
  --surface: #fffaf4;
  --surface-2: #f0ddc4;
  --ink: #2a1512;
  --muted: #7d5c4e;
  --accent: #96632b;
  --accent-ink: #fdf6ec;
  --success: #3f7d4a;
  --danger: #b5502a;

  /* Dark "anchor" bands (hero, folder tabs, alternating section stripes, the modal) --
     deliberately the SAME maroon tones in both themes, never flipped. Everything inside one
     of these containers re-points --ink/--muted/--accent/--accent-ink/--surface-2 to the
     *-band-* fixed values below (see the per-container overrides further down this file) so
     text stays legible regardless of which top-level theme is active. */
  --field-1: #180b0a;
  --field-1-ink: #ece3d8;
  --field-2: #2c1513;
  --field-3: #512a26;
  --band-muted: #bfa193;
  /* Stable escape hatch: always the CURRENT theme's real ambient tokens, even when read
     from inside a dark-band override further down the tree (e.g. a light inset KPI card
     nested inside a dark showcase panel needs ambient text, not the band's). Never
     redeclared inside a band override or the [data-theme="dark"] block below -- that's
     what keeps it tracking the active theme instead of freezing at page-load. */
  --ambient-ink: var(--ink);
  --ambient-muted: var(--muted);
  --band-tint: #432220;
  --band-accent: #c69a52;
  --band-accent-ink: #241110;

  --font-display: "Jost", system-ui, sans-serif;
  --font-text: "Jost", system-ui, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 3.6rem);
  --step-display: clamp(2.1rem, 1.2rem + 4.2vw, 4.6rem);

  --margin: clamp(20px, 4vw, 48px);
  --radius: 10px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-modal: 220ms;
  --t-reveal: 550ms;
}

/* Dark theme: opt-in via a manual toggle (site/script.js sets this attribute and
   remembers the choice) -- light is the default for a first-time visitor. */
:root[data-theme="dark"] {
  --bg: #241110;
  --surface: #35191a;
  --surface-2: #432220;
  --ink: #ece3d8;
  --muted: #bfa193;
  --accent: #c69a52;
  --accent-ink: #241110;
  --success: #9fd3a4;
  --danger: #e4a582;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  padding-inline: var(--margin);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

a { color: inherit; }
p { margin: 0; max-width: 60ch; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; display: block; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.92em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- layout shells ---------- */

.wrap { max-width: 1240px; margin-inline: auto; }
.section { padding-block: clamp(64px, 10vw, 140px); }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
}

.site-nav { display: flex; align-items: center; gap: 20px; }

.nav-link {
  font-size: var(--step-small);
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--t-hover) ease;
}

.nav-link:hover, .nav-link-active { color: var(--accent); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#theme-toggle { padding: 9px 18px; font-size: var(--step-small); }

.wordmark {
  font-family: var(--font-display);
  font-size: var(--step-lead);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-family: inherit;
  font-size: var(--step-small);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:active { transform: translateY(0) scale(0.97); }

.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--muted); }
.btn-outline:active { transform: scale(0.97); }

.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid currentColor; }
.btn-ghost:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .btn-accent:hover { transform: translateY(-2px); }
  .btn-outline:hover { border-color: var(--accent); color: var(--accent); }
  .btn-ghost:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
}

.link { text-decoration: underline; text-underline-offset: 0.18em; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--field-1);
  color: var(--field-1-ink);
  /* always-dark band: pin accent to the fixed dark-mode gold regardless of site theme
     (hero-note strong, the ambient chart SVG, and the open tab all read var(--accent)) */
  --accent: var(--band-accent);
  --accent-ink: var(--band-accent-ink);
  margin-inline: calc(var(--margin) * -1);
  padding-inline: var(--margin);
  padding-block: clamp(24px, 3vw, 40px) clamp(56px, 8vw, 100px);
}

/* ambient data-viz background -- explanatory atmosphere, never the focal point */

.hero-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.1;
}

.hero-chart-bars rect {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(0);
}

.hero-chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

@media (prefers-reduced-motion: no-preference) {
  .js .hero-chart-bars rect {
    animation: hero-bar-grow 900ms var(--ease-out) forwards, hero-bar-drift 42s var(--ease-in-out) 1300ms infinite alternate;
  }
  .hero-chart-bars rect:nth-child(1) { animation-delay: 0ms, 1300ms; }
  .hero-chart-bars rect:nth-child(2) { animation-delay: 60ms, 1360ms; }
  .hero-chart-bars rect:nth-child(3) { animation-delay: 120ms, 1420ms; }
  .hero-chart-bars rect:nth-child(4) { animation-delay: 180ms, 1480ms; }
  .hero-chart-bars rect:nth-child(5) { animation-delay: 240ms, 1540ms; }

  .js .hero-chart-line {
    animation: hero-line-draw 1300ms cubic-bezier(0.23, 1, 0.32, 1) forwards, hero-line-drift 38s var(--ease-in-out) 1300ms infinite alternate;
  }
}

@keyframes hero-bar-grow { to { transform: scaleY(1); } }
@keyframes hero-bar-drift { to { transform: scaleY(1) translateY(-10px); } }
@keyframes hero-line-draw { to { stroke-dashoffset: 0; } }
@keyframes hero-line-drift { to { transform: translate(-14px, 8px); } }

@media (prefers-reduced-motion: reduce) {
  .hero-chart-bars rect { transform: scaleY(1); }
  .hero-chart-line { stroke-dashoffset: 0; }
}

.hero-head { position: relative; z-index: 1; max-width: 760px; padding-top: clamp(24px, 4vw, 48px); }

.hero h1 {
  font-size: var(--step-display);
  text-transform: uppercase;
  line-height: 0.98;
  max-width: 18ch;
}

.hero-sub {
  margin-top: 22px;
  max-width: 46ch;
  font-size: var(--step-lead);
  line-height: 1.32;
  color: var(--field-1-ink);
  opacity: 0.94;
}

.hero-note {
  margin-top: 26px;
  max-width: 46ch;
  font-size: var(--step-body);
  color: var(--field-1-ink);
}

.hero-note strong { color: var(--accent); }

/* folder / tab motif -- the hero's one shape, carried through the page */

.folders {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 7vw, 88px);
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 12px 12px 0 0;
  background: var(--field-2);
  color: var(--field-1-ink);
  font-weight: 700;
  font-size: var(--step-small);
  text-decoration: none;
  transition: transform var(--t-hover) var(--ease-out), background-color var(--t-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  a.tab:hover { transform: translateY(-4px); background: var(--band-tint); }
}

.tab-active { background: var(--accent); color: var(--accent-ink); }

.folder {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 44px) clamp(32px, 4vw, 44px);
}

/* live generator widget, staged inside the open folder */

.field-group { margin-bottom: 18px; }

.field-group label {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 8px;
}

.dropzone {
  border: 1.5px dashed var(--muted);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  font-size: var(--step-small);
  color: var(--muted);
  background: var(--bg);
  display: block;
  transition: border-color var(--t-hover) ease, color var(--t-hover) ease;
}

.dropzone.drag { border-color: var(--accent); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .dropzone:hover { border-color: var(--accent); color: var(--ink); }
}
.dropzone strong { color: var(--ink); }
.dropzone input[type="file"] { display: none; }

#file-name { margin-top: 10px; font-size: var(--step-small); color: var(--ink); overflow-wrap: anywhere; }

textarea, input[type="email"], input[type="text"], input[type="number"], select {
  width: 100%;
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--step-body);
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
}

textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#status { margin-top: 16px; font-size: var(--step-small); min-height: 1.2em; overflow-wrap: anywhere; }
#status[data-state="error"] { color: var(--danger); }
#status[data-state="ok"] { color: var(--success); }
#status[data-state="hint"] { color: var(--accent); }

/* ---------- how it works ---------- */

.how-head { max-width: 46ch; margin-bottom: 48px; }
.how-head h2 { font-size: var(--step-head); margin-bottom: 14px; }
.how-head p { color: var(--muted); }

.steps {
  display: flex;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  flex: 1 1 0;
  padding: clamp(28px, 3vw, 40px) clamp(22px, 3vw, 32px);
}

.step-1, .step-2 {
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  color: var(--ink);
}
.step-1 { background: var(--field-1); }
.step-2 { background: var(--field-3); }
.step-3 { background: var(--surface-2); }

.step h3 { font-size: var(--step-lead); margin-bottom: 14px; }
.step p { color: var(--muted); max-width: 42ch; }

/* real interface fragments -- believable, cropped, numbers that add up */

.output-preview {
  margin-top: 2px;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: clamp(32px, 4vw, 48px);
}

.output-label { font-size: var(--step-lead); font-weight: 700; font-family: var(--font-display); margin-bottom: 24px; }

.profile-ui { margin-top: 24px; background: var(--bg); border-radius: var(--radius); padding: 20px 24px; }
[data-ui] .profile-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: var(--step-body); }
[data-ui] .profile-row:nth-of-type(even) { background: var(--surface-2); margin-inline: -10px; padding-inline: 10px; border-radius: 6px; }
[data-ui] .tag { font-size: var(--step-small); font-weight: 700; padding: 4px 11px; border-radius: 999px; }
[data-ui] .tag-date { background: #4a3620; color: #e8c383; }
[data-ui] .tag-cat { background: #2d4536; color: #9fd3a4; }
[data-ui] .tag-num { background: #3a2550; color: #c4a8e8; }
[data-ui] .profile-caption { margin-top: 14px; font-size: var(--step-small); color: var(--muted); }

.prompt-ui { margin-top: 24px; background: var(--bg); border-radius: var(--radius); padding: 24px 28px; font-size: var(--step-lead); font-style: italic; color: var(--ink); }

.download-ui { margin-top: 24px; background: var(--bg); border-radius: var(--radius); padding: 20px 24px; }
[data-ui] .download-row { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
[data-ui] .download-size { color: var(--muted); font-weight: 400; font-size: var(--step-small); }
[data-ui] .download-status { margin-top: 10px; color: var(--success); font-size: var(--step-small); }

.kpi-ui { display: flex; gap: 16px; flex-wrap: wrap; }
.kpi-card {
  background: var(--bg);
  /* a light ambient card can sit nested inside a dark band (showcase, price-premium) --
     always use the real ambient ink/muted/accent here, never a band override */
  --ink: var(--ambient-ink);
  --muted: var(--ambient-muted);
  border-radius: var(--radius);
  padding: 72px 28px;
  min-width: 180px;
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
[data-ui] .kpi-label { font-size: var(--step-small); color: var(--muted); }
.kpi-value { font-size: var(--step-lead); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

pre.file-tree {
  margin-top: 20px;
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: var(--step-body);
  line-height: 1.7;
  overflow-x: auto;
}

/* ---------- see it in action (video) ---------- */

.demo-video { padding-top: 0; }
.demo-head { max-width: 50ch; margin-bottom: 32px; }
.demo-head h2 { font-size: var(--step-head); margin-bottom: 14px; }
.demo-head p { color: var(--muted); }

.video-frame {
  background: var(--field-1);
  border-radius: var(--radius);
  padding: clamp(10px, 1.5vw, 18px);
}

.video-frame video {
  display: block;
  width: 100%;
  max-height: 72vh;
  border-radius: calc(var(--radius) - 4px);
  background: #000;
}

/* ---------- showcase (worked examples) ---------- */

.showcase-head { max-width: 62ch; margin-bottom: 48px; }
.showcase-head h2 { font-size: var(--step-head); margin-bottom: 16px; }
.showcase-head p { color: var(--muted); }

.example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}

.example-input, .example-output {
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  color: var(--ink);
  padding: clamp(24px, 3vw, 36px);
}

.example-input { background: var(--field-2); }
.example-output { background: var(--field-3); }

.example-domain { font-size: var(--step-lead); font-weight: 700; font-family: var(--font-display); margin-bottom: 18px; }
.example-filename { font-size: var(--step-lead); font-weight: 700; }
.example-meta { margin-top: 6px; font-size: var(--step-small); color: var(--muted); }

.example-cols {
  margin-top: 18px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: var(--step-small);
  color: var(--muted);
  line-height: 1.7;
}

.example-kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.example-kpis .kpi-card { padding: 18px 20px; min-width: 140px; flex: 1 1 140px; }
.example-kpis .kpi-value { font-size: var(--step-lead); }

.example-charts { margin-top: 16px; font-size: var(--step-small); color: var(--muted); line-height: 1.6; }

/* ---------- features ---------- */

.features h2 { font-size: var(--step-head); margin-bottom: 40px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
}

.feature-cell {
  min-width: 0;
  background: var(--surface-2);
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 260px;
}

.feature-cell:nth-child(even) {
  flex-direction: column-reverse;
  background: var(--field-2);
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  --accent: var(--band-accent);
  --accent-ink: var(--band-accent-ink);
  color: var(--ink);
}

/* real shape variety, not just colour: a wide cell top, a wide cell bottom, a tall cell right */
.feature-cell-wide { grid-column: span 2; }
.feature-cell-tall { grid-row: span 2; }
.feature-cell:nth-child(6) { grid-column: span 2; flex-direction: row; align-items: center; }
.feature-cell-wide.feature-cell:nth-child(even) { flex-direction: row-reverse; align-items: center; }

.feature-text h3 { font-size: var(--step-lead); margin-bottom: 10px; }
.feature-text p { color: var(--muted); }

.feature-fragment { background: var(--bg); border-radius: var(--radius); padding: 18px 20px; }

.feature-fragment-chart svg { width: 100%; height: 56px; }
.feature-fragment-chart rect { fill: var(--accent); }

.feature-fragment-files { display: flex; flex-direction: column; gap: 6px; font-size: var(--step-small); color: var(--muted); }

[data-ui].feature-fragment-code { display: block; font-family: "SFMono-Regular", Consolas, monospace; font-size: var(--step-small); color: var(--accent); overflow-x: auto; white-space: nowrap; }

pre.feature-fragment-tree { font-family: "SFMono-Regular", Consolas, monospace; font-size: var(--step-small); line-height: 1.7; color: var(--ink); }

.feature-fragment-btn { display: flex; align-items: center; justify-content: center; }
.feature-fragment-btn .btn { pointer-events: none; }

/* ---------- criteria ("what to look for") ---------- */

.criteria { padding-bottom: clamp(32px, 4vw, 56px); }
.criteria h2 { font-size: var(--step-head); }
.criteria-lead { margin-top: 14px; color: var(--muted); max-width: 52ch; }

.criteria-list { margin-top: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 56px; }
.criteria-row { max-width: 52ch; }
.criteria-q { font-size: var(--step-lead); font-weight: 700; }
.criteria-a { margin-top: 8px; color: var(--muted); }

/* ---------- pricing ---------- */

.pricing-head { margin-bottom: 40px; }
.pricing-head h2 { font-size: var(--step-head); }

.price-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2px;
  background: var(--field-1);
  border-radius: var(--radius);
  overflow: hidden;
}

.price-field {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  min-height: 440px;
}

.price-free { background: var(--surface); }
.price-premium {
  background: var(--field-2);
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  --accent: var(--band-accent);
  --accent-ink: var(--band-accent-ink);
  color: var(--ink);
}

.plan-name { font-size: var(--step-head); font-weight: 700; font-family: var(--font-display); }
.plan-for { margin-top: 10px; font-size: var(--step-lead); max-width: 30ch; }

.plan-ticks {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  max-width: 42ch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-ticks li {
  position: relative;
  padding-left: 28px;
  color: var(--ink);
}

.plan-ticks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.plan-price { margin-top: auto; padding-top: 48px; font-size: var(--step-head); font-weight: 700; }
.price-field .btn { margin-top: 20px; align-self: flex-start; }

/* ---------- faq ---------- */

.faq {
  margin-inline: calc(var(--margin) * -1);
}

.faq-band {
  padding-inline: var(--margin);
  padding-block: 40px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px 56px;
}

.faq-band:nth-of-type(odd):not(.faq-band-head) {
  background: var(--field-2);
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  color: var(--ink);
}

.faq-band-head {
  background: var(--field-1);
  --muted: var(--band-muted);
  padding-block: clamp(48px, 6vw, 72px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 48px;
}

.faq-band-head h2 { font-size: var(--step-head); color: var(--field-1-ink); }
.faq-band-head p { color: var(--muted); max-width: 46ch; flex: 1 1 320px; }

.faq-q { font-size: var(--step-lead); font-weight: 700; }
.faq-a { color: var(--muted); max-width: 64ch; }

/* ---------- footer ---------- */

footer {
  padding-block: clamp(56px, 9vw, 110px);
}

.footer-note { color: var(--muted); max-width: 64ch; font-size: var(--step-small); }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  margin-top: 24px;
  font-size: var(--step-small);
  color: var(--muted);
}

.footer-row a { color: var(--accent); }

.wordmark-big { display: block; margin-top: 40px; font-size: var(--step-display); }

/* ---------- modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 4, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin);
  z-index: 10;
  opacity: 0;
  transition: opacity var(--t-modal) var(--ease-out);
}

.modal-overlay[hidden] { display: none; }
.modal-overlay.is-open { opacity: 1; }

.modal {
  background: var(--field-2);
  --ink: var(--field-1-ink);
  --muted: var(--band-muted);
  --accent: var(--band-accent);
  --accent-ink: var(--band-accent-ink);
  --surface-2: var(--band-tint);
  color: var(--ink);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 40px);
  position: relative;
  transform: scale(0.96);
  opacity: 0;
  transition: transform var(--t-modal) var(--ease-out), opacity var(--t-modal) var(--ease-out);
}

.modal-overlay.is-open .modal {
  transform: scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}

.modal-close:hover { color: var(--accent); }

.modal h3 { font-size: var(--step-lead); margin-bottom: 4px; }
.modal .coming-soon { display: inline-block; margin-bottom: 20px; font-size: var(--step-small); color: var(--muted); }

.modal ul { margin: 0 0 24px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.modal ul li { padding: 10px 14px; border-radius: 8px; font-size: var(--step-body); }
.modal ul li:nth-of-type(even) { background: var(--surface-2); }

.waitlist-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.waitlist-form input { flex: 1 1 200px; }
.waitlist-form .btn { flex: 0 0 auto; }

.modal-fineprint { margin-top: 14px; font-size: var(--step-small); color: var(--muted); }
#waitlist-success { margin-top: 14px; font-size: var(--step-small); color: #9fd3a4; }

/* ---------- motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .tab { transition: background-color var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease; }
  .btn:active, .btn-accent:active { transform: none; }
  .modal { transform: none; transition: opacity var(--t-modal) var(--ease-out); }
  .modal-overlay.is-open .modal { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-cell-wide { grid-column: span 2; }
  .feature-cell-tall { grid-row: span 1; }
}

/* ---------- /tools index + tool pages ---------- */

.tools-hero { padding-block: clamp(48px, 7vw, 96px) clamp(24px, 4vw, 40px); }
.tools-hero h1 { font-size: var(--step-head); }
.tools-lead { margin-top: 14px; color: var(--muted); max-width: 64ch; font-size: var(--step-body); }
.tools-lead a { color: var(--accent); }

.tools-list { padding-top: 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tool-card {
  display: block;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-2);
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--t-hover) var(--ease-out), border-color var(--t-hover) ease;
}

.tool-card h3 { font-size: var(--step-lead); margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: var(--step-small); }

.tools-empty { color: var(--muted); }

.tools-cta { padding-block: clamp(48px, 8vw, 96px); }
.tools-cta-inner { text-align: center; max-width: 56ch; margin-inline: auto; }
.tools-cta-inner h2 { font-size: var(--step-head); }
.tools-cta-inner p { margin: 14px 0 28px; color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover { transform: translateY(-3px); border-color: var(--accent); }
}

/* ---------- individual tool pages (chart chooser, and every tool after it) ---------- */

.tool-hero { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 5vw, 56px); }
.tool-hero h1 { font-size: var(--step-head); }
.tool-lead { margin: 14px 0 32px; color: var(--muted); max-width: 68ch; font-size: var(--step-body); }

.chooser-form { max-width: 640px; }

.tool-status { margin-top: 12px; font-size: var(--step-small); min-height: 1.2em; overflow-wrap: anywhere; }
.tool-status[data-state="error"] { color: var(--danger); }
.tool-status[data-state="ok"] { color: var(--success); }
.tool-status[data-state="hint"] { color: var(--accent); }

.chooser-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
  max-width: 640px;
}

.chooser-result-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-2);
}

.chooser-rank {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--step-small);
}

.chooser-result-card h3 { font-size: var(--step-lead); margin-bottom: 4px; }
.chooser-result-card p { color: var(--muted); }

.tool-copy { padding-top: 0; }
.tool-copy-inner { max-width: 68ch; }
.tool-copy-inner h2 { font-size: var(--step-head); margin-bottom: 14px; }
.tool-copy-inner h3 { font-size: var(--step-lead); margin: 28px 0 10px; }
.tool-copy-inner p { color: var(--muted); margin-bottom: 14px; }
.tool-copy-inner .link { color: var(--accent); }

.tool-links { padding-block: 0 clamp(48px, 7vw, 80px); color: var(--muted); }

/* ---------- DAX code output (generator + explainer) ---------- */

.dax-code-block {
  position: relative;
  margin-top: 0;
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px 56px 20px 20px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: var(--step-small);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-size: 12px;
}

.dax-explanation { margin-top: 14px; color: var(--muted); max-width: 640px; }

/* ---------- theme generator swatches ---------- */

.theme-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--surface-2);
  flex-shrink: 0;
}

.swatch-row { display: flex; flex-direction: column; gap: 6px; }
.swatch-row .swatch-label { font-size: var(--step-small); color: var(--muted); }

/* ---------- data profiler ---------- */

.profile-summary { display: flex; flex-wrap: wrap; gap: 28px; margin: 24px 0; }
.profile-stat { display: flex; flex-direction: column; gap: 4px; }
.profile-stat-value { font-size: var(--step-head); font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-stat-label { font-size: var(--step-small); color: var(--muted); }
.profile-stat-value.score-good { color: var(--success); }
.profile-stat-value.score-mid { color: var(--accent); }
.profile-stat-value.score-bad { color: var(--danger); }

.profile-table-wrap { overflow-x: auto; max-width: 100%; }
table.profile-table { width: 100%; border-collapse: collapse; font-size: var(--step-small); min-width: 480px; }
table.profile-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}
table.profile-table td { padding: 8px 12px; border-bottom: 1px solid var(--surface-2); font-variant-numeric: tabular-nums; }

/* ---------- sample data generator ---------- */

.sample-preview-wrap { overflow-x: auto; max-width: 640px; margin-top: 20px; }
table.sample-preview { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
table.sample-preview th, table.sample-preview td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--surface-2);
  text-align: left;
  white-space: nowrap;
}
table.sample-preview th { color: var(--muted); font-weight: 600; }
.sample-download-row { margin-top: 16px; display: flex; align-items: center; gap: 14px; }

/* ---------- star schema diagram ---------- */

.schema-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px;
  max-width: 520px;
  margin: 28px 0;
}
.schema-box {
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  font-size: var(--step-small);
  background: var(--surface);
  color: var(--muted);
}
.schema-box strong { display: block; margin-bottom: 4px; color: var(--ink); }
.schema-fact {
  grid-column: 2; grid-row: 2;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.schema-dim-top { grid-column: 2; grid-row: 1; }
.schema-dim-left { grid-column: 1; grid-row: 2; }
.schema-dim-right { grid-column: 3; grid-row: 2; }
.schema-dim-bottom { grid-column: 2; grid-row: 3; }

@media (max-width: 520px) {
  .schema-diagram { grid-template-columns: 1fr; grid-template-rows: none; max-width: 320px; }
  .schema-fact, .schema-dim-top, .schema-dim-left, .schema-dim-right, .schema-dim-bottom {
    grid-column: 1; grid-row: auto;
  }
}

@media (max-width: 760px) {
  .steps { flex-direction: column; gap: 2px; }

  .price-split { grid-template-columns: 1fr; }

  /* the tall kpi-card padding exists only to clear design-taste-frontend's
     300x200 picture-floor check on desktop; on a phone it just adds scroll */
  .kpi-card { padding: 28px 24px; }

  .example { grid-template-columns: 1fr; }

  .feature-grid { grid-template-columns: 1fr; }
  .feature-cell-wide, .feature-cell-tall { grid-column: span 1; grid-row: span 1; }
  .feature-cell:nth-child(6) { grid-column: span 1; flex-direction: column-reverse; }

  .criteria-list { grid-template-columns: 1fr; }

  .faq-band { grid-template-columns: 1fr; gap: 10px; }
  .feature-cell, .feature-cell:nth-child(even) { flex-direction: column; }
}
