/* Julien Nigou, portfolio produit.
   Identity: graphite ink on cool paper, ultramarine as the single accent, vermilion for "now" and emphasis.
   Layout: full-width chapters on a 1160px container; each chapter = one claim + one visual. */

:root {
  --paper: #F4F5F7;
  --paper-2: #ECEEF2;
  --surface: #FFFFFF;
  --ink: #16181D;
  --ink-2: #5B606B;
  --ink-3: #8A8F9A;
  --rule: #DADDE3;
  --accent: #2D43C8;
  --accent-2: #5468E0;
  --accent-soft: #E3E7FB;
  --on-accent: #FFFFFF;
  --mark: #CF4520;
  --mark-soft: #FBE6DF;
  --on-mark: #FFFFFF;
  --score-3: #2D43C8;
  --score-2: #7B8CE8;
  --score-1: #C9D0F6;
  --score-0: #E3E5EA;
  --on-score-3: #FFFFFF;
  --on-score-2: #16181D;
  --on-score-1: #16181D;
  --on-score-0: #5B606B;
  --device: #16181D;
  --topbar: rgb(244 245 247 / 0.82);
  --shadow-sm: 0 1px 2px rgb(22 24 29 / 0.06);
  --shadow: 0 1px 2px rgb(22 24 29 / 0.06), 0 18px 40px -18px rgb(22 24 29 / 0.28);

  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --container: 1160px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101217; --paper-2: #151820; --surface: #181B22; --ink: #E8EAF0; --ink-2: #A0A6B3; --ink-3: #727885; --rule: #2A2E38;
    --accent: #8C9BFF; --accent-2: #6F80F2; --accent-soft: #1E2440; --on-accent: #0E1020;
    --mark: #FF7A52; --mark-soft: #3A1F17; --on-mark: #160B07;
    --score-3: #8C9BFF; --score-2: #5566D6; --score-1: #2F3A78; --score-0: #2A2D35;
    --on-score-3: #0E1020; --on-score-2: #FFFFFF; --on-score-1: #E8EAF0; --on-score-0: #A0A6B3;
    --device: #000000; --topbar: rgb(16 18 23 / 0.8);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -18px rgb(0 0 0 / 0.75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101217; --paper-2: #151820; --surface: #181B22; --ink: #E8EAF0; --ink-2: #A0A6B3; --ink-3: #727885; --rule: #2A2E38;
  --accent: #8C9BFF; --accent-2: #6F80F2; --accent-soft: #1E2440; --on-accent: #0E1020;
  --mark: #FF7A52; --mark-soft: #3A1F17; --on-mark: #160B07;
  --score-3: #8C9BFF; --score-2: #5566D6; --score-1: #2F3A78; --score-0: #2A2D35;
  --on-score-3: #0E1020; --on-score-2: #FFFFFF; --on-score-1: #E8EAF0; --on-score-0: #A0A6B3;
  --device: #000000; --topbar: rgb(16 18 23 / 0.8);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -18px rgb(0 0 0 / 0.75);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.08; text-wrap: balance; letter-spacing: -0.02em; }
strong, b { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; }
.chapter-now { display: none; font-family: var(--f-mono); font-size: 0.76rem; color: var(--ink-2); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-now b { color: var(--accent); font-weight: 500; margin-right: 6px; }
@media (min-width: 960px) { .chapter-now { display: block; } }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 0.93rem; white-space: nowrap; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav .ext::after { content: "↗"; margin-left: 4px; font-size: 0.85em; }
@media (max-width: 560px) { .nav .hide-sm { display: none; } }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ---------- Type helpers ---------- */
.kicker { display: block; font-family: var(--f-mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.kicker .n { color: var(--ink-3); margin-inline: 0.2em; }
.display { font-size: clamp(2.6rem, 6.6vw, 5.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; }
.display .turn { display: block; color: var(--accent); }
.h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; max-width: 18ch; }
.h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); font-weight: 700; letter-spacing: -0.015em; }
.lede { font-family: var(--f-body); font-size: clamp(1.1rem, 1.55vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 54ch; }
.small { font-size: 0.9rem; color: var(--ink-2); }
.mono { font-family: var(--f-mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 0.98rem; text-decoration: none; border: 1px solid transparent; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Sections ---------- */
.chapter { padding-block: clamp(72px, 10vw, 128px); border-top: 1px solid var(--rule); }
.chapter.tint { background: var(--paper-2); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head.split { gap: 20px 56px; }
@media (min-width: 960px) {
  .sec-head.split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: end; }
  .sec-head.split .kicker { grid-column: 1 / -1; }
}
.stack { display: grid; gap: clamp(28px, 4vw, 48px); }
.sub { display: grid; gap: 18px; }
.sub-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-title .small { max-width: 46ch; }

.band { background: #14161C; color: #EEF0F5; border-top: 0;
  --ink: #EEF0F5; --ink-2: #A9AFBC; --ink-3: #7C8290; --rule: #2B2F3A; --surface: #1D2029; --paper: #14161C; --paper-2: #181B22;
  --accent: #9AA8FF; --accent-2: #7586F5; --accent-soft: #252B4A; --on-accent: #0E1020; --mark: #FF8A63; --mark-soft: #3A2219;
  --score-2: #5566D6; --score-0: #2A2D36; }
:root[data-theme="dark"] .band { background: #1A1D26; --paper: #1A1D26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { background: #1A1D26; --paper: #1A1D26; } }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .g2, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: clamp(18px, 2.4vw, 26px); min-width: 0; }
.card.pick { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.mark { background: var(--mark-soft); color: var(--mark); }
.tag.plain { background: transparent; border: 1px solid var(--rule); color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 40px; } }
.hero-copy { display: grid; gap: 26px; min-width: 0; }
.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; padding-top: 22px; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.meta dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.meta dd { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.hero-phones { position: relative; display: flex; justify-content: center; align-items: flex-end; padding-block: 12px 18px; }
.phone { display: block; border-radius: 30px; border: 7px solid var(--device); background: var(--device); box-shadow: var(--shadow); overflow: hidden; max-width: 100%; }
.phone img { width: 100%; }
.phone.sm { border-width: 5px; border-radius: 22px; }
.hero-phones .phone { width: min(44%, 236px); }
.hero-phones .phone:first-child { transform: rotate(-4deg) translateY(-22px); margin-right: -30px; }
.hero-phones .phone:last-child { transform: rotate(3deg); position: relative; z-index: 1; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--rule); gap: 1px; }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); padding: clamp(18px, 2.6vw, 28px); display: grid; gap: 8px; align-content: start; }
.kpi b { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 0.45em; letter-spacing: -0.01em; margin-left: 4px; color: var(--ink); }
.kpi > span { color: var(--ink-2); font-size: 0.95rem; line-height: 1.35; }

/* ---------- Big stat ---------- */
.stat { display: grid; gap: 6px; align-content: start; }
.stat b { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat > span { color: var(--ink-2); font-size: 0.95rem; line-height: 1.38; }
.stat .lab { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* ---------- Problem: contrast ---------- */
.contrast { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 860px) { .contrast { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.ring-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.ring { width: clamp(110px, 14vw, 148px); aspect-ratio: 1; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track-c { stroke: var(--paper-2); }
.ring .val-c { stroke: var(--accent); stroke-linecap: round; stroke-dashoffset: var(--off, 0); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-l { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--paper-2); font-size: 0.92rem; }
.task-list { display: grid; gap: 0; }
.task { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.task:last-child { border-bottom: 0; }
.task .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--mark-soft); color: var(--mark); }
.task .who { font-family: var(--f-mono); font-size: 0.72rem; color: var(--mark); white-space: nowrap; }
.constraints { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
@media (min-width: 640px) { .constraints { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .constraints { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.constraints > div { background: var(--surface); padding: 22px; display: grid; gap: 8px; align-content: start; }

/* ---------- Flow diagram ---------- */
.flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; counter-reset: step; }
@media (min-width: 900px) { .flow { grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); gap: 0; } }
.flow-step { position: relative; display: grid; gap: 6px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); min-width: 0; }
@media (min-width: 900px) {
  .flow-step { border-radius: 0; border-left-width: 0; }
  .flow-step:first-child { border-left-width: 1px; border-radius: var(--r-md) 0 0 var(--r-md); }
  .flow-step:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
  .flow-step:not(:last-child)::after { content: ""; position: absolute; z-index: 1; right: -9px; top: 50%; width: 16px; height: 16px; background: var(--surface); border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); transform: translateY(-50%) rotate(45deg); }
}
.flow-step b { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.flow-step span { color: var(--ink-2); font-size: 0.93rem; line-height: 1.35; }
.flow-step.end { background: var(--accent); border-color: var(--accent); }
.flow-step.end b, .flow-step.end span { color: var(--on-accent); }
.flow-step.end::after { display: none; }
.flow-step .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.flow-step h4 { font-size: 1.02rem; letter-spacing: -0.01em; }

/* ---------- Horizontal score bars ---------- */
.bars { display: grid; gap: 18px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: baseline; }
.hbar .label { font-size: 1rem; line-height: 1.3; }
.hbar .val { font-family: var(--f-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hbar .val b { color: var(--ink); font-weight: 500; font-size: 1.05rem; }
.hbar .track { grid-column: 1 / -1; height: 12px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.hbar .fill { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: 6px; background: var(--score-2); transform-origin: left center; }
.hbar.pick .label { font-weight: 700; }
.hbar.pick .fill { background: var(--accent); }
.hbar.pick .val b { color: var(--accent); }
.hbar .why { grid-column: 1 / -1; font-size: 0.9rem; color: var(--ink-2); }
.band .hbar .track { background: #262A35; }

/* ---------- Personas ---------- */
.persona { display: grid; gap: 14px; align-content: start; }
.persona h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.2; }
.persona .row { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 10px; font-size: 0.95rem; line-height: 1.38; padding-top: 10px; border-top: 1px solid var(--rule); }
.persona .row dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }

/* ---------- North star + curve ---------- */
.ns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 960px) { .ns { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); } }
.ns-statement { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; max-width: 24ch; }
.ns-statement em { font-style: normal; color: var(--accent); }
.chart-card { padding: clamp(18px, 2.4vw, 26px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--rule); min-width: 0; display: grid; gap: 14px; }
.chart-card h3 { font-size: 1.02rem; letter-spacing: -0.01em; }
.chart-card .legend-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--ink-2); }
.chart-card .legend-line i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin-right: 6px; }
.chart-card .legend-line i.dash { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 9px); }
svg.chart { width: 100%; height: auto; overflow: visible; font-family: var(--f-mono); }
svg.chart .grid-l { stroke: var(--rule); stroke-width: 1; }
svg.chart .axis-t { fill: var(--ink-3); font-size: 12px; }
svg.chart .area { fill: var(--accent); opacity: 0.12; }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
svg.chart .line.proj { stroke-dasharray: 2 7; }
svg.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
svg.chart .pt.now { fill: var(--mark); stroke: var(--mark); }
svg.chart .pt-l { fill: var(--ink); font-family: var(--f-display); font-weight: 700; font-size: 17px; }
svg.chart .pt-s { fill: var(--ink-2); font-size: 11.5px; }
.targets { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; align-content: start; }
.target { background: var(--surface); padding: 16px 18px; display: grid; gap: 8px; }
.target .t-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; color: var(--ink-2); }
.target .t-vals { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.target .t-vals .from { color: var(--ink-2); font-weight: 600; font-size: 1.05rem; }
.target .t-vals .to { color: var(--accent); }
.target .t-vals .arrow { color: var(--ink-3); font-weight: 400; font-size: 1rem; }

/* ---------- Callout ---------- */
.callout { display: grid; gap: 16px; padding: clamp(20px, 3vw, 30px); border-radius: var(--r-lg); background: var(--mark-soft); }
.callout h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.02em; }
.callout .chips .chip-l { background: var(--surface); }
.callout .chip-l::before { content: "×"; color: var(--mark); font-weight: 700; }
.rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-weight: 700; font-size: 1.05rem; }

/* ---------- Scope swap ---------- */
.swap { display: grid; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.swap-head, .swap-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 14px clamp(16px, 2.4vw, 24px); }
.swap-head { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-2); }
.swap-row { border-top: 1px solid var(--rule); }
.swap-row .was { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; font-size: 0.97rem; line-height: 1.35; }
.swap-row .to { color: var(--accent); text-align: center; font-family: var(--f-mono); }
.swap-row .now { font-weight: 600; line-height: 1.35; }
.swap-row .now .tag { margin-left: 6px; vertical-align: 1px; }
@media (max-width: 640px) {
  .swap-head { display: none; }
  .swap-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .swap-row .to { display: none; }
  .swap-row .now::before { content: "→ "; color: var(--accent); }
}

/* ---------- System diagram ---------- */
.system { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: stretch; }
@media (min-width: 960px) { .system { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); } }
.nest { padding: 16px; border-radius: var(--r-lg); border: 1.5px dashed var(--ink-3); display: grid; gap: 12px; min-width: 0; }
.nest .nest { border-color: var(--rule); background: var(--surface); }
.nest .nest .nest { background: var(--paper-2); border-style: solid; }
.nest-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.nest-label b { font-size: 0.98rem; }
.nest-label span { font-size: 0.86rem; color: var(--ink-2); }
.learners { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.learner { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--rule); }
.learner code { font-family: var(--f-mono); font-size: 0.72rem; color: var(--accent); }
.learner span { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.04em; }
.roles { display: grid; gap: 10px; align-content: start; }
.role { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--rule); }
.role .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.role h4 { font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 2px; }
.role p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.35; }

