/* Repaso. A pile of index cards under a study lamp: violet-to-blue light, a coral header rule,
   a yellow highlighter. Light and dark share the same tokens; only the values change.
   Effects (aurora, spotlight, border beam, marquee, count-up) are plain CSS and a little JS,
   and every one of them stops under prefers-reduced-motion. */

@font-face { font-family: "Atkinson"; src: url(../fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(../fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url(../fonts/bricolage-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url(../fonts/bricolage-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }

@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

:root {
  color-scheme: light;
  --desk: #f3f4fb; --card: #ffffff; --card-2: #eceefa; --ink: #121638; --ink-2: #4d5478;
  --rule: #dcdff2; --line: #c3c8e2; --red: #d3234a; --red-soft: #fde8ed; --green: #0d7a4e; --green-soft: #e0f5ec;
  --blue: #3a45d8; --blue-ink: #ffffff; --blue-soft: #e8eafc; --marker: #ffd93d; --marker-ink: #2b2606;
  --pri-a: #5b45ee; --pri-b: #2a5cf0; --pri-ink: #ffffff;
  --glass: rgba(255, 255, 255, .72); --glass-line: rgba(70, 70, 160, .14);
  --shadow: 0 1px 2px rgba(30, 30, 90, .06), 0 14px 40px -18px rgba(60, 50, 190, .28);
  --shadow-lg: 0 2px 4px rgba(30, 30, 90, .06), 0 30px 70px -28px rgba(70, 50, 210, .42);
  --aur1: rgba(140, 110, 255, .38); --aur2: rgba(70, 150, 255, .30); --aur3: rgba(255, 130, 150, .22); --grid: rgba(60, 70, 150, .07);
  --code-bg: #eef0fb; --tk-kw: #3140c0; --tk-str: #0b6c42; --tk-num: #a2500a; --tk-com: #5a6485; --tk-fn: #7a3fb0;
  --f: "Atkinson", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --d: "Bricolage", "Atkinson", system-ui, sans-serif;
  --m: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 18px;
}
:root[data-theme="dark"] { color-scheme: dark;
  --desk: #080c1c; --card: #111731; --card-2: #19214a; --ink: #eef0ff; --ink-2: #a5adcf;
  --rule: #232c55; --line: #343f6c; --red: #ff7b90; --red-soft: #3d1c2c; --green: #52e0a2; --green-soft: #12372d;
  --blue: #9bb0ff; --blue-ink: #0a0f26; --blue-soft: #1f2a5a; --marker: #ffd93d; --marker-ink: #2b2606;
  --glass: rgba(17, 23, 49, .66); --glass-line: rgba(150, 160, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 44px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 34px 80px -30px rgba(90, 70, 255, .55);
  --aur1: rgba(110, 80, 255, .34); --aur2: rgba(40, 110, 255, .26); --aur3: rgba(255, 70, 120, .14); --grid: rgba(150, 160, 255, .07);
  --code-bg: #0b1129; --tk-kw: #a5bcff; --tk-str: #8fdcb0; --tk-num: #f3b27a; --tk-com: #8390b0; --tk-fn: #e0b3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --desk: #080c1c; --card: #111731; --card-2: #19214a; --ink: #eef0ff; --ink-2: #a5adcf;
  --rule: #232c55; --line: #343f6c; --red: #ff7b90; --red-soft: #3d1c2c; --green: #52e0a2; --green-soft: #12372d;
  --blue: #9bb0ff; --blue-ink: #0a0f26; --blue-soft: #1f2a5a; --marker: #ffd93d; --marker-ink: #2b2606;
  --glass: rgba(17, 23, 49, .66); --glass-line: rgba(150, 160, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 44px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 34px 80px -30px rgba(90, 70, 255, .55);
  --aur1: rgba(110, 80, 255, .34); --aur2: rgba(40, 110, 255, .26); --aur3: rgba(255, 70, 120, .14); --grid: rgba(150, 160, 255, .07);
  --code-bg: #0b1129; --tk-kw: #a5bcff; --tk-str: #8fdcb0; --tk-num: #f3b27a; --tk-com: #8390b0; --tk-fn: #e0b3ff; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--desk); color: var(--ink); font-family: var(--f); font-size: 17px; line-height: 1.55; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }

/* the lamp: a slow aurora and a fading grid behind everything */
body::before { content: ""; position: fixed; left: -15%; right: -15%; top: -25%; height: 95vh; z-index: -2; pointer-events: none;
  background: radial-gradient(38% 48% at 22% 32%, var(--aur1), transparent 72%), radial-gradient(34% 44% at 76% 22%, var(--aur2), transparent 72%), radial-gradient(28% 38% at 55% 72%, var(--aur3), transparent 72%);
  filter: blur(36px); animation: drift 26s ease-in-out infinite alternate; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(75% 60% at 50% 0%, #000 0%, transparent 78%); mask-image: radial-gradient(75% 60% at 50% 0%, #000 0%, transparent 78%); }
@keyframes drift { from { transform: translate3d(-3%, 0, 0) scale(1); } to { transform: translate3d(3%, 4%, 0) scale(1.08); } }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 18px 48px; outline: none; }
main[data-view="home"] { max-width: 1120px; }
main.has-bar { padding-bottom: 124px; }
h1, h2, h3, p { margin: 0; }
h1, h2, .brand, .score, .tcard b, .stat b, .step b { font-family: var(--d); }
h1 { font-size: clamp(1.85rem, 5.4vw, 2.6rem); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: 1.3rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 30; border-radius: 8px; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section { margin-top: 44px; display: flex; flex-direction: column; gap: 16px; }
.loading { padding: 40px 0; color: var(--ink-2); }
mark { background: none; color: inherit; box-shadow: inset 0 -.36em 0 color-mix(in srgb, var(--marker) 78%, transparent); padding: 0 .06em; border-radius: 2px; }

/* top bar: frosted glass */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 9px 18px; padding-top: max(9px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--desk) 62%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--glass-line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.42rem; letter-spacing: -.035em; color: var(--ink); text-decoration: none; line-height: 1; }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; box-shadow: 0 6px 16px -6px rgba(90, 69, 238, .7); transition: transform .35s cubic-bezier(.2, .9, .3, 1.4); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand span { box-shadow: inset 0 -.3em 0 color-mix(in srgb, var(--marker) 85%, transparent); }
.nav { display: flex; gap: 4px; padding: 3px; background: var(--card-2); border-radius: 999px; border: 1px solid var(--glass-line); }
.nav a { padding: 6px 15px; color: var(--ink-2); text-decoration: none; border-radius: 999px; min-height: 36px; display: flex; align-items: center; font-weight: 700; font-size: .95rem; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--pri-ink); background: linear-gradient(135deg, var(--pri-a), var(--pri-b)); box-shadow: 0 4px 14px -4px rgba(70, 70, 240, .7); }
.tools { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.tool { position: relative; min-width: 42px; height: 42px; display: grid; place-items: center; background: none; border: 1px solid transparent; color: var(--ink-2); border-radius: 12px; cursor: pointer; text-decoration: none; transition: color .2s, background .2s, border-color .2s; }
.tool:hover { color: var(--ink); background: var(--card-2); border-color: var(--glass-line); }
.tool.lang { font-weight: 800; font-size: .92rem; letter-spacing: .02em; }
#acct-dot { position: absolute; right: 8px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--desk), 0 0 10px var(--green); }

/* the index card */
.card { position: relative; background: linear-gradient(90deg, var(--red), var(--marker)) 0 0 / 100% 4px no-repeat, var(--card); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 24px 22px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; box-shadow: var(--shadow); }
.qtext { font-size: 1.22rem; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .82rem; color: var(--ink-2); }
.qmeta > * { padding: 2px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--rule); }
.qmeta a { color: var(--blue); font-weight: 700; text-decoration: none; }
.qmeta a:hover { text-decoration: underline; }
code { font-family: var(--m); font-size: .86em; background: var(--code-bg); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
pre.code { margin: 0; background: var(--code-bg); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-family: var(--m); font-size: .82rem; line-height: 1.65; tab-size: 4; }
pre.code code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.tk-kw { color: var(--tk-kw); } .tk-str { color: var(--tk-str); } .tk-num { color: var(--tk-num); } .tk-com { color: var(--tk-com); font-style: italic; } .tk-fn { color: var(--tk-fn); }

/* answers */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px 11px 11px; cursor: pointer; line-height: 1.4; min-height: 52px; width: 100%; transition: transform .18s, border-color .18s, background .18s, box-shadow .18s; }
.opt .k { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--rule); font-family: var(--m); transition: inherit; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.opt:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); box-shadow: 0 8px 22px -12px rgba(70, 70, 240, .6); }
.opt:hover:not(:disabled) .k { background: linear-gradient(135deg, var(--pri-a), var(--pri-b)); color: var(--pri-ink); border-color: transparent; }
.opt:active:not(:disabled) { transform: translateY(0) scale(.99); }
.opt:disabled { cursor: default; color: inherit; }
.opt.ok { border-color: var(--green); background: var(--green-soft); animation: pop .35s cubic-bezier(.2, .9, .3, 1.3); }
.opt.ok .k { background: var(--green); color: var(--desk); border-color: var(--green); }
.opt.bad { border-color: var(--red); background: var(--red-soft); animation: shake .35s; }
.opt.bad .k { background: var(--red); color: var(--desk); border-color: var(--red); }
.opt.dim { opacity: .55; }
@keyframes pop { 0% { transform: scale(.98); } 60% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes shake { 20% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
.fb { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 5px 14px 5px 10px; border-radius: 999px; }
.fb::before { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .75rem; color: var(--desk); }
.fb.ok { color: var(--green); background: var(--green-soft); } .fb.ok::before { content: "✓" / ""; background: var(--green); }
.fb.bad { color: var(--red); background: var(--red-soft); } .fb.bad::before { content: "✕" / ""; background: var(--red); }
.answer { display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.answer h3 { color: var(--ink-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.answer ul, .answer ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.remember { background: var(--marker); color: var(--marker-ink); padding: 11px 15px; font-weight: 700; transform: rotate(-.4deg); border-radius: 4px 12px 5px 13px; box-shadow: 0 10px 24px -14px rgba(255, 190, 0, .9); }
.remember code { background: rgba(0, 0, 0, .08); }
.terms { display: flex; flex-direction: column; gap: 6px; }
.terms h3 { color: var(--ink-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.terms details { border-bottom: 1px solid var(--rule); }
.terms summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
.terms details p { padding: 0 0 10px; }
.terms details a { font-size: .9rem; }
.refs { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; }

/* buttons */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 22px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s, filter .18s; }
.btn:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(70, 70, 240, .6); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.btn.pri { background: linear-gradient(135deg, var(--pri-a), var(--pri-b)); border-color: transparent; color: var(--pri-ink); box-shadow: 0 10px 28px -10px rgba(70, 70, 240, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.pri::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-18deg); transition: left .6s ease; pointer-events: none; }
.btn.pri:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); box-shadow: 0 14px 34px -10px rgba(70, 70, 240, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.pri:hover:not(:disabled)::after { left: 120%; }
.btn.good { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.btn.bad { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; background: color-mix(in srgb, var(--desk) 72%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--glass-line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
.actionbar .in { max-width: 724px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .btn { flex: 1; }
.toast { position: fixed; left: 16px; right: 16px; top: calc(70px + env(safe-area-inset-top)); max-width: 560px; margin: 0 auto; z-index: 25; background: var(--ink); color: var(--desk); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: drop .3s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* search */
.search { position: relative; }
.search input { width: 100%; min-height: 54px; padding: 10px 52px 10px 46px; border: 1.5px solid var(--glass-line); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.search input::placeholder { color: var(--ink-2); opacity: .85; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent), var(--shadow); }
.search svg { position: absolute; left: 15px; top: 17px; color: var(--ink-2); z-index: 1; pointer-events: none; }
.search kbd { position: absolute; right: 12px; top: 14px; font-family: var(--m); font-size: .8rem; color: var(--ink-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; padding: 1px 8px; background: var(--card); transition: opacity .2s; pointer-events: none; }
.search:focus-within kbd { opacity: 0; }
@media (hover: none) { .search kbd { display: none; } }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.results a { display: block; padding: 12px 6px; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; overflow-wrap: anywhere; border-radius: 8px; transition: background .15s; }
.results a:hover { background: var(--blue-soft); }
.results a:hover b { color: var(--blue); }
.results small { display: block; color: var(--ink-2); font-size: .85rem; }

/* home: hero */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; align-items: center; padding-top: 18px; }
.hero-grid #found { grid-column: 1 / -1; }
.hero-grid.searching { grid-template-columns: minmax(0, 1fr); }
.hero-copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; min-width: 0; }
.hero-copy .search { width: 100%; max-width: 520px; }
.hero-copy h1 { font-size: clamp(2.2rem, 6.6vw, 3.9rem); line-height: 1.03; letter-spacing: -.035em; }
.hero-copy h1 mark { box-shadow: inset 0 -.13em 0 color-mix(in srgb, var(--marker) 90%, transparent); }
.hero-copy h1 .grad { background: linear-gradient(100deg, var(--pri-a), var(--pri-b) 55%, #d946ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .hero-copy h1 .grad { background-image: linear-gradient(100deg, #b6a8ff, #7ea6ff 55%, #f0a0ff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-copy h1 .grad { background-image: linear-gradient(100deg, #b6a8ff, #7ea6ff 55%, #f0a0ff); } }
.hero-copy .lead { color: var(--ink-2); font-size: 1.12rem; max-width: 52ch; }
.badge { display: inline-flex; align-items: center; gap: 9px; padding: 6px 15px 6px 11px; border-radius: 999px; font-size: .86rem; font-weight: 700; color: var(--ink); background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: ping 2.2s ease-out infinite; }
.badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--marker) 55%, transparent) 50%, transparent 65%); transform: translateX(-120%); animation: shine 5s ease-in-out 1.2s infinite; pointer-events: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.quickrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.quickrow .btn.pri { min-height: 54px; padding: 12px 28px; font-size: 1.05rem; }

/* the card pile */
.deck { position: relative; perspective: 1100px; min-width: 0; }
.deck::before, .deck::after { content: ""; position: absolute; inset: 14px 6px -14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--glass-line); opacity: .55; z-index: -1; transform: rotate(3.2deg); }
.deck::after { inset: 8px 12px -26px; opacity: .32; transform: rotate(-3deg); z-index: -2; }
.deck .card { box-shadow: var(--shadow-lg); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; will-change: transform; }
.deck .qtext { font-size: 1.28rem; }

/* border beam: a bright arc travels around the card edge */
.beam::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 62%, var(--marker) 76%, #ff4f6a 86%, #7a5cff 94%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; animation: orbit 7s linear infinite; }
@keyframes orbit { to { --ang: 360deg; } }

/* spotlight: light that follows the pointer */
.spot { position: relative; overflow: hidden; }
.spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--blue) 24%, transparent), transparent 70%); }
.spot:hover::after { opacity: 1; }
.deck .card.spot { overflow: visible; }
.deck .card.spot::after { overflow: hidden; }

/* numbers */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 52px; }
.stat { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; background: linear-gradient(120deg, var(--ink), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--ink-2); font-size: .92rem; }

/* marquee */
.marquee { margin: 44px -18px 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.mq-row { display: flex; width: max-content; animation: scroll 52s linear infinite; }
.mq-row.rev { animation-direction: reverse; animation-duration: 60s; }
.marquee:hover .mq-row { animation-play-state: paused; }
.mq-set { display: flex; gap: 12px; padding-right: 12px; }
.mq-set span { white-space: nowrap; padding: 8px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); font-weight: 700; font-size: .95rem; color: var(--ink-2); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* section heads */
.sec-head { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.sec-head h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; }

/* topics as cards */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.tcard { --ic: hsl(var(--h) 72% 40%); --ib: hsl(var(--h) 90% 58% / .13); position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--glass-line); color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .22s cubic-bezier(.2, .9, .3, 1.2), border-color .2s, box-shadow .2s; }
:root[data-theme="dark"] .tcard { --ic: hsl(var(--h) 100% 76%); --ib: hsl(var(--h) 100% 66% / .16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tcard { --ic: hsl(var(--h) 100% 76%); --ib: hsl(var(--h) 100% 66% / .16); } }
.tcard:hover { transform: translateY(-4px); border-color: hsl(var(--h) 80% 60% / .55); box-shadow: var(--shadow-lg); }
.tcard .ti { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--ib); color: var(--ic); margin-bottom: 10px; transition: transform .3s cubic-bezier(.2, .9, .3, 1.5); }
.tcard:hover .ti { transform: rotate(-8deg) scale(1.1); }
.tcard b { font-size: 1.08rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; position: relative; z-index: 1; }
.tcard small { color: var(--ink-2); font-size: .86rem; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.tcard .bar { height: 5px; border-radius: 99px; background: var(--rule); margin-top: 10px; overflow: hidden; position: relative; z-index: 1; }
.tcard .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ic), hsl(calc(var(--h) + 40) 90% 62%)); }
.tcard .ti, .tcard b, .tcard small { position: relative; z-index: 1; }
.topic-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 11px 6px; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; border-radius: 8px; transition: background .15s; }
.topic-row b { font-weight: 700; overflow-wrap: anywhere; }
.topic-row:hover { background: var(--blue-soft); }
.topic-row:hover b { color: var(--blue); }
.topic-row small { color: var(--ink-2); font-size: .85rem; }

/* how it works */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; counter-reset: s; }
.step { position: relative; padding: 22px 22px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--glass-line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.step::before { counter-increment: s; content: "0" counter(s); position: absolute; right: 16px; top: 6px; font-family: var(--d); font-weight: 800; font-size: 4.4rem; line-height: 1; letter-spacing: -.05em; color: var(--blue); opacity: .1; pointer-events: none; }
.step .si { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--pri-ink); background: linear-gradient(135deg, var(--pri-a), var(--pri-b)); box-shadow: 0 8px 20px -8px rgba(70, 70, 240, .8); margin-bottom: 6px; }
.step b { font-size: 1.18rem; font-weight: 700; }
.step p { color: var(--ink-2); }

/* the five Leitner boxes */
.boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; height: 150px; }
.box { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; }
.box .fill { --c: var(--blue); background: linear-gradient(to top, color-mix(in srgb, var(--c) 78%, transparent), color-mix(in srgb, var(--c) 28%, transparent)); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: 12px 12px 5px 5px; min-height: 4px; transition: height .6s cubic-bezier(.2, .9, .3, 1.2); box-shadow: 0 0 22px -6px color-mix(in srgb, var(--c) 70%, transparent); }
.box.b1 .fill { --c: var(--red); }
.box.b2 .fill { --c: #f59e0b; }
.box.b3 .fill { --c: #3b82f6; }
.box.b4 .fill { --c: #14b8a6; }
.box.b5 .fill { --c: var(--green); }
.box .front { background: var(--card); border: 1px solid var(--glass-line); border-radius: 12px; text-align: center; padding: 6px 2px; font-size: .84rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink-2); box-shadow: var(--shadow); }
.box .front b { display: block; font-size: 1.15rem; color: var(--ink); font-family: var(--d); }
.boxes-cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.boxes-cap span:last-child { color: var(--ink); font-weight: 700; background: color-mix(in srgb, var(--marker) 72%, transparent); color: var(--marker-ink); padding: 0 10px; border-radius: 99px; }

/* setup */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 16px; color: var(--ink); cursor: pointer; font-size: .96rem; transition: transform .15s, border-color .15s, background .15s, box-shadow .15s; }
.chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.chip small { color: var(--ink-2); margin-left: 3px; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: linear-gradient(135deg, var(--pri-a), var(--pri-b)); border-color: transparent; color: var(--pri-ink); font-weight: 700; box-shadow: 0 8px 20px -10px rgba(70, 70, 240, .8); }
.chip[aria-pressed="true"] small, .chip[aria-current="true"] small { color: inherit; opacity: .85; }
.level { font-size: .85rem; }
.progress-line { height: 6px; background: var(--rule); border-radius: 99px; overflow: hidden; }
.progress-line i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--marker)); transition: width .35s cubic-bezier(.2, .9, .3, 1.1); }
.timer { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: .95rem; }
.timer.low { color: var(--red); font-weight: 700; }
.timer span { min-width: 3em; }
.timer .progress-line { flex: 1; }
.qtop { display: flex; align-items: center; gap: 12px; }
.qtop .grow { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--ink-2); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.stats b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* results */
.done-top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { --p: 0; position: relative; width: 132px; height: 132px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(from -90deg, var(--green) calc(var(--p) * 1%), var(--rule) 0); box-shadow: 0 0 40px -12px color-mix(in srgb, var(--green) 60%, transparent); }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--card); }
.score { position: relative; font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -14px; left: var(--x); width: 9px; height: 15px; background: var(--c); border-radius: 2px; opacity: 0; animation: fall var(--t) cubic-bezier(.3, .6, .4, 1) var(--w) forwards; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(105vh) translateX(var(--s)) rotate(var(--r)); } }

