*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, [data-theme="light"] {
  --ink: #1a0a2e; --paper: #ffffff; --card-bg: #ffffff; --surface: #f7f4fd;
  --accent: #7c3aed; --accent-light: #ede9fe; --accent-xlight: #f5f3ff; --muted: #7c6fa0;
  --border: rgba(124,58,237,0.12); --border-strong: rgba(124,58,237,0.22);
  --shadow-sm: 0 2px 8px rgba(124,58,237,0.08); --shadow-md: 0 6px 24px rgba(124,58,237,0.13); --shadow-lg: 0 16px 48px rgba(124,58,237,0.18);
  --nav-bg: rgba(255,255,255,0.92); --heat-empty: #e5e7eb; --heat-1: #bbf7d0; --heat-2: #4ade80; --heat-3: #16a34a;
  --recall-easy: #16a34a; --recall-medium: #d97706; --recall-hard: #dc2626;
}
[data-theme="dark"] {
  --ink: #f0eafb; --paper: #100820; --card-bg: #1c1030; --surface: #251540;
  --accent: #9d5ff5; --accent-light: #3b1f6e; --accent-xlight: #2a1550; --muted: #9d8ec0;
  --border: rgba(157,95,245,0.18); --border-strong: rgba(157,95,245,0.32);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3); --shadow-md: 0 6px 24px rgba(0,0,0,0.4); --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --nav-bg: rgba(16,8,32,0.92); --heat-empty: #2a1f3d; --heat-1: #14532d; --heat-2: #16a34a; --heat-3: #4ade80;
  --recall-easy: #4ade80; --recall-medium: #fbbf24; --recall-hard: #f87171;
}

html { font-size: 16px; scroll-behavior: smooth; background: var(--paper); }
body { font-family: 'DM Sans', sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; min-height: 100dvh; line-height: 1.6; transition: background 0.3s, color 0.3s; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); -webkit-tap-highlight-color: transparent; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes spin { to { transform: rotateY(180deg); } }
.reveal-on-scroll { opacity: 0; transform: translateY(34px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
}

/* ── SHARED ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500; padding: 9px 20px; border-radius: 100px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--paper); } .btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--border-strong); } .btn-secondary:hover { background: var(--accent-xlight); border-color: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; } .btn-accent:hover { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(124,58,237,0.4); }
.btn-white { background: #fff; color: var(--accent); border-color: rgba(255,255,255,0.3); } .btn-white:hover { background: rgba(255,255,255,0.9); transform: translateY(-1px); }
.btn-full { width: 100%; } .btn-sm { padding: 6px 14px; font-size: 0.8rem; } .btn-lg { padding: 14px 32px; font-size: 1rem; font-weight: 600; }
.btn-danger-outline { background: transparent; color: #dc2626; border: 1px solid #fca5a5; border-radius: 100px; padding: 4px 12px; font-size: 0.75rem; font-weight: 500; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; }
.btn-danger-outline:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger-solid { background: #dc2626; color: #fff; border: 1px solid #dc2626; border-radius: 100px; padding: 9px 20px; font-size: 0.875rem; font-weight: 500; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; width: 100%; }
.btn-danger-solid:hover { background: #b91c1c; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-family: 'Inter', sans-serif; }
input[type="text"], input[type="email"], input[type="password"], textarea, select { width: 100%; font-family: 'DM Sans', sans-serif; font-size: 0.95rem; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card-bg); color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s; outline: none; appearance: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ── LANDING NAV ──────────────────────────────────── */
#landing-screen { display: none; }
.lnav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: background 0.3s; }
[data-theme="dark"] .lnav { background: rgba(16,8,32,0.85); }
.lnav-logo { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.3rem; letter-spacing: 0; color: var(--ink); text-decoration: none; }
.lnav-logo span { color: var(--accent); }
.lnav-right { display: flex; align-items: center; gap: 10px; }
.lnav-link { font-size: 0.875rem; color: var(--muted); text-decoration: none; padding: 6px 14px; border-radius: 100px; transition: all 0.2s; }
button.lnav-link { border: 0; background: transparent; font-family: 'DM Sans', sans-serif; cursor: pointer; }
.lnav-link:hover { color: var(--accent); background: var(--accent-xlight); }

