:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --line: #EAEAEA;
  --line-soft: rgba(0, 0, 0, 0.06);
  --ink: #111111;
  --ink-2: #2F3437;
  --muted: #787774;
  --muted-2: #A09F9B;

  --red-bg: #FDEBEC;    --red-fg: #9F2F2D;
  --blue-bg: #E1F3FE;   --blue-fg: #1F6C9F;
  --green-bg: #EDF3EC;  --green-fg: #346538;
  --yellow-bg: #FBF3DB; --yellow-fg: #956400;

  --sans: 'Geist', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --serif: 'Newsreader', 'Lyon Text', Georgia, serif;
  --mono: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1080px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, blockquote, hr { margin: 0; }
::selection { background: var(--yellow-bg); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Ambient ───────────────────────────────────── */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient::before {
  content: ''; position: absolute;
  width: 70vmax; height: 70vmax; left: 45%; top: -25vmax;
  background: radial-gradient(closest-side, rgba(214, 190, 160, 0.22), rgba(214, 190, 160, 0));
  animation: drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-18vmax, 10vmax, 0); }
}

/* ── Nav ───────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 246, 243, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { font: 500 20px/1 var(--serif); color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--muted); transition: color 200ms ease;
}
.back:hover { color: var(--ink); }
.back svg { width: 12px; height: 12px; transition: transform 200ms var(--ease); }
.back:hover svg { transform: translateX(-2px); }

/* ── Language toggle ───────────────────────────── */
.nav-r { display: flex; align-items: center; gap: 12px; }
.lang { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.lang-opt {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 4px;
  font: 500 12px/1 var(--mono); color: var(--muted); transition: background 200ms ease, color 200ms ease;
}
.lang-opt:hover { color: var(--ink); }
.lang-opt[aria-current="true"] { background: var(--bg); color: var(--ink); }
.lang-opt .flag { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); flex-shrink: 0; }
.lang-opt:not([aria-current="true"]) .flag { opacity: 0.55; filter: saturate(0.6); transition: opacity 200ms ease, filter 200ms ease; }
.lang-opt:hover .flag { opacity: 1; filter: none; }

/* ── Primitives ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 6px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background 200ms ease, transform 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-primary:hover { background: #333333; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 9999px;
  font: 500 11px/1.2 var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
}
.tag-green  { background: var(--green-bg);  color: var(--green-fg); }
.tag-blue   { background: var(--blue-bg);   color: var(--blue-fg); }
.tag-red    { background: var(--red-bg);    color: var(--red-fg); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow-fg); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-green .tag-dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: box-shadow 200ms ease;
}
.card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }

.eyebrow { font: 400 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; }

/* ── Hero ──────────────────────────────────────── */
.hero { position: relative; padding: 96px 0 0; }
.hero::before {
  content: ''; position: absolute; inset: 0 0 -80px; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
}
.hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-title {
  font: 400 clamp(44px, 8vw, 96px)/1 var(--serif);
  letter-spacing: -0.04em; color: var(--ink);
  margin: 32px 0 32px;
}
.hero-title > span { display: block; }
.hero-title .x { color: var(--muted-2); }
.hero-sum { font-size: 20px; line-height: 1.55; max-width: 640px; color: var(--ink-2); }

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 64px; overflow: hidden;
}
.fact { padding: 22px 24px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact-k { font: 400 12px/1 var(--mono); color: var(--muted-2); margin-bottom: 10px; }
.fact-v { font-size: 14px; line-height: 1.5; color: var(--ink); }

/* ── Intro ─────────────────────────────────────── */
.intro { padding: 112px 0 0; }
.intro-grid { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.lede {
  font: 400 clamp(22px, 2.6vw, 30px)/1.45 var(--serif);
  letter-spacing: -0.015em; color: var(--ink); max-width: 760px;
}
.scope {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; overflow: hidden; max-width: 760px;
}
.scope-cell { padding: 20px 24px; }
.scope-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.scope-cell:nth-child(n+3) { border-top: 1px solid var(--line); }

/* ── Chapters ──────────────────────────────────── */
.chapters { padding: 96px 0 0; }
.chapter {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
  padding: 72px 0; border-top: 1px solid var(--line);
}
.ch-label { position: sticky; top: 96px; align-self: start; }
.ch-num { font: 400 12px/1 var(--mono); color: var(--muted-2); }
.ch-name { margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--ink); }
.ch-body { max-width: 680px; }
.ch-body h2 {
  font: 400 clamp(28px, 3.2vw, 38px)/1.15 var(--serif);
  letter-spacing: -0.025em; color: var(--ink); margin-bottom: 28px;
}
.ch-body p { font-size: 17px; line-height: 1.7; }
.ch-body p + p { margin-top: 18px; }
.ch-body > * + ul, .ch-body > * + blockquote, .ch-body > ul + p, .ch-body > blockquote + p { margin-top: 32px; }

.pull {
  padding: 4px 0 4px 24px; border-left: 2px solid var(--ink);
  font: italic 400 clamp(20px, 2.2vw, 24px)/1.45 var(--serif); color: var(--ink);
  letter-spacing: -0.01em;
}

.list { border-top: 1px solid var(--line); }
.list li {
  display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2);
}
.list-n { font: 400 13px/1.4 var(--mono); color: var(--muted); }

