/* ============================================================
   G2I — Global Genius Index | Design System
   A peer-to-peer global learning & competition platform
   ============================================================ */

:root {
  /* ----- shared brand (theme-independent) ----- */
  --brand:     #ff5e2b;
  --brand-2:   #ff8a3d;
  --brand-glow: rgba(255,94,43,0.45);
  --gold:      #ffd166;
  --violet:    #8a4fcf;
  --violet-2:  #b884e8;

  /* Subject palette */
  --s-math:  #b3245a; --s-apt:   #4ca838; --s-phys:  #e23744; --s-chem:  #e8821e;
  --s-eng:   #4b4be0; --s-geo:   #8a3fb0; --s-hist:  #18a37e; --s-zoo:   #e0a020; --s-bot: #2e9d4f;

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 34px;
  --maxw: 1200px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Sora", var(--font);
}

/* ================= DARK THEME (default) ================= */
:root, [data-theme="dark"] {
  --text:      #eef1f8;
  --muted:     #9aa3b8;
  --muted-2:   #6b7488;
  --line:      rgba(255,255,255,0.10);
  --line-2:    rgba(255,255,255,0.18);
  --bg-2:      #0f1320;   /* nav/footer solid-ish base */
  --bg-3:      #141a2b;

  /* gradient surfaces (no flat fills) */
  --surface:   linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
  --surface-2: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
  --card:      linear-gradient(165deg, rgba(255,255,255,0.075), rgba(255,255,255,0.02));
  --card-hov:  linear-gradient(165deg, rgba(255,255,255,0.11), rgba(255,255,255,0.035));
  --nav-bg:    linear-gradient(180deg, rgba(10,13,20,0.82), rgba(10,13,20,0.66));
  --chip-bg:   linear-gradient(180deg, rgba(15,19,32,0.85), rgba(15,19,32,0.7));

  /* full-page gradient field */
  --page:
    radial-gradient(1100px 720px at 80% -8%, rgba(255,94,43,0.20), transparent 58%),
    radial-gradient(950px 760px at -12% 14%, rgba(138,79,207,0.20), transparent 55%),
    radial-gradient(950px 820px at 50% 118%, rgba(24,163,126,0.14), transparent 55%),
    linear-gradient(180deg, #090c13 0%, #0b0f18 45%, #080a11 100%);
  --dot: rgba(255,255,255,1);
  --logo-dark: block; --logo-light: none;     /* which logo variant shows */
}

/* ================= LIGHT THEME (warm off-white, gradient) ================= */
[data-theme="light"] {
  --text:      #221a33;
  --muted:     #5d566e;
  --muted-2:   #8e8799;
  --line:      rgba(60,40,100,0.12);
  --line-2:    rgba(60,40,100,0.20);
  --bg-2:      #f4f0fb;
  --bg-3:      #ece5f7;

  --surface:   linear-gradient(160deg, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
  --surface-2: linear-gradient(160deg, #ffffff, rgba(255,255,255,0.7));
  --card:      linear-gradient(165deg, #ffffff, #f5efff);
  --card-hov:  linear-gradient(165deg, #ffffff, #efe6fe);
  --nav-bg:    linear-gradient(180deg, rgba(250,247,255,0.86), rgba(248,243,255,0.7));
  --chip-bg:   linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,243,255,0.82));

  --page:
    radial-gradient(1100px 720px at 82% -6%, rgba(255,138,61,0.16), transparent 58%),
    radial-gradient(950px 780px at -10% 12%, rgba(138,79,207,0.18), transparent 55%),
    radial-gradient(900px 820px at 55% 116%, rgba(46,157,79,0.12), transparent 55%),
    radial-gradient(700px 600px at 30% 60%, rgba(75,75,224,0.07), transparent 60%),
    linear-gradient(170deg, #fbf8ff 0%, #f3ecfb 50%, #efe7f8 100%);
  --dot: rgba(80,50,140,1);
  --brand-glow: rgba(255,94,43,0.30);
  --logo-dark: none; --logo-light: block;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font);
  background: var(--page) fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand); color: #fff; }

/* subtle dot texture */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: .04; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* theme-aware logo helpers */
.logo-d { display: var(--logo-dark); }
.logo-l { display: var(--logo-light); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { position: relative; padding: clamp(64px, 9vw, 120px) 0; }

/* ---------- Typography ---------- */
h1,h2,h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-2); padding: 7px 14px; border-radius: 100px;
  background: rgba(255,94,43,0.08); border: 1px solid rgba(255,94,43,0.22);
}
.h-sec { font-size: clamp(2rem, 4.6vw, 3.3rem); margin: 18px 0 14px; }
.lead { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); max-width: 60ch; }
.grad { background: linear-gradient(100deg, var(--brand), var(--brand-2) 40%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: .95rem;
  padding: 13px 22px; border-radius: 100px; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(100deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 30px -8px var(--brand-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px var(--brand-glow); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-lg { padding: 16px 28px; font-size: 1rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 800; letter-spacing: -.01em; }
.brand img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 12px rgba(187,132,232,0.45)); }
.brand b { font-size: 1.18rem; }
.brand span { display: block; font-size: .58rem; letter-spacing: .28em; color: var(--muted); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 9px 13px; border-radius: 100px; font-size: .9rem; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--line); color: var(--text); width: 44px; height: 44px; border-radius: 12px; cursor: pointer; font-size: 1.3rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 150px; padding-bottom: 90px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); }
.hero .lead { margin-top: 22px; font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .n { font-family: var(--display); font-weight: 800; font-size: 1.9rem; background: linear-gradient(120deg,var(--text),var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats .l { font-size: .82rem; color: var(--muted); }

.hero-art { position: relative; aspect-ratio: 1; }
.hero-art .orb { position: absolute; inset: 0; margin: auto; border-radius: 50%; overflow: hidden;
  box-shadow: 0 40px 120px -30px var(--brand-glow), inset 0 0 0 1px rgba(255,255,255,0.06); animation: float 7s ease-in-out infinite; }
.hero-art .orb img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .ring { position: absolute; inset: -6%; border: 1px dashed rgba(255,94,43,0.35); border-radius: 50%; animation: spin 26s linear infinite; }
.hero-art .ring.r2 { inset: -16%; border-color: rgba(75,75,224,0.3); animation-duration: 40s; animation-direction: reverse; }
.chip {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: .82rem; font-weight: 700;
  background: var(--chip-bg); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 100px;
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.7); animation: float 6s ease-in-out infinite;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip.c1 { top: 8%; left: -4%; }
.chip.c2 { top: 44%; right: -8%; animation-delay: -2s; }
.chip.c3 { bottom: 6%; left: 8%; animation-delay: -4s; }

@keyframes float { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-14px) } }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: rgba(255,255,255,0.015); padding: 18px 0; overflow: hidden; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: slide 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--display); font-weight: 700; color: var(--muted-2); font-size: 1.05rem; letter-spacing: .02em; display: inline-flex; gap: 48px; align-items: center; }
.marquee-track span::after { content: "✦"; color: var(--brand); }
@keyframes slide { to { transform: translateX(-50%) } }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: 0 26px 50px -28px rgba(0,0,0,.8); }
.card .ic { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; font-size: 1.4rem; margin-bottom: 16px;
  background: rgba(255,94,43,0.12); border: 1px solid rgba(255,94,43,0.25); }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* ---------- Section header ---------- */