/* ── HERO ─────────────────────────────────────────── */
.hero { padding: 140px 2rem 80px; text-align: center; max-width: 860px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-xlight); border: 1px solid var(--border); border-radius: 100px; padding: 6px 16px; font-size: 0.8rem; font-weight: 600; color: var(--accent); margin-bottom: 2rem; font-family: 'Inter', sans-serif; letter-spacing: 0; animation: fadeUp 0.6s ease both; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.hero h1 { font-family: 'Inter', sans-serif; font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: 0; line-height: 1.05; color: var(--ink); margin-bottom: 1.5rem; animation: fadeUp 0.6s 0.1s ease both; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 520px; margin: 0 auto 2.5rem; line-height: 1.7; animation: fadeUp 0.6s 0.2s ease both; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: fadeUp 0.6s 0.3s ease both; }

/* ── DEMO CARD ────────────────────────────────────── */
.demo-section { padding: 0 2rem 80px; max-width: 680px; margin: 0 auto; animation: fadeUp 0.8s 0.4s ease both; }
.demo-label { text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; font-family: 'Inter', sans-serif; }
.demo-card-wrap { perspective: 1200px; cursor: pointer; margin-bottom: 1.5rem; }
.demo-card { width: 100%; min-height: 220px; position: relative; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); border-radius: 24px; }
.demo-card.flipped { transform: rotateY(180deg); }
.demo-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 24px; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; text-align: center; }
.demo-face-front { background: var(--card-bg); box-shadow: var(--shadow-lg); }
.demo-face-back { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); transform: rotateY(180deg); box-shadow: 0 16px 48px rgba(124,58,237,0.35); }
.demo-face-badge { font-family: 'Inter', sans-serif; font-size: 0.65rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; padding: 4px 12px; border-radius: 100px; margin-bottom: 1rem; }
.demo-face-front .demo-face-badge { background: var(--accent-light); color: var(--accent); }
.demo-face-back .demo-face-badge { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.85); }
.demo-face-text { font-family: 'Inter', sans-serif; font-size: 1.4rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; color: var(--ink); }
.demo-face-back .demo-face-text { color: #fff; }
.demo-face-hint { font-size: 0.78rem; color: var(--muted); margin-top: 1rem; }
.demo-face-back .demo-face-hint { color: rgba(255,255,255,0.5); }
.demo-recall-row { display: flex; gap: 10px; justify-content: center; transition: opacity 0.3s; }
.demo-recall-row.hidden { opacity: 0; pointer-events: none; }
.demo-recall-btn { flex: 1; max-width: 160px; padding: 10px 8px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0; transition: all 0.2s; text-align: center; }
.drb-hard { background: rgba(220,38,38,0.1); color: #dc2626; border-color: rgba(220,38,38,0.3); }
.drb-hard:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.drb-medium { background: rgba(217,119,6,0.1); color: #d97706; border-color: rgba(217,119,6,0.3); }
.drb-medium:hover { background: #d97706; color: #fff; border-color: #d97706; }
.drb-easy { background: rgba(22,163,74,0.1); color: #16a34a; border-color: rgba(22,163,74,0.3); }
.drb-easy:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.demo-deck-dots { display: flex; justify-content: center; gap: 6px; margin-top: 1.25rem; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background 0.3s; }
.demo-dot.active { background: var(--accent); }

/* ── FEATURES ─────────────────────────────────────── */
.summary-section { padding: 20px 2rem 80px; max-width: 960px; margin: 0 auto; }
.summary-band { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; }
.summary-title { font-family: 'Inter', sans-serif; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: 0; line-height: 1.12; color: var(--ink); margin-bottom: 0.75rem; }
.summary-copy { color: var(--muted); font-size: 0.98rem; line-height: 1.75; }
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.5rem; }
.summary-list { display: grid; gap: 10px; }
.summary-point { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; }
.summary-point strong { display: block; font-family: 'Inter', sans-serif; color: var(--ink); font-size: 0.88rem; margin-bottom: 2px; }
.summary-point span { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.features-section { padding: 80px 2rem; background: var(--surface); }
.features-inner { max-width: 900px; margin: 0 auto; }
.section-label { font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.section-title { font-family: 'Inter', sans-serif; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: 0; line-height: 1.1; color: var(--ink); margin-bottom: 3rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.feature-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 1.75rem; transition: all 0.2s; }
.feature-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0; margin-bottom: 0.5rem; color: var(--ink); }
.feature-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ── COMING SOON ─────────────────────────────────── */
.coming-section { padding: 80px 2rem; max-width: 900px; margin: 0 auto; }
.coming-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.coming-title { font-family: 'Inter', sans-serif; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: 0; line-height: 1.1; color: var(--ink); }
.coming-sub { color: var(--muted); font-size: 0.95rem; line-height: 1.6; max-width: 320px; }
.coming-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.coming-card { border: 1px solid var(--border); background: var(--card-bg); border-radius: 20px; padding: 1.75rem; position: relative; overflow: hidden; }
.coming-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
.coming-badge { display: inline-flex; align-items: center; font-family: 'Inter', sans-serif; font-size: 0.65rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--accent); background: var(--accent-xlight); border: 1px solid var(--border); border-radius: 100px; padding: 4px 10px; margin-bottom: 1rem; }
.coming-icon { font-size: 2rem; margin-bottom: 0.9rem; }
.coming-card-title { font-family: 'Inter', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.coming-card-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }

/* ── HOW IT WORKS ─────────────────────────────────── */
.how-section { padding: 80px 2rem; max-width: 860px; margin: 0 auto; }
.steps { display: flex; flex-direction: column; gap: 0; margin-top: 3rem; }
.step { display: flex; gap: 1.5rem; align-items: flex-start; padding-bottom: 2.5rem; position: relative; }
.step:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 44px; bottom: 0; width: 2px; background: var(--border); }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 0.875rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(124,58,237,0.35); }
.step-body { padding-top: 6px; }
.step-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); margin-bottom: 4px; }
.step-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ── STATS STRIP ─────────────────────────────────── */
.stats-strip { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #6d28d9 100%); padding: 60px 2rem; }
.stats-inner { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.stat-val { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 2.5rem; color: #fff; letter-spacing: 0; line-height: 1; }
.stat-lbl { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-top: 6px; }

/* ── CTA SECTION ─────────────────────────────────── */
.cta-section { padding: 100px 2rem; text-align: center; }
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-title { font-family: 'Inter', sans-serif; font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: 0; line-height: 1.1; color: var(--ink); margin-bottom: 1rem; }
.cta-sub { color: var(--muted); font-size: 1rem; margin-bottom: 2.5rem; line-height: 1.7; }

/* ── FOOTER ──────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 2rem; text-align: center; font-size: 0.8rem; color: var(--muted); }
footer strong { color: var(--accent); font-weight: 700; font-family: 'Inter', sans-serif; }

/* ── AUTH SCREEN ─────────────────────────────────── */
#auth-screen { display: none; min-height: 100vh; align-items: center; justify-content: center; background: var(--accent-xlight); padding: 2rem 1rem; }
.auth-card { background: var(--card-bg); border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 2.5rem; animation: fadeUp 0.4s ease; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); cursor: pointer; background: none; border: none; margin-bottom: 1.5rem; font-family: 'DM Sans', sans-serif; padding: 0; transition: color 0.15s; }
.auth-back:hover { color: var(--accent); }
.auth-logo { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: 0; text-align: center; margin-bottom: 0.25rem; color: var(--ink); }
.auth-logo span { color: var(--accent); }
.auth-tagline { text-align: center; color: var(--muted); font-size: 0.875rem; margin-bottom: 2rem; }
.auth-tabs { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 1.75rem; gap: 4px; }
.auth-tab { flex: 1; padding: 8px; border-radius: 9px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500; background: transparent; color: var(--muted); transition: all 0.2s; }
.auth-tab.active { background: var(--card-bg); color: var(--accent); box-shadow: var(--shadow-sm); }
.auth-error { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; color: #b91c1c; margin-bottom: 1rem; display: none; }
.auth-note { background: #dcfce7; border: 1px solid #86efac; border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; color: #166534; margin-bottom: 1rem; display: none; }
[data-theme="dark"] .auth-note { background: rgba(22,163,74,0.16); border-color: rgba(74,222,128,0.38); color: #86efac; }
.auth-helper-row { display: flex; justify-content: flex-end; margin-top: -0.35rem; margin-bottom: 1rem; }
.text-link { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.83rem; font-weight: 600; padding: 0; }
.text-link:hover { text-decoration: underline; }

/* ── SUPPORT SCREEN ───────────────────────────────── */
#support-screen { display: none; min-height: 100vh; background: var(--accent-xlight); padding: 96px 1rem 3rem; }
.support-wrap { width: 100%; max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 1.25rem; align-items: start; }
.support-intro, .support-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-md); padding: 2rem; }
.support-kicker { font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.support-intro h1 { font-family: 'Inter', sans-serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: 0; line-height: 1.05; color: var(--ink); margin-bottom: 1rem; }
.support-intro p { color: var(--muted); line-height: 1.7; margin-bottom: 1.5rem; }
.support-methods { display: grid; gap: 10px; }
.support-method { border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; background: var(--surface); }
.support-method strong { display: block; font-family: 'Inter', sans-serif; font-size: 0.88rem; color: var(--ink); margin-bottom: 2px; }
.support-method span { color: var(--muted); font-size: 0.84rem; }
.support-card textarea { min-height: 130px; }

/* ── APP NAV ─────────────────────────────────────── */
#app-screen { display: none; }
nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); border-bottom: 1px solid var(--border); padding: 0 2rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; backdrop-filter: blur(12px); transition: background 0.3s; }
.nav-logo { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.25rem; letter-spacing: 0; text-decoration: none; color: var(--ink); display: flex; align-items: center; }
.nav-logo .dot { color: var(--accent); }
.nav-tabs { display: flex; gap: 4px; justify-content: center; }
.nav-tab { font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500; padding: 6px 18px; border-radius: 100px; border: 1px solid transparent; cursor: pointer; background: transparent; color: var(--muted); transition: all 0.2s; }
.nav-tab:hover { color: var(--accent); background: var(--accent-xlight); } .nav-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.nav-user-btn { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 100px; padding: 5px 14px 5px 6px; cursor: pointer; text-decoration: none; transition: all 0.2s; color: var(--ink); }
.nav-user-btn:hover { border-color: var(--accent); background: var(--accent-xlight); }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-user-name { font-size: 0.85rem; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-xlight); }
.theme-toggle svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle:hover svg { stroke: var(--accent); }
.icon-sun, .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }

