/* sovryn.space home: infrastructure intelligence and drone operations, the solar case study.
   Three sections: the diorama (dark), the platform tree (paper), the one ask (dark). */

:root {
  --bg: #070a0b;
  --bg-2: #0e1315;
  --ink: #eef1ee;
  --dim: rgba(238, 241, 238, 0.68);
  --mute: rgba(238, 241, 238, 0.44);
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(14, 19, 21, 0.62);
  --accent: #5fe3bd;
  --accent-dim: rgba(95, 227, 189, 0.2);
  --accent-ink: #0d8a6c;
  --mint: #bdefd9;
  --paper: #ebe8e1;
  --paper-2: #f6f4ef;
  --paper-ink: #17191a;
  --paper-mute: rgba(23, 25, 26, 0.55);
  --edge: clamp(20px, 3.4vw, 48px);
  --r: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Inter Tight", "Avenir Next", system-ui, sans-serif;
  --wide: "Michroma", "Inter Tight", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sym { position: absolute; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.eyebrow { margin: 0 0 10px; font: 500 11px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 999px; font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn span { transition: transform 0.25s var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn-light { background: var(--ink); color: #0b0e0f; }
.btn-light:hover { background: #fff; }
.btn-dark { background: #121516; color: #f4f4f1; }
.btn-dark:hover { background: #000; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.22); color: var(--ink); background: rgba(10, 13, 14, 0.35); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.5); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 28px; height: 68px; padding: 0 var(--edge); background: linear-gradient(rgba(7, 10, 11, 0.7), rgba(7, 10, 11, 0)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 12px/1 var(--wide); letter-spacing: 0.28em; text-transform: uppercase; }
.brand svg { width: 15px; height: 15px; color: var(--mint); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a, .nav-quiet { font-size: 14px; text-decoration: none; color: var(--dim); transition: color 0.2s; }
.nav-links a:hover, .nav-quiet:hover { color: var(--ink); }
.nav-end { display: flex; align-items: center; gap: 20px; }
.nav .btn { height: 38px; font-size: 14px; padding: 0 16px; }
.nav { transition: background 0.3s, color 0.3s; }
.nav.paper { background: linear-gradient(rgba(235, 232, 225, 0.94), rgba(235, 232, 225, 0)); color: var(--paper-ink); }
.nav.paper .nav-links a, .nav.paper .nav-quiet { color: var(--paper-mute); }
.nav.paper .nav-links a:hover, .nav.paper .nav-quiet:hover { color: var(--paper-ink); }
.nav.paper .brand svg { color: var(--accent-ink); }
.nav.paper .btn-light { background: var(--paper-ink); color: #f4f2ec; }

/* ── 01 the diorama ────────────────────────────────────────────────────────────────────── */
.dio { position: relative; height: 100svh; min-height: 700px; max-height: 1100px; overflow: hidden; background: var(--bg); outline: none; }
.dio-stage { position: absolute; inset: 0; background: radial-gradient(ellipse at 58% 46%, #1f2a2d 0, #0c1113 55%, #050708 100%); }
.dio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s var(--ease); }
.gl-on .dio-canvas { opacity: 1; }
.dragging .dio-canvas { cursor: grabbing; }
.dio-shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, rgba(5, 7, 8, 0.78) 0, rgba(5, 7, 8, 0.35) 30%, rgba(5, 7, 8, 0) 46%),
  linear-gradient(180deg, rgba(5, 7, 8, 0.55) 0, rgba(5, 7, 8, 0) 18%, rgba(5, 7, 8, 0) 78%, rgba(5, 7, 8, 0.6) 100%); }
.dio-hint { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); margin: 0; font: 400 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute); pointer-events: none; }
.no-gl .dio-hint { display: none; }

.dio-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dio-tag { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 0.5s; will-change: transform; }
.dio-tag i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px rgba(238, 241, 238, 0.18); }
.dio-tag span { position: absolute; left: 14px; top: -12px; white-space: nowrap; padding: 5px 9px; border-radius: 6px; background: rgba(10, 13, 14, 0.82); border: 1px solid var(--line); font: 400 11px/1.2 var(--mono); letter-spacing: 0.02em; color: var(--dim); backdrop-filter: blur(6px); }
.dio-tag span b { font-weight: 500; color: var(--ink); margin-left: 6px; }
.dio-tag span::before { content: ""; position: absolute; right: 100%; top: 50%; width: 10px; height: 1px; background: rgba(238, 241, 238, 0.4); }
.dio-tag.l span { left: auto; right: 14px; }
.dio-tag.l span::before { right: auto; left: 100%; }
.dio-tag.hot i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim), 0 0 14px var(--accent); }
.dio-tag.hot span { border-color: rgba(95, 227, 189, 0.5); }
.dio-tag.hot span b { color: var(--mint); }
/* the build: a block running behind plan, in the same amber the scene tints it */
.dio-tag.late i { background: #f2a33a; box-shadow: 0 0 0 3px rgba(242, 163, 58, 0.2), 0 0 14px #f2a33a; }
.dio-tag.late span { border-color: rgba(242, 163, 58, 0.5); }
.dio-tag.late span b { color: #f7c47a; }

.dio-hero { position: absolute; z-index: 2; top: clamp(92px, 13vh, 132px); left: var(--edge); width: min(650px, 46vw); }
.crumb { margin: 0 0 18px; font: 400 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.crumb span { color: var(--accent); margin: 0 6px; }
.dio-hero h1 { margin: 0; font: 400 clamp(30px, 3.5vw, 50px)/1.12 var(--wide); letter-spacing: -0.01em; }
.lede { margin: 18px 0 26px; max-width: 470px; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.55; color: var(--dim); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.dio-card { position: absolute; z-index: 2; left: var(--edge); bottom: 104px; width: min(420px, 36vw); min-height: 168px; padding: 20px 22px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.2); }
.dio-card article { display: none; }
.dio-card article.on { display: block; animation: rise 0.6s var(--ease); }
.opt { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid rgba(189, 239, 217, 0.35); border-radius: 5px; color: var(--mint); font-size: 9.5px; letter-spacing: 0.1em; vertical-align: 1px; }
.opt-step { position: relative; padding-left: 6px; margin-left: 4px; border-left: 1px dashed var(--line); }
.dio-steps .opt-step button span { white-space: nowrap; }
.dio-card h2 { margin: 0 0 8px; font: 600 21px/1.25 var(--sans); letter-spacing: -0.01em; }
.dio-card p:not(.eyebrow) { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--dim); }
.dio-card .btn { margin-top: 14px; }
/* the build's card: a headline and a line for each phase, swapped as the phase changes */
.dio-card .ph { display: none; }
.dio-card .ph.on { display: block; animation: rise 0.5s var(--ease); }
.dio-card .ph h2 { margin-bottom: 10px; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.15; }

/* on a wide screen the diorama is pinned and the reader scrolls through its chapters */
.dio-track.scrolly { height: calc(100svh * 8); } /* seven chapters, a screen each, and the screen it is pinned in */
.dio-track.scrolly .dio { position: sticky; top: 0; height: 100svh; min-height: 0; max-height: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.dio-steps { position: absolute; z-index: 2; left: var(--edge); bottom: 28px; display: flex; gap: 2px; margin: 0; padding: 6px; list-style: none; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.dio-steps button { position: relative; display: grid; gap: 3px; min-width: 74px; padding: 7px 12px 9px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--dim); cursor: pointer; transition: background 0.2s, color 0.2s; }
.dio-steps button span { font: 400 10px/1 var(--mono); color: var(--mute); }
.dio-steps button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.dio-steps button.on { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.dio-steps button.on span { color: var(--accent); }
.dio-steps button.done span { color: var(--dim); }
.dio-steps button::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.dio-steps button.on::after { transform: scaleX(var(--prog, 0)); }
/* the build's step fills as four short bars, one a phase (clear, prepare, supply, assemble), in place of the one */
.dio-steps .has-sub::after { display: none; }
.dio-steps .sub { position: absolute; left: 12px; right: 12px; bottom: 4px; display: none; gap: 3px; height: 2px; }
.dio-steps button.on .sub { display: flex; }
.dio-steps .sub i { position: relative; flex: 1; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.dio-steps .sub i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }

.dio-panel { position: absolute; z-index: 2; top: 84px; right: var(--edge); max-height: calc(100% - 180px); width: 304px; display: flex; flex-direction: column; border-radius: 18px; background: rgba(12, 16, 18, 0.72); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.2); overflow: hidden; }
.dp-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font: 400 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.dp-tag { padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--mute); }
/* one view per chapter: a single picture of what is happening, not a log */
.dp-views { flex: 0 1 auto; min-height: 0; overflow: auto; scrollbar-width: none; }
.dp-views::-webkit-scrollbar { display: none; }
.dp-view { display: none; padding: 18px 18px 14px; }
.dp-view.on { display: block; animation: rise 0.55s var(--ease); }
.dp-k { margin: 0 0 12px; font: 400 10.5px/1.35 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.dp-big { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 6px; }
.dp-big b { font: 400 40px/1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.dp-big small { font: 400 12px/1 var(--mono); color: var(--mute); }
.dp-cap { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--dim); }
.dp-cap b { font: 500 13px var(--mono); color: var(--mint); }
.dp-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.dp-facts li { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); }
.dp-facts b { display: block; font: 400 18px/1.1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dp-facts span { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--mute); }
.dp-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.dp-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; column-gap: 8px; font-size: 13px; color: var(--dim); }
.dp-legend li i { width: 10px; height: 10px; border-radius: 3px; }
.dp-legend li b { font: 400 14px var(--mono); color: var(--ink); }
.dp-legend li em { grid-column: 2 / -1; font-style: normal; font-size: 11.5px; color: var(--mute); }
@keyframes draw { from { stroke-dashoffset: var(--from, 100); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes slidein { from { opacity: 0; transform: translateX(-8px); } }

/* 01 · the build: a view for each phase, under the phase's headline. Clear: the hectares and the area
   against plan. Prepare: the section against the design level, cut, fill and the set-out. Supply: the
   loads against schedule. Assemble: the 4D lineage, planned against actual, the variance by phase; the
   script lights each part ([data-wk]) as the weeks reach it by taking .wait off; without it all stand lit. */
.dp-phase { display: none; }
.dp-phase.on { display: block; animation: rise 0.5s var(--ease); }
.dp-title { margin: 0 0 12px; font: 600 17px/1.25 var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.area-bar { position: relative; height: 10px; margin: 10px 0 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.area-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--clr, 0)); }
.area-bar::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--mint); }
[data-phase="1"] .dp-axis { margin-bottom: 14px; }
.levels { display: block; width: 100%; margin: 0 0 12px; overflow: visible; }
.lv-cut { fill: rgba(206, 122, 86, 0.45); }
.lv-fill { fill: rgba(86, 150, 206, 0.45); }
.lv-exist { fill: none; stroke: rgba(238, 241, 238, 0.55); stroke-width: 1.4; stroke-linejoin: round; }
.lv-design { fill: none; stroke: rgba(189, 239, 217, 0.6); stroke-width: 1; stroke-dasharray: 3 3; }
.lv-graded { fill: none; stroke: var(--accent); stroke-width: 2; }
.lv-x text { font: 400 7.5px var(--mono); fill: var(--mute); text-anchor: middle; }
.lv-x .r { text-anchor: end; fill: var(--mint); }
.lv-facts .cut b { color: #e2a184; }
.lv-facts .fill b { color: #8fc0e6; }
.deliv { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.deliv li { display: grid; grid-template-columns: 74px 1fr 58px; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.deliv i { position: relative; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.deliv i::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--r, 0)); }
.deliv .short i::after { background: #f2a33a; }
.deliv b { font: 400 12px var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.deliv .short b { color: #f7c47a; }
.lineage { display: block; width: 100%; margin: 0 0 14px; overflow: visible; }
.ln rect { fill: rgba(95, 227, 189, 0.1); stroke: rgba(95, 227, 189, 0.7); stroke-width: 1; transition: fill 0.4s, stroke 0.4s; }
.ln .n { font: 600 7.6px var(--sans); fill: var(--ink); transition: fill 0.4s; }
.ln .s { font: 400 6.6px var(--mono); fill: var(--mint); transition: fill 0.4s; }
.ln.wait rect { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.14); }
.ln.wait .n, .ln.wait .s { fill: var(--mute); }
.le { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset 0.6s var(--ease); }
.le.wait { stroke-dashoffset: 100; }
.sc-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.sc-key { margin: 0 0 9px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 11.5px; color: var(--dim); }
.sc-key li { display: flex; align-items: center; gap: 6px; }
.sc-key i { width: 12px; border-top: 2px solid var(--accent); }
.sc-key .pl i { border-top: 1.5px dashed rgba(238, 241, 238, 0.5); }
.sc-key b { margin-left: auto; padding-left: 10px; font: 400 12px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.scurve { display: block; width: 100%; margin: 0 0 12px; overflow: visible; }
.sc-grid line { stroke: rgba(255, 255, 255, 0.07); }
.sc-grid .z { stroke: rgba(255, 255, 255, 0.2); }
.sc-y text, .sc-x text { font: 400 7.5px var(--mono); fill: var(--mute); }
.sc-x text { text-anchor: middle; }
.sc-plan { fill: none; stroke: rgba(238, 241, 238, 0.45); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sc-act { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.sc-late, .sv-late { fill: rgba(242, 163, 58, 0.5); }
.sc-ahead, .sv-ahead { fill: rgba(95, 227, 189, 0.38); }
.sc-now { stroke: rgba(189, 239, 217, 0.5); stroke-dasharray: 2 3; }
.sc-dot { fill: var(--mint); filter: drop-shadow(0 0 4px var(--accent)); }
.vbars { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 7px; }
.vbars li { display: grid; grid-template-columns: 84px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.vbars i { position: relative; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.04); }
.vbars i::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, 0.22); }
.vbars i::after { content: ""; position: absolute; top: 0; bottom: 0; border-radius: 2px; width: calc(var(--d, 0) * 8%); transition: transform 0.7s var(--ease); }
.vbars i.late::after { right: 50%; background: #f2a33a; transform-origin: right; }
.vbars i.ahead::after { left: 50%; background: var(--accent); transform-origin: left; }
.vbars i.even::after { left: calc(50% - 1.5px); width: 3px; background: var(--mint); }
.vbars b { font: 400 12px var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; transition: opacity 0.4s; }
.vbars .wait span { color: var(--mute); }
.vbars .wait i::after { transform: scaleX(0); }
.vbars .wait b { opacity: 0; }
.dp-cap b.late { color: #f7c47a; }

/* 02 · the gauge */
.gauge { display: block; width: 100%; max-width: 230px; margin: 0 auto -4px; overflow: visible; }
.gauge path { fill: none; stroke-width: 12; stroke-linecap: round; }
.g-track { stroke: rgba(255, 255, 255, 0.08); }
.g-ok { stroke: rgba(95, 227, 189, 0.16); stroke-dasharray: 40 100; stroke-dashoffset: -60; stroke-linecap: butt !important; }
.g-fill { stroke: var(--accent); stroke-dasharray: 74.2 100; }
.on .g-fill { animation: draw 1.3s var(--ease) both; --from: 74.2; }
.g-tick { stroke: var(--mint); stroke-width: 2; }
.g-lab { font: 400 9px var(--mono); fill: var(--mint); }

/* 03 · the ring: modules captured in thermal; the scene fills it */
.rings { position: relative; width: 172px; margin: 0 auto 16px; }
.rings svg { display: block; width: 100%; transform: rotate(-90deg); }
.rings circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.r-bg { stroke: rgba(255, 255, 255, 0.07); }
.r-cap { stroke: url(#g-heat); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--cap, 0) * 100); }
.rings-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rings-c b { font: 400 24px/1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rings-c span { margin-top: 4px; font: 400 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.dp-legend .cap i { background: linear-gradient(135deg, #781c6d, #ed6925, #fcffa4); }
[data-for="2"] .dp-legend { margin-bottom: 14px; }

/* 04 · the donut, by priority */
.donut-row { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; margin-top: 4px; }
.donut { display: block; width: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 11; }
.d-bg { stroke: rgba(255, 255, 255, 0.06); }
.donut .d { stroke-dasharray: var(--a) 100; stroke-dashoffset: var(--o); }
.on .donut .d { animation: draw 0.9s var(--ease) both; --from: calc(var(--o) + var(--a)); }
.on .donut .p3 { animation-delay: 0.25s; }
.on .donut .p4 { animation-delay: 0.5s; }
.donut text { transform: rotate(90deg); transform-origin: 50px 50px; text-anchor: middle; }
.d-n { font: 400 22px var(--mono); fill: var(--ink); }
.d-l { font: 400 8px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--mute); }
.p1 { --c: #ff6b4a; } .p3 { --c: #f2a33a; } .p4 { --c: #e8d36a; }
.donut .d { stroke: var(--c); }
.dp-legend .p1 i, .dp-legend .p3 i, .dp-legend .p4 i { background: var(--c); }

/* 05 · the cell's row, as a temperature profile */
.profile { display: block; width: 100%; margin: 0 0 14px; overflow: visible; }
.p-th { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 3 4; }
.p-th.hot { stroke: rgba(255, 107, 74, 0.55); }
.p-thl { font: 400 8.5px var(--mono); fill: var(--mute); }
.p-area { fill: url(#g-prof); }
.on .p-area { animation: rise 1s 0.6s var(--ease) both; }
.p-line { fill: none; stroke: #fcd27a; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 100; }
.on .p-line { animation: draw 1.4s var(--ease) both; }
.p-dot { fill: #fcffa4; filter: drop-shadow(0 0 6px #ed6925); }
.on .p-dot, .on .p-val { animation: rise 0.5s 1.1s var(--ease) both; }
.p-val { font: 500 10px var(--mono); fill: #fcffa4; text-anchor: end; }
.p-x text { font: 400 9px var(--mono); fill: var(--mute); text-anchor: middle; }

/* 06 · the report, as a page */
.report { padding: 14px; border-radius: 12px; background: #f3f1ec; color: #15181a; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6); }
.on .report { animation: rise 0.6s var(--ease) both; }
.report header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font: 600 12.5px var(--sans); }
.report header span { display: inline-flex; align-items: center; gap: 6px; }
.report header svg { width: 11px; height: 11px; color: #0d8a6c; }
.report header em { font: normal 400 9.5px var(--mono); color: rgba(21, 24, 26, 0.5); }
.r-kpis { display: grid; grid-template-columns: 0.7fr 1.3fr 0.9fr; gap: 6px; margin-bottom: 10px; }
.r-kpis div { padding: 7px 8px; border-radius: 7px; background: rgba(21, 24, 26, 0.05); }
.r-kpis b { display: block; font: 500 14px/1.1 var(--mono); }
.r-kpis span { font-size: 10px; color: rgba(21, 24, 26, 0.55); }
.r-bar { display: flex; gap: 2px; height: 6px; margin-bottom: 10px; border-radius: 3px; overflow: hidden; }
.r-bar i { flex: 1; background: var(--c); transform-origin: left; }
.on .r-bar i { animation: growx 0.7s var(--ease) both; }
.on .r-bar i:nth-child(2) { animation-delay: 0.15s; }
.on .r-bar i:nth-child(3) { animation-delay: 0.3s; }
.r-wo { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.r-wo li { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; border: 1px solid rgba(21, 24, 26, 0.08); font-size: 11px; }
.on .r-wo li { animation: slidein 0.45s var(--ease) both; }
.on .r-wo li:nth-child(1) { animation-delay: 0.5s; } .on .r-wo li:nth-child(2) { animation-delay: 0.62s; }
.on .r-wo li:nth-child(3) { animation-delay: 0.74s; } .on .r-wo li:nth-child(4) { animation-delay: 0.86s; }
.r-wo em { font: normal 600 9.5px var(--mono); padding: 2px 5px; border-radius: 4px; background: var(--c); color: #1a0d06; }
.r-wo b { font: 500 10.5px var(--mono); }
.r-wo span { color: rgba(21, 24, 26, 0.68); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-for="5"] .dp-cap { margin: 12px 0 0; }

/* 07 · the string's data */
.dp-chart { margin: 4px 0 12px; }
.dp-chart svg { display: block; width: 100%; height: 64px; }
.dp-chart .zero { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; }
.dp-chart .mark { stroke: rgba(189, 239, 217, 0.7); stroke-dasharray: 2 3; }
.dp-chart rect { fill: rgba(255, 255, 255, 0.28); transform-box: fill-box; transform-origin: top; }
.dp-chart rect.low { fill: var(--accent); }
.on .dp-chart rect { animation: grow 0.5s calc(var(--i) * 25ms) var(--ease) both; }
.dp-axis { display: flex; justify-content: space-between; margin: 6px 0 0; font: 400 9.5px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
[data-for="6"] .dp-big b { color: var(--mint); }

.dp-ctl { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ic { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.07); cursor: pointer; }
.ic:hover { background: rgba(255, 255, 255, 0.13); }
.ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-act="play"] { background: var(--accent); color: #04221a; }
[data-act="play"]:hover { background: var(--mint); }
[data-act="play"] .i-play { fill: currentColor; display: none; }
[data-act="play"][aria-pressed="false"] .i-play { display: block; }
[data-act="play"][aria-pressed="false"] .i-pause { display: none; }
.seg { display: flex; margin-left: auto; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.seg-speed { margin-left: 0; }
.seg-speed button { min-width: 32px; padding: 0 8px; font-family: var(--mono); font-size: 12px; }
.seg button { height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: none; font-size: 13px; color: var(--dim); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #0b0e0f; }
[data-step="0"] .seg:not(.seg-speed), [data-step="3"] .seg:not(.seg-speed), [data-step="4"] .seg:not(.seg-speed) { opacity: 0.35; pointer-events: none; } /* the build and the analysis are drawn on the model */

/* without WebGL or scripts the words carry it: show every chapter in the card */
.no-gl .dio-canvas, .no-gl .dio-tags { display: none; }

/* ── 02 the platform tree ──────────────────────────────────────────────────────────────── */
.stack { position: relative; padding: clamp(80px, 11vh, 130px) var(--edge) 60px; background: var(--paper); color: var(--paper-ink); overflow: hidden; }
.stack::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 78% 50%, rgba(255, 255, 255, 0.55), transparent 60%); }
.stack > * { max-width: 1440px; margin-left: auto; margin-right: auto; }
.stack-copy { position: relative; }
.stack-copy > * { max-width: 460px; }
.stack h2 { margin: 0; font: 400 clamp(26px, 2.6vw, 38px)/1.15 var(--wide); letter-spacing: -0.01em; }
.stack .sub { margin: 14px 0 0; font-size: 16px; color: var(--paper-mute); }
.stack .sub kbd { padding: 1px 5px; border: 1px solid rgba(23, 25, 26, 0.2); border-radius: 4px; font: 400 12px var(--mono); }
.tree-touch-hint { display: none; }
.stack .eyebrow { color: var(--accent-ink); }

.tree { position: relative; margin-top: 28px; }
.tree.drawn { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 24px; align-items: start; }
.tree.drawn .tree-list { display: none; }
.tree-svg { width: 100%; height: auto; max-height: 76vh; margin-top: -120px; overflow: visible; }
.t-guides circle { fill: none; stroke: rgba(23, 25, 26, 0.12); stroke-width: 1; }
.t-guides circle.far { stroke-dasharray: 2 6; stroke: rgba(23, 25, 26, 0.09); }
.t-trunk { stroke: rgba(13, 138, 108, 0.35); stroke-width: 1.6; transition: stroke 0.3s; }
.t-branch { fill: none; stroke: rgba(13, 138, 108, 0.28); stroke-width: 1.1; transition: stroke 0.3s, stroke-width 0.3s; }
.t-trunk.lit, .t-branch.lit { stroke: var(--accent-ink); stroke-width: 2; }
.t-root .halo { fill: rgba(13, 138, 108, 0.12); }
.t-root circle:not(.halo) { fill: #141718; }
.t-root text, .t-hub text { text-anchor: middle; fill: #f2f0ea; }
.root-name { font: 400 17px var(--wide); letter-spacing: 0.08em; }
.root-sub { font: 400 11px var(--sans); fill: rgba(242, 240, 234, 0.7) !important; }
.root-n { font: 400 9px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; fill: #7fe6c4 !important; }
.t-hub .halo { fill: rgba(13, 138, 108, 0.0); stroke: rgba(13, 138, 108, 0.25); stroke-dasharray: 3 4; transition: fill 0.3s; }
.t-hub.lit .halo { fill: rgba(13, 138, 108, 0.14); }
.t-hub circle:not(.halo) { fill: #1b1e20; }
.hub-name { font: 400 9px var(--wide); letter-spacing: 0.06em; }
.hub-n { font: 400 8px var(--mono); letter-spacing: 0.08em; fill: #7fe6c4 !important; text-transform: uppercase; }

.t-hit { fill: transparent; }
.t-hub { cursor: pointer; outline: none; }
.t-hub:focus-visible .halo { stroke-width: 3; stroke: var(--accent-ink); }
.t-leaf { cursor: pointer; outline: none; }
.t-leaf .dia { fill: rgba(255, 255, 255, 0.6); transition: fill 0.25s, transform 0.3s var(--ease); }
.t-leaf .disc { fill: #fff; stroke: #2a2d2f; stroke-width: 1.2; transition: stroke 0.25s; }
.t-leaf .ico { fill: none; stroke: #1c1f21; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.t-leaf .ret { opacity: 0; transition: opacity 0.25s; }
.t-leaf .ret path { fill: none; stroke: var(--accent-ink); stroke-width: 2.4; }
.t-leaf .lab rect { fill: #17191a; transition: fill 0.25s; }
.t-leaf .lab text { font: 500 13px var(--sans); fill: #f4f2ec; }
.t-leaf .lab .lab-step { font: 400 10.5px var(--mono); fill: rgba(244, 242, 236, 0.5); }
.t-leaf:hover .dia, .t-leaf.hover .dia, .t-leaf:focus-visible .dia { fill: #fff; }
.t-leaf:focus-visible .ret { opacity: 0.6; }
.t-leaf.on .dia { fill: var(--accent-ink); }
.t-leaf.on .disc { stroke: var(--accent-ink); }
.t-leaf.on .ret { opacity: 1; }
.t-leaf.on .lab rect { fill: var(--accent-ink); }
.t-leaf.on .lab .lab-step { fill: rgba(255, 255, 255, 0.8); }

.tree-card { position: relative; z-index: 1; padding: 22px; border-radius: 18px; background: var(--paper-2); border: 1px solid rgba(23, 25, 26, 0.08); box-shadow: 0 20px 50px -24px rgba(40, 30, 20, 0.35); }
.tree-card.swap { animation: rise 0.5s var(--ease); }
.tc-img { position: relative; margin: -10px -10px 16px; border-radius: 12px; overflow: hidden; aspect-ratio: 38 / 23; background: #0c1113; }
.tc-img[hidden] { display: none; }
.tc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tc-img figcaption { position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(10, 13, 14, 0.72); font: 400 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mint); backdrop-filter: blur(6px); }
.tc-crumb { margin: 0 0 8px; font: 400 10.5px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-mute); }
.tc-crumb span { color: var(--accent-ink); margin: 0 4px; }
.tc-name { margin: 0 0 8px; font: 600 22px/1.2 var(--sans); letter-spacing: -0.01em; }
.tc-text { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: rgba(23, 25, 26, 0.72); }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0 0 16px; list-style: none; border-bottom: 1px dashed rgba(23, 25, 26, 0.18); }
.tc-tags li { padding: 5px 10px; border-radius: 7px; background: rgba(23, 25, 26, 0.07); font-size: 12.5px; color: rgba(23, 25, 26, 0.75); }
.tc-foot { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.tc-k { display: block; margin-bottom: 4px; font: 400 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-mute); }
.tc-v { font-size: 15px; font-weight: 500; }
.tc-v::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent-ink); vertical-align: 1px; }

/* the list: no script */
.tree-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tree-list > li { padding: 18px; border-radius: var(--r); background: var(--paper-2); border: 1px solid rgba(23, 25, 26, 0.08); font-size: 13px; color: var(--paper-mute); }
.tree-list > li > b { display: block; margin-bottom: 2px; font: 400 13px var(--wide); letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-ink); }
.tree-list ul { margin: 12px 0 0; padding: 0; list-style: none; }
.tree-list ul li { padding: 10px 0; border-top: 1px dashed rgba(23, 25, 26, 0.14); font-size: 14.5px; font-weight: 500; color: var(--paper-ink); }
.tree-list ul li span { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 400; color: var(--paper-mute); }

/* ── 03 the ask ────────────────────────────────────────────────────────────────────────── */
.ask { padding: clamp(90px, 13vh, 150px) var(--edge) 80px; text-align: center; background: radial-gradient(ellipse at 50% 0, #142024 0, var(--bg) 60%); }
.ask h2 { margin: 0 auto; max-width: 900px; font: 400 clamp(26px, 3.2vw, 44px)/1.18 var(--wide); letter-spacing: -0.01em; }
.ask-card { display: flex; align-items: center; gap: 16px; max-width: 760px; margin: 40px auto 0; padding: 12px 12px 12px 14px; border-radius: 20px; background: linear-gradient(100deg, #f5f4f0, #e4e2dc); color: #141617; text-align: left; box-shadow: 0 30px 80px -30px rgba(95, 227, 189, 0.35); }
.ask-ic { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: #17191a; }
.ask-ic svg { width: 22px; height: 22px; fill: none; stroke: #f4f2ec; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ask-txt { flex: 1; display: grid; gap: 3px; }
.ask-txt b { font-size: 17px; font-weight: 600; }
.ask-txt span { font-size: 14px; color: rgba(20, 22, 23, 0.65); }
.pill { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 6px; background: rgba(20, 22, 23, 0.08); font: 400 11px/1 var(--mono); vertical-align: 2px; color: rgba(20, 22, 23, 0.7) !important; }
.ask-card .btn { height: 50px; padding: 0 22px; }
a.ask-card { text-decoration: none; transition: transform 0.25s var(--ease); }
a.ask-card:hover { transform: translateY(-2px); }
a.ask-card:hover .btn span { transform: translateX(3px); }
.ask-or { margin: 18px 0 0; font-size: 14px; color: var(--mute); }
.ask-or a { color: var(--dim); text-underline-offset: 3px; }
.ask-or a:hover { color: var(--ink); }

.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 1080px; margin: 72px auto 0; padding: 0; list-style: none; text-align: left; }
.paths a { position: relative; display: grid; gap: 6px; height: 100%; padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); text-decoration: none; transition: border-color 0.25s, background 0.25s; }
.paths a:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.04); }
.paths .eyebrow { margin: 0; }
.paths b { font-size: 17px; font-weight: 600; }
.paths em { font-style: normal; font-size: 14px; color: var(--mute); }
.paths i { position: absolute; top: 18px; right: 18px; font-style: normal; color: var(--mute); }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 28px var(--edge) 34px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13.5px; }
.foot p { margin: 0; }
.foot nav { display: flex; gap: 20px; margin-left: auto; }
.foot nav a { text-decoration: none; color: var(--dim); }
.foot nav a:hover { color: var(--ink); }
.foot small { width: 100%; font: 400 11px var(--mono); letter-spacing: 0.06em; }

/* ── narrower ──────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nav-links { display: none; }
  .nav-end { margin-left: auto; }
  .dio-panel { width: 268px; }
  .dio-hero { width: min(500px, 52vw); }
  .dio-card { width: min(400px, 44vw); }
  .dio-steps button { min-width: 0; padding: 7px 10px 9px; }
}
@media (max-height: 820px) and (min-width: 901px) {
  .lede { display: none; }
  .dio-hero h1 { font-size: clamp(28px, 3vw, 40px); }
  .dio-card { bottom: 96px; min-height: 0; padding: 16px 18px; }
  .dio-card h2 { font-size: 18px; }
  .dio-card .ph h2 { font-size: 21px; }
  .dp-cap { font-size: 12px; }
  .dp-big b { font-size: 32px; }
}
@media (max-width: 900px) {
  .nav-quiet { display: none; }
  .dio { height: auto; min-height: 0; max-height: none; display: flex; flex-direction: column; padding-top: 88px; }
  .dio-hero { position: relative; top: 0; width: auto; padding: 0 var(--edge) 22px; left: 0; }
  .dio-stage { position: relative; inset: auto; height: 62svh; min-height: 380px; order: 1; }
  .dio-shade { background: linear-gradient(180deg, var(--bg) 0, rgba(5, 7, 8, 0) 14%, rgba(5, 7, 8, 0) 86%, var(--bg) 100%); }
  .dio-hint { top: 18px; }
  .dio-steps { position: relative; order: 2; left: 0; bottom: 0; margin: -6px var(--edge) 0; overflow-x: auto; scrollbar-width: none; }
  .dio-card { position: relative; order: 3; left: 0; bottom: 0; width: auto; margin: 12px var(--edge) 0; }
  .dio-panel { position: relative; order: 4; inset: auto; width: auto; margin: 12px var(--edge) 40px; }
  .dp-views { max-height: none; }
  .tree.drawn { display: flex; flex-direction: column; gap: 20px; max-width: 600px; }
  .tree-svg { order: -1; margin-top: 0; max-height: none; overflow: visible; }
  .tree-card { width: 100%; min-width: 0; }
  .t-leaf .lab text { fill: var(--paper-ink); font-size: 14px; }
  .t-leaf.on .lab text { fill: var(--accent-ink); font-weight: 600; }
  .t-trunk, .t-branch { vector-effect: non-scaling-stroke; }
  .tree-touch-hint { display: inline; }
  .tree-key-hint { display: none; }
  .dio-panel { max-height: none; }
  .dio-actions { flex-wrap: wrap; }
  .ask-card { flex-wrap: wrap; }
  .ask-card .btn { width: 100%; justify-content: center; }
  .paths { grid-template-columns: 1fr; }
  .foot nav { margin-left: 0; }
}

@media (max-width: 480px) {
  .nav { gap: 12px; height: 64px; }
  .brand { gap: 7px; font-size: 10px; letter-spacing: .2em; }
  .nav .btn { padding: 0 12px; font-size: 12px; }
  .dio-hero h1 { font-size: clamp(24px, 6.8vw, 32px); }
  .dio-hero .btn { padding: 0 14px; font-size: 14px; }
  .dio-stage { height: 52svh; min-height: 300px; }
  .stack h2, .ask h2 { font-size: clamp(22px, 6vw, 28px); overflow-wrap: anywhere; }
  .tree-card { padding: 18px; }
  .tc-crumb { letter-spacing: .06em; }
  .tc-foot { align-items: start; flex-wrap: wrap; }
  .dp-ctl { flex-wrap: wrap; }
  .seg button { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
