/* datatrap.io — styles from the Datatrap design system (tokens.json). */

@font-face { font-family: "Commissioner"; src: url("/fonts/commissioner-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Commissioner"; src: url("/fonts/commissioner-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Commissioner"; src: url("/fonts/commissioner-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Commissioner"; src: url("/fonts/commissioner-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --ground: #f6f5f1;
  --surface: #ffffff;
  --surface-sunk: #eeece6;
  --line: #dedbd3;
  --line-strong: #8a877d;
  --ink: #17191b;
  --ink-muted: #56595d;
  --ink-subtle: #63676b;
  --brand: #0e6660;
  --brand-hover: #0a524d;
  --on-brand: #ffffff;
  --brand-tint: #e1efec;
  --brand-ink: #0a4f4a;
  --accent: #e3a33a;
  --focus: #1d5f8c;
  --positive: #1f7a4a;
  --positive-tint: #e3f1e8;
  --series-1: #1d5f8c;
  --series-2: #d0782a;
  --series-3: #0e8a7e;
  --series-5: #a8841c;
  --div-neg-2: #b4491d;
  --div-pos-2: #1d5f8c;
  --band-deep: #0a4f4a;       /* brand-ink */
  --on-deep: #f6f5f1;         /* ink-inverse */
  --on-deep-muted: #e1efec;   /* brand-tint */
  --cta-bg: #f6f5f1;
  --cta-ink: #0a4f4a;
  --cta-hover: #ffffff;
  --shadow-md: 0 4px 12px rgba(23, 25, 27, 0.08), 0 1px 3px rgba(23, 25, 27, 0.06);
  --shadow-lg: 0 16px 40px rgba(23, 25, 27, 0.14), 0 2px 6px rgba(23, 25, 27, 0.06);
  --sans: "Commissioner", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111315;
    --surface: #191c1f;
    --surface-sunk: #0b0d0e;
    --line: #2e3337;
    --line-strong: #697076;
    --ink: #ecebe6;
    --ink-muted: #a9adb1;
    --ink-subtle: #8e9398;
    --brand: #5cc6b8;
    --brand-hover: #7fd6ca;
    --on-brand: #062422;
    --brand-tint: #15302d;
    --brand-ink: #9fe0d6;
    --accent: #eab35a;
    --focus: #86c3ea;
    --positive: #5fc28d;
    --positive-tint: #14291d;
    --series-1: #6fb3e0;
    --series-2: #eba066;
    --series-3: #4fc4b5;
    --series-5: #dcc063;
    --div-neg-2: #e2825a;
    --div-pos-2: #7dbde0;
    --band-deep: #15302d;     /* brand-tint */
    --on-deep: #ecebe6;       /* ink */
    --on-deep-muted: #a9adb1; /* ink-muted */
    --cta-bg: #5cc6b8;        /* brand */
    --cta-ink: #062422;       /* on-brand */
    --cta-hover: #7fd6ca;     /* brand-hover */
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 5px; }
svg { display: block; }

.skip { position: absolute; left: 16px; top: -48px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 5px; z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1136px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
@media (min-width: 1024px) { .wrap { padding: 0 32px; } }

/* Logo: frame in brand, dot in accent, wordmark in ink (datatrap-lockup). */
.lockup { height: 32px; width: auto; color: var(--ink); }
.lockup .lg-frame { stroke: var(--brand); }
.lockup .lg-dot { fill: var(--accent); }
.brand { display: inline-flex; align-items: center; border-radius: 5px; }
.brand-sm .lockup { height: 26px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a:not(.btn) { color: var(--ink-muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 10px; border-radius: 5px; }
.header-nav a:not(.btn):hover { color: var(--ink); background: var(--brand-tint); }
@media (max-width: 640px) { .header-nav a[href^="#"] { display: none; } }

/* Buttons: radius-sm, 44px tall, one primary per view. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 5px; border: 1px solid transparent; font: 600 15px/1 var(--sans); text-decoration: none; transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease; white-space: nowrap; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--brand-tint); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Type */
.kicker { font-size: 14px; font-weight: 600; line-height: 20px; color: var(--brand-ink); margin-bottom: 12px; }
h1 { font-size: clamp(2.25rem, 1.35rem + 3.4vw, 3.5rem); line-height: 1.06; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-size: 18px; line-height: 26px; font-weight: 600; }
.lead { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; color: var(--ink-muted); max-width: 34em; margin-top: 20px; }
.fine { font-size: 14px; line-height: 20px; color: var(--ink-muted); margin-top: 20px; }

/* Hero */
.hero { padding: 48px 0 64px; }
@media (min-width: 1024px) { .hero { padding: 80px 0 96px; } }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 56px; } }
.hero .actions { margin-top: 32px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.panel-title { font-size: 15px; line-height: 22px; font-weight: 600; }
.panel-sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: 2px; }

.hero-visual { position: relative; padding-bottom: 8px; }
.result-panel { box-shadow: var(--shadow-md); padding-bottom: 40px; }
@media (min-width: 640px) { .result-panel { padding-bottom: 56px; } }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.s1 { background: var(--series-1); }
.s2 { background: var(--series-2); }
.bars { display: grid; gap: 16px; padding-top: 16px; }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; line-height: 20px; font-weight: 500; margin-bottom: 6px; }
.delta { font: 500 13px/18px var(--mono); font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: 3px; }
.delta.pos { color: var(--positive); background: var(--positive-tint); }
.bar-pair { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; }
.bar::before { content: ""; grid-area: 1 / 1; height: 10px; border-radius: 3px; background: var(--surface-sunk); }
.bar .fill { grid-area: 1 / 1; height: 10px; border-radius: 3px; }
.bar b { font: 500 13px/18px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }

.question-panel { margin: -24px 0 0 24px; position: relative; box-shadow: var(--shadow-lg); border-radius: 12px; padding: 20px 20px 18px; }
@media (min-width: 640px) { .question-panel { margin: -40px 0 0 64px; max-width: 460px; } }
.q-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.q-tag { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; padding: 2px 8px; border-radius: 5px; }
.q-text { font-size: 17px; line-height: 25px; font-weight: 500; margin-top: 10px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; }
.scale li { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.opt { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 5px; font: 500 14px/1 var(--mono); color: var(--ink); background: var(--surface); }
.opt.is-selected { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.opt-label { font-size: 11px; line-height: 14px; color: var(--ink-muted); }
.scale li:last-child .opt-label { text-align: right; }
figcaption { font-size: 12px; line-height: 16px; color: var(--ink-subtle); margin-top: 12px; text-align: right; }

/* Sections */
.section, .band { padding: 64px 0; }
@media (min-width: 1024px) { .section, .band { padding: 96px 0; } }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 44rem; margin-bottom: 40px; }
.section-lead { font-size: 17px; line-height: 26px; color: var(--ink-muted); margin-top: 16px; max-width: 38em; }

.cards { display: grid; gap: 16px; }
@media (min-width: 640px) { .cards.four, .cards.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards.four { grid-template-columns: repeat(4, 1fr); } .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.section .card { background: var(--surface); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: var(--brand-tint); color: var(--brand-ink); margin-bottom: 16px; }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon svg circle[r=".5"] { fill: currentColor; }

.steps { display: grid; gap: 16px; counter-reset: none; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.step { border-top: 2px solid var(--brand); padding-top: 20px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: 500 14px/1 var(--mono); margin-bottom: 12px; }
.step h3 { margin-bottom: 8px; }
.step p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } .split.reverse > :first-child { order: 2; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips li { font-size: 14px; line-height: 20px; font-weight: 500; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--ground); }
.lang-panel { background: var(--ground); padding: 24px; }
.lang-list { margin-top: 16px; display: grid; }
.lang-list div { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.lang-list dt { font: 500 12px/16px var(--mono); color: var(--ink-subtle); }
.lang-list dd { font-size: 17px; line-height: 24px; font-weight: 500; }

.ticks { display: grid; gap: 14px; margin-top: 28px; }
.ticks li { position: relative; padding-left: 32px; font-size: 16px; line-height: 24px; color: var(--ink-muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 999px; background: var(--brand-tint); }
.ticks li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 8px; height: 5px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }

.gap-panel { padding: 20px 20px 16px; }
.gap-chart { width: 100%; height: auto; }
.gap-chart .q { stroke: none; }
.gap-chart .q-hidden { fill: var(--div-pos-2); fill-opacity: 0.07; }
.gap-chart .q-aligned { fill: var(--series-3); fill-opacity: 0.08; }
.gap-chart .q-dev { fill: var(--series-5); fill-opacity: 0.09; }
.gap-chart .q-blind { fill: var(--div-neg-2); fill-opacity: 0.08; }
.gap-chart .mid { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.gap-chart .axis { stroke: var(--line); }
.gap-chart .ql { font: 500 11px var(--sans); fill: var(--ink-muted); }
.gap-chart .ax { font: 400 12px var(--sans); fill: var(--ink-muted); }
.gap-chart .pt { stroke: var(--surface); stroke-width: 2; }
.gap-chart .p-hidden { fill: var(--div-pos-2); }
.gap-chart .p-aligned { fill: var(--series-3); }
.gap-chart .p-dev { fill: var(--series-5); }
.gap-chart .p-blind { fill: var(--div-neg-2); }

/* Closing band */
.cta-band { background: var(--band-deep); color: var(--on-deep); padding: 64px 0; }
.cta-inner { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1fr auto; } }
.cta-band p { color: var(--on-deep-muted); margin-top: 12px; font-size: 17px; line-height: 26px; }
.btn-on-dark { background: var(--cta-bg); color: var(--cta-ink); }
.btn-on-dark:hover { background: var(--cta-hover); }
.btn-ghost-dark { color: var(--on-deep); border-color: color-mix(in srgb, var(--on-deep) 55%, transparent); }
.btn-ghost-dark:hover { background: color-mix(in srgb, var(--on-deep) 10%, transparent); }
.cta-band .btn:focus-visible { outline-color: var(--on-deep); }

/* Footer */
.site-footer { padding: 32px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1; }
.site-footer nav a { color: var(--ink-muted); text-decoration: none; font-size: 14px; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.copy { font-size: 13px; color: var(--ink-subtle); }