/* ── APP MAIN ────────────────────────────────────── */
main { max-width: 860px; margin: 0 auto; padding: 2.5rem 2rem 6rem; }
.panel { display: none; } .panel.active { display: block; animation: fadeUp 0.3s ease; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-family: 'Inter', sans-serif; font-size: 2.25rem; font-weight: 800; letter-spacing: 0; line-height: 1.1; color: var(--ink); }
.page-header p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }

/* STREAK */
/* BUCKETS */
.bucket-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; margin-bottom: 1.5rem; }
.bucket-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 0.85rem; }
.bucket-title { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.bucket-note { font-size: 0.78rem; color: var(--muted); text-align: right; }
.bucket-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bucket-square { min-height: 74px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: all 0.18s; font-family: 'Inter', sans-serif; }
.bucket-square span { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.bucket-square small { font-size: 0.72rem; color: var(--muted); }
.bucket-square:hover, .bucket-square.active { border-color: var(--accent); background: var(--accent); color: #fff; transform: translateY(-1px); }
.bucket-square:hover small, .bucket-square.active small { color: rgba(255,255,255,0.75); }

/* DECK GRID */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 2.5rem; }
.deck-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem 1.25rem 1rem; transition: all 0.2s; position: relative; overflow: hidden; }
.deck-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }
.deck-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.deck-card:hover::before { transform: scaleX(1); }
.deck-card-name { display: block; width: 100%; border: 0; background: transparent; text-align: left; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); cursor: pointer; padding: 0; }
.deck-card-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.deck-card-meta { font-size: 0.8rem; color: var(--muted); }
.deck-card-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.deck-btn { font-size: 0.75rem; font-weight: 500; padding: 4px 12px; border-radius: 100px; border: 1px solid var(--border-strong); cursor: pointer; background: transparent; color: var(--accent); transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.deck-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.deck-btn[data-deck-action="delete"]:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.new-deck-card { background: transparent; border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 1.25rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; color: var(--muted); font-size: 0.875rem; transition: all 0.2s; }
.new-deck-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-xlight); }
.new-deck-card .plus { font-size: 1.75rem; font-weight: 300; line-height: 1; }