.sec-head { max-width: 720px; margin-bottom: 48px; }
.sec-head.center { margin-inline: auto; }

/* ---------- How it works ---------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; position: relative; }
.flow-step { text-align: center; padding: 26px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: relative; }
.flow-step .num { width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px -8px var(--brand-glow); }
.flow-step h4 { font-family: var(--display); font-size: 1rem; margin-bottom: 6px; }
.flow-step p { font-size: .85rem; color: var(--muted); }
.flow-step::after { content: "→"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--brand); font-size: 1.3rem; z-index: 2; }
.flow-step:last-child::after { display: none; }

/* ---------- Genius Box explorer ---------- */
.gbox { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
  background: linear-gradient(135deg, rgba(255,94,43,0.07), rgba(75,75,224,0.06));
  border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: clamp(26px, 4vw, 48px); }
.gbox .field { margin-bottom: 18px; }
.gbox label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.gbox select, .gbox input {
  width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); font-family: var(--font); font-size: .98rem; appearance: none; cursor: pointer;
}
.gbox select:focus, .gbox input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.gbox-result { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px; min-height: 260px; position: relative; overflow: hidden; }
.gbox-result::before { content: ""; position: absolute; inset: 0; background: var(--accent, var(--brand)); opacity: .1; }
.gbox-result .rk { position: relative; }
.gbox-result .code { font-family: var(--display); font-weight: 800; font-size: 2.4rem; color: var(--accent, var(--brand)); }
.gbox-result h4 { position: relative; font-size: 1.3rem; margin: 4px 0 14px; }
.gbox-result .tier { position: relative; display: inline-block; padding: 6px 12px; border-radius: 100px; font-size: .78rem; font-weight: 700;
  background: color-mix(in srgb, var(--accent, var(--brand)) 18%, transparent); color: var(--accent, var(--brand)); margin-bottom: 12px; }
