:root {
  --bg: #0b0614;
  --fg: #f6f1ff;
  --muted: #a99cc4;
  --g1: #ff3d8b;
  --g2: #8b5cf6;
  --g3: #22d3ee;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
main { flex: 1; display: flex; position: relative; overflow: hidden; }
[hidden] { display: none !important; }

.screen {
  margin: auto; width: 100%; max-width: 440px; padding: 32px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; color: var(--muted); margin: 0; }
h1 { font-size: clamp(56px, 18vw, 84px); line-height: .9; margin: 0; font-weight: 900; letter-spacing: -.03em; }
.grad {
  background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
form { display: flex; flex-direction: column; gap: 12px; }
input#addr {
  font: inherit; font-size: 16px; padding: 16px; border-radius: 14px;
  border: 1px solid #2c2140; background: #150d24; color: var(--fg); outline: none;
}
input#addr:focus { border-color: var(--g2); }
.chains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chains label { flex: 1; }
.chains input { display: none; }
.chains span {
  display: block; text-align: center; padding: 12px; border-radius: 12px;
  border: 1px solid #2c2140; cursor: pointer; color: var(--muted);
}
.chains input:checked + span { border-color: var(--g2); color: var(--fg); background: #1d1233; }
button[type=submit], .btn {
  font: inherit; font-weight: 800; font-size: 17px; border: 0; cursor: pointer;
  padding: 16px; border-radius: 14px; color: #fff; text-decoration: none; text-align: center;
  background: linear-gradient(90deg, var(--g1), var(--g2));
}
.btn.ghost { background: #1d1233; border: 1px solid #3a2a59; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: #ff8fa3; margin: 0; }

.bar { height: 10px; border-radius: 99px; background: #1d1233; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--g1), var(--g3)); transition: width .3s; }

/* story */
#story { position: absolute; inset: 0; display: flex; flex-direction: column; }
.progress { display: flex; gap: 4px; padding: 12px 16px 0; max-width: 520px; width: 100%; margin: 0 auto; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: #2c2140; }
.progress i.on { background: var(--fg); }
.banner { margin: 10px auto 0; max-width: 488px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: #ffd18f; background: #2a1a0b; border: 1px solid #5a3a12; }
#slides { flex: 1; position: relative; }
.slide {
  position: absolute; inset: 0; padding: 28px 24px 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  max-width: 520px; margin: 0 auto;
  opacity: 0; transform: translateX(30px); pointer-events: none;
  transition: opacity .35s, transform .35s;
}
.slide.active { opacity: 1; transform: none; pointer-events: auto; }
.slide::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; opacity: .35; filter: blur(60px);
  background: radial-gradient(circle at 20% 20%, var(--a, var(--g1)), transparent 45%),
              radial-gradient(circle at 80% 70%, var(--b, var(--g2)), transparent 50%);
}
.slide .big { font-size: clamp(56px, 20vw, 104px); font-weight: 900; line-height: .95; letter-spacing: -.04em; margin: 0; word-break: break-word; }
.slide .hero { font-size: clamp(44px, 13vw, 72px); font-weight: 900; line-height: .95; letter-spacing: -.03em; margin: 0; }
.slide .mid { font-size: clamp(30px, 9vw, 44px); font-weight: 850; line-height: 1.05; margin: 0; word-break: break-word; }
.slide p { margin: 0; font-size: 18px; line-height: 1.4; }
.slide .sub { color: var(--muted); font-size: 15px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; align-items: baseline; gap: 14px; font-size: 26px; font-weight: 800; }
.list li b { font-size: 40px; width: 1.2em; color: var(--muted); }
.list li small { margin-left: auto; font-size: 14px; color: var(--muted); font-weight: 500; }
canvas { width: 100%; max-width: 360px; aspect-ratio: 1 / 1; border-radius: 18px; align-self: center; box-shadow: 0 20px 60px #0008; }
.actions { display: flex; gap: 10px; }
.actions > * { flex: 1; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #ffffff14; color: var(--fg); font-size: 26px; line-height: 1;
}
.nav.prev { left: 8px; } .nav.next { right: 8px; }
@media (max-width: 600px) { .nav { display: none; } }

footer { text-align: center; padding: 12px; font-size: 12px; color: var(--muted); }
footer a { color: var(--fg); }
.actions { flex-wrap: wrap; }
.actions [hidden] { display: none; }
#share { flex-basis: 100%; }

/* nav: yearly recap and quantum check side by side */
nav.top { display: flex; justify-content: center; gap: 8px; padding: 14px 16px 0; position: relative; z-index: 3; }
nav.top a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 10px 16px; border-radius: 99px; border: 1px solid #2c2140; background: #150d24;
}
nav.top a[aria-current=page] { color: var(--fg); background: #1d1233; border-color: var(--g2); }
nav.top a.q { color: var(--fg); border-color: #3a2a59; }
nav.top a.q[aria-current=page] { border-color: var(--g3); box-shadow: 0 0 0 1px var(--g3) inset; }
nav.top a b {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin-left: 6px; padding: 2px 6px; border-radius: 99px;
  color: #0b0614; background: linear-gradient(90deg, var(--g3), var(--g2)); vertical-align: 2px;
}

/* quantum check */
body.page main { overflow: visible; }
.qcard { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; background: #150d24; border: 1px solid #2c2140; }
.qcard p { margin: 0; line-height: 1.45; }
.qaddr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; }
.risk { display: flex; align-items: baseline; gap: 12px; font-size: clamp(40px, 12vw, 56px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.risk span { font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.risk-low { color: #34d399; }
.risk-medium { color: #fbbf24; }
.risk-high { color: #ff6b8b; }
.risk-depends { color: var(--g3); }
.today { font-size: 14px; color: var(--muted); margin-top: -4px !important; }
.why { font-size: 17px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: #1d1233; border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.fix { font-size: 15px; }
.explain { color: var(--muted); font-size: 14px; }
.explain summary { cursor: pointer; color: var(--fg); }
.explain p { margin: 10px 0 0; line-height: 1.5; }
button:disabled { opacity: .6; cursor: progress; }

/* period switch: this year or the whole history */
.period { width: calc(100% - 48px); max-width: 392px; margin: 12px auto 0; position: relative; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 99px; background: #150d24; border: 1px solid #2c2140; }
.period input { position: absolute; opacity: 0; pointer-events: none; }
.period span { display: block; text-align: center; padding: 8px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.period input:checked + span { color: var(--fg); background: #1d1233; box-shadow: 0 0 0 1px var(--g2) inset; }
.period input:focus-visible + span { outline: 2px solid var(--g3); outline-offset: 2px; }
.slide p.hint { font-size: 13px; color: var(--muted); }
.slide .hint a { color: var(--muted); }
.linkish { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
