/* Edulytical landing page — follows the dashboard style guide (§2–§6). */

:root {
  --primary: #3b82f6;          /* blue-500 */
  --primary-strong: #2563eb;   /* blue-600 */
  --primary-50: #eff6ff;
  --pink: #ec4899;
  --emerald: #10b981;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --star-fill: #facc15;
  --star-stroke: #eab308;

  --page: #f3f4f6;             /* gray-100 */
  --surface: #ffffff;
  --raised: #f9fafb;           /* gray-50 */
  --border: #e5e7eb;           /* gray-200 */
  --track: #f3f4f6;            /* gray-100 */
  --text-strong: #111827;      /* gray-900 */
  --text: #374151;             /* gray-700 */
  --text-muted: #6b7280;       /* gray-500 */
  --text-faint: #9ca3af;       /* gray-400 */
  --grid: rgba(0, 0, 0, .06);
  --tick: #6b7280;
  --sweep: rgba(255, 255, 255, .55);
  --hero-from: #ffffff;
  --hero-to: var(--primary-50);
  --nav-bg: rgba(255, 255, 255, .8);

  --ease-out-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  color-scheme: light;
}

.dark {
  --page: #09090b;             /* zinc-950 */
  --surface: #18181b;          /* zinc-900 */
  --raised: #27272a;           /* zinc-800 */
  --border: #27272a;           /* zinc-800 */
  --track: #27272a;
  --text-strong: #f4f4f5;      /* zinc-100 */
  --text: #d4d4d8;             /* zinc-300 */
  --text-muted: #a1a1aa;       /* zinc-400 */
  --text-faint: #71717a;       /* zinc-500 */
  --grid: rgba(255, 255, 255, .06);
  --tick: #a1a1aa;
  --sweep: rgba(255, 255, 255, .13);
  --hero-from: #09090b;
  --hero-to: #0b1530;
  --nav-bg: rgba(9, 9, 11, .75);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.tabular { font-variant-numeric: tabular-nums; }
.text-primary { color: var(--primary); }
.text-error { color: var(--error); }
.caption { font-size: 12px; color: var(--text-faint); }
.context { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.body-muted { font-size: 14px; color: var(--text-muted); }

/* ---------- Logo tile ---------- */

.logo {
  --s: 64px;
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--s) * .07);
  width: var(--s);
  height: var(--s);
  padding: calc(var(--s) * .22);
  border-radius: 16px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .1), 0 10px 15px -3px rgba(59, 130, 246, .3), 0 4px 6px -4px rgba(59, 130, 246, .3);
}
.logo i { display: block; width: calc(var(--s) * .11); border-radius: 999px; background: #fff; }
.logo i:nth-child(1) { height: 45%; }
.logo i:nth-child(2) { height: 80%; }
.logo i:nth-child(3) { height: 60%; }
.logo i:nth-child(4) { height: 100%; }
.logo-lg { --s: 72px; }
.logo-sm { --s: 30px; border-radius: 9px; box-shadow: 0 0 0 3px rgba(59, 130, 246, .1); }
.logo-xs { --s: 24px; border-radius: 7px; box-shadow: none; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text-strong); }
.nav-links { display: none; gap: 20px; margin-left: 8px; }
.nav-links a { font-size: 14px; color: var(--text-muted); transition: color .2s var(--ease-out-soft); }
.nav-links a:hover { color: var(--text-strong); }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color .2s var(--ease-out-soft), color .2s var(--ease-out-soft);
}
.icon-btn:hover { background: var(--raised); color: var(--text-strong); }
.icon-btn .icon-sun { display: none; }
.dark .icon-btn .icon-sun { display: block; }
.dark .icon-btn .icon-moon { display: none; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; font-weight: 500; font-size: 14px;
  padding: 8px 12px;
  transition: background-color .2s var(--ease-out-soft), color .2s var(--ease-out-soft), transform .2s var(--ease-out-soft), box-shadow .2s var(--ease-out-soft);
}
.btn-lg { padding: 10px 18px; font-size: 16px; }
.btn-primary { background: var(--primary); color: #fff; overflow: hidden; }
.btn-primary:hover { background: var(--primary-strong); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(59, 130, 246, .6); }
.btn-primary:active { transform: translateY(0); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: 72px; padding-bottom: 88px;
}
@media (min-width: 768px) { .hero-inner { padding-top: 104px; padding-bottom: 120px; } }

.hero-title {
  margin-top: 28px;
  font-size: 36px; line-height: 1.08; font-weight: 600; letter-spacing: -.025em;
  color: var(--text-strong);
}
@media (min-width: 640px) { .hero-title { font-size: 48px; } }
@media (min-width: 1024px) { .hero-title { font-size: 60px; } }
.hero-sub { max-width: 38rem; margin-top: 18px; font-size: 16px; color: var(--text-muted); }
@media (min-width: 640px) { .hero-sub { font-size: 18px; } }
.hero .btn-lg { margin-top: 32px; }
.hero-caption { margin-top: 12px; }

/* Aurora: large blurred blobs drifting slowly behind the hero */
.aurora { position: absolute; inset: 0; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(60px); will-change: transform; }
.aurora .a1 { width: 520px; height: 520px; left: -120px; top: -180px; background: radial-gradient(circle, rgba(59, 130, 246, .35), transparent 65%); animation: drift-a 22s ease-in-out infinite alternate; }
.aurora .a2 { width: 460px; height: 460px; right: -140px; top: -60px; background: radial-gradient(circle, rgba(236, 72, 153, .22), transparent 65%); animation: drift-b 26s ease-in-out infinite alternate; }
.aurora .a3 { width: 420px; height: 420px; left: 35%; bottom: -260px; background: radial-gradient(circle, rgba(16, 185, 129, .18), transparent 65%); animation: drift-c 18s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(120px, 80px) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-100px, 60px) scale(.95); } }
@keyframes drift-c { to { transform: translate(-80px, -70px) scale(1.15); } }