/* EDIT */
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); cursor: pointer; background: none; border: none; margin-bottom: 1.5rem; transition: color 0.15s; font-family: 'DM Sans', sans-serif; padding: 0; }
.back-btn:hover { color: var(--accent); }
.edit-title { font-family: 'Inter', sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: 0; margin-bottom: 1.75rem; color: var(--ink); }
.add-card-box { background: var(--accent-xlight); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; }
.add-card-box .box-title { font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 700; margin-bottom: 1rem; color: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.edit-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface); }
.edit-header-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.card-list-item { padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; transition: background 0.15s; }
.card-list-item:hover { background: var(--accent-xlight); } .card-list-item:last-child { border-bottom: none; }
.card-list-num { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700; color: var(--accent); min-width: 24px; padding-top: 2px; }
.card-list-body { flex: 1; min-width: 0; }
.card-list-front { font-weight: 500; font-size: 0.9rem; color: var(--ink); } .card-list-back { font-size: 0.85rem; color: var(--muted); margin-top: 3px; }
.card-list-bucket { flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 3px 8px; font-size: 0.7rem; font-weight: 800; font-family: 'Inter', sans-serif; }
.card-list-del { background: transparent; border: none; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 2px 6px; border-radius: 6px; transition: all 0.15s; line-height: 1; }
.card-list-del:hover { background: #fee2e2; color: #dc2626; }
.empty-cards { padding: 2.5rem; text-align: center; color: var(--muted); font-size: 0.875rem; }

/* STUDY */
.study-deck-select-row { display: flex; gap: 10px; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; }
.study-deck-select-row select { max-width: 300px; }
.study-deck-name { font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: 0; color: var(--ink); }
.study-deck-label { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0; color: var(--muted); }
.progress-wrap { margin-bottom: 1.5rem; }
.progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.8rem; color: var(--muted); }
.progress-bar-bg { height: 6px; background: var(--accent-light); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); }
.card-scene { perspective: 1400px; margin-bottom: 1.5rem; }
.flashcard { width: 100%; min-height: 260px; position: relative; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.4,0,0.2,1); cursor: pointer; border-radius: 20px; }
.flashcard.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; text-align: center; box-shadow: var(--shadow-md); }
.card-face-front { background: var(--card-bg); }
.card-face-back { background: var(--accent); transform: rotateY(180deg); }
.face-badge { position: absolute; top: 1.25rem; left: 1.25rem; font-family: 'Inter', sans-serif; font-size: 0.65rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; padding: 4px 10px; border-radius: 100px; }
.card-face-front .face-badge { background: var(--accent-light); color: var(--accent); }
.card-face-back .face-badge { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.75); }
.card-face-text { font-family: 'Inter', sans-serif; font-size: 1.4rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; max-width: 560px; color: var(--ink); }
.card-face-back .card-face-text { color: #fff; }
.flip-hint { position: absolute; bottom: 1.25rem; font-size: 0.75rem; color: var(--muted); }
.card-face-back .flip-hint { color: rgba(255,255,255,0.45); }
.recall-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.recall-row.visible { opacity: 1; pointer-events: all; }
.recall-btn { flex: 1; max-width: 150px; min-height: 58px; padding: 10px 8px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0; transition: all 0.2s; text-align: center; }
.recall-easy { background: rgba(22,163,74,0.12); color: var(--recall-easy); border-color: rgba(22,163,74,0.3); } .recall-easy:hover { background: var(--recall-easy); color: #fff; border-color: var(--recall-easy); }
.recall-medium { background: rgba(217,119,6,0.12); color: var(--recall-medium); border-color: rgba(217,119,6,0.3); } .recall-medium:hover { background: var(--recall-medium); color: #fff; border-color: var(--recall-medium); }
.recall-hard { background: rgba(220,38,38,0.12); color: var(--recall-hard); border-color: rgba(220,38,38,0.3); } .recall-hard:hover { background: var(--recall-hard); color: #fff; border-color: var(--recall-hard); }
.recall-cross { background: rgba(220,38,38,0.12); color: var(--recall-hard); border-color: rgba(220,38,38,0.3); } .recall-cross:hover { background: var(--recall-hard); color: #fff; border-color: var(--recall-hard); }
.recall-tick { background: rgba(22,163,74,0.12); color: var(--recall-easy); border-color: rgba(22,163,74,0.3); } .recall-tick:hover { background: var(--recall-easy); color: #fff; border-color: var(--recall-easy); }
.recall-hint { text-align: center; font-size: 0.78rem; color: var(--muted); margin-bottom: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.recall-hint.visible { opacity: 1; }
.deck-complete { text-align: center; padding: 3rem 1.5rem; }
.deck-complete-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.deck-complete-title { font-family: 'Inter', sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: 0; color: var(--ink); margin-bottom: 0.5rem; }
.deck-complete-sub { color: var(--muted); font-size: 0.95rem; }
.deck-complete-recall { display: flex; gap: 20px; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
.recall-stat { text-align: center; } .recall-stat-val { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.5rem; } .recall-stat-lbl { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.recall-stat.easy .recall-stat-val { color: var(--recall-easy); } .recall-stat.medium .recall-stat-val { color: var(--recall-medium); } .recall-stat.hard .recall-stat-val { color: var(--recall-hard); }
.deck-complete-reset { display: inline-block; margin-top: 1.5rem; cursor: pointer; background: var(--accent-xlight); border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 0.875rem 1.5rem; font-size: 0.875rem; color: var(--muted); transition: all 0.2s; }
.deck-complete-reset:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.study-empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.study-empty-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; color: var(--ink); }

/* ACCOUNT */
.account-avatar-block { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; }
.account-avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.account-name { font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: 0; }
.account-username { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
.account-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 1.25rem; }
.account-card-header { padding: 0.875rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--muted); }
.account-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); gap: 12px; }
.account-row:last-child { border-bottom: none; }
.account-row-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: 0; text-transform: uppercase; }
.account-row-value { font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.provider-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-xlight); border: 1px solid var(--border); border-radius: 100px; padding: 3px 10px; font-size: 0.75rem; color: var(--accent); font-weight: 500; }
.account-row-theme { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); gap: 12px; }
.theme-switch { position: relative; width: 52px; height: 28px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.theme-switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 100px; cursor: pointer; transition: background 0.3s; }
.theme-switch input:checked + .theme-switch-track { background: var(--accent); }
.theme-switch-thumb { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform 0.3s; display: flex; align-items: center; justify-content: center; font-size: 11px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.theme-switch input:checked ~ .theme-switch-thumb { transform: translateX(24px); }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(26,10,46,0.55); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal { background: var(--card-bg); border-radius: 20px; padding: 2rem; width: 100%; max-width: 480px; margin: 1rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-family: 'Inter', sans-serif; font-size: 1.25rem; font-weight: 700; letter-spacing: 0; color: var(--ink); }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 1rem; color: var(--muted); transition: all 0.15s; }
.modal-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }

/* TOAST */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--accent); color: #fff; padding: 10px 22px; border-radius: 100px; font-size: 0.85rem; font-weight: 500; box-shadow: var(--shadow-lg); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1); z-index: 300; pointer-events: none; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .lnav { height: auto; min-height: 64px; padding: 10px 1rem; gap: 10px; align-items: center; }
  .lnav-logo { font-size: 1.15rem; flex-shrink: 0; }
  .lnav-right { gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
  .lnav-right .lnav-link[href="#features"], .lnav-right .lnav-link[href="#how"] { display: none; }
  .lnav-link { padding: 5px 8px; font-size: 0.8rem; }
  .lnav .btn-sm { padding: 6px 10px; font-size: 0.76rem; }
  .hero { padding: 120px 1.2rem 56px; } .hero h1 { font-size: 2.2rem; }
  .hero-sub { font-size: 1rem; line-height: 1.6; }
  .hero-ctas .btn, .summary-actions .btn { width: 100%; max-width: 320px; }
  .hero-ctas, .summary-actions { align-items: center; }
  .demo-section, .features-section, .coming-section, .how-section, .cta-section { padding-left: 1.2rem; padding-right: 1.2rem; }
  .demo-card { min-height: 250px; }
  .demo-face { padding: 1.6rem; }
  .demo-face-text { font-size: 1.15rem; }
  .demo-recall-row { flex-direction: column; align-items: stretch; }
  .demo-recall-btn { max-width: none; }
  .summary-section { padding-left: 1.2rem; padding-right: 1.2rem; } .summary-band, .support-wrap { grid-template-columns: 1fr; }
  .summary-band, .support-intro, .support-card, .auth-card { padding: 1.4rem; }
  #support-screen { padding-top: 82px; }
  .stats-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  nav { height: auto; min-height: 60px; padding: 8px 1rem; grid-template-columns: 1fr auto; row-gap: 8px; }
  .nav-logo { font-size: 1.08rem; }
  .nav-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; width: 100%; }
  .nav-tab { flex: 1; padding: 7px 10px; font-size: 0.8rem; }
  .nav-right { grid-column: 2; grid-row: 1; }
  main { padding: 1.5rem 1rem 5rem; } .two-col { grid-template-columns: 1fr; }
  .deck-grid { grid-template-columns: 1fr; }
  .deck-card-actions { align-items: stretch; }
  .deck-card-actions .deck-btn { flex: 1 1 calc(50% - 6px); }
  .bucket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bucket-head { align-items: flex-start; flex-direction: column; }
  .bucket-note { text-align: left; }
  .card-face-text { font-size: 1.1rem; }
  .study-deck-select-row select { max-width: none; }
  .flashcard { min-height: 300px; }
  .card-face { padding: 2rem 1.25rem; }
  .recall-row { flex-direction: column; align-items: stretch; }
  .recall-btn { max-width: none; }
  .page-header h1 { font-size: 1.75rem; } .account-avatar-block { flex-direction: column; text-align: center; }
  .account-row, .account-row-theme { align-items: flex-start; flex-direction: column; }
  .nav-user-name { display: none; } .recall-btn { font-size: 1.5rem; padding: 10px 8px; }
  .features-grid { grid-template-columns: 1fr; }
  .coming-head { display: block; }
  .coming-sub { margin-top: 0.75rem; max-width: none; }
  .coming-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.4rem; }
  .toast { max-width: calc(100vw - 2rem); white-space: normal; text-align: center; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 1.95rem; }
  .section-title, .cta-title { font-size: 1.65rem; }
  .lnav { align-items: flex-start; }
  .lnav-right { max-width: 230px; }
  .lnav .btn-sm { padding-left: 9px; padding-right: 9px; }
  .stat-val { font-size: 2rem; }
  .support-intro h1 { font-size: 1.85rem; }
}
