/* stoke.html: the survey sheet. Purple is the product; it marks only what stoke changed. */

.ink { color: var(--ink); }
#results, #metalbench, #how { scroll-margin-top: var(--nav); }

/* ---------- S1 ---------- */
.s1 { padding-top: 24px; }
.s1-frame {
  border: 1.5px solid var(--ink); display: grid; grid-template-columns: 5fr 7fr;
  min-height: min(calc(var(--vh) - var(--nav) - 48px), 860px);
}
.s1-text { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-width: 0; }
.s1-text .wordmark-stoke { font-size: clamp(104px, 11.5vw, 200px); margin: -0.06em 0 0 -0.04em; padding-bottom: .06em; }
.s1-mid h1 { max-width: 14ch; font-size: clamp(38px, 3.9vw, 64px); }
.s1-body { margin-top: 24px; font-size: 18px; line-height: 1.6; max-width: 40ch; }
.s1-map { position: relative; border-left: 1px solid var(--ink); background: var(--wood); min-height: 420px; }
.s1-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- S2 intro ---------- */
.res-intro { padding-block: clamp(96px, 12vw, 176px) 48px; align-items: end; }
.res-intro h2 { grid-column: 1 / 7; max-width: 18ch; }
.res-sub { grid-column: 7 / 13; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 46ch; }