/* ---------- Help ladder ---------- */
.ladder { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.ladder > figure { scroll-snap-align: start; }
@media (min-width: 900px) { .ladder { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }
.rung { display: grid; gap: 12px; justify-items: start; }
.rung .phone { width: 100%; max-width: 230px; }
.rung-head { display: flex; align-items: center; gap: 10px; }
.score-chip { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-family: var(--f-mono); font-weight: 500; font-size: 1rem; flex: none; }
.s3 { background: var(--score-3); color: var(--on-score-3); }
.s2 { background: var(--score-2); color: var(--on-score-2); }
.s1 { background: var(--score-1); color: var(--on-score-1); }
.s0 { background: var(--score-0); color: var(--on-score-0); }
.rung-head b { display: block; font-size: 0.98rem; line-height: 1.2; }
.rung-head span { display: block; font-size: 0.84rem; color: var(--ink-2); }

/* ---------- Diagnostic grid ---------- */
.diag { display: grid; gap: 18px; padding: clamp(18px, 2.4vw, 26px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--rule); }
.domains { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .domains { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .domains { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }
.domain { display: grid; gap: 8px; align-content: start; min-width: 0; }
.domain h4 { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.missions { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .missions { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1000px) { .domain.wide .missions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mission { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: var(--paper-2); font-size: 0.9rem; line-height: 1.2; min-height: 52px; }
.mission .n { font-family: var(--f-mono); font-size: 0.68rem; color: var(--ink-3); display: block; }
.diag-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-top: 16px; border-top: 1px solid var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.88rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .score-chip { width: 26px; height: 26px; border-radius: 7px; font-size: 0.8rem; }
.level { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.level .pill { font-family: var(--f-mono); font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }

.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.lang { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 0.95rem; }
.lang code { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); }
.lang.out { background: transparent; color: var(--ink-3); text-decoration: line-through; }
.lang.out code { color: var(--ink-3); }

/* ---------- Galleries ---------- */
.rail-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.rail-scroll > figure { scroll-snap-align: start; }
.rail-scroll .phone img { aspect-ratio: 600 / 1298; object-fit: contain; object-position: top; background: #FFFFFF; }
@media (min-width: 900px) { .rail-scroll { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }
figure { display: grid; gap: 12px; align-content: start; min-width: 0; }
figcaption { font-size: 0.9rem; line-height: 1.38; color: var(--ink-2); }
figcaption b { color: var(--ink); }
.desk { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--surface); }
.desk-bar { display: flex; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.desk-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }

/* ---------- Stories ---------- */
.story { display: grid; gap: 14px; align-content: start; }
.story .id { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); }
.story .as { font-weight: 700; font-size: 1.04rem; line-height: 1.3; letter-spacing: -0.01em; }
.story ul { display: grid; gap: 8px; }
.story li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: 0.92rem; line-height: 1.38; color: var(--ink-2); }
.story li::before { content: "✓"; color: var(--accent); font-weight: 700; }

/* ---------- Vertical bars ---------- */
.vbars { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: clamp(8px, 2vw, 18px); align-items: end; height: 220px; padding-top: 26px; border-bottom: 1px solid var(--rule); }
.vbar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.vbar i { display: block; width: 100%; height: calc(var(--v) * 100%); border-radius: 8px 8px 2px 2px; background: var(--accent); transform-origin: bottom center; }
.vbar.soft i { background: var(--score-2); }
.vbar b { position: absolute; left: 0; right: 0; bottom: calc(var(--v) * 100% + 6px); text-align: center; font-family: var(--f-mono); font-size: 0.9rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.vlabels { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: clamp(8px, 2vw, 18px); font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); text-align: center; padding-top: 8px; }

/* ---------- Pipeline ---------- */
.fixes { display: grid; border-top: 1px solid var(--rule); }
.fix { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .fix { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 14px; align-items: start; } }
.fix .was { color: var(--ink-2); font-size: 0.97rem; line-height: 1.38; }
.fix .to { color: var(--accent); font-family: var(--f-mono); }
.fix .now { font-weight: 600; line-height: 1.38; }
@media (max-width: 759px) { .fix .to { display: none; } .fix .now::before { content: "→ "; color: var(--accent); } }

/* ---------- Ring (AI) ---------- */
.ai { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; }
@media (min-width: 900px) { .ai { grid-template-columns: auto minmax(0, 1fr); gap: 40px; } }
.ai .ring { width: clamp(150px, 18vw, 200px); }
.ai .ring b { font-size: clamp(2.2rem, 4vw, 3rem); }
.ai .ring small { position: absolute; left: 0; right: 0; bottom: 26%; text-align: center; font-family: var(--f-mono); font-size: 0.68rem; color: var(--ink-3); }
.workflows { display: grid; gap: 10px; }
.wf { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 10px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--rule); font-size: 0.95rem; line-height: 1.3; }
.wf code { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); display: block; margin-bottom: 2px; }
.wf .to { color: var(--ink-3); text-align: center; }
.wf .out { font-weight: 600; }

/* ---------- Phases ---------- */
.phases { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
@media (min-width: 960px) { .phases { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.phase { position: relative; padding: 26px 18px 20px 30px; border-left: 2px solid var(--rule); display: grid; gap: 8px; align-content: start; }
@media (min-width: 960px) { .phase { padding: 30px 22px 0 0; border-left: 0; border-top: 2px solid var(--rule); } }
.phase::before { content: ""; position: absolute; left: -7px; top: 30px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-3); }
@media (min-width: 960px) { .phase::before { left: 0; top: -7px; } }
.phase.done::before { background: var(--accent); border-color: var(--accent); }
.phase.done { border-color: var(--accent); }
.phase.now::before { background: var(--mark); border-color: var(--mark); box-shadow: 0 0 0 5px var(--mark-soft); }
.phase .when { font-family: var(--f-mono); font-size: 0.74rem; color: var(--ink-3); }
.phase h3 { font-size: 1.12rem; letter-spacing: -0.015em; }
.phase p { font-size: 0.93rem; color: var(--ink-2); line-height: 1.4; }
.phase .gate { font-size: 0.86rem; color: var(--ink); padding-top: 8px; border-top: 1px dashed var(--rule); }
.phase .gate::before { content: "Passage · "; font-family: var(--f-mono); font-size: 0.72rem; color: var(--accent); }

/* ---------- Wave & stacks ---------- */
.timebar { display: flex; height: 54px; border-radius: 10px; overflow: hidden; }
.timebar span { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 0.85rem; line-height: 1.15; }
.timebar span small { font-family: var(--f-mono); font-size: 0.68rem; opacity: 0.8; }
.timebar span + span { border-left: 2px solid var(--surface); }
.tb-1 { background: var(--accent-soft); color: var(--ink); }
.tb-2 { background: var(--score-2); color: var(--on-score-2); }
.tb-3 { background: var(--accent); color: var(--on-accent); }
.tb-4 { background: var(--mark-soft); color: var(--ink); }
.tb-5 { background: var(--score-0); color: var(--on-score-0); }
@media (max-width: 640px) { .timebar span { padding: 0 4px; } .timebar span em { display: none; } }
.timebar em { font-style: normal; font-weight: 600; }
.ticks { position: relative; height: 18px; font-family: var(--f-mono); font-size: 0.7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.wave-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; font-size: 0.88rem; color: var(--ink-2); }
.wave-key b { color: var(--ink); }
.stack-bar { display: flex; height: 44px; border-radius: 10px; overflow: hidden; }
.stack-bar span { display: flex; align-items: center; padding: 0 12px; white-space: nowrap; overflow: hidden; font-size: 0.86rem; font-weight: 600; }
.stack-bar span + span { border-left: 2px solid var(--surface); }
.stack-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; color: var(--ink-2); }
.stack-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.etp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; height: 180px; padding-top: 26px; border-bottom: 1px solid var(--rule); }
.etp div { position: relative; height: 100%; display: flex; align-items: flex-end; }
.etp i { display: block; width: 100%; height: calc(var(--v) * 100%); border-radius: 8px 8px 2px 2px; background: var(--score-2); transform-origin: bottom center; }
.etp div:last-child i { background: var(--accent); }
.etp b { position: absolute; left: 0; right: 0; bottom: calc(var(--v) * 100% + 6px); text-align: center; font-family: var(--f-mono); font-weight: 500; font-size: 0.9rem; }
.etp-l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: center; font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); padding-top: 8px; }

/* ---------- Results ---------- */
.result-tile { display: grid; gap: 8px; align-content: start; }
.result-tile b { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-tile > span { color: var(--ink-2); font-size: 0.95rem; line-height: 1.38; }
.next { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px 22px; border-radius: var(--r-lg); border: 1px dashed var(--mark); background: var(--mark-soft); }
.next .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mark); margin-top: 7px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--mark) 22%, transparent); }
.next p { line-height: 1.45; }
.lesson { display: grid; gap: 10px; align-content: start; }
.lesson .k { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); }
.lesson b { font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.01em; }
.lesson p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.42; }