/* study */
.sitem { background: var(--card); border: 1px solid var(--glass-line); border-radius: 14px; margin-bottom: 10px; padding: 0 18px; box-shadow: var(--shadow); transition: border-color .2s; }
.sitem[open] { border-color: color-mix(in srgb, var(--blue) 50%, var(--glass-line)); }
.sitem > summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 15px 0; font-weight: 700; overflow-wrap: anywhere; }
.sitem > summary::-webkit-details-marker { display: none; }
.sitem > summary:hover { color: var(--blue); }
.sitem .chk { color: var(--green); font-weight: 800; }
.sbody { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; min-width: 0; }

/* forms and prose */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
textarea, select, label.field input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 400; }
textarea:focus, select:focus, label.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent); }
textarea { min-height: 140px; resize: vertical; }
.prose { display: flex; flex-direction: column; gap: 14px; max-width: 66ch; }
.prose h2 { margin-top: 14px; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.notice { border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); border-left: 4px solid var(--blue); border-radius: 12px; padding: 10px 14px; background: var(--blue-soft); }
.notice.err { border-color: color-mix(in srgb, var(--red) 40%, transparent); border-left-color: var(--red); background: var(--red-soft); }

.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 26px 18px 34px; font-size: .9rem; border-top: 1px solid var(--glass-line); background: color-mix(in srgb, var(--desk) 60%, transparent); }
.foot a { color: var(--ink-2); text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }
body.in-quiz .foot { display: none; }

