/* Stumblepoint design system: warm paper, editorial serif, mono labels, colour blocks. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --ink: #111214;
  --muted: #5f646c;
  --line: #eaecef;
  --accent: #e0573a;      /* coral – stumble, problem */
  --accent-soft: #fdebe5;
  --good: #1f9254;        /* green – easiest, winner */
  --good-soft: #e3f4ea;
  --warn: #a8710f;
  --warn-soft: #f8efd9;
  --cobalt: #3448b8;
  --shadow: 0 1px 2px rgba(17, 18, 20, .04), 0 12px 32px -14px rgba(17, 18, 20, .16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter Tight", "Inter", -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; overflow-x: clip; background-color: var(--mood, var(--bg)); transition: background-color .9s ease; color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
b { font-weight: 600; color: var(--ink); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font: 400 13px/1.4 var(--font); letter-spacing: 0; text-transform: none; display: block; margin-top: 2px; }
.error { color: var(--accent); font-weight: 500; }
.eyebrow { font: 500 14px/1 var(--font); color: var(--muted); margin: 0 0 18px; }
.grad { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; padding-right: .04em; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.035em; }

/* Logo: four squares, one has stumbled. */
.mark { display: inline-grid; grid-template-columns: 11px 11px; gap: 3px; vertical-align: middle; }
.mark i { width: 11px; height: 11px; border-radius: 3px; background: var(--accent); }
.mark i:nth-child(2) { background: #e7b34d; }
.mark i:nth-child(3) { background: var(--cobalt); }
.mark i:nth-child(4) { background: var(--good); transform: translate(2px, 3px) rotate(14deg); }

/* Header */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 22px 40px; max-width: 1360px; margin: 0 auto; }
.brand { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.top nav { display: flex; gap: 34px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.ver { font-variant-numeric: tabular-nums; justify-self: end; font: 500 13px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 999px; padding: 12px 20px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; background: none; color: var(--ink); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(17, 18, 20, .55); }
.btn.primary:hover { background: #2a2c30; }
.btn.ghost { border-color: var(--line); background: var(--surface); box-shadow: 0 1px 2px rgba(17, 18, 20, .04); }
.btn.ghost:hover { border-color: #cfd3d8; }
.btn.big { padding: 16px 30px; font-size: 16px; }
.btn.small { padding: 7px 14px; font-size: 13px; }
/* The arrow sits in a small green "go" chip – Pip's colour, pointing to the winner. */
.btn .arrow { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -4px -10px -4px 2px; border-radius: 50%; background: var(--good); color: #fff; font-size: 14px; transition: transform .15s; }
.btn.big .arrow { width: 30px; height: 30px; margin-right: -16px; }
.btn:hover .arrow { transform: translateX(3px); }
.cmd { display: inline-flex; align-items: center; gap: 10px; background: #15171a; color: #f1f2f4; border: 0; border-radius: 14px; padding: 18px 22px; font: 500 15px var(--mono); cursor: pointer; }
.cmd .dollar { color: #e7b34d; }
.cmd .copy { color: #8f887d; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; border-left: 1px solid #47423b; padding-left: 12px; margin-left: 6px; }

/* Hero: centred copy, the podium as the product shot. */
.hero { max-width: 1080px; margin: 0 auto; padding: 72px 24px 8px; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border: 1px solid var(--line); border-radius: 999px; font: 500 14px var(--font); color: var(--muted); box-shadow: var(--shadow); }
.pill .pip { margin: -4px 0; }
.hero h1 { text-wrap: balance; font-size: clamp(44px, 6vw, 80px); line-height: 1.04; letter-spacing: -0.032em; margin: 26px auto 22px; max-width: 980px; }
.lede { text-wrap: pretty; font-size: 19px; line-height: 1.6; color: var(--muted); margin: 0 auto 30px; max-width: 640px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.more { display: inline-block; margin-top: 28px; color: var(--muted); text-decoration: none; font-size: 16px; }
.more:hover { color: var(--ink); }

.scene { position: relative; max-width: 900px; margin: 30px auto 110px; padding: 40px 24px 0; }
.scene::before { content: ""; position: absolute; left: 50%; top: 0; width: min(760px, 100vw); height: 520px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(31, 146, 84, .13), rgba(31, 146, 84, 0)); pointer-events: none; }
.scene::after { content: ""; position: absolute; left: 50%; bottom: -26px; width: 92%; height: 52px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(17, 18, 20, .12), rgba(17, 18, 20, 0)); }
.podium { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px; align-items: end; max-width: 700px; margin: 0 auto; }
.place { display: flex; flex-direction: column; align-items: center; }
.mini-frame { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.mini-frame .screen { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.mini-cap { font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 6px; font: 500 13px var(--font); padding: 8px 4px 2px; white-space: nowrap; }
.mini-cap span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.wf { position: absolute; inset: 0; padding: 10%; display: flex; flex-direction: column; gap: 8%; }
.wf i { display: block; height: 7px; border-radius: 4px; background: #e3e6ea; }
.wf i.s { width: 70%; } .wf i.xs { width: 45%; }
.wf b { display: block; height: 14px; width: 46%; border-radius: 5px; margin-top: auto; }
.wf .img { display: block; border-radius: 6px; }
.wf.split { flex-direction: row; gap: 9%; } .wf.split .img { flex: 1; } .wf.split > div { flex: 1; display: flex; flex-direction: column; gap: 12%; }
.wf.stack .img { height: 40%; }
.dot { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(224, 87, 58, .4); z-index: 2; }
.plinth { width: 100%; margin-top: 14px; border-radius: 20px 20px 8px 8px; display: flex; flex-direction: column; align-items: center; padding-top: 18px; background: linear-gradient(180deg, #ffffff 0%, #f2f3f5 100%); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #fff, 0 30px 50px -34px rgba(17, 18, 20, .35); transform-origin: bottom; }
.plinth span { font: 600 56px/1 var(--display); letter-spacing: -0.04em; color: #c9cdd3; }
.plinth em { font: 600 13px var(--font); font-style: normal; color: var(--good); margin-top: 8px; }
.p1 .plinth { height: 196px; }
.p1 .plinth span { color: var(--good); }
.p2 .plinth { height: 140px; }
.p3 .plinth { height: 104px; }
.lift { width: 100%; display: flex; flex-direction: column; align-items: center; }
.lift .mini-frame { position: relative; z-index: 1; border-color: rgba(31, 146, 84, .5); box-shadow: 0 0 0 4px rgba(31, 146, 84, .12), 0 24px 60px -18px rgba(31, 146, 84, .45); margin-bottom: -2px; }
.lift .pip { display: block; margin-bottom: -10px; }

.scene.play .plinth { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.scene.play .p2 .plinth { animation-delay: .15s; } .scene.play .p1 .plinth { animation-delay: .3s; } .scene.play .p3 .plinth { animation-delay: .22s; }
.scene.play .p2 > .mini-frame { animation: drop .6s ease-out .75s both; }
.scene.play .p3 > .mini-frame { animation: drop .6s ease-out .85s both; }
.scene.play .lift { animation: hoist 1s cubic-bezier(.3, 1.35, .5, 1) 1.05s both; }
.scene.play .dot { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) var(--dd) both; }
.scene.play .lift .mini-frame { animation: float 3.2s ease-in-out 2.2s 2 alternate both; }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-28px); } }
@keyframes hoist { from { opacity: 0; transform: translateY(80px); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes float { to { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .scene.play * { animation: none !important; } }

/* Storyline: one chapter per screen, the page background follows the mood. */
.story { max-width: 880px; margin: 0 auto; padding: 0 24px; text-align: center; }
.chapter { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8vh 0; }
.ch-label { font: 600 14px var(--font); color: var(--muted); margin: 0; }
.chapter h2 { font-size: clamp(36px, 4.8vw, 62px); line-height: 1.05; letter-spacing: -0.035em; margin: 14px 0 16px; max-width: 760px; text-wrap: balance; }
.ch-sub { font-size: 19px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 560px; text-wrap: pretty; }
.ch-visual { position: relative; margin-top: 48px; width: min(540px, 100%); }
.story.armed .chapter > * { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.story.armed .chapter:not(.in) > * { opacity: 0; transform: translateY(18px); }
.story.armed .chapter > :nth-child(2) { transition-delay: .08s; } .story.armed .chapter > :nth-child(3) { transition-delay: .16s; } .story.armed .chapter > :nth-child(4) { transition-delay: .26s; }

/* 01 – a fan of ten variants */
.fan { height: 170px; }
.fan span { position: absolute; left: calc(50% - 46px + (var(--k) - 4.5) * 46px); top: 20px; width: 92px; height: 122px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(calc((var(--k) - 4.5) * 4deg)) translateY(calc((var(--k) - 4.5) * (var(--k) - 4.5) * 1.2px)); }
.fan span::before { content: ""; position: absolute; inset: 10px 10px auto; height: 40px; border-radius: 7px; background: var(--c, #e3e6ea); }
.fan span::after { content: ""; position: absolute; left: 10px; bottom: 12px; width: 44%; height: 12px; border-radius: 6px; background: #111214; opacity: .85; }
.fan span:nth-child(1) { --c: #f3c9bc; } .fan span:nth-child(2) { --c: #f2d39b; } .fan span:nth-child(3) { --c: #c9d3e6; } .fan span:nth-child(4) { --c: #d8c9e0; } .fan span:nth-child(5) { --c: #bfe3cc; }
.fan span:nth-child(6) { --c: #f6d7cf; } .fan span:nth-child(7) { --c: #cfe1f5; } .fan span:nth-child(8) { --c: #e9e2c4; } .fan span:nth-child(9) { --c: #d7e8df; } .fan span:nth-child(10) { --c: #ead1e1; }
.chapter.in .fan span { animation: deal .7s cubic-bezier(.2, .9, .2, 1) calc(.3s + var(--k) * .06s) both; }
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(0); } }

/* 02 – three equally plausible variants */
.doubt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.doubt div { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.doubt div::before { content: ""; position: absolute; inset: 14px 14px auto; height: 38%; border-radius: 8px; background: #dfe4ec; }
.doubt div::after { content: ""; position: absolute; left: 14px; bottom: 16px; width: 46%; height: 14px; border-radius: 7px; background: #111214; }
.doubt .q { position: absolute; top: -16px; right: -10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #111214; color: #fff; font: 600 17px var(--display); box-shadow: var(--shadow); }
.chapter.in .doubt .q { animation: bob 2.4s ease-in-out infinite; }
.doubt div:nth-child(2) .q { animation-delay: .3s; } .doubt div:nth-child(3) .q { animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* 03 – friction tags on one screen */
.friction { display: flex; justify-content: center; }
.friction .ph { position: relative; width: 250px; height: 320px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.friction i { display: block; height: 9px; border-radius: 5px; background: #e3e6ea; } .friction i.s { width: 60%; }
.friction u { display: block; height: 36px; border-radius: 9px; border: 1px solid #dfe2e6; }
.friction b { display: block; height: 40px; border-radius: 20px; background: #111214; margin-top: auto; }
.friction .tag { position: absolute; white-space: nowrap; font: 600 13px var(--font); color: #fff; background: var(--accent); padding: 7px 12px 7px 26px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(224, 87, 58, .6); }
.friction .tag::before { content: ""; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #fff; }
.chapter.in .friction .tag { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) calc(.6s + var(--t) * .35s) both; }

/* 04 – Pip walks the flow */
.walk { height: 150px; }
.walk .track { position: absolute; left: 6%; right: 6%; bottom: 22px; display: flex; justify-content: space-between; border-top: 2px dashed #c9d2e3; }
.walk .stop { position: relative; top: -9px; font: 500 13px var(--font); color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 0; white-space: nowrap; }
.walk .stop::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #c9d2e3; }
.chapter.in .walk .stop::before { animation: reach .3s ease both; }
.walk .stop:nth-child(1)::before { animation-delay: .5s; } .walk .stop:nth-child(2)::before { animation-delay: 1.3s; } .walk .stop:nth-child(3)::before { animation-delay: 2.1s; } .walk .stop:nth-child(4)::before { animation-delay: 2.9s; }
@keyframes reach { to { background: var(--good); border-color: var(--good); } }
.walk .walker { position: absolute; left: 6%; bottom: 50px; transform: translateX(-50%); }
.chapter.in .walk .walker { animation: stroll 2.6s cubic-bezier(.45, 0, .35, 1) .4s both; }
.chapter.in .walk .walker .pip { animation: walk .45s ease-in-out 6; transform-origin: 50% 90%; }
@keyframes stroll { from { left: 6%; } to { left: 94%; } }
.walk .walker { left: 94%; }

/* 05 – numbers per step */
.steps { display: grid; gap: 12px; text-align: left; }
.steps .row { display: grid; grid-template-columns: 110px 1fr; gap: 6px 16px; align-items: center; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.steps .row span { font: 600 15px var(--font); }
.steps .row em { font: 500 14px var(--font); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.steps .row i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--good), var(--good)) 0 0 / var(--w) 100% no-repeat, var(--surface-2); }
.steps .row.bad i { background: linear-gradient(90deg, var(--accent), var(--accent)) 0 0 / var(--w) 100% no-repeat, var(--surface-2); }
.steps .row.bad em { color: var(--accent); }
.chapter.in .steps .row i { animation: grow 1.1s cubic-bezier(.2, .8, .2, 1) calc(.5s + var(--r) * .25s) both; }
@keyframes grow { from { background-size: 0 100%, auto; } }

/* 06 – the ranking */
.ranks { display: grid; gap: 10px; text-align: left; }
.ranks .rk { display: grid; grid-template-columns: 34px 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.ranks .rk b { font: 600 22px var(--display); color: #c9cdd3; }
.ranks .rk span { font: 600 15px var(--font); }
.ranks .rk em { font: 500 14px var(--font); font-style: normal; color: var(--muted); }
.ranks .rk i { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #e0573a, #e7b34d 50%, var(--good)) 0 0 / 100% 100% no-repeat; clip-path: inset(0 calc(100% - var(--w)) 0 0); }
.ranks .rk.win { border-color: rgba(31, 146, 84, .45); box-shadow: 0 0 0 4px rgba(31, 146, 84, .1), 0 18px 40px -18px rgba(31, 146, 84, .45); }
.ranks .rk.win b, .ranks .rk.win em { color: var(--good); }
.ranks .rk.dim { opacity: .55; }
.chapter.in .ranks .rk { animation: drop .6s ease-out calc(.4s + var(--r) * .15s) both; }
.chapter.in .ranks .rk i { animation: fill 1.2s cubic-bezier(.2, .8, .2, 1) calc(.8s + var(--r) * .15s) both; }
@keyframes fill { from { clip-path: inset(0 100% 0 0); } }

/* 07 – sharing */
.share { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.share .link { font: 500 15px var(--font); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px; box-shadow: var(--shadow); }
.share .bubble { display: flex; align-items: center; gap: 10px; font: 500 15px var(--font); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px 16px 10px 10px; box-shadow: var(--shadow); }
.share .b1 { align-self: flex-start; margin-left: 4%; } .share .b2 { align-self: flex-end; margin-right: 8%; }
.share .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 13px var(--font); }
.chapter.in .share .b1 { animation: drop .6s ease-out .6s both; } .chapter.in .share .b2 { animation: drop .6s ease-out 1.3s both; }

/* 08 – finale on dark */
.finale h2 { font-size: clamp(42px, 6vw, 80px); margin-bottom: 34px; }
html[data-mood-dark] .story { color: #fff; }
html[data-mood-dark] .story .ch-label, html[data-mood-dark] .story .ch-sub { color: #a3a8b0; }
.finale .btn.primary.inverse { background: #fff; color: #111214; }
html:not([data-mood-dark]) .finale .btn.primary.inverse { background: #111214; color: #fff; }
html[data-mood-dark] .finale .btn.ghost { background: transparent; color: #fff; border-color: #3a3d43; }
@media (prefers-reduced-motion: reduce) {
  .story.armed .chapter > * { transition: none; }
  .story .chapter * { animation: none !important; }
  body { transition: none; }
}

/* Pip outside the hero */
.pip-walk { display: inline-block; vertical-align: middle; margin-right: 10px; animation: walk 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes walk { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pip-walk { animation: none; } }


/* Panels and forms */
.panel { max-width: 1120px; margin: 0 auto 32px; padding: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.panel h2 { font-size: clamp(36px, 4vw, 52px); line-height: 1; margin: 0 0 22px; }
label { display: block; font: 600 13px var(--font); margin: 22px 0 8px; }
input[type=text], input[type=email], input[type=number], textarea, select { width: 100%; padding: 14px 16px; border: 1px solid #dfe2e6; border-radius: 12px; font: 400 15px var(--font); background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17, 18, 20, .04); }
textarea { font-family: var(--mono); font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: transparent; }
.adv { margin-top: 16px; }
.adv summary { cursor: pointer; color: var(--muted); font: 500 14px var(--font); }
.adv-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.or { color: var(--muted); font: 500 13px var(--font); margin: 0 6px 0 12px; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.plan { border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; background: var(--surface); }
.plan.featured { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.plan.featured ul, .plan.featured .price span { color: #b8b0a3; }
.plan.featured .btn.primary { background: #e7b34d; color: var(--ink); }
.plan-tag { font: 600 12px var(--font); color: var(--muted); }
.plan.featured .plan-tag { color: #e7b34d; }
.plan h3 { font: 600 34px var(--display); margin: 6px 0 0; }
.plan .price { font: 600 34px var(--font); letter-spacing: -0.02em; margin: 4px 0 12px; }
.plan .price span { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.plan ul { padding-left: 18px; color: var(--muted); font-size: 15px; flex: 1; }

.recent-row { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 15px; }
.recent-row:hover .g { text-decoration: underline; }
.recent-row .muted { font-variant-numeric: tabular-nums; font: 500 13px var(--font); }

dialog { border: 0; border-radius: 22px; padding: 32px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(28, 26, 23, .45); }
dialog h3 { font: 600 32px var(--display); margin: 0 0 6px; }

.foot { font-variant-numeric: tabular-nums; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); font: 500 13px var(--font); padding: 40px 16px 60px; }

/* Report */
#report { max-width: 1280px; margin: 0 auto; padding: 16px 40px 40px; }
.r-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.r-head h1 { margin: 0 0 10px; font-size: clamp(38px, 4vw, 56px); line-height: 1; }
.r-head .goal { font-variant-numeric: tabular-nums; color: var(--muted); font: 500 13px var(--font); }
.r-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.verdict { background: var(--surface); border-radius: 18px; padding: 26px 28px; margin-bottom: 26px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.verdict .big { font: 600 34px/1.1 var(--display); }
.verdict .note { font-size: 14px; color: var(--muted); }
.flag { display: inline-block; font: 600 12px var(--font); padding: 5px 9px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin: 0 6px 4px 0; }
.flag.good { background: var(--good-soft); color: var(--good); }
.flag.bad { background: var(--accent-soft); color: var(--accent); }

.rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 34px; }
.vcard { align-self: start; background: var(--surface); border: 0; border-radius: 10px; padding: 0 0 4px; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); transition: transform .2s; }
.vcard::before { content: ""; display: block; height: 10px; background: var(--muted); margin-bottom: 16px; }
.vcard.best::before { background: var(--good); }
.vcard:has(.stum.bad)::before { background: var(--accent); }
.vcard:has(.stum.mid)::before { background: #e7b34d; }
.vcard:hover { transform: translateY(-3px); }
.vcard.sel { outline: 2px solid var(--ink); outline-offset: 3px; }
.vcard .pos, .vcard .url, .vcard .kv, .vcard .running, .vcard > div:not([class]), .vcard > .muted { margin-left: 18px; margin-right: 18px; }
.vcard .pos { font: 600 12px var(--font); color: var(--muted); }
.vcard .name { font: 600 32px/1.1 var(--display); margin: 4px 18px 2px; }
.vcard .url { font-variant-numeric: tabular-nums; font: 400 12px var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .stum { font: 600 15px var(--font); margin: 12px 18px 10px; }
.vcard img { width: calc(100% - 36px); margin: 14px 18px 14px; height: 120px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); display: block; }
.vcard .running { margin-bottom: 18px; }
.kv { display: grid; grid-template-columns: 1fr auto; font-size: 13px; gap: 4px 10px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv b { font-variant-numeric: tabular-nums; font: 500 13px var(--font); }
.running { color: var(--muted); font-size: 13px; }
.running .log { font: 400 12px var(--mono); margin-top: 6px; max-height: 92px; overflow: hidden; }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 8px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bad { color: var(--accent); } .mid { color: var(--warn); } .good { color: var(--good); }

.detail h2 { font-size: 44px; line-height: 1; margin: 0 0 6px; }
.step { display: grid; grid-template-columns: 360px 1fr; gap: 26px; background: var(--surface); border-radius: 18px; padding: 22px; margin: 16px 0; box-shadow: var(--shadow); }
.shot { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); align-self: start; background: var(--surface-2); }
.shot img { display: block; width: 100%; }
.marker { position: absolute; border: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 5px rgba(217, 96, 63, .22); pointer-events: none; }
.step h3 { margin: 0 0 2px; font: 600 30px/1.1 var(--display); }
.metrics { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; margin: 10px 0 16px; }
.metrics b { font-variant-numeric: tabular-nums; font: 500 14px var(--font); }
.stumbles { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.stumbles li { font-size: 14px; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); }
.stumbles li.effort { background: var(--warn-soft); }
.stumbles li small { font: 600 11px var(--font); margin-right: 10px; opacity: .7; }
.none { font-size: 14px; color: var(--good); font-weight: 600; margin-bottom: 14px; }
.sub { font: 600 12px var(--font); color: var(--muted); margin: 18px 0 8px; }
.wt { display: grid; grid-template-columns: 1fr 120px 44px; gap: 4px 12px; align-items: center; font-size: 13px; }
.wt b { font-variant-numeric: tabular-nums; font: 500 13px var(--font); }
.wt .why { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--good); }
.bar i.lo { background: var(--accent); } .bar i.md { background: #e7b34d; }
.qs { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.qs li { padding: 3px 0; }
.qs .src { font-variant-numeric: tabular-nums; font: 400 11px var(--font); color: var(--muted); }
table.acts { width: 100%; border-collapse: collapse; font-size: 13px; }
table.acts td, table.acts th { text-align: left; padding: 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.acts th { color: var(--muted); font: 600 12px var(--font); }
table.acts code { font: 400 11px var(--mono); color: var(--muted); }
details.more summary { cursor: pointer; font: 500 13px var(--font); color: var(--muted); margin-top: 12px; }
.final { display: flex; gap: 16px; align-items: center; background: var(--good-soft); border-radius: 14px; padding: 16px 20px; margin: 16px 0; font-size: 15px; }
.failbox { background: var(--accent-soft); border-radius: 14px; padding: 16px 20px; margin: 16px 0; font-size: 14px; }

.validate table { width: 100%; border-collapse: collapse; font-size: 14px; }
.validate td, .validate th { padding: 8px; border-top: 1px solid var(--line); text-align: left; }
.validate th { font: 600 12px var(--font); color: var(--muted); }
.validate input { width: 120px; padding: 8px 10px; }
.vresult { margin-top: 14px; font-size: 15px; }
.limits { font-size: 14px; color: var(--muted); }
.limits li { margin: 4px 0; }

@media (max-width: 1080px) {
  .top { grid-template-columns: 1fr auto; padding: 18px 24px; }
  .top nav { display: none; }
}
@media (max-width: 760px) {
  .hero { padding: 36px 16px 0; }
  .hero h1 { font-size: 44px; }
  .pill { font-size: 13px; }
  .lede { font-size: 18px; }
  .scene { padding: 20px 8px 0; margin-bottom: 80px; }
  .podium { gap: 10px; }
  .mini-frame { padding: 5px; border-radius: 12px; }
  .mini-cap { font-size: 11px; flex-direction: column; align-items: center; gap: 0; }
  .lift .pip { width: 84px; height: 84px; }
  .plinth span { font-size: 40px; }
  .p1 .plinth { height: 150px; } .p2 .plinth { height: 108px; } .p3 .plinth { height: 80px; }
  .cmd { font-size: 14px; padding: 16px 18px; }
  .plans, .adv-grid { grid-template-columns: 1fr; }
  .chapter { min-height: 76vh; padding: 6vh 0; }
  .ch-sub { font-size: 17px; }
  .ch-visual { margin-top: 36px; }
  .fan span { width: 64px; height: 86px; left: calc(50% - 32px + (var(--k) - 4.5) * 28px); }
  .fan span::before { height: 26px; inset: 7px 7px auto; } .fan span::after { height: 9px; bottom: 9px; left: 7px; }
  .doubt { gap: 12px; }
  .friction .tag { font-size: 12px; }
  .walk .stop { font-size: 11px; }
  .panel { margin: 0 12px 20px; padding: 26px 18px; border-radius: 18px; }
  .step { grid-template-columns: 1fr; }
  #report { padding: 8px 16px 40px; }
  .recent-row { grid-template-columns: 1fr; gap: 2px; }
  .ver { display: none; }
  .top { padding: 16px; }
}
.pip-inline { vertical-align: middle; margin-right: 8px; }

/* Tool names with their marks inline, in their own colours. Names stay for clarity. */
.tool { white-space: nowrap; }
.tool img { width: auto; height: .95em; margin: 0 .3em 0 .1em; vertical-align: -.12em; }
