/* ═══════════════════════════════════════════════════════════════
   StudySprint — style.css
   Deep Indigo & Electric Cyan Calm Focus · Linear/Vercel-grade UI
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Design tokens ---------- */
:root {
  --indigo: #6366F1;
  --indigo-bright: #818CF8;
  --cyan: #06B6D4;
  --cyan-bright: #22D3EE;
  --emerald: #10B981;
  --rose: #F43F5E;
  --amber: #F59E0B;
  --violet: #A855F7;

  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  --header-h: 72px;
  --ease-spring: cubic-bezier(.22, 1, .36, 1);
  --shadow-lg: 0 24px 60px -18px rgba(2, 6, 23, .55);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, .25), 0 12px 40px -12px rgba(99, 102, 241, .45);
}

[data-theme="dark"] {
  --bg: #0B0F19;
  --bg-2: #0E1424;
  --card: #151D2E;
  --card-2: #1A2338;
  --border: #232D42;
  --border-strong: #2E3B57;
  --text: #E8EDF9;
  --text-2: #A7B2CC;
  --text-3: #6B7794;
  --glass-bg: rgba(21, 29, 46, .62);
  --glass-border: rgba(120, 140, 190, .16);
  --grid-line: rgba(120, 140, 190, .12);
  --shadow-card: 0 18px 44px -20px rgba(0, 0, 0, .65);
  --hero-fade: rgba(11, 15, 25, 0);
  --scrim: rgba(7, 10, 20, .6);
  --doc-bg: #0E1424;
}

[data-theme="light"] {
  --bg: #FAFBFF;
  --bg-2: #F1F4FB;
  --card: #FFFFFF;
  --card-2: #F6F8FE;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-border: rgba(100, 116, 139, .18);
  --grid-line: rgba(100, 116, 139, .14);
  --shadow-card: 0 18px 44px -22px rgba(30, 41, 59, .25);
  --hero-fade: rgba(250, 251, 255, 0);
  --scrim: rgba(226, 232, 240, .55);
  --doc-bg: #FFFFFF;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
}
body.theme-anim, body.theme-anim *, body.theme-anim *::before, body.theme-anim *::after {
  transition: none !important;
}
::selection { background: rgba(99, 102, 241, .35); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
strong { font-weight: 700; }
em { font-style: normal; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--indigo); }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.grad-text {
  background: linear-gradient(100deg, var(--indigo-bright), var(--cyan-bright) 55%, var(--emerald));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Glass & surfaces ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.4em; border-radius: 14px; font-weight: 700; font-size: .95rem;
  transition: transform .18s var(--ease-spring), box-shadow .25s ease, background .25s ease, border-color .25s ease, opacity .2s;
  min-height: 48px; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo), #4F46E5 60%, #7C3AED);
  color: #fff; box-shadow: 0 10px 26px -10px rgba(99, 102, 241, .7);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(99, 102, 241, .8); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-glass {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text);
}
.btn-glass:hover { border-color: var(--indigo); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-ghost { color: var(--text-2); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(120, 140, 190, .1); }
.btn-sm { min-height: 40px; padding: .5em 1em; font-size: .85rem; border-radius: 11px; }
.btn-lg { padding: .95em 1.7em; font-size: 1.02rem; border-radius: 16px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; color: var(--text-2); border: 1px solid transparent;
  transition: all .2s ease; min-width: 44px;
}
.icon-btn:hover { color: var(--text); background: rgba(120, 140, 190, .12); border-color: var(--glass-border); }
.icon-btn.xs { width: 38px; height: 38px; }
.icon-btn.lg { width: 52px; height: 52px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.icon-btn .ic-pause { display: none; }
.icon-btn.playing .ic-play, .btn.playing .ic-play { display: none; }
.icon-btn.playing .ic-pause, .btn.playing .ic-pause { display: block; }

.kbd {
  display: inline-block; padding: .1em .55em; border-radius: 6px; font-size: .72em; font-weight: 700;
  background: var(--card-2); border: 1px solid var(--border); border-bottom-width: 2px;
  color: var(--text-2); font-family: var(--font-sans);
}

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h);
  transition: transform .4s var(--ease-spring);
}
.header-inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 14px;
}
.header.scrolled .header-inner > * { box-shadow: var(--shadow-card); }
.header.scrolled .brand, .header.scrolled .nav-desktop, .header.scrolled .header-actions {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-border);
}
.header.scrolled .brand { border-radius: 14px; padding: 8px 14px; }
.header.scrolled .nav-desktop { border-radius: 99px; padding: 6px; }
.header.scrolled .header-actions { border-radius: 99px; padding: 6px 8px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  box-shadow: 0 0 18px rgba(99, 102, 241, .55), inset 0 1px 0 rgba(255,255,255,.25);
  overflow: hidden; flex-shrink: 0; padding: 0;
}
.brand-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-name { font-weight: 800; }

.nav-desktop { display: flex; align-items: center; gap: 2px; }
.nav-desktop a {
  padding: .5em .95em; border-radius: 99px; font-size: .9rem; font-weight: 600; color: var(--text-2);
  transition: color .2s, background .2s;
}
.nav-desktop a:hover { color: var(--text); }
.nav-desktop a.active { color: var(--text); background: rgba(99, 102, 241, .16); }
[data-theme="light"] .nav-desktop a.active { color: var(--indigo); }