/* ---------- Page & sections ---------- */

.page { padding-top: 56px; padding-bottom: 72px; }
.section + .section { margin-top: 72px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; color: var(--text-muted); }
.section-title { font-size: 24px; font-weight: 600; letter-spacing: -.015em; color: var(--text-strong); }
@media (min-width: 640px) { .section-title { font-size: 30px; } }
.section-intro { max-width: 40rem; margin-bottom: 28px; }
.section-intro .body-muted { margin-top: 8px; font-size: 16px; }

.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .stats-4, .stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Cards & stats ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.card-pad { padding: 20px; }
.stat { padding: 20px; overflow: visible; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; color: var(--text-muted); }
.hero-num {
  position: relative;
  margin-top: 10px;
  font-size: 30px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}
.hero-num.text-error { color: var(--error); }
.hero-num .count { position: relative; display: inline-block; border-radius: 6px; overflow: hidden; vertical-align: top; }
.hero-num-sm { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--text-strong); }
.hero-num-sm .of { font-size: 14px; font-weight: 500; color: var(--text-faint); }
.stat-value { margin-top: 4px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-strong); }


.lift { transition: transform .2s var(--ease-out-soft), box-shadow .2s var(--ease-out-soft); }
.lift:hover { transform: translateY(-2px); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .18); }
.dark .lift:hover { box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(59, 130, 246, .1); color: var(--primary);
  font-size: 12px; font-weight: 500; white-space: nowrap; flex-shrink: 0;
}

/* ---------- Features ---------- */

.features { display: grid; gap: 20px; }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature { display: flex; flex-direction: column; }
.feature .card { flex: 1; display: flex; flex-direction: column; overflow: visible; }
.feature-copy { margin-bottom: 20px; }
.feature-title { font-size: 16px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.feature-icon { width: 20px; height: 20px; color: var(--primary); margin-bottom: 12px; }
.mini {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--border);
  padding: 16px;
}
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mini .stat-label + .hero-num-sm { margin-top: 4px; }

