:root {
  --paper: #f1efe8;
  --panel: #fbfaf6;
  --ink: #1d1b17;
  --ink-2: #57524a;
  --line: #d3cebf;
  --gold: #a18a3c;
  --gold-hi: #dbc87a;
  --asphalt: #1d1b17;
  --r1: #4f8a63; --r2: #93a654; --r3: #d6a936; --r4: #d27a32; --r5: #bb3a30;
  --font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold-hi); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1; }
h1 { font-size: clamp(2.9rem, 6.6vw, 5.6rem); font-weight: 800; letter-spacing: -.005em; max-width: 17ch; text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 700; }
h3 { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
p { margin: 0 0 1rem; max-width: 64ch; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1.5rem; padding: .65rem clamp(1rem, 4vw, 3rem); background: var(--asphalt); color: #f4f1e8; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.6rem; text-decoration: none; }
.top nav { display: flex; gap: 1.5rem; margin-left: auto; }
.top nav a { text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--gold-hi); }

.btn { display: inline-block; font: 600 1.05rem var(--font); padding: .75rem 1.3rem; border-radius: 999px; border: 2px solid var(--gold-hi); text-decoration: none; cursor: pointer; transition: transform .15s, background-color .15s, color .15s; }
.btn.solid { background: var(--gold-hi); color: var(--ink); }
.btn.solid:hover { background: #ecdb93; transform: translateY(-2px); }
.btn.ghost { color: #f4f1e8; }
.btn.ghost:hover { background: #f4f1e8; color: var(--ink); border-color: #f4f1e8; }
.actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; max-width: none; }

/* hero: asphalt with a moving lane line */
.hero { background: var(--asphalt); color: #f4f1e8; position: relative; overflow: hidden; }
.hero-inner { max-width: 84rem; margin: 0 auto; padding: clamp(3.5rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem) clamp(5rem, 10vw, 8rem); position: relative; z-index: 1; }
.lede { font-size: 1.25rem; margin-top: 1.6rem; max-width: 58ch; color: #e2ddd0; }
.fine { color: #b9b3a3; font-size: .95rem; margin-top: 1.4rem; }
.lane { position: absolute; left: 0; right: 0; bottom: 1.4rem; width: 100%; height: 2.2rem; }
.lane path { stroke: var(--gold-hi); stroke-width: 7; stroke-dasharray: 70 50; fill: none; animation: drive 1.6s linear infinite; }
@keyframes drive { to { stroke-dashoffset: -120; } }

.band { max-width: 84rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem); }
.band + .band { border-top: 2px solid var(--ink); }
.band-head { margin-bottom: 2.2rem; }
.band-head h2 { margin-bottom: .8rem; }
.band-head p { color: var(--ink-2); font-size: 1.1rem; }

/* calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend { font-family: var(--display); font-weight: 700; font-size: 1.45rem; padding: 0; margin-bottom: .6rem; }
legend span { display: block; font: 400 .95rem var(--font); color: var(--ink-2); }
.inputs label { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .55rem 0; border-top: 1px solid var(--line); font-weight: 500; }
.inputs output { font-family: var(--display); font-weight: 700; font-size: 1.3rem; min-width: 1.2ch; text-align: right; }
.inputs input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--gold); height: 1.6rem; margin: 0; cursor: pointer; }
.presets { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; max-width: none; }
.presets button { font: 500 .95rem var(--font); background: var(--panel); border: 1.5px solid var(--ink); border-radius: 999px; padding: .35rem .85rem; cursor: pointer; transition: background-color .15s, color .15s; }
.presets button:hover { background: var(--ink); color: #fff; }

.outcome { position: sticky; top: 5.5rem; }
.matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-width: 30rem; }
.cell { aspect-ratio: 1.25; border-radius: 6px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: #fff; background: var(--c); opacity: .32; transition: opacity .25s, transform .25s cubic-bezier(.2, 1.4, .4, 1), box-shadow .25s; }
.cell.row, .cell.col { opacity: .62; }
.cell.on { opacity: 1; transform: scale(1.14); box-shadow: 0 0 0 3px var(--ink), 0 10px 22px rgb(0 0 0 / .28); z-index: 1; }
[data-r="1"] { --c: var(--r1); } [data-r="2"] { --c: var(--r2); } [data-r="3"] { --c: var(--r3); } [data-r="4"] { --c: var(--r4); } [data-r="5"] { --c: var(--r5); }
.axis { color: var(--ink-2); font-size: .9rem; margin: .8rem 0 1.5rem; }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; padding: 1.1rem 1.3rem; max-width: 34rem; }
.risk-num { margin: 0; width: 5.2rem; height: 5.2rem; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 3.4rem; line-height: 1; transition: background-color .25s; }
.risk-num.bump span { display: inline-block; animation: bump .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { from { transform: scale(.5); } }
.risk-name { font-family: var(--display); font-weight: 700; font-size: 1.7rem; margin: 0 0 .2rem; line-height: 1.1; }
.verdict p { margin: 0 0 .25rem; }
#risk-why { color: var(--ink-2); font-size: .97rem; }
.decision { font-weight: 600; }

/* route */
.route { list-style: none; counter-reset: stop; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.6rem 0; }
.route li { counter-increment: stop; position: relative; padding: 3.4rem 1.2rem 0 0; }
.route li::before { content: counter(stop); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ink); color: var(--gold-hi); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.3rem; z-index: 1; transition: background-color .3s, color .3s, transform .3s; }
.route li::after { content: ""; position: absolute; top: 1.05rem; left: 2.4rem; right: 0; height: 5px; background: repeating-linear-gradient(90deg, var(--gold) 0 18px, transparent 18px 30px); }
.route li:last-child::after { display: none; }
.route li.in::before { background: var(--gold-hi); color: var(--ink); transform: scale(1.12); }
.route p { margin: .4rem 0 0; color: var(--ink-2); }

/* workbench */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--ink); box-shadow: 0 16px 30px rgb(29 27 23 / .18); transition: transform .3s; }
.shots figure:hover img { transform: translateY(-5px); }
.shots figcaption { margin-top: .7rem; color: var(--ink-2); font-size: .95rem; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 2.2rem; }
.features article { border-top: 4px solid var(--gold); padding-top: .9rem; }
.features p { margin: .5rem 0 0; color: var(--ink-2); font-size: 1rem; }

.limits ul { margin: 1.5rem 0 0; padding: 0; list-style: none; max-width: 70ch; }
.limits li { padding: 1rem 0; border-top: 1px solid var(--line); }

.foot { background: var(--asphalt); color: #b9b3a3; padding: 2.2rem clamp(1rem, 4vw, 3rem) 3rem; }
.foot p { max-width: none; margin: 0 0 .4rem; }
.foot a { color: #f4f1e8; }

.js .rise { opacity: 0; transform: translateY(22px); transition: opacity .6s, transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--rd, 0s); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 62rem) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .outcome { position: static; }
  .route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top nav a:not(:first-child) { display: none; }
}
@media (max-width: 36rem) {
  .shots, .features { grid-template-columns: minmax(0, 1fr); }
  .route { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .route li { padding: .3rem 0 1.8rem 3.4rem; }
  .route li::after { top: 2.4rem; bottom: 0; left: 1.05rem; right: auto; width: 5px; height: auto; background: repeating-linear-gradient(180deg, var(--gold) 0 12px, transparent 12px 20px); }
  .verdict { grid-template-columns: minmax(0, 1fr); }
  .cell { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rise { opacity: 1; transform: none; }
}