.header-actions { display: flex; align-items: center; gap: 8px; }
#themeToggle .ic-moon { display: none; }
[data-theme="light"] #themeToggle .ic-sun { display: none; }
[data-theme="light"] #themeToggle .ic-moon { display: block; }
.hamburger { display: none; }

.mobile-drawer {
  position: fixed; top: calc(var(--header-h) + 6px); left: 16px; right: 16px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-12px) scale(.98); pointer-events: none;
  transition: opacity .25s ease, transform .3s var(--ease-spring);
}
.mobile-drawer.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-drawer a { padding: .8em 1em; border-radius: 12px; font-weight: 600; color: var(--text-2); }
.mobile-drawer a:hover { background: rgba(120,140,190,.12); color: var(--text); }
.mobile-drawer .btn { justify-content: center; margin-top: 6px; color: #fff; }

/* ---------- Views / routing ---------- */
.view { display: none; animation: viewIn .5s var(--ease-spring); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main { min-height: 100vh; }
.view-page { position: relative; padding-top: calc(var(--header-h) + 48px); padding-bottom: 90px; }
/* Ambient glow shared by every inner page */
.view-page::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 520px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(720px 340px at 12% -4%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(640px 320px at 88% -2%, rgba(6, 182, 212, .13), transparent 62%);
}
body[data-pomo-mode="break"] #view-pomodoro::before,
body[data-pomo-mode="long"] #view-pomodoro::before {
  background:
    radial-gradient(720px 360px at 15% -4%, rgba(16, 185, 129, .18), transparent 62%),
    radial-gradient(640px 320px at 85% -2%, rgba(6, 182, 212, .13), transparent 62%);
}
[data-theme="light"] .view-page::before { opacity: .7; }
.view-page > .container { position: relative; z-index: 1; }
.page-narrow { max-width: 860px; }
.page-head { margin-bottom: 34px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); margin: .35em 0 .3em; }
.page-head p { color: var(--text-2); max-width: 620px; }
.head-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.head-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: .5em 1.1em; border-radius: 99px; font-size: .82rem; font-weight: 700; color: var(--text-2);
}

