:root {
  --paper: #FFFFFF;
  --paper-2: #F4F5F9;
  --ink: #101B3A;
  --ink-2: #5A6480;
  --rule: #DCE0EA;
  --honey: #E1961F;
  --honey-deep: #8A5A0E;
  --honey-tint: #FFF1D3;
  --ok: #2E7D4F;
  --term-bg: #0F1729;
  --term-fg: #E6ECF5;
  --display: "Bricolage Grotesque", "Arial Black", Impact, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0E1322; --paper-2: #161C2E; --ink: #EEF0F6; --ink-2: #A3ABC2;
    --rule: #2B3348; --honey: #F0A93A; --honey-deep: #F5C46B; --honey-tint: #3A2A10; --ok: #6CCB8F;
    --term-bg: #05080F; --term-fg: #E6ECF5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0E1322; --paper-2: #161C2E; --ink: #EEF0F6; --ink-2: #A3ABC2;
  --rule: #2B3348; --honey: #F0A93A; --honey-deep: #F5C46B; --honey-tint: #3A2A10; --ok: #6CCB8F;
  --term-bg: #05080F; --term-fg: #E6ECF5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.55;
  padding-inline: 20px; padding-block: 0; overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--honey-deep); }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1080px; margin-inline: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(30px, 4.6vw, 48px); }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--ink-2); }
.mark { background: linear-gradient(transparent 55%, var(--honey-tint) 55%); padding-inline: 2px; }
section { padding-block: 64px; border-top: 1px solid var(--rule); }
.kicker { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--honey-deep); }