/* ---------- Home ---------- */
.home-hero { padding-block: clamp(64px, 10vw, 140px) clamp(48px, 7vw, 96px); }
.home-hero .display { max-width: 16ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.facts-line { display: flex; flex-wrap: wrap; gap: 8px; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--rule); background: var(--surface); text-decoration: none; transition: border-color .25s, box-shadow .25s; }
.feature:hover { border-color: var(--ink-3); box-shadow: var(--shadow); }
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.feature-copy { padding: clamp(22px, 3.4vw, 40px); display: grid; gap: 20px; align-content: start; }
.feature-copy h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.05; }
.feature-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.feature-kpis b { display: block; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.feature-kpis span { font-size: 0.85rem; color: var(--ink-2); line-height: 1.3; }
.feature-visual { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; padding: 36px 24px 0; background: linear-gradient(180deg, var(--accent-soft), transparent 85%); overflow: hidden; min-height: 300px; }
.feature-visual .phone { width: min(42%, 200px); margin-bottom: -60px; }
.feature-visual .phone + .phone { margin-left: -18px; transform: translateY(-26px); }
.feature .cta { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--accent); }
.feature:hover .cta .arrow { transform: translateX(3px); }
.feature .cta .arrow { transition: transform .2s var(--ease); }
.skills .card { display: grid; gap: 12px; align-content: start; }
.skills .card b { font-size: clamp(1.8rem, 3.2vw, 2.4rem); letter-spacing: -0.04em; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.skills .card h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
.skills .card p { color: var(--ink-2); font-size: 0.93rem; line-height: 1.4; }
.timeline { display: grid; border-top: 1px solid var(--rule); }
.tl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .tl { grid-template-columns: 9.5em minmax(0, 1fr) minmax(0, 1.1fr); align-items: baseline; } }
.tl .when { font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl .what b { display: block; font-size: 1.05rem; }
.tl .what span { color: var(--ink-2); font-size: 0.93rem; }
.tl p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.4; }
.tl.edu .what b { font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 56px 64px; border-top: 1px solid var(--rule); }
.footer-grid { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.footer-grid .h2 { max-width: 16ch; }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 40px; font-size: 0.86rem; color: var(--ink-3); }