.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cyan-bright); margin-bottom: 12px;
}
[data-theme="light"] .eyebrow { color: #0891B2; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(var(--header-h) + 70px) 0 60px; overflow: hidden; }
.hero-bg-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 660px; z-index: 0;
  object-fit: cover; object-position: center 24%;
  opacity: .65; pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 45%, rgba(0,0,0,.5) 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, rgba(0,0,0,.5) 75%, transparent 100%);
}
[data-theme="light"] .hero-bg-img {
  opacity: .28; filter: hue-rotate(-10deg) saturate(.9) brightness(1.35) contrast(.95);
}
.hero .hero-grid { position: relative; z-index: 1; }
.hero-glow {
  position: absolute; inset: -20% -10% auto; height: 720px; pointer-events: none;
  background:
    radial-gradient(640px 420px at 18% 12%, rgba(99, 102, 241, .22), transparent 65%),
    radial-gradient(560px 420px at 82% 8%, rgba(6, 182, 212, .16), transparent 65%),
    radial-gradient(700px 500px at 50% 100%, rgba(16, 185, 129, .08), transparent 70%);
}
.hero-glow::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 9px; padding: .5em 1.1em; border-radius: 99px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 26px;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.hero-copy h1 { font-size: clamp(2.5rem, 5.4vw, 4rem); margin-bottom: .45em; }
.hero-sub { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--text-2); max-width: 540px; margin-bottom: 32px; }
.hero-sub strong { color: var(--text); font-weight: 700; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.hero-social { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .85rem; flex-wrap: wrap; }
.stars { color: var(--amber); letter-spacing: 2px; font-size: .95rem; }

/* Hero flip card */
.hero-card-wrap { perspective: 1600px; }
.scene { width: 100%; max-width: 440px; margin: 0 auto; }
.flip-card { width: 100%; height: 420px; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .7s var(--ease-spring);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; border-radius: var(--radius-lg);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  padding: 28px; display: flex; flex-direction: column;
  background: var(--glass-bg);
}
.flip-back { transform: rotateY(180deg); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.tag {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: .35em .8em; border-radius: 99px;
}
.tag-indigo { background: rgba(99,102,241,.16); color: var(--indigo-bright); }
.tag-cyan { background: rgba(6,182,212,.16); color: var(--cyan-bright); }
.tag-emerald { background: rgba(16,185,129,.16); color: #34D399; }
.tag-rose { background: rgba(244,63,94,.16); color: #FB7185; }
.tag-violet { background: rgba(168,85,247,.16); color: #C084FC; }
[data-theme="light"] .tag-indigo { color: #4F46E5; }
[data-theme="light"] .tag-cyan { color: #0E7490; }
[data-theme="light"] .tag-emerald { color: #047857; }
[data-theme="light"] .tag-rose { color: #BE123C; }
[data-theme="light"] .tag-violet { color: #7E22CE; }

.card-term { font-size: 2.3rem; font-weight: 800; text-align: center; margin: auto 0; letter-spacing: -.02em; }
.card-term-sub { font-size: 1.2rem; color: var(--text-3); font-weight: 600; }
.card-answer { font-size: 1.02rem; color: var(--text-2); margin: auto 0; text-align: center; }
.card-answer strong { color: var(--text); }
.hint-toggle {
  display: inline-flex; align-items: center; gap: 7px; align-self: center;
  color: var(--amber); font-size: .85rem; font-weight: 700; padding: .5em 1em;
  border-radius: 99px; border: 1px dashed rgba(245, 158, 11, .4); transition: all .2s;
}
.hint-toggle:hover { background: rgba(245,158,11,.1); }
.hint-body {
  font-size: .88rem; color: var(--text-2); background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 12px; display: none;
}
.hint-body.open { display: block; animation: viewIn .35s var(--ease-spring); }
.card-flip-hint { text-align: center; color: var(--text-3); font-size: .78rem; margin-top: 16px; }

.rate-label { text-align: center; font-size: .8rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .8em .3em; border-radius: 12px; min-height: 56px;
  font-weight: 800; font-size: .85rem; border: 1px solid var(--border);
  background: var(--card-2); transition: all .18s var(--ease-spring);
}
.rate-btn small { font-size: .68rem; font-weight: 600; color: var(--text-3); }
.rate-btn:hover { transform: translateY(-3px); }
.rate-again { color: #FB7185; } .rate-again:hover { border-color: var(--rose); box-shadow: 0 8px 20px -8px rgba(244,63,94,.5); }
.rate-hard { color: #FBBF24; } .rate-hard:hover { border-color: var(--amber); box-shadow: 0 8px 20px -8px rgba(245,158,11,.5); }
.rate-good { color: #34D399; } .rate-good:hover { border-color: var(--emerald); box-shadow: 0 8px 20px -8px rgba(16,185,129,.5); }
.rate-easy { color: var(--cyan-bright); } .rate-easy:hover { border-color: var(--cyan); box-shadow: 0 8px 20px -8px rgba(6,182,212,.5); }

.sm2-readout {
  display: flex; gap: 14px; align-items: center; max-width: 440px; margin: 18px auto 0;
  padding: 14px 18px; border-radius: var(--radius);
}
.sm2-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); flex-shrink: 0; }
.sm2-readout strong { display: block; font-size: .9rem; }
.sm2-meta { font-size: .76rem; color: var(--text-3); }
.sm2-meta b { color: var(--cyan-bright); font-weight: 700; }

/* ---------- Metrics ribbon ---------- */
.metrics { border-radius: var(--radius-lg); padding: 8px; }
.ribbon { display: grid; grid-template-columns: repeat(4, 1fr); }
.metric { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.metric strong { display: block; font-size: .95rem; }
.metric span { font-size: .8rem; color: var(--text-3); }
.ic-offline { background: rgba(99,102,241,.14); color: var(--indigo-bright); }
.ic-target { background: rgba(16,185,129,.14); color: #34D399; }
.ic-timer { background: rgba(244,63,94,.14); color: #FB7185; }
.ic-ai { background: rgba(6,182,212,.14); color: var(--cyan-bright); }
.ic-cyan { background: rgba(6,182,212,.14); color: var(--cyan-bright); }
.ic-rose { background: rgba(244,63,94,.14); color: #FB7185; }
.ic-amber { background: rgba(245,158,11,.14); color: #FBBF24; }
.ic-violet { background: rgba(168,85,247,.14); color: #C084FC; }
.ic-indigo { background: rgba(99,102,241,.14); color: var(--indigo-bright); }
.ic-emerald { background: rgba(16,185,129,.14); color: #34D399; }

/* ---------- Sections ---------- */
.section { padding: 90px 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 54px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: .45em; }
.section-sub { color: var(--text-2); font-size: 1.02rem; }
.section-sub em { color: var(--rose); font-weight: 700; }
.section-sub em.grad-text { color: transparent; }

/* ---------- Science ---------- */
.sci-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 24px; align-items: stretch; }
.sci-chart { border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; }
#sciCanvas { width: 100%; height: 340px; }
.sci-legend { display: flex; gap: 22px; justify-content: center; padding-top: 12px; font-size: .82rem; color: var(--text-2); font-weight: 600; }
.sci-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.dot-rose { background: var(--rose); } .dot-emerald { background: var(--emerald); }
.sci-controls { border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 22px; }
.sci-control-head { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 700; font-size: .92rem; }
.sci-control-head b { color: var(--cyan-bright); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--indigo), var(--cyan)); outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--indigo); cursor: grab;
  box-shadow: 0 4px 14px rgba(99,102,241,.5); transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--indigo); cursor: grab; }
.sci-formula { display: flex; flex-direction: column; gap: 6px; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.sci-formula code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .76rem; color: var(--cyan-bright); }
.sci-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sci-chip {
  font-size: .78rem; font-weight: 700; padding: .45em 1em; border-radius: 99px;
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.3); color: var(--indigo-bright);
  animation: chipIn .4s var(--ease-spring) backwards;
}
.sci-chip:last-child { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.4); color: #34D399; }
@keyframes chipIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.sci-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.sci-stat-row div { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.sci-stat-row b { display: block; font-size: 1.5rem; color: var(--text); }
.sci-stat-row span { font-size: .76rem; color: var(--text-3); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.bento-card { border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 20px; transition: transform .3s var(--ease-spring), box-shadow .3s ease, border-color .3s; }
.bento-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.bento-wide { grid-column: span 2; }
.bento-head { display: flex; gap: 16px; align-items: flex-start; }
.bento-head h3 { font-size: 1.15rem; margin-bottom: 4px; }
.bento-head p { font-size: .88rem; color: var(--text-3); }
.bento-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.bento-link { align-self: flex-start; margin-top: auto; }

/* AI simulator */
.ai-sim { display: flex; flex-direction: column; gap: 14px; }
.ai-input-row { display: flex; gap: 10px; }
.ai-input-row input {
  flex: 1; min-height: 52px; padding: 0 18px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  font-size: .95rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
.ai-input-row input:focus { border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(99,102,241,.18); }
.ai-chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  font-size: .8rem; font-weight: 700; padding: .45em 1.1em; border-radius: 99px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s;
}
.chip-btn:hover { border-color: var(--cyan); color: var(--cyan-bright); transform: translateY(-1px); }
.ai-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ai-placeholder {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 34px; color: var(--text-3); border: 1.5px dashed var(--border); border-radius: var(--radius); text-align: center; font-size: .9rem;
}
.ai-card-out {
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  animation: cardGen .5s var(--ease-spring) backwards;
}
.ai-card-out:nth-child(2) { animation-delay: .12s; }
.ai-card-out:nth-child(3) { animation-delay: .24s; }
@keyframes cardGen { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
.ai-card-out .ac-q { font-weight: 700; font-size: .9rem; }
.ai-card-out .ac-a { font-size: .82rem; color: var(--text-2); border-top: 1px dashed var(--border); padding-top: 10px; }
.ai-card-out .ac-tag { align-self: flex-start; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--cyan-bright); background: rgba(6,182,212,.12); padding: .3em .7em; border-radius: 99px; }
.ai-typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); margin: 0 2px; animation: typing 1s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .15s; } .ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Mini chart */
.mini-chart-wrap { height: 170px; }
.mini-chart-wrap canvas { width: 100%; height: 100%; }

/* Pomodoro */
.pomo-mini { display: flex; align-items: center; gap: 24px; justify-content: center; padding: 8px 0; }
.pomo-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.pomo-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-ring-bg { fill: none; stroke: var(--border); stroke-width: 7; }
.pomo-ring-prog { fill: none; stroke: url(#pomoGrad); stroke: var(--rose); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset .5s linear, stroke .4s; filter: drop-shadow(0 0 6px rgba(244,63,94,.5)); }
.pomo-ring.break-mode .pomo-ring-prog { stroke: var(--emerald); filter: drop-shadow(0 0 6px rgba(16,185,129,.5)); }
.pomo-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pomo-mini-controls { display: flex; flex-direction: column; gap: 10px; }

/* Quiz mini */
.quiz-mini-mount { min-height: 210px; display: flex; flex-direction: column; }
.qmini-q { font-weight: 700; font-size: .95rem; margin-bottom: 12px; }
.qmini-opts { display: grid; gap: 8px; }
.qmini-opt {
  text-align: left; padding: .7em 1em; border-radius: 11px; min-height: 44px;
  background: var(--card-2); border: 1px solid var(--border); font-size: .88rem; font-weight: 600;
  transition: all .15s; display: flex; align-items: center; gap: 10px;
}
.qmini-opt:hover:not(:disabled) { border-color: var(--indigo); transform: translateX(3px); }
.qmini-opt.correct { border-color: var(--emerald); background: rgba(16,185,129,.14); color: #34D399; }
.qmini-opt.wrong { border-color: var(--rose); background: rgba(244,63,94,.12); color: #FB7185; }
.qmini-opt:disabled { cursor: default; }
.qmini-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; font-size: .82rem; color: var(--text-3); font-weight: 700; }
.qmini-score { color: var(--amber); }

/* IO row */
.io-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.io-status { font-size: .82rem; color: var(--emerald); font-weight: 700; }

/* ---------- Deck cards ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.deck-card { border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; gap: 14px; transition: transform .3s var(--ease-spring), box-shadow .3s; }
.deck-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.deck-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; }
.deck-card h3 { font-size: 1.2rem; }
.deck-card p { color: var(--text-3); font-size: .9rem; flex: 1; }
.deck-meta { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-3); font-weight: 700; }
.deck-card .btn { width: 100%; }

/* ---------- Privacy ---------- */
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.privacy-grid h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin-bottom: .5em; }
.privacy-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.privacy-tile { border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.privacy-tile strong { display: block; font-size: .92rem; margin-bottom: 2px; }
.privacy-tile span { font-size: .8rem; color: var(--text-3); }

/* ---------- Testimonials ---------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testimonial { border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 14px; margin: 0; transition: transform .3s var(--ease-spring); }
.testimonial:hover { transform: translateY(-4px); }
.testimonial blockquote { font-size: .9rem; color: var(--text-2); flex: 1; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; flex-shrink: 0; overflow: hidden; border: 2px solid var(--border); box-shadow: 0 6px 16px -6px rgba(2,6,23,.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-rose { background: linear-gradient(135deg, #F43F5E, #FB7185); }
.av-cyan { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.av-indigo { background: linear-gradient(135deg, #6366F1, #818CF8); }
.av-emerald { background: linear-gradient(135deg, #10B981, #34D399); }
.av-violet { background: linear-gradient(135deg, #A855F7, #C084FC); }
.av-amber { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.testimonial figcaption strong { display: block; font-size: .88rem; }
.testimonial figcaption span:not(.avatar) { font-size: .78rem; color: var(--text-3); }

/* ---------- Download / phone ---------- */
.download-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }
.phone-wrap { position: relative; display: grid; place-items: center; }
.phone {
  width: 280px; height: 572px; border-radius: 42px; padding: 10px;
  background: linear-gradient(160deg, #2A3550, #141B2D 60%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 90px -30px rgba(2, 6, 23, .8), inset 0 1px 0 rgba(255,255,255,.08);
  position: relative; overflow: hidden;
}
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; border-radius: 99px; background: #000; z-index: 4; }
.phone-shots { position: relative; }
.phone-shot {
  position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px);
  border-radius: 33px; object-fit: cover; object-position: top center;
  opacity: 0; transform: scale(1.04); transition: opacity .7s var(--ease-spring), transform .7s var(--ease-spring);
  z-index: 1;
}
.phone-shot.active { opacity: 1; transform: scale(1); }
.phone-shade {
  position: absolute; inset: 10px; border-radius: 33px; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.phone-dots { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }
.phone-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); transition: all .3s; min-width: 0; padding: 0; }
.phone-dot.active { width: 26px; border-radius: 99px; background: linear-gradient(90deg, var(--indigo), var(--cyan)); box-shadow: 0 0 10px rgba(99,102,241,.6); }
.float-chip {
  position: absolute; padding: .6em 1.1em; border-radius: 99px; font-size: .8rem; font-weight: 700;
  animation: floaty 4.5s ease-in-out infinite;
}
.chip-a { top: 8%; left: -4%; }
.chip-b { top: 42%; right: -6%; animation-delay: 1.4s; }
.chip-c { bottom: 10%; left: -2%; animation-delay: 2.6s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.download-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: .5em; }
.store-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: .7em 1.4em;
  border-radius: 16px; background: #0B0F19; color: #fff; min-height: 58px;
  border: 1px solid #232D42; transition: transform .2s var(--ease-spring), box-shadow .2s;
}
[data-theme="light"] .store-badge { background: #0F172A; }
.store-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.store-badge small { display: block; font-size: .66rem; opacity: .7; font-weight: 600; letter-spacing: .08em; }
.store-badge strong { font-size: 1.05rem; font-weight: 800; }
.qr-row { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: var(--radius); max-width: 460px; }
#qrCanvas { width: 110px; height: 110px; border-radius: 12px; background: #fff; padding: 8px; }
.qr-row strong { display: block; margin-bottom: 4px; }
.qr-row span { font-size: .82rem; color: var(--text-3); }

/* "Coming soon" app buttons */
.soon-tag {
  font-size: .62em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255,255,255,.18); border-radius: 99px; padding: .25em .65em;
  vertical-align: middle; margin-left: .3em; white-space: nowrap;
}
.store-badge.soon-btn { cursor: pointer; font-family: inherit; text-align: left; }
.store-badge small { opacity: .65; }

/* ---------- Study runner ---------- */
.deck-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.deck-pick {
  position: relative; border-radius: var(--radius-lg); padding: 28px 24px; text-align: left;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: all .28s var(--ease-spring); display: flex; flex-direction: column; gap: 10px;
  min-height: 48px; overflow: hidden;
}
.deck-pick::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(280px 160px at 20% 0%, rgba(99,102,241,.12), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.deck-pick:hover { border-color: rgba(99,102,241,.5); transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.deck-pick:hover::before { opacity: 1; }
.deck-pick.active { border-color: var(--indigo); background: rgba(99,102,241,.1); }
.deck-pick-ic {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(6,182,212,.16));
  color: var(--cyan-bright); border: 1px solid var(--glass-border); margin-bottom: 4px;
}
.deck-pick strong { font-size: 1.05rem; position: relative; }
.deck-pick-desc { font-size: .85rem; color: var(--text-3); line-height: 1.55; flex: 1; position: relative; }
.deck-pick-meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--text-3); font-weight: 700; position: relative; }

.runner { border-radius: var(--radius-lg); padding: 28px; }
.runner-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.runner-progress { flex: 1; height: 10px; border-radius: 99px; background: var(--card-2); overflow: hidden; border: 1px solid var(--border); }
.runner-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--indigo), var(--cyan)); width: 0%; transition: width .4s var(--ease-spring); box-shadow: 0 0 12px rgba(99,102,241,.6); }
.runner-count { font-size: .85rem; font-weight: 800; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.runner-scene { perspective: 1600px; max-width: 560px; margin: 0 auto; }
.runner-card { height: 380px; }
.runner-card .flip-face { cursor: pointer; }
.runner-card .card-term { font-size: 1.9rem; }
.runner-card .card-term .jp-kana { display: block; font-size: 1rem; color: var(--text-3); font-weight: 600; margin-top: 8px; }
.runner-card .card-term .jp-romaji { display: block; font-size: .85rem; color: var(--cyan-bright); font-weight: 700; margin-top: 4px; }
.runner-actions { display: flex; justify-content: center; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.runner-rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; margin: 0 auto; }
.runner-rates .rate-btn { min-height: 60px; font-size: .92rem; }
.rate-hint { text-align: center; font-size: .76rem; color: var(--text-3); margin-top: 12px; }

.victory { text-align: center; padding: 40px 20px; }
.victory-badge { width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), #F97316); box-shadow: 0 16px 40px -10px rgba(245,158,11,.6); animation: victoryPop .6s var(--ease-spring); }
@keyframes victoryPop { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
.victory h2 { font-size: 1.8rem; margin-bottom: 8px; }
.victory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 480px; margin: 26px auto; }
.victory-stats div { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.victory-stats b { display: block; font-size: 1.6rem; }
.victory-stats span { font-size: .74rem; color: var(--text-3); }
.victory .btn { margin: 4px; }

/* ---------- Pomodoro full ---------- */
.pomo-full { border-radius: var(--radius-lg); padding: 40px 30px; text-align: center; }
.pomo-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); margin-bottom: 34px; flex-wrap: wrap; }
.pomo-tab { padding: .6em 1.3em; border-radius: 99px; font-weight: 700; font-size: .85rem; color: var(--text-3); transition: all .2s; }
.pomo-tab.active { background: linear-gradient(135deg, var(--indigo), #4F46E5); color: #fff; box-shadow: 0 6px 18px -6px rgba(99,102,241,.7); }
.pomo-ring-lg { width: 280px; height: 280px; margin: 0 auto 26px; }
.pomo-ring-lg .pomo-ring-bg { stroke-width: 6; }
.pomo-ring-lg .pomo-ring-prog { stroke-width: 6; }
.pomo-time-lg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.pomo-sessions { display: flex; gap: 10px; justify-content: center; margin-bottom: 28px; }
.pomo-session-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all .3s; }
.pomo-session-dot.done { background: var(--emerald); border-color: var(--emerald); box-shadow: 0 0 10px rgba(16,185,129,.6); }
.pomo-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pomo-main { min-width: 190px; font-size: 1.05rem; }
.pomo-hint { margin-top: 26px; font-size: .84rem; color: var(--text-3); }
.pomo-hint a { color: var(--cyan-bright); font-weight: 700; }
.pomo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px auto 0; max-width: 480px; }
.pomo-stat { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; }
.pomo-stat b { display: block; font-size: 1.5rem; line-height: 1.2; color: var(--text); }
.pomo-stat span { font-size: .74rem; color: var(--text-3); font-weight: 600; }
.pomo-tips { border-radius: var(--radius-lg); padding: 26px; margin-top: 22px; }
.pomo-tips h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 18px; }
.pomo-tips h3 svg { color: var(--amber); }
.pomo-tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pomo-tip { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.pomo-tip b { display: block; font-size: .92rem; margin-bottom: 4px; }
.pomo-tip p { font-size: .84rem; color: var(--text-3); line-height: 1.55; }
@media (max-width: 640px) { .pomo-tips-grid { grid-template-columns: 1fr; } }

/* ---------- Quiz full ---------- */
.quiz-board { border-radius: var(--radius-lg); padding: 30px; }
.quiz-intro { text-align: center; padding: 46px 34px; }
.quiz-intro-badge {
  width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 2.4rem; background: linear-gradient(135deg, rgba(245,158,11,.22), rgba(244,63,94,.16));
  border: 1px solid rgba(245,158,11,.3); box-shadow: 0 14px 40px -12px rgba(245,158,11,.5);
  animation: victoryPop .55s var(--ease-spring);
}
.quiz-intro h2 { font-size: 1.8rem; margin-bottom: 8px; }
.quiz-intro-sub { color: var(--text-3); max-width: 480px; margin: 0 auto 26px; font-size: .95rem; }
.quiz-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 30px; text-align: left; }
.quiz-rule {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.quiz-rule span { font-size: 1.3rem; margin-bottom: 4px; }
.quiz-rule b { font-size: .95rem; }
.quiz-rule small { color: var(--text-3); font-size: .78rem; }
.quiz-rule strong { color: var(--amber); }
@media (max-width: 560px) { .quiz-rules { grid-template-columns: 1fr; } }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 14px; flex-wrap: wrap; }
.quiz-hud { display: flex; gap: 10px; flex-wrap: wrap; }
.hud-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--card-2); border: 1px solid var(--border); padding: .5em 1.1em; border-radius: 99px; font-size: .84rem; font-weight: 800; }
.hud-chip .hud-v { color: var(--cyan-bright); }
.hud-chip.combo .hud-v { color: var(--amber); }
.quiz-timer-bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-bottom: 24px; border: 1px solid var(--border); }
.quiz-timer-fill { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--emerald), var(--amber) 70%, var(--rose)); transition: width .2s linear; }
.quiz-q { font-size: 1.25rem; font-weight: 800; margin-bottom: 22px; letter-spacing: -.01em; }
.quiz-opts { display: grid; gap: 12px; }
.quiz-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 1em 1.2em; border-radius: 14px; min-height: 54px;
  background: var(--card-2); border: 1.5px solid var(--border); font-weight: 600; font-size: .98rem;
  transition: all .16s var(--ease-spring);
}
.quiz-opt:hover:not(:disabled) { border-color: var(--indigo); transform: translateX(6px); box-shadow: 0 8px 22px -12px rgba(99,102,241,.6); }
.quiz-opt .opt-key { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); font-size: .8rem; font-weight: 800; color: var(--text-3); flex-shrink: 0; }
.quiz-opt.correct { border-color: var(--emerald); background: rgba(16,185,129,.13); }
.quiz-opt.correct .opt-key { background: var(--emerald); color: #06281C; border-color: var(--emerald); }
.quiz-opt.wrong { border-color: var(--rose); background: rgba(244,63,94,.1); }
.quiz-opt.wrong .opt-key { background: var(--rose); color: #310810; border-color: var(--rose); }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback { margin-top: 18px; font-weight: 700; min-height: 28px; text-align: center; }
.quiz-feedback.good { color: #34D399; } .quiz-feedback.bad { color: #FB7185; }
.quiz-end { text-align: center; padding: 30px 10px; }
.quiz-end .rank { font-size: 3.4rem; margin-bottom: 6px; }
.quiz-end h2 { font-size: 1.9rem; margin-bottom: 6px; }
.quiz-end p { color: var(--text-3); margin-bottom: 22px; }
.quiz-end .victory-stats b { font-size: 1.7rem; }
.new-highscore { display: inline-block; background: rgba(245,158,11,.15); color: #FBBF24; font-weight: 800; padding: .4em 1.1em; border-radius: 99px; font-size: .85rem; margin-bottom: 14px; animation: pulse 1.4s infinite; }

/* ---------- Analytics ---------- */
.analytics-board { border-radius: var(--radius-lg); padding: 26px; }
.analytics-toolbar { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg-btn { padding: .55em 1.2em; border-radius: 99px; font-size: .82rem; font-weight: 700; color: var(--text-3); transition: all .2s; min-height: 38px; }
.seg-btn.active { background: linear-gradient(135deg, var(--indigo), #4F46E5); color: #fff; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-tile { display: flex; align-items: center; gap: 12px; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.stat-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.stat-tile b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: .76rem; color: var(--text-3); }
.chart-wrap { position: relative; height: 380px; }
.chart-wrap canvas { width: 100%; height: 100%; cursor: crosshair; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 10px 14px; font-size: .8rem; box-shadow: var(--shadow-lg);
  transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap;
}
.chart-tooltip b { display: block; color: var(--cyan-bright); font-size: .95rem; }
.chart-tooltip span { color: var(--text-3); }

/* ---------- Legal docs ---------- */
.page-doc { max-width: 820px; }
.doc-updated { color: var(--text-3); font-size: .88rem; }
.doc-toc {
  border-radius: var(--radius); padding: 18px 22px; margin-top: 22px;
  border-left: 3px solid var(--indigo);
}
.doc-toc h4 {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3); margin-bottom: 10px;
}
.doc-toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: 28px; }
.doc-toc li { counter-increment: toc; }
.doc-toc button {
  display: block; width: 100%; text-align: left; padding: .42em 0;
  color: var(--text-2); font-size: .88rem; font-weight: 600; background: none; border: none;
  font-family: inherit; line-height: 1.4; transition: color .2s;
}
.doc-toc button::before {
  content: counter(toc) ". "; color: var(--cyan-bright); font-weight: 800; margin-right: 4px;
}
.doc-toc button:hover { color: var(--cyan-bright); }
.doc { border-radius: var(--radius-lg); padding: 44px; counter-reset: section; }
.doc.doc-numbered h2 { counter-increment: section; }
.doc.doc-numbered h2::before {
  content: counter(section); display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin-right: 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.14));
  border: 1px solid rgba(99,102,241,.3); color: var(--indigo-bright);
  font-size: 1rem; vertical-align: middle;
}
.doc h2 { font-size: 1.25rem; margin: 1.7em 0 .6em; scroll-margin-top: 100px; }
.doc h2:first-child { margin-top: 0; }
@media (max-width: 560px) { .doc-toc ol { columns: 1; } }
.doc p, .doc li { color: var(--text-2); font-size: .95rem; margin-bottom: .8em; }
.doc ul { padding-left: 22px; margin-bottom: .8em; }
.doc li { margin-bottom: .5em; }
.doc code { background: var(--card-2); border: 1px solid var(--border); padding: .15em .5em; border-radius: 6px; font-size: .85em; font-family: ui-monospace, Menlo, monospace; color: var(--cyan-bright); }
.doc a { color: var(--cyan-bright); font-weight: 700; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { border-radius: var(--radius); padding: 0 22px; transition: border-color .25s, box-shadow .25s; }
.faq-item[open] { border-color: rgba(99,102,241,.45); box-shadow: var(--shadow-glow); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; font-weight: 700; font-size: 1rem; min-height: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-ic {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(99,102,241,.12); color: var(--indigo-bright);
  transition: transform .3s var(--ease-spring);
}
.faq-item[open] .faq-ic { transform: rotate(45deg); background: rgba(16,185,129,.15); color: #34D399; }
.faq-item p {
  color: var(--text-2); font-size: .92rem; padding: 0 0 20px; max-width: 720px; line-height: 1.7;
}
.faq-item p strong { color: var(--text); }
.faq-item p em { color: var(--cyan-bright); font-style: italic; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 34px; padding-bottom: 44px; }
.footer-brand p { color: var(--text-3); font-size: .88rem; margin: 16px 0; max-width: 300px; }
.footer-contact { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan-bright); font-weight: 700; font-size: .88rem; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-2); font-size: .9rem; padding: .4em 0; transition: color .2s; }
.footer-col a:hover { color: var(--cyan-bright); }
.footer-col a.gh-link { display: inline-flex; align-items: center; gap: 8px; }
.footer-col a.gh-link svg { flex-shrink: 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0 30px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-3); }
.footer-made { font-weight: 700; }

/* ---------- Back to top ---------- */
.back-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--cyan)); color: #fff;
  box-shadow: 0 14px 34px -8px rgba(99,102,241,.7);
  opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none;
  transition: all .3s var(--ease-spring);
}
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(420px, calc(100% - 40px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: .9em 1.3em; border-radius: 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 600;
  animation: toastIn .4s var(--ease-spring);
}
.toast.out { animation: toastOut .35s ease forwards; }
.toast .t-ic { color: var(--emerald); display: grid; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ---------- Modal ---------- */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; background: var(--scrim);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(720px, 100%); max-height: 86vh; border-radius: var(--radius-lg); display: flex; flex-direction: column; background: var(--glass-bg); animation: modalIn .35s var(--ease-spring); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.1rem; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border); }