/* How it works */
.step { position: relative; }
.step-num {
  position: absolute; top: 16px; right: 16px;
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px;
  background: rgba(59, 130, 246, .1); color: var(--primary);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Key figures, 2x2 beside the example cards */
.stat-quad { flex: 1; grid-auto-rows: 1fr; }
@media (min-width: 640px) { .stat-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-quad .stat { display: flex; flex-direction: column; justify-content: center; }

/* Stacked bars (assessment levels) */
.stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; }
.seg { display: block; height: 100%; width: var(--w); }
.levels { display: grid; gap: 10px; margin-bottom: 12px; }
.level-row { display: grid; grid-template-columns: 18px 1fr 52px; align-items: center; gap: 10px; }
.lv1 { background: #ef4444; }
.lv2 { background: #f59e0b; }
.lv3 { background: #3b82f6; }
.lv4 { background: #10b981; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.key-base { background: var(--primary); }
.key-weight { background: var(--emerald); }
.key-dash { height: 0; border-top: 2px dashed var(--text-faint); border-radius: 0; }
.grade-name { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.grade-num { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-strong); }
.ping { position: relative; width: 8px; height: 8px; border-radius: 999px; background: var(--error); }
.ping::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--error); opacity: 0; }

/* Goal rings */
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 640px) { .rings { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ring-item { text-align: center; }
.ring { --c: 163.36; position: relative; width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 999px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: #e5e7eb; }
.dark .ring-track { stroke: #3f3f46; }
.ring-fill {
  stroke: var(--primary); stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: calc(163.36 * (1 - var(--p)));
  transition: stroke-dashoffset 1.4s var(--ease-out-cubic) .3s;
}
.ring-success .ring-fill { stroke: var(--success); }
.ring-warning .ring-fill { stroke: var(--warning); }
.ring-value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.ring-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-strong); }
.ring-label .trophy { color: var(--success); }
.ring-success::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 22px 4px rgba(34, 197, 94, .45);
}

/* Chart */
.chart { position: relative; width: 100%; margin-bottom: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--tick); font-size: 11px; font-family: var(--font); }
.chart .target { stroke: var(--text-faint); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.chart .target-label { fill: var(--text-faint); font-size: 10px; font-family: var(--font); }
.chart .line { stroke: var(--primary); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .line-2 { stroke: var(--emerald); stroke-width: 2; opacity: 1; transition: opacity .6s var(--ease-out-soft); }
.chart .flag rect { fill: var(--primary); }
.chart .flag text { fill: #fff; font-size: 10px; font-weight: 600; font-family: var(--font); }
.chart .flag .stem { stroke: var(--primary); stroke-width: 2; }
.chart .flag .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }

/* Closing CTA */
.cta-card {
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
  padding: 28px 20px;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(59, 130, 246, .06) 100%);
}
.cta-copy .body-muted { margin-top: 6px; max-width: 36rem; }
@media (min-width: 768px) { .cta-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px; } }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; }
.footer .brand-name { font-size: 14px; }

/* ---------- Motion ---------- */

/* Continuous: the hero logo floats and breathes; the hero CTA sweeps. Nothing else loops. */
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

.glow-logo::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 22px 4px rgba(59, 130, 246, .45);
  opacity: .15;
  animation: breathe 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe { 50% { opacity: 1; } }

.shine::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, var(--sweep) 50%, transparent 65%);
  transform: translateX(-110%);
  animation: sweep var(--shine-every, 3.2s) var(--ease-out-soft) var(--shine-delay, 1.2s) infinite;
}
.btn-primary.shine::after { background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); }
.shine-once::after { animation-iteration-count: 1; animation-duration: 1.4s; animation-delay: 0s; }
@keyframes sweep { 0% { transform: translateX(-110%); } 22%, 100% { transform: translateX(110%); } }
.shine-once::after { animation-name: sweep-once; }
@keyframes sweep-once { from { transform: translateX(-110%); } to { transform: translateX(110%); } }