/* ---------- Motion (only when JS runs and the reader allows motion) ---------- */
.motion [data-reveal] .fill { transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.motion [data-reveal]:not(.is-in) .fill { transform: scaleX(0); }
.motion [data-reveal] .vbar i, .motion [data-reveal] .etp i { transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 120ms); }
.motion [data-reveal]:not(.is-in) .vbar i, .motion [data-reveal]:not(.is-in) .etp i { transform: scaleY(0); }
.motion [data-reveal] .vbar b, .motion [data-reveal] .etp b { transition: opacity .4s; transition-delay: calc(var(--i, 0) * 120ms + 600ms); }
.motion [data-reveal]:not(.is-in) .vbar b, .motion [data-reveal]:not(.is-in) .etp b { opacity: 0; }
.motion [data-reveal] .draw { transition: stroke-dashoffset 1.8s var(--ease); }
.motion [data-reveal]:not(.is-in) .draw { stroke-dashoffset: 1; }
.motion [data-reveal] .area { transition: opacity 1s ease .9s; }
.motion [data-reveal]:not(.is-in) .area { opacity: 0; }
.motion [data-reveal] .pt, .motion [data-reveal] .pt-l, .motion [data-reveal] .pt-s { transition: opacity .4s; transition-delay: calc(var(--d, 0) * 1ms); }
.motion [data-reveal]:not(.is-in) .pt, .motion [data-reveal]:not(.is-in) .pt-l, .motion [data-reveal]:not(.is-in) .pt-s { opacity: 0; }
.motion [data-reveal] .val-c { transition: stroke-dashoffset 1.6s var(--ease); }
.motion [data-reveal]:not(.is-in) .val-c { stroke-dashoffset: 100; }
.motion [data-reveal] .timebar, .motion [data-reveal] .stack-bar { transition: clip-path 1.5s var(--ease); clip-path: inset(0 0 0 0 round 10px); }
.motion [data-reveal]:not(.is-in) .timebar, .motion [data-reveal]:not(.is-in) .stack-bar { clip-path: inset(0 100% 0 0 round 10px); }
.motion .diag[data-reveal] .mission .score-chip { transition: background-color .35s, color .35s; transition-delay: calc(var(--i, 0) * 120ms); }
.motion .diag[data-reveal]:not(.is-in) .mission .score-chip { background: var(--score-0); color: transparent; }
.motion .diag[data-reveal] .level { transition: opacity .5s, transform .5s var(--ease); transition-delay: 1.6s; }
.motion .diag[data-reveal]:not(.is-in) .level { opacity: 0; transform: translateY(6px); }
.motion [data-reveal] .flow-step { transition: opacity .5s, transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 120ms); }
.motion [data-reveal]:not(.is-in) .flow-step { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
