/* =========================================================
   PrepWays design system · day & night themes
   ========================================================= */
:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --bg: #f5f6fc;
  --bg-2: #eef0fb;
  --surface: #ffffff;
  --surface-2: #f6f7fe;
  --surface-3: #eceefd;
  --text: #171a3a;
  --text-2: #3d4266;
  --muted: #6b7196;
  --border: #e3e6f5;
  --border-2: #d3d7ef;
  --primary: #5b4bff;
  --primary-2: #8a5cff;
  --primary-soft: #ecebff;
  --accent: #00b89f;
  --accent-soft: #dbf7f2;
  --sun: #ffb020;
  --sun-soft: #fff3d9;
  --rose: #f0466b;
  --rose-soft: #ffe4ea;
  --sky: #2d9cff;
  --sky-soft: #e0f0ff;
  --success: #17a673;
  --grad: linear-gradient(135deg, #5b4bff 0%, #8a5cff 48%, #00c2a8 100%);
  --grad-warm: linear-gradient(135deg, #ff7a59 0%, #ffb020 100%);
  --grad-rose: linear-gradient(135deg, #f0466b 0%, #8a5cff 100%);
  --grad-sky: linear-gradient(135deg, #2d9cff 0%, #00c2a8 100%);
  --shadow-sm: 0 1px 2px rgba(23, 26, 58, .06), 0 2px 8px rgba(23, 26, 58, .04);
  --shadow: 0 10px 30px -12px rgba(48, 38, 140, .22), 0 4px 12px rgba(23, 26, 58, .05);
  --shadow-lg: 0 30px 60px -20px rgba(48, 38, 140, .35);
  --glow: 0 0 0 4px rgba(91, 75, 255, .15);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --skin: #f6c9a7;
  --skin-2: #c98b62;
  --hair: #2b2140;
  --ink: #171a3a;
  --paper: #ffffff;
  --nav-h: 72px;
  --side-w: 270px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #090b18;
  --bg-2: #0e1124;
  --surface: #12162b;
  --surface-2: #171c36;
  --surface-3: #1d2342;
  --text: #eef0ff;
  --text-2: #c7cbef;
  --muted: #949ac4;
  --border: #252b4d;
  --border-2: #323a63;
  --primary: #8577ff;
  --primary-2: #a98bff;
  --primary-soft: #23214d;
  --accent: #2ee6c8;
  --accent-soft: #10342f;
  --sun-soft: #3a2e12;
  --rose-soft: #3d1724;
  --sky-soft: #10284a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
  --glow: 0 0 0 4px rgba(133, 119, 255, .25);
  --skin: #e5b08c;
  --hair: #0f0b1d;
  --ink: #e8eaff;
  --paper: #e9ebff;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; width: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- layout utilities ---------- */
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.grid { display: grid; gap: 20px; }
.grid > *, .stack > *, .main, .content { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-auto-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mt-4 { margin-top: 44px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
.flex-1 { flex: 1; min-width: 0; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--surface); --c: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--b); color: var(--c); font: 600 .95rem/1.2 var(--font);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, background .25s, border-color .25s, color .25s;
  position: relative; overflow: hidden; isolation: isolate;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--grad); background-size: 160% 160%; color: #fff; border: 0; box-shadow: 0 10px 24px -10px rgba(91, 75, 255, .7); animation: gradShift 8s ease infinite; }
.btn-primary:hover { box-shadow: 0 16px 30px -10px rgba(91, 75, 255, .8); color: #fff; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s; z-index: -1; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-accent { background: var(--accent); color: #fff; border: 0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-danger { background: var(--rose-soft); color: var(--rose); border-color: transparent; }
.btn-success { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: 12px; }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .9rem; color: var(--text-2); }
.hint { font-size: .8rem; color: var(--muted); }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=week], input[type=month], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; max-width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: 500 1rem var(--font);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=file] { width: 100%; padding: 10px; border: 1.5px dashed var(--border-2); border-radius: 12px; background: var(--surface-2); color: var(--muted); font: 500 .9rem var(--font); }
input[type=file]::file-selector-button { border: 0; background: var(--primary-soft); color: var(--primary); padding: 8px 14px; border-radius: 9px; font-weight: 700; margin-right: 12px; cursor: pointer; }
.phone-group { display: flex; gap: 8px; }
.phone-group > select { flex: 0 0 38%; max-width: 170px; min-width: 0; text-overflow: ellipsis; }
.phone-group > input { flex: 1; min-width: 0; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; min-width: 0; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.otp-input { letter-spacing: .6em; font-weight: 800 !important; font-size: 1.2rem !important; text-align: center; }
.verified-tag { display: none; color: var(--success); font-weight: 700; align-items: center; gap: 6px; font-size: .9rem; }
.is-verified .verified-tag { display: inline-flex; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); position: relative; transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s, background .35s; }
.card.hover:hover, a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-2); text-decoration: none; }
a.card { color: inherit; display: block; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; display: flex; gap: 10px; align-items: center; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.glass { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.gradient { background: var(--grad); color: #fff; border: 0; }
.card.gradient h1, .card.gradient h2, .card.gradient h3 { color: #fff; }
.card .corner-art { position: absolute; right: -10px; top: -10px; opacity: .1; width: 120px; height: 120px; pointer-events: none; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* icon badges */
.ibox { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.ibox .ic { width: 22px; height: 22px; }
.ibox.lg { width: 58px; height: 58px; border-radius: 18px; }
.ibox.lg .ic { width: 28px; height: 28px; }
.ibox.sm { width: 36px; height: 36px; border-radius: 11px; }
.ibox.sm .ic { width: 18px; height: 18px; }
.ibox.grad { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -10px rgba(91, 75, 255, .8); }
.ibox.teal { background: var(--accent-soft); color: var(--accent); }
.ibox.sun { background: var(--sun-soft); color: #d58a00; }
.ibox.rose { background: var(--rose-soft); color: var(--rose); }
.ibox.sky { background: var(--sky-soft); color: var(--sky); }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--accent-soft); color: var(--accent); }
.badge.amber { background: var(--sun-soft); color: #c27c00; }
.badge.red { background: var(--rose-soft); color: var(--rose); }
.badge.sky { background: var(--sky-soft); color: var(--sky); }
[data-theme="dark"] .badge.amber { color: var(--sun); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: pulseDot 1.6s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .85rem; font-weight: 600; text-decoration: none !important; transition: .2s; }
.chip:hover, .chip.on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* avatars */
.avatar { --h: 250; width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 800; font-size: .9rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 40) 75% 52%)); object-fit: cover; overflow: hidden; border: 2px solid var(--surface); box-shadow: var(--shadow-sm); }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.xl { width: 110px; height: 110px; font-size: 2.2rem; border-width: 4px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .person { display: flex; align-items: center; gap: 10px; }
.table input[type=number] { max-width: 110px; padding: 8px 10px; }

/* ---------- alerts / toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.alert .ic { margin-top: 2px; }
.alert.success { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.alert.success .ic { color: var(--accent); }
.alert.error { background: var(--rose-soft); border-color: transparent; }
.alert.error .ic { color: var(--rose); }
.alert.info { background: var(--sky-soft); border-color: transparent; }
.alert.info .ic { color: var(--sky); }
.alert.warn { background: var(--sun-soft); border-color: transparent; }
.toast-wrap { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { box-shadow: var(--shadow-lg); animation: toastIn .5s cubic-bezier(.2, .9, .3, 1.3) both; word-break: break-word; }
.toast .close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 8px; }
.toast.hide { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 12px; font-weight: 600; }
.btn-google:hover { background: #f8f9fa; border-color: #c6c9cc; color: #1f1f1f; }
.btn-google:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn-google .g-logo { flex: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ibox { margin: 0 auto 14px; }

/* ---------- public navbar ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); background: var(--grad); z-index: 120; }
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; transition: background .3s, box-shadow .3s, backdrop-filter .3s; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--border); }
.nav .container { display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--text); letter-spacing: -.03em; text-decoration: none !important; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px -8px rgba(91, 75, 255, .9); position: relative; overflow: hidden; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.brand span em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; margin-left: 18px; }
.nav-links a { padding: 9px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .93rem; text-decoration: none; transition: .2s; }
.nav-links a:hover, .nav-links a.on { background: var(--surface-2); color: var(--primary); }
.nav-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.theme-toggle { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; position: relative; overflow: hidden; transition: .3s; }
.theme-toggle:hover { transform: rotate(-12deg); border-color: var(--border-2); }
.theme-toggle .ic { position: absolute; transition: transform .5s cubic-bezier(.5, 1.6, .4, 1), opacity .3s; }
.theme-toggle .i-moon { transform: translateY(30px) rotate(90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .i-sun { transform: translateY(-30px) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .i-moon { transform: none; opacity: 1; }
.menu-btn { display: none; width: 44px; height: 44px; padding: 0; place-items: center; }
.menu-btn .ic { width: 24px; height: 24px; stroke-width: 2.25; transition: transform .25s; }
.menu-btn[aria-expanded="true"] .ic { transform: rotate(90deg); }
.install-btn[hidden] { display: none !important; }
.mobile-menu { display: none; }

/* ---------- footer ---------- */
.footer { margin-top: 80px; border-top: 1px solid var(--border); background: var(--surface); padding: 56px 0 28px; position: relative; overflow: hidden; }
.footer .cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer a { color: var(--text-2); display: block; padding: 4px 0; }
.footer .bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }

/* =========================================================
   Landing page
   ========================================================= */
.hero { position: relative; padding: 40px 0 70px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -2; pointer-events: none; }
/* soft radial gradients instead of filter: blur() — same glow, no per-frame blur cost */
.blob { position: absolute; border-radius: 50%; opacity: .55; animation: blobMove 18s ease-in-out infinite; will-change: transform; background: radial-gradient(circle closest-side, var(--bc) 0%, color-mix(in srgb, var(--bc) 45%, transparent) 45%, transparent 100%); }
.blob.b1 { --bc: #8a5cff; width: 660px; height: 660px; top: -190px; left: -190px; }
.blob.b2 { --bc: #00c2a8; width: 600px; height: 600px; top: 50px; right: -210px; animation-delay: -6s; opacity: .4; }
.blob.b3 { --bc: #ffb020; width: 500px; height: 500px; bottom: -150px; left: 40%; animation-delay: -12s; opacity: .25; }
[data-theme="dark"] .blob { opacity: .32; }
@keyframes blobMove { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, 40px) scale(1.1); } 66% { transform: translate(-40px, 30px) scale(.92); } }
.grid-bg { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); opacity: .55; }
.hero-inner { display: grid; grid-template-columns: 1.02fr 1fr; gap: 40px; align-items: center; min-height: min(calc(100vh - var(--nav-h) - 110px), 760px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-weight: 600; font-size: .85rem; color: var(--text-2); }
.eyebrow .pill { background: var(--grad); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.hero h1 { margin: 0 0 16px; font-size: clamp(1.75rem, 3.6vw, 2.8rem); }
.hero h1 .word { display: inline-block; }
.hero h1 .typed { position: relative; white-space: nowrap; }
.hero h1 .typed::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .16em; background: var(--grad); border-radius: 4px; opacity: .35; transform-origin: left; animation: underline 1.2s .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes underline { from { transform: scaleX(0); } }
.hero .lead { font-size: clamp(.95rem, 1.3vw, 1.05rem); color: var(--text-2); max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-cta .btn-lg { padding: 13px 22px; font-size: .95rem; }
.hero-stats { display: flex; gap: 26px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats .s b { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; }
.hero-stats .s span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.hero-art { position: relative; aspect-ratio: 600 / 540; width: 100%; max-width: 640px; margin-inline: auto; }
.hero-art svg.scene { width: 100%; height: 100%; overflow: visible; }
.float-card { position: absolute; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 95%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .82rem; font-weight: 700; animation: float 6s ease-in-out infinite; z-index: 2; will-change: transform; }
.float-card small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; }
.float-card.fc1 { left: -6%; top: 80%; }
.float-card.fc2 { right: -2%; top: 4%; animation-delay: -2s; }
.float-card.fc3 { right: 2%; bottom: 10%; animation-delay: -4s; }

/* floating formulas */
.formulas { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.formula { position: absolute; font-family: var(--hand); font-weight: 700; color: var(--primary); opacity: .22; font-size: calc(var(--fs, 1.4rem) * .78); animation: drift var(--d, 14s) ease-in-out infinite; animation-delay: var(--dl, 0s); white-space: nowrap; transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px)); }
.formula:nth-child(3n) { color: var(--accent); }
.formula:nth-child(4n) { color: #e48a00; }
[data-theme="dark"] .formula { opacity: .3; }
@keyframes drift { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -26px; rotate: 4deg; } }

/* SVG scene animations */
.scene .anim { transform-box: fill-box; transform-origin: center; }
.scene .float { animation: float 5s ease-in-out infinite; }
.scene .float.slow { animation-duration: 7s; }
.scene .float.d1 { animation-delay: -1.5s; } .scene .float.d2 { animation-delay: -3s; } .scene .float.d3 { animation-delay: -4.5s; }
.scene .spin { animation: spin 9s linear infinite; }
.scene .spin.rev { animation-direction: reverse; animation-duration: 12s; }
.scene .spin.fast { animation-duration: 4s; }
.scene .head-think { transform-box: fill-box; transform-origin: 50% 90%; animation: headThink 4s ease-in-out infinite; }
.scene .head-read { transform-box: fill-box; transform-origin: 50% 90%; animation: headRead 5s ease-in-out infinite; }
.scene .blink { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
.scene .blink.late { animation-delay: -2s; }
.scene .tap { transform-box: fill-box; transform-origin: 20% 90%; animation: tap 1.4s ease-in-out infinite; }
.scene .write { transform-box: fill-box; transform-origin: 80% 90%; animation: write 1.1s ease-in-out infinite; }
.scene .page { transform-box: fill-box; transform-origin: 0% 50%; animation: pageFlip 3.2s ease-in-out infinite; }
.scene .page.p2 { animation-delay: -1.6s; }
.scene .bubble { transform-box: fill-box; transform-origin: center; animation: bubblePop 3s ease-in-out infinite; }
.scene .bubble.b2 { animation-delay: .25s; } .scene .bubble.b3 { animation-delay: .5s; }
.scene .cloud { transform-box: fill-box; transform-origin: 30% 100%; animation: cloud 6s ease-in-out infinite; }
.scene .glow { animation: glow 2.8s ease-in-out infinite; }
.scene .rise { animation: rise 2.6s ease-in infinite; }
.scene .rise.r2 { animation-delay: -.9s; } .scene .rise.r3 { animation-delay: -1.7s; }
.scene .plane { animation: plane 9s ease-in-out infinite; }
.scene .twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.scene .twinkle.t2 { animation-delay: -.8s; } .scene .twinkle.t3 { animation-delay: -1.6s; }
.scene .draw { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 4s ease-in-out infinite; }
.scene .steam { animation: steam 3s ease-in-out infinite; }
.scene .s-shadow { fill: rgba(23, 26, 58, .1); }
[data-theme="dark"] .scene .s-shadow { fill: rgba(0, 0, 0, .45); }
.scene .s-orbit { stroke: var(--border-2); stroke-width: 1.5; stroke-dasharray: 6 8; }
.scene .s-bg-stop1 { stop-color: var(--primary-soft); }
.scene .s-bg-stop2 { stop-color: var(--bg); stop-opacity: 0; }
.scene .s-cloud { fill: var(--surface); stroke: var(--border-2); stroke-width: 2; }
.scene .s-hand { font-family: var(--hand); font-weight: 700; fill: var(--primary); }
.scene .s-hand-2 { fill: var(--accent); }
.scene .s-chair { fill: var(--border-2); }
.scene .s-skin { fill: var(--skin); }
.scene .s-hair { fill: var(--hair); }
.scene .s-ink { fill: #1b1838; }
.scene .s-stroke { stroke: #1b1838; stroke-width: 2.4; stroke-linecap: round; }
.scene .s-stroke-thin { stroke: var(--border-2); stroke-width: 1.5; }
.scene .s-paper-f { fill: #ffffff; }
.scene .s-lines { stroke: #c9c4ff; }
.scene .s-leg { fill: var(--border-2); }
.scene .s-glass { fill: rgba(255, 255, 255, .55); stroke: var(--border-2); stroke-width: 2; }
[data-theme="dark"] .scene .s-glass { fill: rgba(255, 255, 255, .12); }
.scene .meridian { transform-box: fill-box; transform-origin: center; animation: meridian 3s linear infinite; }
@keyframes meridian { 0% { transform: scaleX(1); } 50% { transform: scaleX(.08); } 100% { transform: scaleX(1); } }
.theme-anim, .theme-anim * { transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease !important; }
.side-toggle { display: none; }
@media (max-width: 980px) { .side-toggle { display: grid; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes headThink { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(3deg) translateY(-2px); } }
@keyframes headRead { 0%, 100% { transform: rotate(3deg); } 40% { transform: rotate(-2deg); } 70% { transform: rotate(1deg) translateY(1px); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes tap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-10deg); } }
@keyframes write { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(5px, 1px) rotate(4deg); } 50% { transform: translate(10px, 0) rotate(-2deg); } 75% { transform: translate(4px, 2px) rotate(3deg); } }
@keyframes pageFlip { 0%, 20% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 80%, 100% { transform: scaleX(1); } }
@keyframes bubblePop { 0%, 100% { transform: scale(.85); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes cloud { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.04) translateY(-6px); } }
@keyframes glow { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-46px) scale(1.1); opacity: 0; } }
@keyframes plane { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(60px, -30px) rotate(-8deg); } 50% { transform: translate(120px, 0) rotate(6deg); } 75% { transform: translate(60px, 24px) rotate(10deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .4; } 50% { transform: scale(1.15) rotate(45deg); opacity: 1; } }
@keyframes draw { 0% { stroke-dashoffset: 260; } 50%, 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -260; } }
@keyframes steam { 0%, 100% { opacity: 0; transform: translateY(4px); } 50% { opacity: .8; transform: translateY(-6px); } }

/* subject marquee */
.marquee { position: relative; overflow: hidden; padding: 22px 0; border-block: 1px solid var(--border); background: var(--surface); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .subj { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; color: var(--text-2); white-space: nowrap; }
.marquee .subj .ic { color: var(--primary); width: 20px; height: 20px; }
.marquee .subj:nth-child(3n) .ic { color: var(--accent); }
.marquee .subj:nth-child(3n+1) .ic { color: #e48a00; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* sections */
.section { padding: 96px 0; position: relative; }
.section.alt { background: var(--bg-2); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 54px; }
.section-head .kicker { display: inline-flex; gap: 8px; align-items: center; color: var(--primary); font-weight: 800; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 1.06rem; }

/* feature cards with glow + tilt */
.feature { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; transform-style: preserve-3d; transition: transform .25s ease-out, box-shadow .3s, border-color .3s; }
.feature::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(138, 92, 255, .16), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.feature:hover::before { opacity: 1; }
.feature:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.feature .ibox { margin-bottom: 18px; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.feature:hover .ibox { transform: translateZ(30px) rotate(-8deg) scale(1.08); }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--text-2); margin: 0; font-size: .95rem; }
.feature .tag { position: absolute; top: 18px; right: 18px; }
.feature .deco { position: absolute; right: -24px; bottom: -24px; width: 120px; height: 120px; color: var(--primary); opacity: .07; transition: transform .6s, opacity .3s; }
.feature:hover .deco { transform: rotate(18deg) scale(1.15); opacity: .14; }

/* steps timeline */
.steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.steps::before { content: ""; position: absolute; top: 34px; left: 8%; right: 8%; height: 3px; background: var(--border); border-radius: 3px; }
.steps::after { content: ""; position: absolute; top: 34px; left: 8%; width: calc(84% * var(--p, 0)); height: 3px; background: var(--grad); border-radius: 3px; transition: width .2s linear; }
.step { text-align: center; position: relative; z-index: 1; }
.step .num { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); font-size: 1.4rem; font-weight: 800; color: var(--primary); box-shadow: var(--shadow); transition: .5s cubic-bezier(.3, 1.5, .5, 1); }
.step.in .num { background: var(--grad); color: #fff; border-color: transparent; transform: rotate(-6deg); }
.step p { color: var(--text-2); font-size: .93rem; }

/* role cards */
.role-card { border-radius: var(--radius-lg); padding: 30px; position: relative; overflow: hidden; color: #fff; min-height: 320px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.role-card.r1 { background: linear-gradient(150deg, #5b4bff, #8a5cff); }
.role-card.r2 { background: linear-gradient(150deg, #00a58f, #2d9cff); }
.role-card.r3 { background: linear-gradient(150deg, #ff7a59, #f0466b); }
.role-card h3 { color: #fff; font-size: 1.4rem; }
.role-card ul { list-style: none; padding: 0; margin: 10px 0 24px; display: grid; gap: 9px; }
.role-card li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; opacity: .95; }
.role-card li .ic { margin-top: 3px; }
.role-card .btn { margin-top: auto; align-self: flex-start; background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.role-card .btn:hover { background: #fff; color: #171a3a; }
.role-card .art { position: absolute; right: -30px; top: -30px; width: 160px; height: 160px; opacity: .18; animation: spin 30s linear infinite; }

/* science lab cards */
.lab-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); padding: 22px; text-align: center; overflow: hidden; position: relative; transition: transform .3s, box-shadow .3s; }
.lab-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.lab-card .stage { height: 170px; display: grid; place-items: center; position: relative; margin-bottom: 12px; }
.lab-card h3 { margin-bottom: 4px; }
.lab-card p { color: var(--muted); font-size: .9rem; margin: 0; }

/* CSS atom */
.atom { position: relative; width: 140px; height: 140px; }
.atom .nucleus { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd27a, #ff7a59); box-shadow: 0 0 22px #ff9a59; animation: pulse 2s ease-in-out infinite; }
.atom .orbit { position: absolute; inset: 0; border: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); border-radius: 50%; animation: orbit 3s linear infinite; }
.atom .orbit::after { content: ""; position: absolute; top: -6px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.atom .orbit.o1 { transform: rotateZ(0deg) rotateX(70deg); }
.atom .orbit.o2 { --r: 60deg; animation-name: orbit2; animation-duration: 3.6s; }
.atom .orbit.o3 { --r: -60deg; animation-name: orbit3; animation-duration: 4.2s; }
@keyframes orbit { from { transform: rotateZ(0deg) rotateX(70deg) rotateZ(0); } to { transform: rotateZ(0deg) rotateX(70deg) rotateZ(360deg); } }
@keyframes orbit2 { from { transform: rotateZ(60deg) rotateX(70deg) rotateZ(0); } to { transform: rotateZ(60deg) rotateX(70deg) rotateZ(360deg); } }
@keyframes orbit3 { from { transform: rotateZ(-60deg) rotateX(70deg) rotateZ(0); } to { transform: rotateZ(-60deg) rotateX(70deg) rotateZ(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* DNA helix */
.dna { display: flex; gap: 7px; height: 130px; align-items: center; }
.dna span { position: relative; width: 4px; height: 100%; }
.dna span::before, .dna span::after { content: ""; position: absolute; left: -5px; width: 14px; height: 14px; border-radius: 50%; animation: helix 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.16s); }
.dna span::before { background: var(--primary); top: 0; }
.dna span::after { background: var(--accent); bottom: 0; animation-name: helix2; }
/* helix moves with transform (compositor-only) instead of top/bottom (layout every frame); 116px = 130px track - 14px dot */
.dna span i { position: absolute; left: 1px; width: 2px; top: 10%; bottom: 10%; background: var(--border-2); animation: rung 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.16s); }
@keyframes helix { 0%, 100% { transform: translateY(0) scale(1); z-index: 2; } 50% { transform: translateY(116px) scale(.6); z-index: 0; } }
@keyframes helix2 { 0%, 100% { transform: translateY(0) scale(.6); } 50% { transform: translateY(-116px) scale(1); } }
@keyframes rung { 0%, 100% { transform: scaleY(1); } 25%, 75% { transform: scaleY(.1); } 50% { transform: scaleY(1); } }

/* solar system */
.solar { position: relative; width: 160px; height: 160px; }
.solar .sun { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #ffb020 60%, #ff7a59); box-shadow: 0 0 30px #ffb020; }
.solar .ring { position: absolute; border: 1.5px dashed var(--border-2); border-radius: 50%; inset: var(--in); animation: spin var(--t) linear infinite; }
.solar .ring::after { content: ""; position: absolute; top: calc(var(--s) / -2); left: calc(50% - var(--s) / 2); width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }

/* flask */
.flask-wrap { position: relative; width: 120px; height: 150px; }
.flask-wrap svg { width: 100%; height: 100%; overflow: visible; }
.flask-wrap .b { animation: rise 2.2s ease-in infinite; transform-box: fill-box; }
.flask-wrap .b:nth-of-type(2) { animation-delay: -.7s; } .flask-wrap .b:nth-of-type(3) { animation-delay: -1.4s; }
.flask-wrap .liquid { animation: slosh 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes slosh { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(-4deg) scaleY(1.03); } }

/* flipping book */
.book3d { position: relative; width: 170px; height: 115px; perspective: 900px; }
.book3d .cover { position: absolute; inset: 0; border-radius: 6px 10px 10px 6px; background: var(--grad); box-shadow: var(--shadow); }
.book3d .leaf { position: absolute; top: 6px; bottom: 6px; left: 50%; width: calc(50% - 6px); background: var(--paper); border-radius: 0 6px 6px 0; transform-origin: left center; animation: leaf 4.5s ease-in-out infinite; animation-delay: calc(var(--i) * .5s); box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .2); background-image: repeating-linear-gradient(transparent 0 9px, rgba(91, 75, 255, .18) 9px 10px); background-position: 0 14px; }
.book3d .leaf.static { animation: none; }
.book3d .leaf.left { left: 6px; transform: rotateY(0); border-radius: 6px 0 0 6px; }
@keyframes leaf { 0%, 15% { transform: rotateY(0); } 50%, 100% { transform: rotateY(-180deg); } }

/* math graph */
.graph svg { width: 180px; height: 130px; overflow: visible; }
.graph .axis { stroke: var(--border-2); stroke-width: 2; }
.graph .curve { fill: none; stroke: url(#gGrad); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; animation: graphDraw 4s ease-in-out infinite; }
.graph .pt { fill: var(--sun); animation: twinkle 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes graphDraw { 0% { stroke-dashoffset: 320; } 55%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -320; } }

/* analytics preview */
.preview { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.mock { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 22px; position: relative; }
.mock .bars { display: flex; gap: 10px; align-items: flex-end; height: 160px; padding: 10px 0; }
.mock .bars span { flex: 1; border-radius: 8px 8px 4px 4px; background: var(--grad); height: var(--h); transform-origin: bottom; animation: barGrow 1.4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * .1s); }
.mock .bars span.alt { background: var(--grad-warm); }
.reveal:not(.in) .mock .bars span, .mock.reveal:not(.in) .bars span { animation-play-state: paused; }
@keyframes barGrow { from { transform: scaleY(0); } }
.check-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-weight: 500; }
.check-list li .ibox { width: 28px; height: 28px; border-radius: 9px; }
.check-list li .ibox .ic { width: 15px; height: 15px; }

/* school cards — cover photo + overlapping logo, profile-card style */
.school-logo { width: 54px; height: 54px; border-radius: 16px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.1rem; background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 50) 70% 50%)); overflow: hidden; box-shadow: var(--shadow-sm); }
.school-logo img { width: 100%; height: 100%; object-fit: cover; }
.school-logo.xl { width: 96px; height: 96px; border-radius: 26px; font-size: 2rem; }

.school-card { display: flex; flex-direction: column; padding: 0; position: relative; overflow: hidden; }
.school-card .sc-cover { height: 76px; position: relative; background: linear-gradient(135deg, hsl(var(--h) 72% 54%), hsl(calc(var(--h) + 48) 68% 46%)); background-size: 180% 180%; background-position: 0% 0%; transition: background-position .6s ease; }
.school-card:hover .sc-cover { background-position: 100% 100%; }
.school-card .sc-cover::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 88% 15%, rgba(255, 255, 255, .4), transparent 42%), radial-gradient(circle at 10% 95%, rgba(255, 255, 255, .2), transparent 48%); }
.school-card .sc-cover::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px); background-size: 14px 14px; opacity: .3; }
.school-card .sc-board { position: absolute; top: 11px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .25); color: #fff; font-weight: 800; font-size: .7rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.school-card .sc-board .ic { width: 12px; height: 12px; }
.school-card .sc-logo { position: absolute; top: 46px; left: 20px; z-index: 2; border-radius: 19px; box-shadow: 0 0 0 4px var(--surface); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.school-card:hover .sc-logo { transform: scale(1.08) rotate(-4deg); }
.school-card .sc-logo .school-logo { width: 60px; height: 60px; border-radius: 15px; font-size: 1.3rem; }
.school-card .sc-body { padding: 38px 20px 16px; flex: 1; }
.school-card .sc-body h3 { font-size: 1.08rem; }
.school-card .sc-body .loc { display: inline-flex; align-items: center; gap: 4px; }
.school-card .sc-stats { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.school-card .sc-stats .st { display: flex; flex-direction: column; }
.school-card .sc-stats .st b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.school-card .sc-stats .st span { color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.school-card .sc-stats .sep { width: 1px; height: 26px; background: var(--border); flex: none; }
.school-card .sc-cta { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; font-weight: 700; font-size: .87rem; color: var(--primary); background: var(--surface-2); border-top: 1px solid var(--border); transition: background .25s, color .25s, gap .25s; }
.school-card .sc-cta .ic { width: 15px; height: 15px; transition: transform .25s; }
.school-card:hover .sc-cta { background: var(--grad); color: #fff; }
.school-card:hover .sc-cta .ic { transform: translateX(3px); }
.stars { display: inline-flex; gap: 1px; color: var(--sun); }
.stars .ic { width: 15px; height: 15px; }
.stars .off { color: var(--border-2); }
.stars .on path { fill: currentColor; }

/* CTA band */
.cta-band { border-radius: 32px; padding: 60px 40px; background: var(--grad); color: #fff; text-align: center; position: relative; overflow: hidden; background-size: 200% 200%; animation: gradShift 12s ease infinite; }
.cta-band h2 { color: #fff; }
.cta-band p { opacity: .92; font-size: 1.1rem; max-width: 620px; margin: 0 auto 26px; }
.cta-band .btn { background: #fff; color: #3a2fd6; border: 0; }
.cta-band .btn.ghost { background: rgba(255, 255, 255, .15); color: #fff; }
.cta-band .shape { position: absolute; color: rgba(255, 255, 255, .15); animation: float 7s ease-in-out infinite; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--rd, 0s); }
.reveal.left { transform: translateX(-40px); }
.reveal.right { transform: translateX(40px); }
.reveal.zoom { transform: scale(.92); }
.reveal.in { opacity: 1; transform: none; }
/* Above-the-fold hero content animates on load (never waits for JS) */
.hero .reveal { opacity: 1; transform: none; transition: none; animation: heroIn .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--rd, 0s); }
.hero .reveal.zoom { animation-name: heroZoom; }
@keyframes heroIn { from { opacity: 0; transform: translateY(30px); } }
@keyframes heroZoom { from { opacity: 0; transform: scale(.92); } }
[hidden] { display: none !important; }

/* =========================================================
   Auth pages
   ========================================================= */
.auth { min-height: calc(100vh - var(--nav-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; isolation: isolate; }
.auth-art h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.auth-art p { opacity: .9; max-width: 440px; }
.auth-art .formula { color: #fff; opacity: .18; }
.auth-art .art-svg { width: min(420px, 100%); margin-top: 26px; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .2)); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-box { width: min(500px, 100%); }
.auth-box.wide { width: min(700px, 100%); }
.auth-box .card { padding: 30px; }
.tabs { display: flex; gap: 4px; padding: 5px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a, .tabs button { flex: 1; text-align: center; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: .88rem; color: var(--muted); text-decoration: none !important; border: 0; background: none; cursor: pointer; white-space: nowrap; font-family: var(--font); transition: .25s; }
.tabs a.on, .tabs button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-panel[hidden] { display: none; }
.invite-banner { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--primary-soft); margin-bottom: 22px; }
.stepper { display: flex; gap: 8px; margin-bottom: 18px; }
.stepper span { flex: 1; height: 5px; border-radius: 5px; background: var(--border); }
.stepper span.on { background: var(--grad); }

/* =========================================================
   Dashboard shell
   ========================================================= */
.dash { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; z-index: 60; transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .35s; }
.sidebar .brand { padding: 4px 8px 18px; }
.side-school { margin: 0 4px 14px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.side-school b { display: block; font-size: .88rem; line-height: 1.3; }
.side-school small { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: capitalize; }
.side-label { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: .93rem; text-decoration: none !important; position: relative; transition: background .2s, color .2s, transform .2s; }
.side-link .ic { width: 20px; height: 20px; color: var(--muted); transition: color .2s, transform .3s; }
.side-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.side-link:hover .ic { color: var(--primary); }
.side-link.on { background: var(--primary-soft); color: var(--primary); }
.side-link.on .ic { color: var(--primary); }
.side-link.on::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.side-link .count { margin-left: auto; background: var(--rose); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; padding-top: 16px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; height: 70px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.2rem; margin: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.user-chip b { display: block; font-size: .85rem; line-height: 1.2; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.content { padding: 28px; width: 100%; max-width: 1320px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.scrim { display: none; }

/* welcome banner */
.welcome { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 30px; background: var(--grad); background-size: 200% 200%; animation: gradShift 14s ease infinite; color: #fff; margin-bottom: 24px; isolation: isolate; }
.welcome h2 { color: #fff; margin-bottom: 6px; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.welcome p { opacity: .92; margin: 0; max-width: 620px; }
.welcome .actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.welcome .actions .btn { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
.welcome .actions .btn:hover { background: #fff; color: #3a2fd6; }
.welcome .wart { position: absolute; right: 18px; bottom: -6px; width: 240px; height: 170px; z-index: -1; opacity: .95; }
.welcome .fl { position: absolute; color: rgba(255, 255, 255, .22); animation: float 6s ease-in-out infinite; z-index: -1; }

/* stat cards */
.stat { display: flex; gap: 16px; align-items: center; overflow: hidden; }
.stat .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stat::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--primary-soft); opacity: .6; transition: transform .5s; z-index: 0; }
.stat > * { position: relative; z-index: 1; }
.stat:hover::after { transform: scale(1.4); }
.stat.teal::after { background: var(--accent-soft); }
.stat.sun::after { background: var(--sun-soft); }
.stat.rose::after { background: var(--rose-soft); }

/* progress */
.progress { height: 9px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--grad); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.progress.warm > span { background: var(--grad-warm); }
.progress.rose > span { background: var(--grad-rose); }
.ring { --p: 0; --size: 120px; --c: var(--primary); width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; flex: none; transition: --p 1s; }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring > div { position: relative; text-align: center; line-height: 1.1; }
.ring b { font-size: calc(var(--size) / 4.2); font-weight: 800; letter-spacing: -.03em; }
.ring small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; }
.ring.sm { --size: 72px; }
.ring.sm::before { inset: 7px; }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }

/* list rows */
.list { display: grid; }
.list-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 700; }
.list-item .s { color: var(--muted); font-size: .85rem; }
.date-tile { width: 54px; flex: none; text-align: center; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.date-tile b { display: block; font-size: 1.3rem; font-weight: 800; padding: 4px 0 2px; }
.date-tile small { display: block; background: var(--grad); color: #fff; font-weight: 800; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: 3px 0; }

/* notice cards */
.notice { border-left: 4px solid var(--primary); }
.notice.pinned { border-left-color: var(--sun); }
.notice .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 8px; }
.notice h3 { margin-bottom: 6px; }
.notice p { color: var(--text-2); white-space: pre-line; margin: 0; }

/* star of month */
.star-card { text-align: center; overflow: hidden; padding: 30px 22px; isolation: isolate; }
.star-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 110px; background: var(--grad); z-index: -1; }
.star-card .avatar.xl { display: grid; margin: 20px auto 12px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--sun) 50%, transparent), var(--shadow); }
.star-card .crown { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); color: var(--sun); width: 38px; height: 38px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); animation: float 3s ease-in-out infinite; }
.star-card .crown path { fill: var(--sun); }
.star-card .ribbon { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--sun-soft); color: #b06d00; font-weight: 800; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
[data-theme="dark"] .star-card .ribbon { color: var(--sun); }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.confetti i { position: absolute; width: 8px; height: 14px; border-radius: 2px; top: -20px; animation: confetti 5s linear infinite; opacity: .8; }
@keyframes confetti { to { transform: translateY(360px) rotate(540deg); opacity: 0; } }
.mini-star { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }

/* chapters / syllabus */
.ch-tile { color: inherit; text-decoration: none !important; transition: border-color .2s, transform .2s; }
.ch-tile:hover { border-color: var(--border-2); transform: translateY(-2px); }
.ch-prog { gap: 10px; flex-wrap: nowrap; margin-top: 6px; }
.ch-summary { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ch-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.ch { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.ch .ch-title { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ch.done .ch-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.ch-mark { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--border-2); display: grid; place-items: center; color: #fff; }
.ch-mark .ic { width: 14px; height: 14px; }
.ch.done .ch-mark { background: var(--accent); border-color: var(--accent); }
.ch-toggle { width: 30px; height: 30px; flex: none; border-radius: 9px; border: 2px solid var(--border-2); background: var(--surface); color: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background .2s, border-color .2s, color .2s, transform .15s; }
.ch-toggle .ic { width: 18px; height: 18px; stroke-width: 3; }
.ch-toggle:hover { border-color: var(--accent); color: var(--accent); }
.ch-toggle:active { transform: scale(.9); }
.ch.done .ch-toggle { background: var(--accent); border-color: var(--accent); color: #fff; }
.ch-list.editable .ch { padding: 6px 6px 6px 8px; }
.ch-list.editable form { margin: 0; }
.ch-add { display: flex; gap: 12px; align-items: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-2); flex-wrap: wrap; }
.ch-add .field { min-width: 220px; }
.ch-add textarea { resize: vertical; }
.ch-card { scroll-margin-top: 90px; }
.ch-details { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.ch-details > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; flex-wrap: wrap; border-radius: 14px; }
.ch-details > summary::-webkit-details-marker { display: none; }
.ch-details > summary:hover { background: var(--surface-3); }
.ch-details > summary > .ic { transition: transform .25s; color: var(--muted); margin-left: auto; }
.ch-details[open] > summary > .ic { transform: rotate(90deg); }
.ch-sum-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 220px; min-width: 0; }
.ch-sum-p { flex: 1 1 200px; max-width: 320px; }
.ch-sum-p .ch-prog { margin-top: 0; }
.ch-details-body { padding: 0 12px 12px; }
.ch-details-body .ch { background: var(--surface); }
.req-item { flex-wrap: wrap; }

/* =========================================================
   Calendar
   ========================================================= */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal .dow { text-align: center; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 0; }
.cal .day { position: relative; min-height: 92px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.cal a.day:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.cal .day .n { font-weight: 800; font-size: .95rem; }
.cal .day.out { opacity: .35; }
.cal .day.today { border: 2px solid var(--primary); box-shadow: var(--glow); }
.cal .day.sun { background: var(--surface-2); }
.cal .day.hol { background: var(--sun-soft); border-color: transparent; }
.cal .day .hl { font-size: .7rem; font-weight: 700; color: #b06d00; line-height: 1.2; }
[data-theme="dark"] .cal .day .hl { color: var(--sun); }
.cal .day .bar { margin-top: auto; height: 6px; border-radius: 6px; background: var(--rose-soft); overflow: hidden; }
.cal .day .bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.cal .day .pc { font-size: .72rem; font-weight: 700; color: var(--muted); }
.cal .day .todo { margin-top: auto; font-size: .7rem; font-weight: 700; color: var(--primary); }
.cal .day.st-P { background: var(--accent-soft); border-color: transparent; }
.cal .day.st-A { background: var(--rose-soft); border-color: transparent; }
.cal .day.st-L { background: var(--sun-soft); border-color: transparent; }
.cal .day .stl { margin-top: auto; font-size: .72rem; font-weight: 800; }
.cal .day.st-P .stl { color: var(--accent); } .cal .day.st-A .stl { color: var(--rose); } .cal .day.st-L .stl { color: #c27c00; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* attendance marking */
.att-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, background .2s; }
.att-row .roll { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; margin-left: auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 13px; border-radius: 9px; font-weight: 800; font-size: .82rem; cursor: pointer; color: var(--muted); transition: .2s; user-select: none; }
.seg input:checked + label.p { background: var(--accent); color: #fff; }
.seg input:checked + label.a { background: var(--rose); color: #fff; }
.seg input:checked + label.l { background: var(--sun); color: #3b2a00; }
.seg input:focus-visible + label { outline: 2px solid var(--primary); }
.att-sticky { position: sticky; bottom: 16px; z-index: 5; margin-top: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* =========================================================
   Papers, builder, test-taking, results
   ========================================================= */
.paper-card .top { display: flex; gap: 12px; align-items: flex-start; }
.paper-card h3 { margin: 0 0 4px; }
.paper-card .meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; font-weight: 600; }
.q-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 20px; }
.q-card .q-head { display: flex; gap: 12px; align-items: flex-start; }
.q-num { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .9rem; }
.q-text { font-weight: 600; font-size: 1.02rem; white-space: pre-line; }
.q-img { margin-top: 12px; max-height: 320px; border-radius: 12px; border: 1px solid var(--border); }
.opts { display: grid; gap: 8px; margin-top: 14px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 500; }
.opt .k { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.opt.correct { border-color: var(--accent); background: var(--accent-soft); }
.opt.correct .k { background: var(--accent); color: #fff; }
.opt.wrong { border-color: var(--rose); background: var(--rose-soft); }
.opt.wrong .k { background: var(--rose); color: #fff; }
details.edit { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
details.edit summary { cursor: pointer; font-weight: 700; color: var(--primary); font-size: .9rem; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.edit summary::-webkit-details-marker { display: none; }
.opt-inputs { display: grid; gap: 8px; }
.opt-input { display: flex; gap: 8px; align-items: center; }
.opt-input input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.ai-loading { display: none; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-weight: 700; margin-top: 12px; }
.ai-loading.on { display: flex; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.mode-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 22px; }
.mode-card { cursor: pointer; border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; background: var(--surface); transition: .25s; text-decoration: none !important; color: inherit; }
.mode-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.mode-card.on { border-color: var(--primary); box-shadow: var(--glow); }
.mode-card b { display: block; color: var(--text); }
.mode-card small { color: var(--muted); }
/* AI paper form */
.blueprint { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.bp-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 1fr 80px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.bp-row:first-child { border-top: 0; }
.bp-row > label { font-weight: 600; }
.bp-row > b { text-align: right; }
.bp-row input[type=number] { padding: 8px 10px; }
.bp-head { background: var(--surface-2); font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bp-head span:last-child { text-align: right; }
.bp-total { background: var(--primary-soft); color: var(--primary); }
.bp-total b:last-child { font-size: 1.05rem; }
[data-bp-warn] { color: var(--rose); font-weight: 600; }
.ai-wait { max-width: 640px; margin: 30px auto; text-align: center; display: grid; justify-items: center; gap: 6px; }
.ai-wait h2 { margin: 6px 0 0; }
.ai-wait .ai-loading { justify-content: center; width: 100%; }
.ai-steps { display: grid; gap: 6px; text-align: left; }
.ai-steps span { display: inline-flex; gap: 8px; align-items: center; }
.ai-steps svg { color: var(--accent); }
.q-move { width: 30px; height: 30px; padding: 0; }
.q-move:disabled { opacity: .35; cursor: default; }
.rot90 { transform: rotate(90deg); }
@media (max-width: 640px) {
  .bp-row { grid-template-columns: minmax(0, 1fr) 72px 72px 52px; padding: 10px; gap: 6px; font-size: .9rem; }
}

/* test taking */
.exam { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.exam-q { min-height: 380px; }
.exam .opt { cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.exam .opt:hover { border-color: var(--primary); transform: translateX(3px); }
.exam .opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.exam .opt.sel .k { background: var(--primary); color: #fff; }
.exam-side { position: sticky; top: 90px; display: grid; gap: 16px; }
.timer { display: flex; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.timer b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.timer.low b { color: var(--rose); animation: pulse 1s infinite; }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qgrid button { aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 800; color: var(--text-2); cursor: pointer; font-family: var(--font); transition: .2s; }
.qgrid button.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qgrid button.flag { background: var(--sun-soft); border-color: var(--sun); }
.qgrid button.cur { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.06); }
.q-anim { animation: qIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes qIn { from { opacity: 0; transform: translateX(24px); } }
.qtime { font-size: .8rem; color: var(--muted); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }

/* result analysis */
.score-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.tbar { display: grid; grid-template-columns: 40px 1fr 70px; gap: 10px; align-items: center; font-size: .82rem; font-weight: 700; }
.tbar .track { height: 12px; border-radius: 12px; background: var(--surface-3); overflow: hidden; }
.tbar .track span { display: block; height: 100%; border-radius: inherit; width: var(--w); background: var(--grad); animation: grow 1.2s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.tbar .track span.ok { background: linear-gradient(90deg, #00b89f, #2ee6c8); }
.tbar .track span.bad { background: linear-gradient(90deg, #f0466b, #ff7a59); }
.tbar .track span.skip { background: var(--border-2); }
@keyframes grow { from { transform: scaleX(0); } }
.diff { font-weight: 800; font-size: .75rem; padding: 3px 10px; border-radius: 999px; }
.diff.Easy { background: var(--accent-soft); color: var(--accent); }
.diff.Medium { background: var(--sun-soft); color: #c27c00; }
.diff.Hard { background: var(--rose-soft); color: var(--rose); }

/* report card */
.report { overflow: hidden; }
.report-head { padding: 20px 22px; background: var(--grad); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-head h3 { color: #fff; margin: 0; }
.grade-pill { display: inline-grid; place-items: center; min-width: 40px; padding: 3px 10px; border-radius: 10px; font-weight: 800; background: var(--primary-soft); color: var(--primary); }

/* feedback */
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-input input { position: absolute; opacity: 0; }
.rating-input label { cursor: pointer; color: var(--border-2); transition: transform .2s, color .2s; }
.rating-input label .ic { width: 34px; height: 34px; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: var(--sun); }
.rating-input label:hover .ic path, .rating-input label:hover ~ label .ic path, .rating-input input:checked ~ label .ic path { fill: currentColor; }
.rating-input label:hover { transform: scale(1.15) rotate(-8deg); }
.rating-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 6px; }
.anon-shield { width: 120px; height: 120px; margin: 0 auto; position: relative; }
.anon-shield .ring-pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary); animation: ripple 2.4s ease-out infinite; }
.anon-shield .ring-pulse:nth-child(2) { animation-delay: .8s; }
@keyframes ripple { from { transform: scale(.6); opacity: .8; } to { transform: scale(1.3); opacity: 0; } }

/* link box */
.link-box { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-2); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--text-2); }

/* campus & community (public school page: video, transport, facilities) */
.campus-card { overflow: hidden; }
.campus-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: start; margin-top: 4px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); box-shadow: var(--shadow-sm); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 720px) { .campus-grid { grid-template-columns: 1fr; } }

/* error page */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-page .big { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: -.05em; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam { grid-template-columns: 1fr; }
  .exam-side { position: static; order: -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .hero-inner, .preview { grid-template-columns: 1fr; }
  .hero-inner { min-height: 0; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-art { max-width: 520px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .steps::before, .steps::after { display: none; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .menu-btn:active { transform: scale(.94); }
  .mobile-menu { display: grid; position: fixed; inset: var(--nav-h) 0 auto; z-index: 99; padding: 16px 20px 22px; gap: 6px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateY(-120%); opacity: 0; transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
  .mobile-menu.open { transform: none; opacity: 1; }
  .mobile-menu a { padding: 12px 14px; border-radius: 12px; font-weight: 700; color: var(--text); }
  .mobile-menu a:hover { background: var(--surface-2); text-decoration: none; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(9, 11, 24, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .user-chip .who { display: none; }
  .user-chip { padding: 4px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .g2, .g3, .form-grid, .mode-cards { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .section { padding: 70px 0; }
  .nav-actions .hide-sm { display: none; }
  .nav .container { gap: 10px; }
  .nav-actions { gap: 6px; }
  .float-card { display: none; }
  .float-card.fc2 { display: flex; transform: scale(.85); right: 0; top: -2%; }
  .cta-band { padding: 44px 22px; border-radius: 24px; }
  .cal { gap: 4px; }
  .cal .day { min-height: 58px; padding: 5px; border-radius: 10px; }
  .cal .day .hl, .cal .day .pc { display: none; }
  .cal .day .todo { font-size: 0; }
  .cal .day .todo::after { content: "•"; font-size: 1.2rem; }
  .cal .day .stl { font-size: .62rem; }
  .att-row { flex-wrap: wrap; }
  .seg { margin-left: 0; width: 100%; justify-content: space-between; }
  .seg label { flex: 1; text-align: center; padding: 9px 10px; }
  .exam-side { grid-template-columns: 1fr; }
  .welcome .wart { display: none; }
  .tbar { grid-template-columns: 34px 1fr 56px; }
  .hero-stats { gap: 18px; }
  .footer .cols { grid-template-columns: 1fr; }
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; max-width: none; }

  /* ---- forms: more breathing room, no cramped fields ---- */
  .card { padding: 18px; }
  .auth-box .card { padding: 20px; }
  .form-grid { gap: 14px; }
  .field > label, .label { font-size: .85rem; }
  .btn { padding: 11px 16px; }
  .btn-lg { padding: 14px 20px; font-size: 1rem; }

  /* ---- input-group: stop squishing inputs next to action buttons ---- */
  .input-group { flex-wrap: wrap; }
  .input-group > input, .input-group > select { flex: 1 1 100%; min-width: 0; }
  .input-group > .btn:not(.btn-icon) { flex: 1 1 100%; }
  .input-group > .btn.btn-icon { flex: 0 0 auto; margin-left: auto; }
  .subject-row select { max-width: 130px; }

  /* chapters: the tick button already shows the state on small screens */
  .ch-list.editable .badge { display: none; }
  .ch .badge { font-size: .68rem; }
  .ch-add .btn { flex: 1 1 100%; }
  .ch-summary { width: 100%; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 1.1rem; }
  .btn-lg { padding: 13px 20px; }
  .theme-toggle { width: 38px; height: 38px; }
  .nav-actions .btn-primary { padding: 10px 14px; }
}

/* PWA install popup (mobile bottom sheet) */
.install-sheet {
  position: fixed; z-index: 300; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateY(140%); opacity: 0;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.1), opacity .25s ease;
}
.install-sheet.open { transform: none; opacity: 1; }
.install-sheet-icon { flex: none; width: 56px; height: 56px; border-radius: 14px; }
.install-sheet-body { flex: 1; min-width: 0; }
.install-sheet-body strong { display: block; font-size: 1.02rem; }
.install-sheet-body p { margin: 4px 0 12px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.install-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.install-sheet-actions .btn { min-height: 44px; }

/* PWA standalone tweaks */
@media (display-mode: standalone) {
  .install-btn, .install-sheet { display: none !important; }
  body { overscroll-behavior-y: contain; }
}

/* Sections scrolled out of view stop running their looping animations (toggled by app.js) */
.anim-off, .anim-off *, .anim-off *::before, .anim-off *::after { animation-play-state: paused !important; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Print (report cards, results) */
@media print {
  .sidebar, .topbar, .nav, .footer, .no-print, .toast-wrap, .scroll-progress { display: none !important; }
  .dash { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; color: #000; }
}