/* ---------- S2 frame: static (reduced motion, no JS, short screens) ---------- */
.res-frame { position: relative; border: 1.5px solid var(--ink); }
.ticks { display: none; }
.step { display: grid; grid-template-columns: 5fr 7fr; }
.step + .step { border-top: 1px solid var(--ink); }
.st-text { padding: 48px 48px 48px 64px; min-width: 0; }
.st-num { margin: 0; }
.st-num .num { font-size: clamp(88px, 9.4vw, 160px); line-height: .9; letter-spacing: -0.05em; display: inline-block; margin-left: -0.04em; }
.st-name { margin-top: 20px; font: 600 28px/1.2 var(--sans); letter-spacing: -0.015em; }
.st-name .paren { font: italic 400 22px/1.2 var(--serif); color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.st-label { margin-top: 12px; font-size: 19px; line-height: 1.5; max-width: 34ch; }
.st-rem { margin-top: 14px; max-width: 44ch; }
.st-viz { position: relative; border-left: 1px solid var(--ink); background: var(--wood); min-height: 520px; min-width: 0; }
.st-viz-in { position: absolute; inset: 0; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 40px; }
.st-viz .chart { flex: 0 0 46%; min-height: 220px; }

/* ---------- S2 pinned (JS + motion + room) ---------- */
.res-track.live { height: calc(4.5 * var(--vh)); }
.res-track.live .res-pin { position: sticky; top: var(--nav); height: calc(var(--vh) - var(--nav)); display: flex; align-items: center; }
.res-track.live .res-frame { height: calc(var(--vh) - var(--nav) - 80px); }
.res-track.live .step { position: absolute; inset: 0; border-top: 0; visibility: hidden; }
.res-track.live .step.on { visibility: visible; }
.res-track.live .st-viz { min-height: 0; }
.res-track.live .st-text { display: flex; flex-direction: column; justify-content: center; padding-bottom: 72px; }
.res-track.live .st-text > * { opacity: 0; transition: opacity .15s ease, transform .15s ease; }
.res-track.live .step.on .st-text > * { opacity: 1; transform: none; transition: opacity .26s cubic-bezier(.2, .7, .2, 1), transform .26s cubic-bezier(.2, .7, .2, 1); }
.res-track.live .step.enter .st-text > * { transform: translateY(8px); opacity: 0; transition: none; }
.res-track.live .ticks {
  display: flex; flex-direction: column; gap: 0; position: absolute; z-index: 2;
  left: 8px; top: 50%; transform: translateY(-50%);
}
.res-track.live .rbar { --ink-ms: .7s; }
/* progress ticks are buttons, filled in ink (purple is only for stoke's revisions) */
.tick { width: 32px; height: 32px; padding: 7px; margin: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.tick svg { width: 18px; height: 16px; overflow: visible; }
.tick path { fill: var(--sheet); stroke: var(--ink); stroke-width: 3.4; stroke-linejoin: round; transition: fill .2s; }
.tick.on path { fill: var(--ink); }

/* ---------- S5 MetalBench ---------- */
.bench .grid { align-items: center; row-gap: 48px; }
.b-left { grid-column: 1 / 6; }
.b-desc { margin-top: 20px; font-size: 17px; line-height: 1.6; max-width: 40ch; }
.b-link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; white-space: nowrap; }
.b-link:hover { text-decoration-thickness: 2px; }
.rc-in { font-family: var(--mono); font-size: .85em; }
.geo { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.big-geo { font-size: clamp(80px, 8vw, 128px); line-height: .9; letter-spacing: -0.04em; margin-left: -0.04em; }
.geo-cap { max-width: 34ch; text-wrap: balance; }
.b-close { grid-column: 1 / 13; border-top: 1px solid var(--rule); padding-top: 24px; font-size: 18px; line-height: 1.6; }
/* rows: ink speedup bars from the 1.00x mark on a shared 0-2.5x scale; the value sits 12px past each tip */
.b-rows { grid-column: 7 / 13; position: relative; display: grid; gap: 30px; --track: calc(100% - 64px); }
.row { display: grid; row-gap: 10px; position: relative; }
.r-n { font: 500 16px/1.2 var(--sans); }
.r-t { position: relative; height: 12px; width: var(--track); }
.r-t::before { content: ""; position: absolute; left: 0; width: 40%; top: 5.4px; height: 1.25px; background: var(--ink); }
.r-t::after { content: ""; position: absolute; left: calc(40% - .75px); top: 0; width: 1.5px; height: 12px; background: var(--ink); }
.r-t i { position: absolute; left: 40%; top: 3px; height: 6px; width: calc((var(--v) - 1) / 2.5 * 100%); background: var(--ink); transform-origin: left; }
.r-v { position: absolute; top: -3px; left: calc(40% + (var(--v) - 1) / 2.5 * 100% + 12px); font: 500 16px/1 var(--mono); white-space: nowrap; }
.r-t .gm { position: absolute; left: 46.4%; top: -4px; height: 20px; border-left: 1px dashed var(--ink); }
.r-foot { position: relative; height: 18px; margin-top: -14px; width: var(--track); font: 400 12px/1 var(--mono); color: var(--muted); }
.r-foot span { position: absolute; white-space: nowrap; }
.r-one { left: 40%; top: 0; transform: translateX(-50%); }
.r-geo { left: 46.4%; top: 0; color: var(--ink); }
@media (min-width: 760px) { .r-one { transform: translateX(-100%); margin-left: -6px; } .r-geo { margin-left: 6px; } }
@media (max-width: 759px) { .r-one { left: 0; transform: none; } }
.js.motion .bench .r-t i { transform: scaleX(0); }
.js.motion .bench .r-v { opacity: 0; }
.js.motion .bench .in .r-t i { transform: scaleX(1); transition: transform .6s var(--ease-ink); }
.js.motion .bench .in .r-v { opacity: 1; transition: opacity .3s .5s; }
.js.motion .bench .in .row:nth-child(2) .r-t i { transition-delay: .12s; }
.js.motion .bench .in .row:nth-child(3) .r-t i { transition-delay: .24s; }
.js.motion .bench .in .row:nth-child(4) .r-t i { transition-delay: .36s; }
.js.motion .bench .in .row:nth-child(5) .r-t i { transition-delay: .48s; }

/* ---------- S4 how it works: ink-dashed route to the gate, purple-dashed only after the check ---------- */
.how h2 { max-width: 20ch; }
.route { position: relative; margin-top: 64px; --g: .5; }
.route-line { position: absolute; left: 0; right: 26px; top: 0; height: 2px; }
.route-line i { position: absolute; top: 0; height: 2px; transform-origin: left; }
.seg-ink { left: 0; width: calc(var(--g) * 100%); background: repeating-linear-gradient(to right, var(--ink) 0 2px, transparent 2px 7px); }
.seg-rev { left: calc(var(--g) * 100%); right: 0; background: repeating-linear-gradient(to right, var(--purple) 0 7px, transparent 7px 13px); }
.route-end { position: absolute; right: 0; top: -9px; width: 20px; height: 18px; overflow: visible; }
.route-end .end-dot { fill: var(--purple); transition: fill .3s; }
.route-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.rs { position: relative; padding-top: 34px; padding-right: 8px; transition: opacity .3s ease; }
.rs h3 { font: 600 18px/1.3 var(--sans); letter-spacing: -0.005em; }
.rs p { margin-top: 10px; font-size: 16px; line-height: 1.55; }
.rs code { font: 400 .92em var(--mono); }
.rs .chip { display: inline-block; font: 400 15px/1 var(--mono); background: var(--ink); color: var(--sheet); padding: 10px 14px; }
.node { position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--sheet); }
.node.gate { width: 22px; height: 22px; top: -10px; border: 0; border-radius: 0; background: none; }
.node.gate svg { width: 22px; height: 22px; overflow: visible; }
.node.gate rect { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.node.gate .chk { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.closing { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 18px; line-height: 1.6; }
.closing p { max-width: 86ch; text-wrap: pretty; }
.closing p + p { margin-top: 10px; }
.js.motion .how .rs { opacity: .35; }
.js.motion .how .rs.lit { opacity: 1; }
.js.motion .how .chk { stroke-dashoffset: 1; transition: stroke-dashoffset .3s ease-out; }
.js.motion .how .ticked .chk { stroke-dashoffset: 0; }
.js.motion .how .route-end .end-dot { fill: var(--sheet); }
.js.motion .how .route.done .route-end .end-dot { fill: var(--purple); }

/* ---------- S6 ---------- */
.contact .display { max-width: 16ch; }
.contact .body { font-size: 19px; max-width: 46ch; }
.contact .c-text { grid-column: 1 / 9; }
.contact .c-act { margin-top: 32px; }

/* ---------- footer: draw a revision ---------- */
.sfoot { display: flex; align-items: flex-end; gap: 32px; }
.sfoot-mark { width: 70%; aspect-ratio: 2.6; }
.sfoot-mark canvas.base { position: absolute; inset: 0; width: 100%; height: 100%; }
.sfoot-fallback { font: italic 500 clamp(96px, 20vw, 300px)/0.9 var(--serif); letter-spacing: -0.035em; }
.js .sfoot-fallback { visibility: hidden; }
.sfoot-hint { font: 400 13px/1.4 var(--mono); color: var(--purple); padding-bottom: 6%; transition: opacity .6s ease; }

@media (min-width: 760px) and (max-width: 1239px) {
  .s1-frame { grid-template-columns: 1fr 1fr; }
  .s1-text { padding: 40px; }
}

/* ---------- tablet ---------- */
@media (min-width: 760px) and (max-width: 1023px) {
  .step { grid-template-columns: 1fr 1fr; }
  .route-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}

/* ---------- phone ---------- */
@media (max-width: 759px) {
  .s1 { padding-top: 0; }
  .s1-frame { display: flex; flex-direction: column; border: 0; min-height: 0; }
  .s1-map { order: -1; height: 34vh; height: 34svh; min-height: 240px; margin-inline: calc(-1 * var(--pad)); border-left: 0; border-bottom: 1.5px solid var(--ink); }
  .s1-text { padding: 20px 0 0; gap: 0; text-align: center; align-items: center; }
  .s1-text .wordmark-stoke { font-size: 80px; margin: 0; }
  .s1-mid { margin-top: 10px; }
  .s1-mid h1 { font-size: 32px; margin-inline: auto; }
  .s1-body { font-size: 17px; margin: 20px auto 0; }
  .s1-text .btns { margin: 24px auto 0; }

  .res-intro { padding-block: 96px 32px; text-align: center; }
  .res-sub { margin: 16px auto 0; font-size: 17px; }

  .res-frame { border: 0; }
  .step { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 40px; }
  .step + .step { border-top: 1px solid var(--ink); }
  .st-text { padding: 0; display: flex; flex-direction: column; align-items: center; }
  .st-num .num { font-size: 80px; }
  .st-name { font-size: 22px; margin-top: 14px; }
  .st-name .paren { display: block; font-size: 16px; margin-top: 4px; }
  .st-label { font-size: 16px; max-width: 30ch; margin-top: 10px; }
  .st-rem { margin-top: 10px; max-width: 34ch; }
  .st-viz { width: 100%; margin-top: 16px; border: 1px solid var(--ink); min-height: 0; }
  .st-viz-in { position: relative; padding: 18px 24px 16px 16px; gap: 18px; text-align: left; }
  .st-viz .chart { flex: none; height: 130px; min-height: 0; }
  .res-track.live .res-frame { height: calc(var(--vh) - var(--nav) - 24px); }
  .res-track.live .st-text { padding-bottom: 0; }
  .res-track.live .step { justify-content: center; padding-block: 40px 0; }
  .res-track.live .ticks { flex-direction: row; gap: 0; left: 50%; top: 0; transform: translateX(-50%); }

  .bench .grid { display: block; }
  .b-left { text-align: left; }
  .b-desc { margin-top: 16px; }
  .geo { margin-top: 32px; }
  .big-geo { font-size: 80px; }
  .b-rows { margin-top: 32px; gap: 26px; }
  .b-close { margin-top: 32px; font-size: 17px; }
  .r-n { font-size: 15px; }

  .how h2 { text-align: center; margin-inline: auto; max-width: 13ch; }
  .route { margin-top: 64px; }
  .route-line { left: 0; right: auto; top: 0; bottom: 26px; width: 2px; height: auto; }
  .route-line i { left: 0; width: 2px; height: auto; transform-origin: top; }
  .route-line .seg-ink { top: 0; height: calc(var(--g) * 100%); background: repeating-linear-gradient(to bottom, var(--ink) 0 2px, transparent 2px 7px); }
  .route-line .seg-rev { top: calc(var(--g) * 100%); bottom: 0; height: auto; right: auto; background: repeating-linear-gradient(to bottom, var(--purple) 0 7px, transparent 7px 13px); }
  .route-end { left: -9px; right: auto; top: auto; bottom: 0; }
  .route-steps { display: block; padding-bottom: 48px; }
  .rs { padding: 0 0 0 28px; }
  .rs + .rs { margin-top: 56px; }
  .rs p { max-width: 34ch; }
  .node { left: -3px; top: 7px; }
  .node.gate { left: -10px; top: 1px; }
  .closing { font-size: 17px; margin-top: 56px; }

  .sfoot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sfoot-mark { width: 100%; }
  .sfoot-hint { padding: 0; align-self: flex-end; }
}