/* Hero entrance */
.js .rise { animation: rise .7s var(--ease-out-soft) backwards; animation-delay: calc(var(--i, 0) * 80ms + 80ms); }
.js .rise.float { animation: rise .7s var(--ease-out-soft) backwards, float 6s ease-in-out .8s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* Sections rise in as they scroll into view */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out-soft), transform .7s var(--ease-out-soft); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.in > .grid > * { animation: rise .6s var(--ease-out-soft) backwards; }
.js .reveal.in > .grid > *:nth-child(2) { animation-delay: 80ms; }
.js .reveal.in > .grid > *:nth-child(3) { animation-delay: 160ms; }
.js .reveal.in > .grid > *:nth-child(4) { animation-delay: 240ms; }

/* Bars grow when visible */
.grow { transition: width 1.2s var(--ease-out-cubic) .25s; }
.js .reveal:not(.in) .grow { width: 0; }

/* Pop in, staggered */
.js .reveal:not(.in) .pop-chip, .js .reveal:not(.in) .pop-target { opacity: 0; }
.js .reveal.in .pop-chip { animation: pop .45s var(--ease-out-soft) both; animation-delay: calc(.35s + var(--i, 0) * 70ms); }
.js .reveal.in .pop-target { animation: pop .45s var(--ease-out-soft) 1.1s both; }
@keyframes pop { 0% { opacity: 0; transform: scale(.85); } 65% { opacity: 1; transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }

/* Bars and rings start empty until their section arrives */
.js .reveal:not(.in) .ring-fill { stroke-dashoffset: 163.36; }
.level-row:nth-child(2) .grow { transition-delay: .33s; }
.level-row:nth-child(3) .grow { transition-delay: .41s; }
.level-row:nth-child(4) .grow { transition-delay: .49s; }
.level-row:nth-child(5) .grow { transition-delay: .57s; }

/* Goals: the reached ring glows once and its trophy wiggles as the ring lands */
.js .reveal.in .ring-success::before { animation: glow-once 2.8s ease-in-out 1.7s both; }
@keyframes glow-once { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.js .reveal.in .trophy { animation: wiggle 3.2s var(--ease-out-soft) 1.7s both; transform-origin: 50% 80%; }
@keyframes wiggle {
  0% { transform: none; }
  4% { transform: rotate(-14deg) scale(1.15); }
  8% { transform: rotate(12deg) scale(1.15); }
  12% { transform: rotate(-8deg) scale(1.08); }
  16% { transform: rotate(4deg); }
  20%, 100% { transform: none; }
}

/* Testing: the outlier grade pings a few times, then rests */
.js .reveal.in .ping::after { animation: ping 1.6s var(--ease-out-soft) 1.6s 4; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }

/* Chart flags */
.chart .flag { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.chart .flag.show { opacity: 1; animation: pop .45s var(--ease-out-soft) both; }
.chart .area { transition: opacity .8s var(--ease-out-soft); }

/* Confetti */
.confetti-piece {
  position: absolute; left: 50%; top: 50%;
  width: 7px; height: 10px; border-radius: 2px;
  pointer-events: none; z-index: 5;
}
.confetti-glyph { width: auto; height: auto; background: none !important; font-weight: 700; line-height: 1; }

/* Reduced motion: nothing moves, nothing is left hidden */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .rise { opacity: 1 !important; transform: none !important; }
  .js .reveal:not(.in) .grow { width: var(--w) !important; }
  .js .reveal .pop-chip, .js .reveal .pop-target, .chart .flag { opacity: 1 !important; }
  .js .reveal:not(.in) .ring-fill { stroke-dashoffset: calc(163.36 * (1 - var(--p))) !important; }
  .shine::after, .glow-logo::before { display: none; }
  .aurora span { animation: none; }
}

.legend-tight { margin-bottom: 4px; }