.gbox-result ul { position: relative; list-style: none; display: grid; gap: 8px; }
.gbox-result li { font-size: .9rem; color: var(--muted); display: flex; gap: 9px; }
.gbox-result li::before { content: "✓"; color: var(--accent, var(--brand)); font-weight: 800; }

/* ---------- Subject index wall ---------- */
.subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.subj {
  position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); cursor: pointer;
  background: var(--bg-2); aspect-ratio: 3/4; transition: transform .4s var(--ease), box-shadow .4s, border-color .4s;
}
.subj:hover { transform: translateY(-8px); border-color: var(--sc); box-shadow: 0 30px 60px -28px var(--sc); }
.subj img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s, transform .8s var(--ease); }
.subj .back { opacity: 0; }
.subj:hover .front { opacity: 0; }
.subj:hover .back { opacity: 1; transform: scale(1.04); }
.subj .tag { position: absolute; left: 12px; top: 12px; z-index: 3; padding: 6px 11px; border-radius: 100px; font-weight: 800; font-size: .8rem;
  color: #fff; background: var(--sc); box-shadow: 0 6px 16px -6px rgba(0,0,0,.6); }
.subj .meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 16px; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.subj .meta b { font-family: var(--display); font-size: 1rem; display: block; }
.subj .meta s { color: rgba(255,255,255,.7); font-size: .78rem; text-decoration: none; }

/* ---------- Ranking ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rung { padding: 30px 24px; border-radius: var(--r-lg); border: 1px solid var(--line); position: relative; overflow: hidden;
  background: var(--card); }
.rung .lvl { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; opacity: .14; position: absolute; right: 16px; top: 8px; }
.rung h4 { font-family: var(--display); font-size: 1.25rem; margin-bottom: 8px; }
.rung p { font-size: .9rem; color: var(--muted); }
.rung .bar { height: 6px; border-radius: 100px; margin-top: 18px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.rung:nth-child(1) .bar { width: 25%; }
.rung:nth-child(2) .bar { width: 50%; }
.rung:nth-child(3) .bar { width: 75%; }
.rung:nth-child(4) .bar { width: 100%; }

/* ---------- Collaborate / split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.feat-list { list-style: none; display: grid; gap: 16px; margin-top: 24px; }
.feat-list li { display: flex; gap: 14px; align-items: flex-start; }
.feat-list .fi { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem;
  background: rgba(255,94,43,0.12); border: 1px solid rgba(255,94,43,0.25); }
.feat-list b { font-family: var(--display); display: block; }
.feat-list p { color: var(--muted); font-size: .92rem; }
.collage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.collage img { border-radius: var(--r); border: 1px solid var(--line); box-shadow: 0 24px 50px -30px rgba(0,0,0,.9); }
.collage img:nth-child(odd) { transform: translateY(16px); }

/* ---------- Rewards ---------- */
.rewards { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.reward { padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.reward .rh { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.reward .rh .e { font-size: 1.7rem; }
.reward .rh h4 { font-family: var(--display); font-size: 1.1rem; }
.reward ul { list-style: none; display: grid; gap: 9px; }
.reward li { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; }
.reward li::before { content: "◆"; color: var(--brand); font-size: .7rem; margin-top: 5px; }

/* ---------- Audience bands ---------- */
.bands { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }
.band { padding: 24px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: center; transition: transform .3s var(--ease), border-color .3s; }
.band:hover { transform: translateY(-5px); border-color: var(--brand); }
.band .e { font-size: 2rem; }
.band b { font-family: var(--display); display: block; margin: 8px 0 4px; }
.band span { font-size: .8rem; color: var(--muted); }

/* ---------- Universe gallery ---------- */
.universe { columns: 4; column-gap: 16px; }
.universe img { width: 100%; margin-bottom: 16px; border-radius: var(--r); border: 1px solid var(--line); transition: transform .4s var(--ease), box-shadow .4s; break-inside: avoid; }
.universe img:hover { transform: scale(1.03) rotate(-.6deg); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }

/* ---------- Pricing / register ---------- */
.join { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: stretch; }
.price-card { padding: 36px; border-radius: var(--r-xl); border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(255,94,43,0.1), rgba(75,75,224,0.06)); }
.price-card .amt { font-family: var(--display); font-weight: 800; font-size: 3rem; }
.price-card .amt s { font-size: 1rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.price-card ul { list-style: none; margin: 22px 0; display: grid; gap: 12px; }
.price-card li { display: flex; gap: 10px; color: var(--muted); }
.price-card li::before { content: "✓"; color: var(--brand-2); font-weight: 800; }
.form-card { padding: 36px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-card label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.form-card input, .form-card select { width: 100%; padding: 12px 14px; border-radius: 11px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); font-family: var(--font); }
.form-card input:focus, .form-card select:focus { outline: 2px solid var(--brand); border-color: transparent; }
.form-note { font-size: .82rem; color: var(--muted-2); margin-top: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(140%); z-index: 200;
  background: linear-gradient(100deg, var(--brand), var(--brand-2)); color: #fff; padding: 14px 26px; border-radius: 100px; font-weight: 700;
  box-shadow: 0 20px 40px -12px var(--brand-glow); transition: transform .5s var(--ease); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.qa { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.qa summary { list-style: none; cursor: pointer; padding: 20px 24px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--brand); font-size: 1.5rem; transition: transform .3s; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa p { padding: 0 24px 22px; color: var(--muted); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 64px 0 36px; background: var(--bg-2); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h5 { font-family: var(--display); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.foot-grid a { display: block; color: var(--muted); font-size: .92rem; padding: 5px 0; transition: color .2s; }
.foot-grid a:hover { color: var(--brand-2); }
.foot-grid p { color: var(--muted); font-size: .92rem; }
.foot-bot { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: .85rem; flex-wrap: wrap; gap: 12px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .hero-grid, .split, .gbox, .join { grid-template-columns: 1fr; }
  .hero-art { max-width: 440px; margin: 10px auto 0; }
  .g-4, .rewards, .subjects, .universe { columns: unset; }
  .g-4, .rewards { grid-template-columns: repeat(2,1fr); }
  .subjects { grid-template-columns: repeat(2,1fr); }
  .universe { columns: 2; }
  .flow, .ladder, .bands { grid-template-columns: repeat(2,1fr); }
  .flow-step::after { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .g-3, .g-4, .rewards, .subjects { grid-template-columns: 1fr; }
  .universe { columns: 1; }
  .flow, .ladder, .bands { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .foot-grid { grid-template-columns: 1fr; }
}

/* mobile menu drawer */
.drawer { position: fixed; inset: 0; z-index: 99; background: var(--bg-2); backdrop-filter: blur(12px); display: none; flex-direction: column; padding: 100px 28px 40px; gap: 6px; }
.drawer.open { display: flex; }
.drawer a { padding: 14px 16px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; border-bottom: 1px solid var(--line); }

/* ============================================================
   BRAND SHOWCASE — "The Mark" (cup + G21 to prominence)
   ============================================================ */
.mark-sec { background:
  radial-gradient(900px 500px at 50% 0%, rgba(187,132,232,0.14), transparent 60%),
  radial-gradient(700px 500px at 50% 100%, rgba(255,94,43,0.10), transparent 60%);
  border-block: 1px solid var(--line); overflow: hidden; }
.mark-stage { position: relative; text-align: center; padding: 24px 0 8px; }
.mark-stage .spark {
  position: absolute; left: 50%; top: 40px; width: 360px; height: 360px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(187,132,232,0.30), transparent 65%); filter: blur(10px); z-index: 0;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{ opacity:.6; transform: translateX(-50%) scale(1) } 50%{ opacity:1; transform: translateX(-50%) scale(1.08) } }
.mark-cup { position: relative; z-index: 2; height: clamp(150px, 22vw, 240px); margin: 0 auto;
  filter: drop-shadow(0 14px 40px rgba(187,132,232,0.5)); animation: float 7s ease-in-out infinite; }
.mark-lockup { position: relative; z-index: 2; height: clamp(74px, 11vw, 128px); margin: 18px auto 0;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); }
.mark-read { position: relative; z-index: 2; max-width: 60ch; margin: 26px auto 0; color: var(--muted); font-size: clamp(1.02rem,1.5vw,1.22rem); }
.mark-read b { color: var(--text); }
.decode .ic { font-family: var(--display); font-weight: 800; font-style: normal; }

/* ============================================================
   BOOKLET LIBRARY — every front + back, all 9 disciplines
   ============================================================ */
.library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.spread { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  background: var(--card);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.spread:hover { transform: translateY(-6px); border-color: var(--sc); box-shadow: 0 30px 60px -30px var(--sc); }
.spread .pages { display: flex; gap: 12px; perspective: 1400px; }
.spread .pages img { width: 50%; border-radius: 9px; border: 1px solid var(--line);
  box-shadow: 0 16px 30px -18px rgba(0,0,0,.85); transition: transform .5s var(--ease); }
.spread .pages img.front { transform-origin: right center; }
.spread .pages img.back  { transform-origin: left center; }
.spread:hover .pages img.front { transform: rotateY(8deg); }
.spread:hover .pages img.back  { transform: rotateY(-8deg); }
.spread .cap { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.spread .cap b { font-family: var(--display); font-size: 1rem; }
.spread .cap .code { font-family: var(--display); font-weight: 800; color: var(--sc); font-size: .9rem;
  padding: 4px 10px; border-radius: 100px; background: color-mix(in srgb, var(--sc) 16%, transparent); }
.spread .pp { position: absolute; bottom: 76px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.spread .pp s { font-size: .64rem; color: var(--muted-2); text-decoration: none; letter-spacing: .1em; text-transform: uppercase; }
.lib-note { text-align: center; color: var(--muted); font-size: .86rem; margin-top: 30px; }

@media (max-width: 1000px){ .library { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .library { grid-template-columns: 1fr; } }

/* ============================================================
   THEME TOGGLE + LIGHT-MODE POLISH
   ============================================================ */
.theme-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  cursor: pointer; font-size: 1.1rem; transition: transform .25s var(--ease), background .25s;
}
.theme-btn:hover { transform: translateY(-2px) rotate(-8deg); }
.theme-btn .sun { display: var(--logo-light); }   /* sun shows in light mode */
.theme-btn .moon { display: var(--logo-dark); }    /* moon shows in dark mode */

.brand .logo-l, .brand .logo-d { width: auto; height: 40px; filter: drop-shadow(0 3px 14px rgba(138,79,207,0.35)); }

/* Light mode: tame deep shadows, lift tinted panels */
[data-theme="light"] .card:hover { box-shadow: 0 26px 50px -30px rgba(80,50,140,0.4); }
[data-theme="light"] .marquee { background: linear-gradient(180deg, rgba(138,79,207,0.05), transparent); }
[data-theme="light"] .marquee-track span { color: var(--violet); }
[data-theme="light"] .subj, [data-theme="light"] .spread .pages img { box-shadow: 0 16px 34px -22px rgba(80,50,140,0.45); }
[data-theme="light"] .hero-art .orb { box-shadow: 0 40px 110px -30px rgba(138,79,207,0.5), inset 0 0 0 1px rgba(0,0,0,0.05); }
[data-theme="light"] .mark-sec { background:
  radial-gradient(900px 500px at 50% 0%, rgba(138,79,207,0.16), transparent 62%),
  radial-gradient(700px 500px at 50% 100%, rgba(255,94,43,0.10), transparent 62%); }
[data-theme="light"] .mark-lockup { filter: drop-shadow(0 10px 26px rgba(138,79,207,0.30)); }
[data-theme="light"] .mark-cup { filter: drop-shadow(0 14px 36px rgba(138,79,207,0.4)); }
[data-theme="light"] .price-card { background: linear-gradient(160deg, #fff, #f3ecff); }
[data-theme="light"] .gbox { background: linear-gradient(135deg, rgba(255,138,61,0.10), rgba(138,79,207,0.10)); }
[data-theme="light"] .nav-toggle, [data-theme="light"] .theme-btn { box-shadow: 0 4px 14px -8px rgba(80,50,140,0.4); }

/* smooth cross-fade when switching theme */
.card, .subj, .spread, .nav, footer, .stat-card, .gbox, .price-card, .form-card, .qa, .rung, .reward, .band, .flow-step {
  transition: background .45s var(--ease), border-color .45s var(--ease), color .3s, box-shadow .45s var(--ease);
}