.guide-doc { background: #fff; color: #0F172A; border-radius: var(--radius-sm); padding: 30px; font-size: .88rem; }
.guide-doc h1 { font-size: 1.4rem; margin-bottom: 4px; color: #0F172A; }
.guide-doc .g-meta { color: #64748B; font-size: .78rem; margin-bottom: 18px; }
.guide-doc .g-card { border: 1px solid #E2E8F0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; page-break-inside: avoid; }
.guide-doc .g-q { font-weight: 800; margin-bottom: 4px; }
.guide-doc .g-a { color: #475569; }
.guide-doc .g-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: #0891B2; }

/* ---------- Confetti ---------- */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 180; }

/* ---------- Reveal on scroll ---------- */
.reveal { transition: opacity .7s var(--ease-spring), transform .7s var(--ease-spring); }
html.js .reveal:not(.in) { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in, html.js .reveal:not(.in) { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy { text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-ctas, .hero-social { justify-content: center; }
  .sci-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .download-grid { grid-template-columns: 1fr; gap: 50px; }
  .phone-wrap { order: 2; }
}
@media (max-width: 860px) {
  .nav-desktop, .hide-sm { display: none; }
  .hamburger { display: grid; }
  .bento { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  .ai-cards { grid-template-columns: 1fr; }
  .deck-grid, .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .privacy-grid { grid-template-columns: 1fr; gap: 32px; }
  .privacy-tiles { grid-template-columns: 1fr 1fr; }
  .ribbon { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: none; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .deck-select { grid-template-columns: 1fr; }
  .chart-wrap { height: 300px; }
}
@media (max-width: 560px) {
  .container { width: calc(100% - 28px); }
  .section { padding: 64px 0; }
  .hero { padding-top: calc(var(--header-h) + 44px); }
  .deck-grid, .testimonial-grid, .privacy-tiles, .ribbon { grid-template-columns: 1fr; }
  .metric + .metric { border-left: none; border-top: 1px solid var(--border); }
  .metric:nth-child(3) { border-top: 1px solid var(--border); }
  .flip-card, .runner-card { height: 440px; }
  .card-term { font-size: 1.9rem; }
  .runner-card .card-term { font-size: 1.55rem; }
  .rate-btn { font-size: .78rem; }
  .pomo-ring-lg { width: 230px; height: 230px; }
  .pomo-time-lg { font-size: 2.7rem; }
  .analytics-toolbar { flex-direction: column; align-items: stretch; }
  .seg { justify-content: center; }
  .doc { padding: 26px 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .ai-input-row { flex-direction: column; }
  .victory-stats, .quiz-end .victory-stats { grid-template-columns: 1fr; }
  .pomo-mini { flex-direction: column; gap: 14px; }
  .pomo-mini-controls { flex-direction: row; }
  .float-chip { display: none; }
  .store-row .store-badge { flex: 1; justify-content: center; }
  .qr-row { flex-direction: column; text-align: center; }
  .quiz-q { font-size: 1.08rem; }
}

/* ---------- Print (PDF export) ---------- */
@media print {
  body * { visibility: hidden; }
  #guideContent, #guideContent * { visibility: visible; }
  #guideContent { position: absolute; inset: 0; padding: 0; }
  .guide-doc { border: none; }
  .modal-overlay { position: absolute; background: #fff; backdrop-filter: none; }
}
