/* Fonts: Geist + Geist Mono (OFL), self-hosted. Palette and sharp 2px corners follow skalaconsult.com. */
@font-face { font-family: "Geist"; src: url(fonts/geist-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

/* Shape rule: everything is 2px, like the main site. The receipt has a torn zigzag edge. */
:root {
  --bg: #f5f7fa; --surface: #ffffff; --ink: #081927; --muted: #4b5d6e; --line: #dbe3ea;
  --accent: #2563a0; --accent-ink: #ffffff; --accent-soft: #e4edf6; --glow: #dfeaf5;
  --r: 2px; --ease: cubic-bezier(.32,.72,0,1);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07131f; --surface: #0f2133; --ink: #eaf1f7; --muted: #9fb2c4; --line: #1e3348;
    --accent: #5da2e0; --accent-ink: #04101a; --accent-soft: #12304a; --glow: #0e2740;
  }
  .logo img { filter: brightness(0) invert(1); }
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 400 18px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 520px at 88% -8%, var(--glow), transparent 62%), var(--bg); min-height: 100dvh; }
svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 22px 24px 0; }
.logo img { display: block; height: 34px; width: auto; }
.prod { font: 500 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

#app { max-width: 1120px; margin: 0 auto; padding: 8px 24px 64px; }
.screen[hidden] { display: none !important; }
.screen.active { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* Intro */
#intro { display: grid; gap: 36px; padding-top: 28px; }
h1 { font: 700 clamp(2.3rem, 9vw, 4.4rem)/1.02 var(--sans); letter-spacing: -.04em; margin: 0 0 18px; text-wrap: balance; }
.lede { color: var(--muted); font-size: 1.12rem; margin: 0; max-width: 28rem; }
.intro-art { position: relative; padding-bottom: 54px; }
.hero-img { display: block; width: 100%; height: auto; border-radius: var(--r); aspect-ratio: 3 / 2; object-fit: cover; }
.hero-shadow { position: absolute; right: 10px; bottom: 0; width: 208px; }
.hero-shadow .receipt { font-size: .72rem; padding: 14px 14px 26px; white-space: nowrap; }
.hero-img { aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  #intro { grid-template-columns: .9fr 1.1fr; align-items: center; gap: 56px; min-height: calc(100dvh - 130px); padding-top: 0; }
  .intro-art { padding-bottom: 0; }
  .hero-img { aspect-ratio: 3 / 2; }
  .hero-shadow { right: auto; left: -44px; bottom: -34px; width: 250px; transform: rotate(-2.5deg); }
  .hero-shadow .receipt { font-size: .8rem; padding: 18px 18px 30px; }
}

/* Buttons: square, brand blue, trailing arrow in its own box */
.primary { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; border: 0; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: 9px 9px 9px 24px;
  font: 600 1.02rem var(--sans); margin-top: 30px; min-height: 54px;
  transition: transform .5s var(--ease), background-color .3s var(--ease); }
.primary .arr { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r);
  background: rgba(255,255,255,.16); transition: transform .5s var(--ease); }
@media (prefers-color-scheme: dark) { .primary .arr { background: rgba(0,0,0,.16); } }
.primary .arr svg { width: 18px; height: 18px; }
.primary:hover .arr { transform: translateX(3px); }
.primary:active { transform: scale(.985); }
.primary.disabled { opacity: .45; pointer-events: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Quiz */
#quiz { max-width: 600px; margin: 0 auto; padding-top: 28px; }
.qmeta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 40px; }
.back { width: 40px; height: 40px; border-radius: var(--r); border: 0; background: var(--surface); display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(8,25,39,.08); transition: transform .4s var(--ease); }
.back:hover { transform: translateX(-2px); }
.back[hidden] { display: grid; visibility: hidden; }
.back svg { width: 20px; height: 20px; }
.count { margin: 0 0 0 auto; font-family: var(--mono); color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.count .of { margin-left: 4px; }
.count .n { color: var(--ink); font-weight: 600; font-size: 1.15rem; }
.progress { height: 3px; background: var(--line); border-radius: var(--r); overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width .6s var(--ease); }
#qwrap { padding-top: 34px; }
.qicon { width: 48px; height: 48px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 22px; }
.qicon svg { width: 28px; height: 28px; }
h2 { font: 650 clamp(1.5rem, 5.4vw, 1.95rem)/1.18 var(--sans); letter-spacing: -.028em; margin: 0 0 26px; text-wrap: balance; }
#qwrap.fwd { animation: infwd .55s var(--ease) both; }
#qwrap.bwd { animation: inbwd .55s var(--ease) both; }
@keyframes infwd { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes inbwd { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }

.options { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 16px; text-align: left; min-height: 60px; background: var(--surface); border: 0;
  border-radius: var(--r); padding: 12px 18px 12px 12px; line-height: 1.35; box-shadow: 0 1px 2px rgba(8,25,39,.07), 0 6px 16px -10px rgba(8,25,39,.2);
  transition: transform .45s var(--ease), background-color .25s var(--ease), color .25s var(--ease); }
.opt .key { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent); font: 600 .85rem var(--mono); transition: background-color .25s var(--ease), color .25s var(--ease); }
.opt:hover { transform: translateX(5px); }
.opt:hover .key { background: var(--accent); color: var(--accent-ink); }
.opt:active { transform: scale(.985); }
.opt.picked { background: var(--accent); color: var(--accent-ink); }
.opt.picked .key { background: rgba(255,255,255,.2); color: var(--accent-ink); }
.busy .opt { pointer-events: none; opacity: .55; }
.err { margin-top: 20px; color: var(--accent); }
.link { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; font-weight: 600; }

/* Receipt (hero example + result) */
.shadow { filter: drop-shadow(0 18px 22px rgba(8,25,39,.2)); }
.receipt { position: relative; background: #fbfbfc; color: #081927; font: 500 .8rem/1.5 var(--mono); padding: 18px 18px 30px; --t: 14px;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--t) 100% repeat-x;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--t) 100% repeat-x; }
.receipt p { margin: 0; }
.r-title { text-align: center; text-transform: uppercase; letter-spacing: .16em; font-weight: 600; font-size: .72rem; }
.rule { border-top: 1px dashed #8fa0b0; margin: 10px 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 0;
  opacity: 0; animation: print .6s var(--ease) forwards; animation-delay: calc(.5s + var(--i) * .32s); }
.row span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
@keyframes print { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.row.total { font-weight: 700; font-size: 1.05rem; }
.stamp { display: block; width: max-content; margin: 12px 4px 0 auto; padding: 3px 9px; border: 2px solid #2563a0; color: #2563a0; border-radius: 2px;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; transform: rotate(-10deg);
  opacity: 0; animation: thump .5s var(--ease) 1.9s forwards; }
@keyframes thump { from { opacity: 0; transform: rotate(-10deg) scale(1.7); } to { opacity: .9; transform: rotate(-10deg) scale(1); } }

#result { max-width: 460px; margin: 0 auto; padding-top: 28px; }
.receipt.big { font-size: .9rem; padding: 24px 22px 34px; }
.receipt.big .r-date { text-align: center; color: #5b6b7a; font-size: .74rem; margin-top: 2px; }
.score-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 2px; }
.score-row .lbl { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.score-row .val { font: 700 3.2rem/1 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.score-row .val small { font: 500 1rem var(--mono); color: #5b6b7a; letter-spacing: 0; }
.band { margin: 2px 0 4px !important; color: #3d4f60; font-family: var(--sans); font-weight: 500; }
.redact { display: inline-block; height: .95em; background: #081927; border-radius: 1px; vertical-align: -1px; }
.loss-lbl { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; margin-top: 4px !important; }
.loss-num { font: 800 clamp(2.8rem, 15vw, 3.8rem)/1.05 var(--sans) !important; letter-spacing: -.045em; color: #2563a0; font-variant-numeric: tabular-nums; margin-top: 2px !important; }
.loss-num small { font: 500 .9rem var(--mono); color: #5b6b7a; letter-spacing: 0; }
.barcode { height: 34px; margin-top: 18px; background: repeating-linear-gradient(90deg, #081927 0 2px, transparent 2px 4px, #081927 4px 5px, transparent 5px 9px, #081927 9px 12px, transparent 12px 14px); opacity: .85; }
#result .primary { display: flex; margin-top: 34px; }
.fine { color: var(--muted); font-size: .9rem; margin: 14px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .row, .stamp { opacity: 1; }
  .stamp { opacity: .9; }
}
