/* ---- Theme tokens ----
   Dark is the default. Light applies when the OS prefers light (and the user
   hasn't forced a theme) or when data-theme="light" is set explicitly.
   Explicit data-theme always wins over the OS preference. */
:root {
  --bg: #0f1226;
  --bg-2: #171a35;
  --card: #1e2246;
  --card-2: #262c56;
  --line: #333a6b;
  --text: #eef0ff;
  --muted: #a3a9d4;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  /* semantic text tokens that must stay readable in BOTH themes */
  --good-text: #86efac;
  --bad-text: #fca5a5;
  --warn-text: #fcd34d;
  --badge-text: #c7cbff;
  --link: #c4b5fd;
  --brand-name-a: #a5b4fc;
  --brand-name-b: #c4b5fd;
  --bar-bg: rgba(15,18,38,.82);
  --glow: 232,40,85; /* unused rgb hint placeholder */
  --page-glow: #232855;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* Forced-light palette. (Auto + OS-light is handled by the media query below.) */
:root[data-theme="light"] {
  --bg: #f3f4fb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f4f5fc;
  --line: #dde1f0;
  --text: #171a2e;
  --muted: #5a6079;
  --brand: #5b56e0;
  --brand-2: #7c3aed;
  --good-text: #15803d;
  --bad-text: #b91c1c;
  --warn-text: #b45309;
  --badge-text: #4338ca;
  --link: #6d28d9;
  --brand-name-a: #4f46e5;
  --brand-name-b: #7c3aed;
  --bar-bg: rgba(255,255,255,.82);
  --page-glow: #dfe2fb;
  --shadow: 0 8px 26px rgba(43,45,90,.12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4fb;
    --bg-2: #ffffff;
    --card: #ffffff;
    --card-2: #f4f5fc;
    --line: #dde1f0;
    --text: #171a2e;
    --muted: #5a6079;
    --brand: #5b56e0;
    --brand-2: #7c3aed;
    --good-text: #15803d;
    --bad-text: #b91c1c;
    --warn-text: #b45309;
    --badge-text: #4338ca;
    --link: #6d28d9;
    --brand-name-a: #4f46e5;
    --brand-name-b: #7c3aed;
    --bar-bg: rgba(255,255,255,.82);
    --page-glow: #dfe2fb;
    --shadow: 0 8px 26px rgba(43,45,90,.12);
    color-scheme: light;
  }
}
/* Forced dark must beat the OS-light media query above. */
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ---- Motion system ---- */
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cardRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-enter { animation: pageIn .34s cubic-bezier(.2,.8,.2,1) both; }
/* Stagger cards/rows within a freshly navigated screen. */
.page-enter .screen > *, .page-enter .stack > * { animation: cardRise .42s cubic-bezier(.2,.8,.2,1) both; }
.page-enter .screen > *:nth-child(1) { animation-delay: .03s; }
.page-enter .screen > *:nth-child(2) { animation-delay: .07s; }
.page-enter .screen > *:nth-child(3) { animation-delay: .11s; }
.page-enter .screen > *:nth-child(4) { animation-delay: .15s; }
.page-enter .screen > *:nth-child(5) { animation-delay: .19s; }
.page-enter .screen > *:nth-child(n+6) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) {
  .page-enter, .page-enter .screen > *, .page-enter .stack > *,
  [data-reveal], .hero-h1, .hero-sub, .price-pill, .hero-cta, .hero-trust, .hero-auth,
  .feat, .splash-ring, .splash-pulse,
  .orb, .hero-grid, .grad-move, .hero .cta1::after, .price-card { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .grad-move { color: var(--brand-2) !important; -webkit-text-fill-color: var(--brand-2); }
}
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, var(--page-glow) 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  transition: background-color .25s ease, color .25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
#app { min-height: 100%; }

/* Layout shells */
.screen { max-width: 720px; margin: 0 auto; padding: calc(16px + var(--safe-top)) 16px calc(96px + var(--safe-bottom)); }
.center-screen {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  max-width: 460px; margin: 0 auto; text-align: center;
}

/* Typography */
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
p { line-height: 1.55; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
a { color: var(--link); }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand .logo { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow); }
.brand .name { font-size: 1.5rem; background: linear-gradient(90deg,var(--brand-name-a),var(--brand-name-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { color: var(--muted); font-size: .9rem; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  padding: 14px 16px; border-radius: 14px; font-size: 1rem; font-weight: 700;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: white;
  box-shadow: 0 6px 18px rgba(99,102,241,.35); transition: transform .06s ease, filter .2s;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:hover { filter: brightness(1.06); }
.card.deck { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.card.deck[onclick], .card.deck { cursor: pointer; }
.card.deck:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 10px 26px rgba(99,102,241,.14); }
.chip { transition: transform .12s ease, border-color .15s ease, background .15s ease; }
.chip:active { transform: scale(.96); }
.option { transition: transform .1s ease, border-color .15s ease, background .15s ease; }
.icon-btn { transition: transform .1s ease, background .15s ease; }
.icon-btn:active { transform: scale(.92); }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.danger { background: linear-gradient(90deg,#ef4444,#b91c1c); box-shadow: 0 6px 18px rgba(239,68,68,.3); }
.btn.small { width: auto; padding: 9px 13px; font-size: .85rem; border-radius: 11px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* Inputs */
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: .9rem; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--input-bg, var(--bg-2)); border: 1.5px solid var(--input-border, var(--line)); color: var(--text);
  font-size: 1rem; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.field + .field { margin-top: 12px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--bar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { font-weight: 800; font-size: 1.05rem; flex: 1; }
.icon-btn { background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 11px; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; }

/* Account dropdown (top-right avatar) */
.acct-menu { position: relative; }
.acct-drop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 40px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.acct-menu:hover .acct-drop, .acct-menu.open .acct-drop { opacity: 1; visibility: visible; transform: none; }
.acct-drop .acct-name { padding: 8px 10px 6px; font-weight: 700; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-drop button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  padding: 10px; border-radius: 8px; font-size: .92rem; cursor: pointer; }
.acct-drop button:hover { background: var(--bg-2); }
.acct-drop button .icon { color: var(--muted); }

/* Bottom nav */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bar-bg); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar button {
  background: none; border: 0; color: var(--muted); padding: 10px 4px 12px;
  font-size: .7rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar button .ic { font-size: 1.25rem; }
.tabbar button.active { color: var(--text); }
.tabbar button.active .ic { filter: drop-shadow(0 0 8px rgba(139,92,246,.7)); }

/* Avatars (accounts) */
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 1rem; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); letter-spacing: .02em; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; }
.avatar.big { width: 72px; height: 72px; font-size: 1.6rem; }

/* Deck list */
.deck { display: flex; align-items: center; gap: 12px; }
.deck .meta { flex: 1; min-width: 0; }
.deck .meta h3 { margin: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck .meta .sub { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(99,102,241,.18); color: var(--badge-text); border: 1px solid rgba(99,102,241,.35); }
.badge.week { background: rgba(139,92,246,.16); color: var(--badge-text); border-color: rgba(139,92,246,.35); }

/* Upgrade banner (trial → subscribe) */
.upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; color: #fff; }
.upgrade-banner b, .upgrade-banner .small { color: #fff; }
.btn.light { background: #fff; color: var(--brand); box-shadow: none; }
.btn.light:hover { filter: brightness(.97); }

/* Progress bar */
.progress { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg,var(--brand),var(--brand-2)); border-radius: 999px; transition: width .3s; }

/* Flashcard */
.flash-wrap { perspective: 1600px; margin: 6px 0 16px; }
.flash {
  position: relative; width: 100%; height: 56vh; min-height: 340px; max-height: 620px;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,0,.2,1); cursor: pointer;
}
.flash.flipped { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 22px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg,var(--card),var(--card-2)); box-shadow: var(--shadow);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.flash .front { justify-content: flex-start; }
.fc-opts { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.fc-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(127,127,127,.06); font-size: .95rem; line-height: 1.4; }
.fc-opt .k { font-weight: 800; color: var(--muted); min-width: 18px; }
.fc-opt.correct { border-color: var(--good); background: rgba(34,197,94,.16); }
.fc-opt.correct .k { color: var(--good-text); }
.flash .back { transform: rotateY(180deg); background: linear-gradient(180deg,#182a20,#14311d); border-color: #2f6b45; }
.flash .q { font-size: 1.12rem; font-weight: 600; line-height: 1.55; }
.flash .hint { position: sticky; bottom: -22px; margin: auto -22px -22px; padding: 10px 0 12px; text-align: center; color: var(--muted); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.flash .front .hint { background: linear-gradient(to top, var(--card-2) 55%, transparent); }
.flash .back .hint { background: linear-gradient(to top, #14311d 55%, transparent); }
.flash .ans-label { color: #86efac; font-weight: 800; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }

/* Options (quiz / exam) */
.option {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); font-size: .98rem; cursor: pointer; margin-top: 10px; line-height: 1.45;
}
.option .key { font-weight: 800; color: var(--muted); min-width: 20px; }
.option.selected { border-color: var(--brand); background: rgba(99,102,241,.14); }
.option.correct { border-color: var(--good); background: rgba(34,197,94,.16); }
.option.correct .key { color: var(--good-text); }
.option.wrong { border-color: var(--bad); background: rgba(239,68,68,.15); }
.option.wrong .key { color: var(--bad-text); }
.option[disabled] { cursor: default; }

/* Explanation */
.explain { margin-top: 14px; padding: 13px 14px; border-radius: 12px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35); font-size: .92rem; line-height: 1.55; }
.explain b { color: var(--warn-text); }

/* Question meta row */
.qmeta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.timer.low { color: var(--warn); }

/* Result ring */
.ring-wrap { display: grid; place-items: center; margin: 10px 0 4px; }
.score-big { font-size: 3rem; font-weight: 800; letter-spacing: -.02em; }
.score-big.pass { color: var(--good-text); }
.score-big.fail { color: var(--bad-text); }

/* Streak + study calendar */
.streak-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cal-wrap { overflow-x: auto; margin-top: 14px; padding-bottom: 4px; }
.cal { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; width: max-content; }
.cal-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.cal-cell.l1 { background: color-mix(in srgb, var(--brand) 30%, var(--bg-2)); }
.cal-cell.l2 { background: color-mix(in srgb, var(--brand) 55%, var(--bg-2)); }
.cal-cell.l3 { background: color-mix(in srgb, var(--brand) 80%, var(--bg-2)); }
.cal-cell.l4 { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; }
.cal-cell.future { opacity: .25; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat .n { font-size: 1.4rem; font-weight: 800; }
.stat .l { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%);
  background: #1b1f3a; border: 1px solid #2c315e; color: #eef0ff; padding: 11px 16px; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); z-index: 100; font-size: .9rem; max-width: 90%; text-align: center; }

/* Spinner */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand-2); animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Misc */
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: .85rem; cursor: pointer; }
.chip.active { border-color: var(--brand); background: rgba(99,102,241,.16); }
.hidden { display: none !important; }
.installhint { font-size: .82rem; color: var(--muted); line-height: 1.5; }
kbd { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .8rem; }

/* Deck-hub mode grid */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; border-radius: 14px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.mode-btn:active { transform: scale(.98); }
.mode-btn:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(99,102,241,.16); }
.mode-btn .icon { color: var(--brand-2); flex: none; }
.mode-btn span { display: flex; flex-direction: column; line-height: 1.2; }
.mode-btn b { font-size: .98rem; }
.mode-btn em { font-style: normal; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.mode-btn.primary { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--card-2)), var(--card-2)); border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); }
.mode-grid .mode-btn:nth-child(3) { grid-column: span 2; }
@media (max-width: 420px) { .mode-grid { grid-template-columns: 1fr; } .mode-grid .mode-btn:nth-child(3) { grid-column: auto; } }

/* Auth card tabs / polish */
.auth-card .chip-row { gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.auth-card .chip-row .chip { flex: 1; text-align: center; border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-card .chip-row .chip.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.auth-card .field input { padding: 14px; }
.auth-card .btn { margin-top: 4px; }

/* ===================== Landing page (full-width, theme-aware) ===================== */
.landing { width: 100%; min-height: 100dvh; }
.landing section { width: 100%; }

/* Hero band */
.hero {
  position: relative; overflow: hidden;
  padding: calc(40px + var(--safe-top)) 24px 44px;
  background:
    radial-gradient(900px 460px at 12% -10%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    radial-gradient(760px 420px at 92% 8%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 55%);
  border-bottom: 1px solid var(--line);
}
/* drifting gradient orbs behind the hero */
.hero .orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0; pointer-events: none; }
.hero .orb1 { width: 340px; height: 340px; background: var(--brand); top: -80px; left: -60px; animation: drift1 14s ease-in-out infinite; }
.hero .orb2 { width: 300px; height: 300px; background: var(--brand-2); bottom: -100px; right: -40px; animation: drift2 17s ease-in-out infinite; }
.hero .orb3 { width: 260px; height: 260px; background: #22d3ee; top: 40%; left: 46%; opacity: .28; animation: drift3 20s ease-in-out infinite; }
.hero-inner { position: relative; z-index: 1; }
/* faint moving grid for a techy backdrop */
.hero-grid { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(color-mix(in srgb, var(--brand) 16%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand) 16%, transparent) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: radial-gradient(700px 380px at 50% 20%, #000, transparent 75%);
  mask-image: radial-gradient(700px 380px at 50% 20%, #000, transparent 75%); animation: gridpan 24s linear infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-36px,-26px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-30px) scale(1.16); } }
@keyframes gridpan { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }

/* Animated gradient headline highlight */
.grad-move { background: linear-gradient(90deg, var(--brand), var(--brand-2), #22d3ee, var(--brand));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradmove 6s linear infinite; }
@keyframes gradmove { to { background-position: 300% 0; } }

/* Scroll-reveal: elements rise/fade in when they enter the viewport */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
[data-reveal].in { opacity: 1; transform: none; }

/* Count-up stats strip */
.stats-strip { padding: 8px 24px 28px; }
.stats-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.statc { text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 10px; }
.statc .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(90deg, var(--brand-name-a), var(--brand-name-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statc .l { color: var(--muted); font-size: .8rem; margin-top: 3px; }
@media (max-width: 560px) { .stats-inner { grid-template-columns: repeat(2, 1fr); } }
.hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 30px; align-items: center; }
.hero-copy { text-align: center; }
.hero-copy .brand { justify-content: center; margin-bottom: 8px; }
.hero-h1 { font-size: 2.3rem; letter-spacing: -.03em; margin: 14px 0 12px; line-height: 1.08; animation: riseIn .6s .05s ease both; }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 540px; margin: 0 auto 18px; line-height: 1.6; animation: riseIn .6s .12s ease both; }
.price-pill { display: inline-block; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: .9rem; margin-bottom: 18px; animation: riseIn .6s .18s ease both; }
.hero-cta { animation: riseIn .6s .24s ease both; }
.hero .cta1 { position: relative; overflow: hidden; width: auto; padding: 15px 30px; font-size: 1.05rem; box-shadow: 0 10px 30px rgba(99,102,241,.45); }
/* gleam sweep across the primary CTA */
.hero .cta1::after { content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-18deg);
  animation: gleam 3.6s ease-in-out infinite; }
@keyframes gleam { 0% { left: -60%; } 55%,100% { left: 130%; } }
.hero-trust { margin: 14px 0 0; animation: riseIn .6s .3s ease both; }
.hero-auth { display: flex; justify-content: center; animation: riseIn .6s .2s ease both; }
.auth-card { width: 100%; max-width: 420px; text-align: left; padding: 22px; border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.auth-h { text-align: center; margin: 0 0 2px; }
.auth-sub { text-align: center; margin: 0 0 14px; }

/* Features */
.features { padding: 40px 24px 20px; }
.features-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feat { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; animation: riseIn .6s ease both; }
.feat:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 12px 30px rgba(99,102,241,.18); }
.feat:nth-child(1){animation-delay:.10s} .feat:nth-child(2){animation-delay:.18s} .feat:nth-child(3){animation-delay:.26s} .feat:nth-child(4){animation-delay:.34s}
.icon { display: inline-block; vertical-align: -.15em; }
.feat .fic { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 13px; color: var(--brand-2);
  background: color-mix(in srgb, var(--brand) 15%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  transition: transform .18s ease, box-shadow .18s ease; }
.feat:hover .fic { transform: translateY(-3px) scale(1.06); box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 30%, transparent); }
.feat h3 { margin: 12px 0 5px; font-size: 1.05rem; }
.feature-list { list-style: none; margin: 4px 0; padding: 0; }
.feature-list li { position: relative; padding: 7px 0 7px 24px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.feature-list li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.feat p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.55; }

/* Landing sections (how-it-works, domains, pricing, FAQ, CTA) */
.lsec { padding: 46px 24px; }
.lsec.alt { background: color-mix(in srgb, var(--card) 55%, transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lsec-inner { max-width: 1000px; margin: 0 auto; }
.sec-h { text-align: center; font-size: 1.7rem; letter-spacing: -.02em; margin: 0 0 6px; }
.sec-sub { text-align: center; color: var(--muted); margin: 0 auto 24px; max-width: 520px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 22px; }
.step { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.step-n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.domain-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.dchip { padding: 9px 15px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line)); background: color-mix(in srgb, var(--brand) 8%, transparent); font-size: .88rem; font-weight: 600; }
.price-card { max-width: 460px; margin: 0 auto; background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1.5px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 20px; padding: 26px; box-shadow: 0 18px 50px rgba(99,102,241,.18); animation: pricepulse 4.5s ease-in-out infinite; }
@keyframes pricepulse { 0%,100% { box-shadow: 0 18px 50px rgba(99,102,241,.18); } 50% { box-shadow: 0 20px 60px rgba(139,92,246,.34); } }
.price-head { text-align: center; margin-bottom: 4px; }
.price-amt { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; }
.price-per { color: var(--muted); font-weight: 600; }
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-list details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 4px 16px; margin-bottom: 10px; }
.faq-list summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; position: relative; padding-right: 28px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.3rem; color: var(--brand-2); transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin: 0 0 12px; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.cta-band { padding: 52px 24px; background: radial-gradient(700px 300px at 50% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%); }

.landing-foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 26px 24px calc(30px + var(--safe-bottom)); line-height: 1.8; border-top: 1px solid var(--line); margin-top: 0; }
.landing-foot a { color: var(--link); }

.legal h2 { margin-top: 0; }
.legal h3 { margin: 16px 0 4px; font-size: 1rem; }
.legal p { color: var(--muted); font-size: .9rem; line-height: 1.65; }

/* Desktop: two-column hero (pitch left, sign-in right) */
@media (min-width: 860px) {
  .hero { padding-top: 64px; padding-bottom: 60px; }
  .hero-inner { grid-template-columns: 1.05fr .95fr; gap: 48px; }
  .hero-copy { text-align: left; }
  .hero-copy .brand { justify-content: flex-start; }
  .hero-sub { margin-left: 0; }
  .hero-h1 { font-size: 3rem; }
  .hero-auth { justify-content: flex-end; }
}
@media (max-width: 420px) { .hero-h1 { font-size: 1.9rem; } }

/* ===================== Launch splash ===================== */
.splash {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(900px 500px at 50% 38%, var(--page-glow) 0%, var(--bg) 60%);
  padding: 24px; text-align: center;
  transition: opacity .45s ease, visibility .45s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-core { position: relative; width: 132px; height: 132px; display: grid; place-items: center; margin-bottom: 4px; }
.splash-logo {
  width: 84px; height: 84px; border-radius: 22px; position: relative; z-index: 2;
  box-shadow: 0 10px 34px rgba(99,102,241,.45);
  animation: splashIn .7s cubic-bezier(.2,.9,.25,1) both;
}
/* rotating scanner ring */
.splash-ring {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 200deg, var(--brand) 300deg, var(--brand-2) 340deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin 1.5s linear infinite;
  opacity: .95;
}
/* soft pulsing halo */
.splash-pulse {
  position: absolute; inset: 12px; border-radius: 50%; z-index: 0;
  border: 2px solid var(--brand);
  animation: splashPulse 1.8s ease-out infinite;
}
.splash-name {
  font-size: 2rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--brand-name-a), var(--brand-name-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: riseIn .6s .12s ease both;
}
.splash-name span { -webkit-text-fill-color: var(--brand-2); }
.splash-tag { color: var(--muted); font-size: .92rem; animation: riseIn .6s .22s ease both; }
.splash-bar {
  width: 168px; height: 5px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--muted) 22%, transparent); margin-top: 8px;
  animation: riseIn .6s .3s ease both;
}
.splash-bar > span {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: loadSlide 1.15s ease-in-out infinite;
}
.splash-boot { color: var(--muted); font-size: .76rem; letter-spacing: .04em; animation: riseIn .6s .38s ease both; }

@keyframes splashIn { from { transform: scale(.6) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes splashPulse { 0% { transform: scale(.75); opacity: .55; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }
@keyframes riseIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes loadSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

@media (prefers-reduced-motion: reduce) {
  .splash-ring, .splash-pulse, .splash-bar > span { animation: none; }
  .splash-logo, .splash-name, .splash-tag, .splash-bar, .splash-boot { animation: none; }
}

/* ===================== Admin dashboard ===================== */
/* Revenue hero + KPI grid */
.admin-hero { border-radius: 18px; padding: 20px; margin-bottom: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 24%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.ah-rev { margin-bottom: 16px; }
.ah-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ah-amt { font-size: 2.6rem; font-weight: 800; line-height: 1.05; margin-top: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ah-amt span { font-size: 1.1rem; font-weight: 700; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.ah-sub { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 13px;
  background: var(--card-2); border: 1px solid var(--line); }
.kpi .k-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand-2); }
.kpi .k-n { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.kpi .k-l { font-size: .74rem; color: var(--muted); margin-top: 3px; }
@media (max-width: 640px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } .ah-amt { font-size: 2.2rem; } }

/* Activity timeline */
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.tl-body { flex: 1; line-height: 1.4; }
.tl-body b { font-weight: 700; }
.tl-time { color: var(--muted); font-size: .76rem; white-space: nowrap; flex: none; margin-top: 2px; }

/* Status pill */
.pill { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.pill.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

/* PRO badge — shows the user their access is upgraded */
.pro-badge { display: inline-block; vertical-align: middle; font-size: .6rem; font-weight: 800; letter-spacing: .08em;
  padding: 2px 7px; border-radius: 999px; color: #fff; line-height: 1.4;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 1px 6px color-mix(in srgb, var(--brand) 45%, transparent); }
.avatar.sm.pro { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-2); }

/* User / content rows */
.user-row { display: flex; align-items: center; gap: 12px; }
.user-row .meta { flex: 1; min-width: 0; }
.user-row .meta h3 { font-size: .95rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .meta .sub { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.user-row .btn { flex: none; }