/* scroll reveal: only when the script is running, so nothing is ever hidden without it */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease-out, transform .6s cubic-bezier(.2, .8, .3, 1); transition-delay: calc(var(--i, 0) * 55ms); }
.js .rv.in { opacity: 1; transform: none; }

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: 56px; padding-top: 34px; }
  .hero-grid.searching { grid-template-columns: minmax(0, 1fr); }
  .qtext { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  main { padding-left: 14px; padding-right: 14px; }
  .marquee { margin-left: -14px; margin-right: -14px; }
  .card { padding: 22px 16px 18px; }
  .boxes { gap: 6px; }
}
@media (max-width: 440px) {
  .top { gap: 8px; padding-left: 12px; padding-right: 8px; }
  .tool { min-width: 38px; }
  .brand { font-size: 1.28rem; }
}
/* Phones: the menu goes on its own row instead of pushing the buttons off screen. */
@media (max-width: 470px) {
  .top { flex-wrap: wrap; row-gap: 6px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; justify-content: center; }
  .nav a { flex: 1; justify-content: center; }
  html { scroll-padding-top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .remember { transform: none; }
  .deck .card { transform: none; }
  .js .rv { opacity: 1; transform: none; }
  .confetti { display: none; }
  .mq-row { width: auto; flex-wrap: wrap; }
  .mq-set { flex-wrap: wrap; }
  .mq-set + .mq-set { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; margin-left: 0; margin-right: 0; }
}
@media print { body::before, body::after, .top, .foot, .actionbar { display: none; } }

.hint { display: block; margin-top: 2px; font-weight: 400; font-size: .85em; color: var(--ink-2); overflow-wrap: anywhere; }

/* Categories (groups) above topics */
.gfilter { margin: 4px 0 18px; }
.grp { margin: 0 0 22px; }
.grp-h { font-family: var(--d); font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink-2); margin: 0 0 10px; }
.crumb { margin: 0; font-size: .9rem; }
.crumb a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.crumb a:hover { color: var(--blue); }
.gchip { margin: 0 0 10px; font-weight: 800; border-style: dashed; }
.gchip[aria-pressed="mixed"] { border-color: var(--blue); background: var(--blue-soft); border-style: solid; }
