@property --h { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
:root {
  --paper: #F3F5FB; --paper-2: #E4E9F7; --ink: #16184A; --ink-2: #4B4F80; --line: #C5CCE6;
  --blue: #2B39F5; --on-blue: #fff; --tag: #FFD23F; --on-tag: #16184A; --yes: #0A7F62; --no: #B3261E; --stage: #DFE5F6; --mat: #EEF1FA;
  --glow: #FF3D9A; --ambient: .16;
  --c-top: #3D4063; --c-side: #24263F; --c-front: #191A30; --c-edge: #575B85;
  --spring: linear(0, .32 8%, .86 20%, 1.09 31%, 1.04 43%, .99 58%, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --display: "Anybody", "Arial Black", sans-serif; --body: "Figtree", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0E1038; --paper-2: #181B50; --ink: #EEF0FF; --ink-2: #AEB3E0; --line: #30347C;
  --blue: #8C96FF; --on-blue: #0E1038; --yes: #4FE0B5; --no: #FF9A8F; --stage: #1C1F63; --mat: #262A80; --ambient: .5;
  color-scheme: dark;
}
[data-case="white"] { --c-top: #FFFFFF; --c-side: #ECEEF6; --c-front: #D6DAEA; --c-edge: #A4ABCB; }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 1rem/1.5 var(--body); color: var(--ink); background: var(--paper); min-height: 100dvh; overflow-x: hidden; transition: background .5s, color .5s; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1:focus, h2:focus { outline: none; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; z-index: 5; }
.skip:focus { left: 8px; }

.app { max-width: 1080px; margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.brand { font: 800 1.15rem/1 var(--display); font-stretch: 125%; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.lights { border: 1.5px solid var(--ink); background: none; border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: .875rem; min-height: 40px; }

/* ---------- the stage and the drawn PC ---------- */
.stage { position: relative; background: var(--stage); margin: 8px 16px 0; border-radius: 28px; overflow: hidden; transition: background .5s; }
.stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 55%, var(--glow), transparent 70%); opacity: 0; transition: opacity .8s; }
.stage.lit::before { opacity: var(--ambient); }
.stage svg { display: block; width: 100%; height: clamp(120px, 24dvh, 260px); position: relative; }
.caption { position: relative; padding: 0 14px 12px; margin-top: -4px; font-size: .875rem; font-weight: 600; color: var(--ink-2); text-align: center; min-height: 1.4em; text-wrap: balance; }
.caption span { display: inline-block; animation: rise .5s var(--out) both; }

#pc { transform-origin: 210px 396px; transition: scale .7s var(--spring); }
[data-size="compact"] #pc { scale: .82; }
.f-top { fill: var(--c-top); } .f-side { fill: var(--c-side); } .f-front { fill: var(--c-front); }
.f-top, .f-side, .f-front, .cover { transition: fill .6s; stroke: var(--c-edge); stroke-width: 1.5; stroke-linejoin: round; }
.inside { fill: #0A0B22; } .board { fill: #171A44; stroke: #2A2F73; } .metal { fill: #2B2E55; stroke: #4A4F86; } .dark { fill: #12142F; stroke: #33376E; }
.cover { fill: var(--c-side); }
.slit { stroke: var(--c-edge); stroke-width: 2; stroke-linecap: round; }
.mat { fill: var(--mat); stroke: var(--line); stroke-width: 1.5; transition: fill .5s, stroke .5s; }
.shadow { fill: #05061c; opacity: .22; }
.glow { stroke: var(--glow); fill: none; opacity: .13; transition: opacity .8s, stroke .5s, fill .5s; }
.glowfill { fill: var(--glow); stroke: none; }
.lit .glow { opacity: 1; filter: drop-shadow(0 0 5px var(--glow)); }
.rainbow { --glow: hsl(var(--h) 95% 62%); animation: hue 6s linear infinite; }
.blades { fill: #3B3F74; transform-origin: 0 0; animation: spin 1s linear infinite paused; }
.spinning .blades { animation-play-state: running; }
.hub { fill: #0A0B22; stroke: #4A4F86; }
.part { transition: opacity .35s, transform .7s var(--spring); }
.part.out { opacity: 0; transform: translateY(-80px); }
.sheen { fill: #fff; opacity: .07; }
.cover-wrap { transition: opacity .4s, transform .6s var(--out); }
.glass-on .cover-wrap { opacity: 0; transform: translateX(-40px); }
.drop { animation: drop .8s var(--spring) both; animation-delay: calc(var(--i) * 110ms); }
.drop-top { animation-name: drop-top; }
.led { fill: var(--c-edge); transition: fill .4s; }
.spinning .led { fill: var(--glow); filter: drop-shadow(0 0 4px var(--glow)); }

/* ---------- questions ---------- */
main { padding: 20px 16px 28px; overflow-x: clip; } /* the tags swing in; clip keeps that from widening the page */
.scene { animation: scene-in .45s var(--out) both; }
.scene.leaving { animation: scene-out .18s ease-in both; }
h1 { font: 800 clamp(1.8rem, 5.5vw, 2.65rem)/.98 var(--display); font-stretch: 78%; letter-spacing: -.015em; text-wrap: balance; }
.lede { margin-top: 10px; color: var(--ink-2); max-width: 34rem; }
.count { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-top: 18px; }
h2 { font: 750 1.6rem/1.08 var(--display); font-stretch: 90%; margin: 2px 0 12px; text-wrap: balance; }
h2 + .lede { margin: -4px 0 14px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; background: none; border: 1.5px solid var(--ink); border-radius: 20px; padding: 13px 18px; display: grid; gap: 2px; min-height: 44px; transition: transform .15s var(--out), background .2s, color .2s; }
.opt b { font: 700 1.1rem/1.2 var(--body); } .opt small { font-size: .9rem; color: var(--ink-2); transition: color .2s; }
.opt:active, .chip:active, .go:active { transform: scale(.97); }
@media (hover: hover) { .opt:hover, .chip:hover { background: var(--paper-2); } }
.opt[aria-pressed="true"], .chip[aria-pressed="true"], .chip.solid { background: var(--ink); color: var(--paper); }
.opt[aria-pressed="true"] small { color: inherit; opacity: .78; }
.go { display: block; margin-top: 22px; width: 100%; border: 0; border-radius: 99px; background: var(--blue); color: var(--on-blue); font-weight: 700; font-size: 1.125rem; padding: 16px 20px; transition: transform .15s var(--out), opacity .2s; }
.go:disabled { opacity: .45; cursor: not-allowed; }
.back { background: none; border: 0; padding: 12px 0; margin-top: 4px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.note { font-size: .9rem; color: var(--ink-2); margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rowlabel { font-weight: 700; margin: 18px 0 8px; }
.chip { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); background: none; border-radius: 99px; padding: 9px 16px; font-weight: 600; min-height: 44px; text-decoration: none; transition: transform .15s var(--out), background .2s, color .2s; }
.sw { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--c); transition: transform .3s var(--spring); }
.sw[aria-pressed="true"] { transform: scale(1.14); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.sw.rb { background: conic-gradient(#ff3d9a, #ffb300, #3dff8b, #29b6ff, #a25bff, #ff3d9a); }
.welcome { margin-top: 18px; padding: 16px 18px; border-radius: 20px; background: var(--paper-2); }
.welcome .row { margin-top: 10px; }
.flag { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--tag); color: var(--on-tag); font-size: .92rem; font-weight: 500; }
.flag b { display: block; }
.term { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline dotted 2px; text-underline-offset: 4px; color: inherit; }

.money { font: 900 clamp(3.4rem, 19vw, 6rem)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.money small { font: 700 1.1rem/1 var(--body); letter-spacing: 0; margin-left: 6px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: none; margin-top: 6px; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 9px; background: linear-gradient(to right, var(--blue) var(--p), var(--line) var(--p)); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 9px; background: linear-gradient(to right, var(--blue) var(--p), var(--line) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%; background: var(--tag); border: 2px solid var(--on-tag); }
input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--tag); border: 2px solid var(--on-tag); }
.reach { margin-top: 10px; font-weight: 600; min-height: 3em; }

/* ---------- results ---------- */
.cards { display: grid; gap: 6px; margin-top: 8px; }
.tagwrap { padding-top: 34px; transform-origin: 50% 0; animation: swing 1.5s var(--out) both; animation-delay: calc(var(--i) * 160ms); }
.tagcard { position: relative; border: 1.5px solid var(--ink); border-radius: 26px; padding: 44px 20px 22px; background: var(--paper); transition: background .5s; }
.tagcard::before { content: ""; position: absolute; top: 14px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper-2); }
.tagcard::after { content: ""; position: absolute; left: 50%; top: -34px; height: 56px; border-left: 1.5px solid var(--ink); }
.kind { font-weight: 700; color: var(--blue); }
.tagcard h3 { font: 750 1.4rem/1.12 var(--display); font-stretch: 88%; margin-top: 4px; text-wrap: balance; overflow-wrap: anywhere; }
.shop { color: var(--ink-2); margin-top: 4px; }
.pricerow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 12px; }
.sticker { background: var(--tag); color: var(--on-tag); font: 900 2rem/1 var(--display); font-stretch: 85%; padding: 10px 16px 9px; border-radius: 12px; rotate: -3deg; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sticker small { font: 700 .9rem var(--body); margin-left: 4px; }
.under { font-weight: 700; color: var(--yes); }
.lead { font-weight: 700; font-size: 1.05rem; }
.why { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.why li { padding-left: 28px; position: relative; }
.why li::before { content: ""; position: absolute; left: 2px; top: .35em; width: 14px; height: 8px; border-left: 2.5px solid var(--yes); border-bottom: 2.5px solid var(--yes); rotate: -45deg; }
.why li.ask::before { width: 9px; height: 9px; border: 2.5px solid var(--ink-2); border-radius: 50%; rotate: none; top: .4em; left: 4px; }
.block { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line); }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 7.2rem); gap: 10px; align-items: center; margin-top: 8px; font-weight: 600; font-size: .95rem; }
.pips { display: flex; gap: 4px; }
.pips i { width: 20px; height: 10px; border-radius: 9px; background: var(--line); }
.pips[data-fit="smooth"] i, .pips[data-fit="ok"] i:nth-child(-n+2) { background: var(--yes); }
.pips[data-fit="no"] i:first-child { background: var(--no); }
.pips i { animation: pop .5s var(--spring) both; animation-delay: calc(.9s + var(--n, 0) * 90ms); }
.pips i:nth-child(2) { --n: 1; } .pips i:nth-child(3) { --n: 2; }
.range { position: relative; height: 10px; border-radius: 9px; background: var(--line); margin: 14px 0 4px; }
.range i { position: absolute; top: -5px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--tag); border: 2px solid var(--on-tag); left: var(--k); }
.ends { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
details summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; }
details summary::after { content: "+"; font: 800 1.3rem/1 var(--display); margin-left: auto; transition: rotate .3s var(--out); }
details[open] summary::after { rotate: 45deg; }
details summary::-webkit-details-marker { display: none; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 4px; font-size: .95rem; }
dt { font-weight: 700; } dd { margin: 0; overflow-wrap: anywhere; }
.buy { display: block; text-align: center; text-decoration: none; margin-top: 18px; border-radius: 99px; background: var(--blue); color: var(--on-blue); font-weight: 700; font-size: 1.125rem; padding: 16px 20px; transition: transform .15s var(--out); }
.buy:active { transform: scale(.97); }

.section { margin-top: 44px; }
.section h2 { margin-bottom: 6px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 12px; font-size: .9rem; }
thead th { font: 750 .95rem/1.15 var(--display); font-stretch: 85%; text-align: left; vertical-align: bottom; padding: 0 8px 8px 0; position: sticky; top: 0; background: var(--paper); overflow-wrap: anywhere; }
thead th span { display: block; font: 600 .8rem var(--body); color: var(--blue); }
tbody th { text-align: left; font-weight: 700; padding: 12px 0 2px; border-top: 1.5px dashed var(--line); }
tbody th .term { font-weight: 700; }
td { vertical-align: top; padding: 0 8px 12px 0; overflow-wrap: anywhere; }
td b { font-family: var(--display); font-weight: 800; }
td .pips i { width: 14px; animation: none; }
select { width: 100%; min-height: 44px; margin-top: 14px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--paper); padding: 8px 16px; font-weight: 600; }
.actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); margin: 24px -16px 0; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-top: 1.5px solid var(--line); }
.actions .chip { flex: 1; justify-content: center; text-align: center; background: var(--paper); }
.actions .chip.solid { background: var(--ink); flex: 1.6; }
footer { padding: 8px 16px 40px; font-size: .85rem; color: var(--ink-2); max-width: 40rem; }

.sheet { border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--paper); color: var(--ink); padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; max-height: 88dvh; inset: auto 0 0 0; margin: 0 auto; overflow-y: auto; }
.sheet::backdrop { background: #05061c99; }
.sheet:popover-open { animation: sheet .4s var(--out); }
.sheet h4 { font: 750 1.3rem/1.1 var(--display); margin-bottom: 8px; }
.sheet .chip { margin-top: 16px; }
.sheet .row .chip { margin-top: 0; }
textarea { width: 100%; margin: 12px 0; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--paper-2); padding: 12px 14px; font-size: .9rem; resize: vertical; }

@keyframes spin { to { rotate: 360deg; } }
@keyframes hue { to { --h: 360deg; } }
@keyframes drop { from { opacity: 0; transform: translateY(-90px); } }
@keyframes drop-top { from { opacity: 0; transform: translate(-90px, 90px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }
@keyframes scene-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes scene-out { to { opacity: 0; transform: translateX(-20px); } }
@keyframes swing { 0% { opacity: 0; transform: translateY(-40px) rotate(-7deg); } 25% { opacity: 1; transform: rotate(4deg); } 50% { transform: rotate(-2.2deg); } 75% { transform: rotate(.9deg); } 100% { transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  header, footer { grid-column: 1 / -1; }
  .stage { position: sticky; top: 16px; }
  .stage svg { height: clamp(200px, 48dvh, 420px); }
  main { padding-top: 24px; }
  .actions { margin: 24px 0 0; padding: 10px 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .blades, .rainbow { animation: none !important; }
}