/* progress */
.progress { position: fixed; left: 0; top: env(safe-area-inset-top, 0px); height: 3px; width: 100%; background: transparent; z-index: 20; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--honey); transition: width .08s linear; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; position: relative; z-index: 3; }
.nav .name { font-family: var(--display); font-weight: 800; font-size: 20px; text-decoration: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.nav a:not(.name) { text-decoration: none; font-weight: 700; }
.nav .lang { color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.nav .lang:hover { color: var(--ink); border-color: var(--ink); }

/* hero: the portrait is a cut-out figure standing on the section rule, clipped by the hero's bottom edge */
.hero { position: relative; overflow: hidden; min-height: 640px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; padding-block: 24px 72px; isolation: isolate; }
.hero .bg { position: absolute; top: 16px; bottom: 0; right: -16px; width: min(46%, 520px); z-index: -1; pointer-events: none; will-change: transform; }
.hero .bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
@media (max-width: 1000px) and (min-width: 761px) {
  /* narrower heroes: the figure keeps its natural size and stands on the rule with headroom instead of being cropped */
  .hero { min-height: 0; padding-bottom: 56px; }
  .hero .bg { top: auto; height: auto; }
  .hero .bg img { height: auto; }
}
.hero h1 { font-size: clamp(42px, 7vw, 86px); }
.hero h1 .nowrap { white-space: nowrap; }
.hero h1 .rot { display: inline-block; color: var(--honey-deep); border-bottom: 5px solid var(--honey); line-height: 1; padding-bottom: .02em; }
.hero h1 .rot.swap { animation: swap .45s ease; }
@keyframes swap { 0% { opacity: 1; transform: translateY(0); } 40% { opacity: 0; transform: translateY(-.25em); } 60% { opacity: 0; transform: translateY(.25em); } 100% { opacity: 1; transform: translateY(0); } }
.hero .lead { font-size: clamp(19px, 2.2vw, 23px); margin-top: 22px; max-width: 32ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .tag { position: absolute; left: 0; bottom: 28px; color: var(--ink-2); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; font-family: var(--body); font-size: 17px; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn:hover { border-color: var(--honey-deep); background: var(--honey-deep); color: #fff; }

/* chooser */
.chooser-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.score { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink-2); white-space: nowrap; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; }
.score b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pains { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
.pain { text-align: left; font-family: var(--body); font-size: 17px; font-weight: 700; padding: 12px 18px; border-radius: 999px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.pain:hover { border-color: var(--ink); transform: translateY(-1px); }
.pain[aria-pressed="true"] { border-color: var(--honey); background: var(--honey-tint); }
.pain.done::after { content: " ✓"; color: var(--ok); }
.answer { position: relative; margin-top: 28px; padding: 32px; border-radius: 24px; background: var(--paper-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 32px; align-items: start; overflow: hidden; }
.answer canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.answer .verdict { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 44px); line-height: 1.02; letter-spacing: -0.02em; }
.answer .verdict small { display: block; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--honey-deep); margin-bottom: 10px; }
.answer p { margin-top: 12px; }
.answer .go { align-self: end; }
.answer.pop { animation: pop .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }

/* numbers */
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 36px; }
.num { border-top: 3px solid var(--ink); padding-top: 16px; }
.num .v { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 8vw, 96px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.num .v sup { font-size: .45em; vertical-align: super; color: var(--honey-deep); }
.num .l { margin-top: 10px; font-weight: 700; }
.num .s { margin-top: 6px; font-size: 14px; color: var(--ink-2); }

/* timeline */
.tl-wrap { margin-top: 32px; overflow-x: auto; padding-bottom: 8px; }
.tl { display: block; min-width: 860px; width: 100%; height: auto; }
.tl .line { fill: none; stroke: var(--rule); stroke-width: 3; }
.tl .draw { fill: none; stroke: var(--honey); stroke-width: 3; stroke-linecap: round; }
.tl .dot { fill: var(--paper); stroke: var(--ink); stroke-width: 3; cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .2s ease, fill .2s ease; }
.tl .dot:hover, .tl .dot.on { fill: var(--honey); transform: scale(1.35); }
.tl .dot.hidden { transform: scale(0); }
.tl text { font-family: var(--body); font-size: 13px; font-weight: 700; fill: var(--ink); }
.tl text.y { fill: var(--ink-2); font-weight: 400; }
.tl-detail { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: start; padding: 24px; border-radius: 20px; background: var(--paper-2); min-height: 120px; }
.tl-detail h3 { font-size: clamp(22px, 2.8vw, 30px); }
.tl-detail .d { color: var(--honey-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-detail p { margin-top: 8px; }
.clock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.clock .c { padding: 20px; border: 1px solid var(--rule); border-radius: 20px; }
.clock .cv { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 5vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; }
.clock .cv small { font-size: .4em; color: var(--ink-2); font-weight: 700; margin-left: 4px; }
.clock .cl { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.clock .late { color: var(--honey-deep); font-weight: 700; }

/* method */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding-block: 22px; border-top: 1px solid var(--rule); align-items: baseline; }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--honey); }
.steps h3 { font-size: clamp(22px, 2.8vw, 30px); }
.steps p { margin-top: 8px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; margin-top: 36px; }
.two h3 { font-size: clamp(22px, 2.8vw, 28px); margin-bottom: 12px; }
.now { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.now li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.now .d { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--honey-deep); }
.now .in { display: inline-block; margin-left: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.now .in:empty { display: none; }

/* terminal */
.term { margin-top: 28px; border-radius: 16px; background: var(--term-bg); color: var(--term-fg); box-shadow: 0 20px 50px rgba(16,27,58,.18); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,.06); font-family: var(--mono); font-size: 13px; color: rgba(230,236,245,.6); }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.18); }
.term-bar i:first-child { background: #F26B5B; }
.term-bar i:nth-child(2) { background: #F5BE4F; }
.term-bar i:nth-child(3) { background: #5FC66B; }
.term-bar span { margin-left: 8px; }
.term-out { margin: 0; padding: 20px 20px 24px; font-family: var(--mono); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 300px; max-height: 520px; overflow-y: auto; }
.term-ps { color: #F5BE4F; }
.term-cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--term-fg); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-tries { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.try { font-family: var(--mono); font-size: 14px; font-weight: 600; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
.try:hover, .try[aria-pressed="true"] { border-color: var(--honey); background: var(--honey-tint); }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: start; }
.rows { display: grid; gap: 14px; margin-top: 8px; }
.row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-block: 12px; border-top: 1px solid var(--rule); }
.row .k { color: var(--ink-2); font-weight: 700; }
.row .v { font-weight: 700; overflow-wrap: anywhere; }
.copy { font-family: var(--body); font-size: 14px; font-weight: 700; padding: 8px 12px; border-radius: 999px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
.copy:hover { border-color: var(--ink); }
.not { margin-top: 24px; padding-left: 20px; }
.not li { margin-bottom: 8px; }
footer { border-top: 1px solid var(--rule); padding-block: 28px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }

/* 404 */
.nf { padding-block: 80px; }
.nf h1 { font-size: clamp(40px, 7vw, 80px); }
.nf p { margin-top: 20px; font-size: 19px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .answer.pop, .hero h1 .rot.swap, .term-cursor { animation: none; }
  .pain, .tl .dot, .progress i { transition: none; }
  .hero .bg { transform: none !important; }
}

@media (max-width: 760px) {
  body { padding-inline: 16px; font-size: 16px; }
  .nav ul { display: none; }
  .nav .lang { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-block: 16px 0; }
  .hero .bg { position: relative; order: 2; top: auto; bottom: auto; right: auto; height: auto; width: min(72%, 320px); margin: 28px 0 -18% auto; }
  .hero .bg img { height: auto; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .hero .tag { display: none; }
  .chooser-head { grid-template-columns: 1fr; }
  .answer { grid-template-columns: 1fr; padding: 24px; }
  .nums, .two, .contact, .clock { grid-template-columns: 1fr; gap: 28px; }
  .tl-detail { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); }
  .steps li::before { font-size: 32px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .term-out { font-size: 13px; min-height: 240px; }
  section { padding-block: 48px; }
}

/* spacing utilities (CSP forbids inline style attributes) */
.mt14 { margin-top: 14px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }
.bold { font-weight: 700; }
.small { font-size: 15px; }