/* ── Results ───────────────────────────────────── */
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.result { padding: 24px; min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.result-n { font: 400 48px/1 var(--serif); letter-spacing: -0.04em; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-n .s { font-size: 28px; color: var(--muted-2); margin-left: 2px; }
.result-l { font-size: 13px; line-height: 1.45; color: var(--muted); }
.chapter.is-impact .ch-body { max-width: none; }

/* ── Related ───────────────────────────────────── */
.related { padding: 128px 0 0; }
.related-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rel { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.rel-name {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font: 400 28px/1.15 var(--serif); letter-spacing: -0.02em; color: var(--ink);
}
.rel-name svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); transition: transform 200ms var(--ease), color 200ms ease; }
.rel:hover .rel-name svg { transform: translate(2px, -2px); color: var(--ink); }
.rel-sub { font-size: 15px; color: var(--muted); }

/* ── Contact ───────────────────────────────────── */
.contact-wrap { padding: 16px 0 0; }
.contact { padding: 56px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: end; margin-top: 16px; }
.contact-title { font: 400 clamp(40px, 5vw, 60px)/1.02 var(--serif); letter-spacing: -0.035em; color: var(--ink); margin-top: 20px; }
.contact-sub { margin-top: 20px; max-width: 480px; color: var(--muted); font-size: 17px; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.contact-row:first-child { border-top: 1px solid var(--line); }
.contact-row .k { font: 400 12px/1 var(--mono); color: var(--muted-2); }
.contact-row .v { font-size: 15px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.contact-row .v svg { width: 12px; height: 12px; transition: transform 200ms var(--ease); }
a.contact-row:hover .v svg { transform: translate(2px, -2px); }
.contact-cta { margin-top: 24px; }

.foot { padding: 64px 0 56px; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; font: 400 12px/1.6 var(--mono); color: var(--muted-2); }
.foot-in a:hover { color: var(--ink); }

/* ── Reveal ────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ambient::before, .tag-green .tag-dot { animation: none; }
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 960px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .intro-grid, .chapter { grid-template-columns: 1fr; gap: 20px; }
  .ch-label { position: static; display: flex; gap: 12px; align-items: baseline; }
  .ch-name { margin-top: 0; }
  .results { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; padding: 40px; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .nav .brand { display: none; }
  .lang-opt span { display: none; }
  .nav-r { gap: 8px; }
  .back span { font-size: 13px; }
  .hero { padding-top: 56px; }
  .hero-sum { font-size: 18px; }
  .facts, .scope { grid-template-columns: 1fr; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .scope-cell:nth-child(odd) { border-right: 0; }
  .scope-cell + .scope-cell { border-top: 1px solid var(--line); }
  .intro { padding-top: 72px; }
  .chapters { padding-top: 56px; }
  .chapter { padding: 56px 0; }
  .list li { grid-template-columns: 56px 1fr; }
  .result { padding: 20px; min-height: 0; }
  .result-n { font-size: 40px; }
  .related { padding-top: 88px; }
  .related-grid { grid-template-columns: 1fr; }
  .rel, .contact { padding: 24px; }
  .foot-in { flex-direction: column; }
}

/* ══ Figures ══════════════════════════════════════ */
.fig { margin: 40px 0; }
.ch-body > .fig:last-child { margin-bottom: 0; }
.fig-hero { margin: 64px 0 0; }
.fig-box {
  position: relative; overflow: hidden;
  padding: 40px;
  background-color: var(--surface-2);
  background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 16px 16px; background-position: -8px -8px;
  border: 1px solid var(--line); border-radius: 12px;
  --brand: var(--blue-fg);
}
.fig-hero .fig-box { padding: 56px; }
.fig-box[data-mode="b"] { --brand: var(--ink); }
.fig figcaption { display: flex; gap: 12px; margin-top: 12px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.fig figcaption b { font-weight: 400; color: var(--muted-2); white-space: nowrap; }

.m-b { display: none; }
[data-mode="b"] .m-a { display: none; }
[data-mode="b"] .m-b { display: inline; }

/* Faux window */
.win { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: 0; }
.win-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.win-bar i { width: 8px; height: 8px; border-radius: 50%; background: #E3E2DE; flex-shrink: 0; }
.win-bar span { margin-left: 8px; font: 400 11px/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { padding: 16px; }

/* Atoms of the illustrations */
.sk { display: block; height: 8px; border-radius: 4px; background: #EEEDE9; }
.sk.dk { background: #D9D8D3; }
.lbl { font: 400 11px/1.4 var(--mono); color: var(--muted); }
.stack { display: grid; gap: 10px; align-content: start; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.arr { display: grid; place-items: center; color: var(--muted-2); }
.arr svg { width: 28px; height: 12px; }
.node { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.35; color: var(--ink); min-width: 0; }
.node small { display: block; font: 400 11px/1.4 var(--mono); color: var(--muted); margin-top: 3px; }
.node.dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.node.dark small { color: var(--muted-2); }

.mc-btn { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 12px; border-radius: 5px; background: var(--ink); color: #FFFFFF; font-size: 12px; font-weight: 500; white-space: nowrap; transition: background 300ms var(--ease); }
.mc-btn.is-brand { background: var(--brand); }
.mc-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.mc-input { display: flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 12px; color: var(--muted-2); }
.mc-toggle { width: 28px; height: 16px; border-radius: 9999px; background: var(--brand); position: relative; flex-shrink: 0; transition: background 300ms var(--ease); }
.mc-toggle::after { content: ''; position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; }

.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 6px; background: #EFEEEA; }
.seg button, .seg span { font: 500 11px/1 var(--sans); padding: 6px 10px; border-radius: 4px; color: var(--muted); background: none; border: 0; white-space: nowrap; }
.seg button { cursor: pointer; transition: background 200ms ease, color 200ms ease; }
.seg [aria-pressed="true"], .seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

.tkn { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 400 12px/1.2 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.sw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(0, 0, 0, 0.06); transition: background 300ms var(--ease); }
.sw.is-brand { background: var(--brand); }
.sw.sp { width: 16px; height: 6px; border-radius: 1px; background: var(--ink); border: 0; }

.pin { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #FFFFFF; font: 500 10px/1 var(--mono); flex-shrink: 0; }

/* Two-up with arrow (before / after, merge) */
.ba { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: center; }
.ba.wide-r { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); }

/* SG · merge */
.comp-row { display: flex; align-items: center; gap: 8px; font: 400 12px/1 var(--mono); color: var(--ink-2); }
.comp-row em { width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); flex-shrink: 0; }
.avenir-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.avenir-card { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: grid; gap: 8px; }
.avenir-card .t { font-size: 13px; font-weight: 500; color: var(--ink); }
.row-inline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }

/* SG · flows */
.flow-block + .flow-block { margin-top: 24px; padding-top: 24px; border-top: 1px dashed #D9D8D3; }
.flow-block > .tag { margin-bottom: 14px; }
.scatter { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.scatter svg { width: 100%; height: 56px; color: var(--red-fg); opacity: 0.6; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.steps > * { position: relative; }
.steps > *:not(:last-child)::after {
  content: ''; position: absolute; right: -15px; top: 50%; width: 7px; height: 7px;
  border-top: 1.5px solid var(--muted-2); border-right: 1.5px solid var(--muted-2);
  transform: translateY(-50%) rotate(45deg);
}

/* SG · library tree */
.tree { display: grid; gap: 4px; }
.tree-g { font-size: 12px; font-weight: 500; color: var(--ink); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.tree-g:first-child { margin-top: 0; }
.tree-g::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid var(--muted-2); border-bottom: 1.5px solid var(--muted-2); transform: rotate(45deg) translate(-1px, -1px); }
.tree-i { display: flex; align-items: center; gap: 8px; font: 400 12px/1.7 var(--mono); color: var(--ink-2); }
.tree-g ~ .tree-i { padding-left: 14px; }
.tree-i::before { content: ''; width: 8px; height: 10px; border: 1px solid #C9C8C3; border-radius: 1.5px; flex-shrink: 0; }
.tree-chip { margin-bottom: 10px; }

/* SG · size tokens */
.tk-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--ink-2); }
.tk-head { color: var(--muted-2); padding-top: 0; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar i { display: block; height: 10px; width: calc(var(--w) * 2px); border-radius: 2px; background: var(--muted-2); }
.bar.d i { background: var(--ink); }

/* SG / ECV · token chain */
.chain { display: grid; gap: 10px; margin-top: 20px; }
.chain-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); gap: 6px; align-items: center; }
.chain-row .arr svg { width: 16px; }
.chain-head { font: 400 11px/1 var(--mono); color: var(--muted-2); }

/* SG · slots */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.fr-bar { height: 14px; border-radius: 3px; background: #E6E5E1; }
.fr-slot {
  height: 104px; border: 1px dashed #B9C9D4; border-radius: 5px; background: var(--blue-bg);
  display: grid; place-items: center; padding: 10px;
}
.fr-slot .lbl { color: var(--blue-fg); }
.tabs { display: flex; gap: 10px; align-self: start; width: 100%; border-bottom: 1px solid #C6DDEA; padding-bottom: 6px; }
.tabs i { height: 6px; flex: 1; border-radius: 3px; background: #C6DDEA; }
.tabs i:first-child { background: var(--blue-fg); }
.stepper { display: flex; align-items: center; width: 100%; }
.stepper i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--blue-fg); flex-shrink: 0; }
.stepper i:first-child { background: var(--blue-fg); }
.stepper b { flex: 1; height: 1.5px; background: #C6DDEA; }
.slot-cap { text-align: center; }

/* SG · three supports */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.trio .win-body { min-height: 150px; }
.sel { position: relative; display: inline-block; padding: 6px; outline: 1px solid var(--blue-fg); }
.sel::before, .sel::after { content: ''; position: absolute; width: 5px; height: 5px; background: var(--surface); border: 1px solid var(--blue-fg); }
.sel::before { left: -3px; top: -3px; }
.sel::after { right: -3px; bottom: -3px; }
.code { font: 400 11px/1.7 var(--mono); color: var(--ink-2); white-space: pre; overflow: hidden; }
.code .k { color: var(--blue-fg); }
.code .s { color: var(--green-fg); }
.mini-dd { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-dd i { height: 28px; border-radius: 4px; }

/* FDJ · phones (sized with container units) */
.phones { display: flex; justify-content: center; gap: clamp(16px, 5%, 48px); }
.phone-col { display: grid; gap: 12px; justify-items: center; width: min(210px, 44%); }
.phone {
  --p-bg: #F7F6F3; --p-surface: #FFFFFF; --p-ink: #111111; --p-muted: #A09F9B; --p-line: #EAEAEA;
  --p-accent: #111111; --p-accent-ink: #FFFFFF; --p-ball: #FBF3DB; --p-ball-ink: #956400;
  container-type: inline-size;
  width: 100%; aspect-ratio: 9 / 18.5; padding: 4%;
  border-radius: 14% / 6.8%; border: 1px solid var(--line); background: var(--surface);
}
.phone.dark {
  --p-bg: #161719; --p-surface: #222325; --p-ink: #EDEDEA; --p-muted: #6F7072; --p-line: #2E2F31;
  --p-accent: #EDEDEA; --p-accent-ink: #111111; --p-ball: #3A3320; --p-ball-ink: #E9C46A;
  background: #0E0F10; border-color: #0E0F10;
}
.screen {
  height: 100%; border-radius: 11% / 5.2%; background: var(--p-bg); overflow: hidden;
  padding: 8cqw 6cqw; display: flex; flex-direction: column; gap: 5cqw;
}
.ph-status { display: flex; justify-content: space-between; }
.ph-status i { display: block; height: 3cqw; width: 14cqw; border-radius: 2cqw; background: var(--p-line); }
.ph-title { font: 400 9cqw/1.1 var(--serif); letter-spacing: -0.02em; color: var(--p-ink); }
.ph-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 5cqw; padding: 5cqw; display: grid; gap: 4cqw; }
.ph-lbl { font: 400 4.6cqw/1 var(--mono); color: var(--p-muted); }
.balls { display: flex; gap: 2cqw; }
.balls span { width: 12cqw; height: 12cqw; border-radius: 50%; display: grid; place-items: center; background: var(--p-ball); color: var(--p-ball-ink); font: 500 5cqw/1 var(--mono); }
.ph-sk { display: block; height: 3.2cqw; border-radius: 2cqw; background: var(--p-line); }
.ph-btn { margin-top: auto; height: 16cqw; border-radius: 4cqw; display: grid; place-items: center; background: var(--p-accent); color: var(--p-accent-ink); font: 500 5.4cqw/1 var(--sans); }
.ph-nav { display: flex; justify-content: space-around; padding-top: 4cqw; border-top: 1px solid var(--p-line); }
.ph-nav i { width: 3cqw; height: 3cqw; border-radius: 50%; background: var(--p-muted); }
.ph-nav i:first-child { background: var(--p-ink); }
.tok-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.tok-strip .tkn { padding: 6px 10px; }
.duo { display: inline-flex; border-radius: 3px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.08); }
.duo i { width: 10px; height: 14px; }

/* FDJ · user flow */
.screens { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.screens > * { position: relative; display: grid; gap: 10px; }
.screens > *:not(:last-child)::after {
  content: ''; position: absolute; right: -18px; top: 42%; width: 7px; height: 7px;
  border-top: 1.5px solid var(--muted-2); border-right: 1.5px solid var(--muted-2); transform: rotate(45deg);
}
.mini { aspect-ratio: 9 / 16; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 9% 8%; display: flex; flex-direction: column; gap: 6%; overflow: hidden; }
.mini .blk { border-radius: 4px; background: #EEEDE9; }
.mini .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6%; flex: 1; }
.mini .g2 i { border-radius: 4px; background: #EEEDE9; }
.mini .g5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5%; }
.mini .g5 i { aspect-ratio: 1; border-radius: 50%; border: 1px solid #DDDCD8; }
.mini .g5 i.on { background: var(--yellow-bg); border-color: #E6C77A; }
.mini .ok { width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--green-bg); display: grid; place-items: center; margin: 8% auto 0; color: var(--green-fg); }
.mini .ok svg { width: 50%; }
.mini .cta { margin-top: auto; height: 11%; border-radius: 4px; background: var(--ink); }

/* FDJ · hub */
.hub svg { display: block; width: 100%; height: auto; }
.hub .n rect { fill: var(--surface); stroke: var(--line); }
.hub .n.c rect { fill: var(--ink); stroke: var(--ink); }
.hub text { font: 400 13px var(--sans); fill: var(--ink); }
.hub .n.c text { fill: #FFFFFF; font-weight: 500; }
.hub text.s { font: 400 10px var(--mono); fill: var(--muted); }
.hub .n.c text.s { fill: var(--muted-2); }
.hub line { stroke: #C9C8C3; stroke-dasharray: 3 4; }

/* FDJ · variants */
.copies { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.copies i { aspect-ratio: 2 / 1; border-radius: 4px; background: var(--ink); }
.copies i:nth-child(3n+2) { background: var(--surface); border: 1px solid var(--line); }
.copies i:nth-child(4n+3) { background: #D9D8D3; }
.copies i:nth-child(n+13) { opacity: 0.55; }
.copies i:nth-child(n+19) { opacity: 0.3; }
.props { display: grid; gap: 10px; }
.prop { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; }
.prop .seg { justify-self: start; }
.prop-preview { display: grid; place-items: center; padding: 18px; margin-top: 4px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }

/* FDJ · loop */
.loop-back { position: relative; margin: 14px 12.5% 0; height: 30px; border: 1px dashed #C9C8C3; border-top: 0; border-radius: 0 0 10px 10px; }
.loop-back .lbl { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%); padding: 0 10px; background: var(--surface-2); white-space: nowrap; }

/* ECV · atomic */
.atomic { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-items: end; }
.at { display: grid; gap: 10px; }
.at-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.dots3 { display: flex; gap: 6px; }
.dots3 i { width: 14px; height: 14px; border-radius: 50%; }
.aa { font: 400 26px/1 var(--serif); color: var(--ink); }
.slot-d { height: 34px; border: 1px dashed #C9C8C3; border-radius: 4px; }
.img-b { height: 46px; border-radius: 4px; background: #EEEDE9; }

/* ECV · library */
.lib { display: grid; grid-template-columns: 148px minmax(0, 1fr); min-height: 250px; }
.lib-side { border-right: 1px solid var(--line); padding: 12px 8px; display: grid; gap: 2px; align-content: start; }
.lib-side span { font: 400 12px/1 var(--mono); color: var(--muted); padding: 7px 8px; border-radius: 4px; }
.lib-side span.on { background: #F1F0EC; color: var(--ink); }
.lib-canvas { padding: 20px; display: grid; gap: 14px; align-content: start; background: var(--surface-2); }
.pal { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.pal i { aspect-ratio: 1; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.06); }
.scale { display: grid; gap: 6px; }
.scale div { display: flex; align-items: baseline; gap: 12px; }
.scale b { font-family: var(--serif); font-weight: 400; color: var(--ink); line-height: 1; width: 44px; }

/* ECV · decomposition */
.decomp { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.pcard .pin { position: absolute; }
.pc-media { position: relative; height: 120px; border: 1px dashed #B9C9D4; border-radius: 6px; background: var(--blue-bg); }
.pc-title { position: relative; font: 400 18px/1.2 var(--serif); color: var(--ink); }
.pc-meta { position: relative; }
.pc-foot { position: relative; display: flex; justify-content: space-between; align-items: center; }
.pc-price { font: 500 14px/1 var(--sans); color: var(--ink); }
.legend { display: grid; }
.legend li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.legend li:first-child { border-top: 1px solid var(--line); }
.legend .tag { margin-right: 6px; }

/* ECV · documentation */
.doc-h { font: 400 24px/1.1 var(--serif); letter-spacing: -0.02em; color: var(--ink); }
.dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.dd-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 12px; align-content: start; }
.dd-box .tag { justify-self: start; }
.dd-demo { display: flex; justify-content: center; gap: 8px; padding: 18px 8px; border-radius: 6px; background: var(--surface-2); flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.chips .tkn { padding: 5px 8px; font-size: 11px; }

/* ECV · days */
.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.day { display: grid; gap: 10px; justify-items: center; }
.day-bar { width: 100%; height: 180px; display: flex; flex-direction: column; gap: 3px; }
.day-bar i { border-radius: 4px; }
.d-pres { background: var(--ink); }
.d-demo { background: #C9C8C3; }
.d-prat { background: var(--yellow-bg); border: 1px solid #EFDDA8; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; }
.legend-row span { display: inline-flex; align-items: center; gap: 8px; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; }

@media (max-width: 960px) {
  .fig-hero .fig-box { padding: 40px; }
}
@media (max-width: 600px) {
  .fig-box, .fig-hero .fig-box { padding: 20px; }
  .fig { margin: 32px 0; }
  .fig-hero { margin-top: 40px; }
  .ba, .ba.wide-r, .scatter, .decomp { grid-template-columns: 1fr; }
  .ba > .arr, .scatter > svg { transform: rotate(90deg); justify-self: center; }
  .scatter svg { width: 56px; height: 40px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 10px; }
  .steps > *::after { display: none; }
  .chain-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chain-row > .arr { display: none; }
  .tkn { font-size: 10.5px; padding: 7px 8px; }
  .tk-row { gap: 8px; font-size: 11px; }
  .bar i { width: calc(var(--w) * 1.3px); }
  .slots { gap: 8px; }
  .frame { padding: 6px; }
  .fr-slot { height: 84px; padding: 6px; }
  .trio { grid-template-columns: 1fr; }
  .trio .win-body { min-height: 0; }
  .screens { gap: 14px; }
  .screens > *::after { display: none; }
  .atomic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib { grid-template-columns: 104px minmax(0, 1fr); }
  .lib-side span { font-size: 10.5px; padding: 6px; }
  .lib-canvas { padding: 12px; }
  .pal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dd { grid-template-columns: 1fr; }
  .days { gap: 8px; }
  .day-bar { height: 140px; }
  .loop-back { margin-left: 25%; margin-right: 25%; }
}
