/* EDURA Kickstarter Series – notes site */
@font-face {
  font-family: "Cinzel";
  src: url("/fonts/Cinzel-Variable.woff2") format("woff2");
  font-weight: 400 900; font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg: #031412;
  --bg-2: #062521;
  --panel: rgba(10, 46, 41, 0.55);
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(160, 230, 205, 0.12);
  --line-gold: rgba(232, 196, 108, 0.35);
  --emerald: #10b981;
  --emerald-2: #34d399;
  --teal: #14b8a6;
  --gold: #e8c46c;
  --gold-2: #f6dc94;
  --gold-3: #b8923b;
  --ink: #eaf6f1;
  --muted: #9fc4b9;
  --dim: #6e958b;
  --radius: 18px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --ui: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.55;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #1a1405; padding: 8px 14px; border-radius: 10px; z-index: 100; font-weight: 700; }
.skip:focus { left: 12px; }

/* --- starfield --- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(20, 184, 166, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(16, 185, 129, 0.10), transparent 60%),
    radial-gradient(1000px 800px at 50% 120%, rgba(232, 196, 108, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #041b18 45%, var(--bg) 100%);
}
.stars { position: absolute; inset: -50%; background-repeat: repeat; opacity: .55; }
.stars.s1 {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent 60%),
    radial-gradient(1px 1px at 120px 80px, #cfe, transparent 60%),
    radial-gradient(1.5px 1.5px at 200px 160px, #fff, transparent 60%),
    radial-gradient(1px 1px at 260px 40px, #def, transparent 60%),
    radial-gradient(1px 1px at 60px 210px, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 330px 250px, #fea, transparent 60%);
  background-size: 360px 300px;
  animation: drift 160s linear infinite;
}
.stars.s2 {
  background-image:
    radial-gradient(1px 1px at 50px 90px, #9fe, transparent 60%),
    radial-gradient(1px 1px at 300px 20px, #fff, transparent 60%),
    radial-gradient(1.6px 1.6px at 420px 300px, #fff, transparent 60%),
    radial-gradient(1px 1px at 180px 380px, #cfe, transparent 60%);
  background-size: 520px 460px; opacity: .35;
  animation: drift 260s linear infinite reverse;
}
.orbit {
  position: absolute; width: 1400px; height: 1400px; right: -700px; top: 260px; border-radius: 50%;
  border: 1px solid rgba(232, 196, 108, 0.07);
  box-shadow: inset 0 0 0 120px rgba(16, 185, 129, 0.015), 0 0 0 220px rgba(16, 185, 129, 0.012);
}
@keyframes drift { to { transform: translate3d(180px, 120px, 0); } }
@media (prefers-reduced-motion: reduce) { .stars { animation: none; } html { scroll-behavior: auto; } }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px); padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(3, 20, 18, 0.92), rgba(3, 20, 18, 0.72));
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(16, 185, 129, .35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 1.12rem; }
.brand-text small { color: var(--gold); font-size: .66rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 600; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.class-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(232, 196, 108, 0.08); border: 1px solid var(--line-gold); color: var(--gold-2); font-weight: 600; font-size: .86rem;
  transition: background .2s, transform .2s;
}
.class-pill svg { width: 16px; height: 16px; }
.class-pill:hover { background: rgba(232, 196, 108, 0.16); }
.account { display: flex; align-items: center; min-height: 40px; }
.gsi-slot { min-height: 0; }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; }
.user-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.user-btn span { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: .88rem; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 12px; border-radius: 14px;
  background: #072723; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.user-email { margin: 0 0 10px; color: var(--muted); font-size: .8rem; word-break: break-all; }
.user-menu button { width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-weight: 600; }
.user-menu button:hover { background: rgba(255, 255, 255, .1); }

/* --- hero / landing --- */
.hero { position: relative; overflow: hidden; min-height: calc(100vh - 66px); display: flex; align-items: center; }
.hero.compact { min-height: 0; }
.hero-art { position: absolute; inset: 0; z-index: 0; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; opacity: .78; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(90deg, rgba(3, 20, 18, .96) 0%, rgba(3, 20, 18, .82) 38%, rgba(3, 20, 18, .25) 75%, rgba(3, 20, 18, .45) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 30%);
}
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(40px, 8vh, 96px) clamp(18px, 4vw, 40px) clamp(48px, 8vh, 90px); }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 7px 16px 7px 12px; border-radius: 999px;
  border: 1.5px solid var(--gold); color: var(--gold-2); text-transform: uppercase; letter-spacing: .22em; font-weight: 700; font-size: .74rem;
  background: rgba(232, 196, 108, 0.07); box-shadow: 0 0 24px -6px rgba(232, 196, 108, .45);
}
.kicker svg { width: 16px; height: 16px; color: var(--gold); transform: rotate(35deg); }
.hero h1 {
  font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.02; letter-spacing: .02em;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  background: linear-gradient(180deg, #fff 30%, #cfeee3 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(16, 185, 129, .15);
}
.hero h1 span {
  display: block; font-size: .52em; margin-top: .25em; letter-spacing: .06em;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 540px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); margin: 18px 0 0; }
.picker { margin-top: clamp(28px, 5vh, 48px); max-width: 720px; }
.picker-q { font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 0 0 16px; letter-spacing: .04em; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.class-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 18px; align-items: center; text-align: left;
  padding: 22px 22px 20px; border-radius: 22px; min-height: 150px; overflow: hidden;
  background: linear-gradient(160deg, rgba(16, 185, 129, .14), rgba(6, 37, 33, .7) 60%);
  border: 1px solid rgba(160, 230, 205, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s ease, border-color .25s, box-shadow .25s;
}
.class-card::before {
  content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px; border-radius: 50%;
  border: 1px dashed rgba(232, 196, 108, .25); transition: transform .6s ease;
}
.class-card:hover, .class-card:focus-visible { transform: translateY(-4px); border-color: var(--line-gold); box-shadow: 0 24px 60px -20px rgba(16, 185, 129, .45); }
.class-card:hover::before { transform: rotate(60deg) scale(1.08); }
.class-card.is-current { border-color: var(--gold); }
.cc-num {
  grid-row: 1 / 4; font-family: var(--display); font-weight: 800; font-size: 3.6rem; line-height: 1;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cc-label { font-weight: 700; font-size: 1.25rem; }
.cc-sub { color: var(--muted); font-size: .86rem; line-height: 1.4; margin-top: 2px; }
.cc-go { color: var(--gold); font-weight: 700; font-size: .85rem; margin-top: 10px; letter-spacing: .04em; }

/* --- library --- */
.library { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 40px) 72px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--gold); letter-spacing: .2em; text-transform: uppercase; font-size: .72rem; font-weight: 700; }
.lib-head h2 { font-family: var(--display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0; letter-spacing: .03em; }
.link-btn { background: none; border: 0; color: var(--emerald-2); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; }
.link-btn:hover { color: var(--gold-2); }
.tabs {
  display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  margin-bottom: 18px; max-width: 100%; overflow-x: auto;
}
.tabs [role="tab"] {
  border: 0; background: transparent; color: var(--muted); padding: 10px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: background .2s, color .2s;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] {
  color: #10241f; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 6px 18px -6px rgba(232, 196, 108, .6);
}
.panel:focus-visible { outline-offset: 6px; }
.stat { color: var(--dim); font-size: .86rem; margin: 0 0 14px; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ch {
  position: relative; display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--line); min-height: 86px;
}
.ch-num {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; color: var(--dim); background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.ch-body { flex: 1; min-width: 0; }
.ch-title { margin: 0; font-weight: 600; font-size: 1rem; line-height: 1.3; }
.ch-meta { margin: 4px 0 0; font-size: .8rem; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.soon {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); background: rgba(255, 255, 255, .04); border: 1px dashed rgba(160, 230, 205, .22); text-transform: uppercase;
}
.soon svg { width: 12px; height: 12px; opacity: .8; }
.ch.available {
  grid-column: 1 / -1; padding: 18px; gap: 22px; align-items: stretch;
  background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(6, 37, 33, .65) 55%, rgba(232, 196, 108, .07));
  border-color: var(--line-gold); box-shadow: var(--shadow);
}
.ch.available .ch-num { color: #10241f; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 0; }
.ch-thumb {
  flex: none; width: 128px; aspect-ratio: 210 / 297; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8); transform: rotate(-2deg); background: #0a2e29; padding: 0; cursor: zoom-in;
  transition: transform .3s;
}
.ch-thumb:hover { transform: rotate(0) scale(1.03); }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ch.available .ch-body { display: flex; flex-direction: column; justify-content: center; }
.ch.available .ch-title { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 1.75rem); letter-spacing: .02em; }
.ch-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--emerald-2); font-weight: 700; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.ch-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-2); box-shadow: 0 0 10px var(--emerald-2); }
.ch-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ch-note { margin: 10px 0 0; font-size: .78rem; color: var(--dim); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .92rem;
  border: 1px solid transparent; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-gold { color: #14200f; background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, #d6ae52); box-shadow: 0 10px 24px -10px rgba(232, 196, 108, .7), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { box-shadow: 0 14px 30px -10px rgba(232, 196, 108, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, .05); border-color: rgba(160, 230, 205, .25); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: var(--line-gold); }
.btn[aria-busy="true"] { opacity: .8; cursor: progress; }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.lock { font-size: .7rem; font-weight: 600; opacity: .75; }

/* --- footer --- */
.footer { border-top: 1px solid var(--line); background: rgba(2, 14, 12, .6); padding: 28px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom)); }
.foot-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.foot-brand { display: flex; gap: 12px; align-items: center; }
.foot-brand strong { font-family: var(--display); letter-spacing: .06em; }
.foot-brand p, .foot-yt p { margin: 2px 0; color: var(--muted); font-size: .88rem; }
.foot-yt strong { color: var(--ink); }
.yt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #ff3d3d; margin-right: 8px; box-shadow: 0 0 10px rgba(255, 61, 61, .6); }
.fine { max-width: 1180px; margin: 18px auto 0; color: var(--dim); font-size: .76rem; }

/* --- reader --- */
.reader {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: radial-gradient(900px 600px at 50% 0%, rgba(16, 185, 129, .10), transparent 70%), #020f0d;
}
.r-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px clamp(10px, 2vw, 20px); padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: rgba(3, 20, 18, .9); backdrop-filter: blur(10px);
}
.r-title { flex: 1; min-width: 0; }
.r-eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; color: var(--gold); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.r-title h2 { margin: 0; font-family: var(--display); font-size: clamp(.95rem, 2vw, 1.2rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.zoom-val { min-width: 58px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: .82rem; color: var(--muted); }
.r-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.r-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; scrollbar-color: rgba(160, 230, 205, .25) transparent; }
.r-page {
  position: relative; margin: 18px auto 28px; background: #fff; border-radius: 6px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06);
  transition: opacity .2s; min-height: 200px;
}
.r-page img { width: 100%; height: 100%; display: block; border-radius: 6px; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; opacity: 0; transition: opacity .25s; }
.r-page.loaded img { opacity: 1; }
.r-page.loaded .r-spin { display: none; }
.r-spin { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(16, 185, 129, .2); border-top-color: var(--emerald); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(3, 20, 18, .75); border: 1px solid var(--line-gold); color: var(--gold-2); backdrop-filter: blur(6px);
  transition: background .2s, opacity .2s;
}
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn:hover { background: rgba(232, 196, 108, .18); }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.nav-btn.prev { left: clamp(8px, 2vw, 28px); }
.nav-btn.next { right: clamp(8px, 2vw, 28px); }
.r-foot {
  display: flex; align-items: center; gap: 16px; padding: 10px clamp(12px, 3vw, 24px); padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(3, 20, 18, .9);
}
.r-count { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; color: var(--gold-2); }
#rSlider { flex: 1; accent-color: var(--gold); }
.r-hint { color: var(--dim); font-size: .76rem; white-space: nowrap; }

/* --- modal --- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(1, 10, 9, .72); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: min(420px, 100%); text-align: center; padding: 32px 26px 26px; border-radius: 24px;
  background: linear-gradient(170deg, #0b3a33, #052520 60%); border: 1px solid var(--line-gold); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
}
.modal-card img { margin: 0 auto 10px; filter: drop-shadow(0 0 14px rgba(16, 185, 129, .5)); }
.modal-card h2 { font-family: var(--display); margin: 6px 0 8px; font-size: 1.45rem; }
.modal-card p { color: var(--muted); margin: 0 0 20px; font-size: .92rem; }
.modal-x { position: absolute; top: 12px; right: 12px; }
.gsi-modal-slot { display: flex; justify-content: center; min-height: 44px; }
.modal-note { margin-top: 14px !important; font-size: .8rem !important; color: var(--gold-2) !important; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  padding: 12px 18px; border-radius: 14px; background: #0b3a33; border: 1px solid var(--line-gold); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; max-width: calc(100% - 32px);
}

/* --- responsive --- */
@media (max-width: 760px) {
  .brand-text small { letter-spacing: .18em; }
  .hero { min-height: auto; }
  .hero-art img { object-position: 78% 30%; opacity: .55; }
  .hero::after { background: linear-gradient(180deg, rgba(3, 20, 18, .7) 0%, rgba(3, 20, 18, .9) 55%, var(--bg) 100%); }
  .picker-grid { grid-template-columns: 1fr; }
  .class-card { min-height: 0; padding: 18px; }
  .cc-num { font-size: 3rem; }
  .chapters { grid-template-columns: 1fr; }
  .ch.available { flex-direction: column; align-items: flex-start; }
  .ch.available .ch-num { position: absolute; top: 16px; right: 16px; }
  .ch-thumb { width: 112px; }
  .ch-actions .btn { flex: 1; }
  .r-hint, .zoom-val, #zoomIn, #zoomOut { display: none; }
  #rDownload span { display: none; }
  #rDownload { width: 42px; height: 40px; padding: 0; }
  .r-bar { gap: 10px; }
  .nav-btn { width: 42px; height: 42px; top: auto; bottom: 14px; transform: none; }
  .r-page { margin: 10px auto 70px; }
  .user-btn span { display: none; }
  .user-btn { padding: 3px; }
}
@media (max-width: 420px) {
  .brand-text small { display: none; }
  .class-pill { padding: 7px 10px; font-size: .8rem; }
  .tabs [role="tab"] { padding: 9px 14px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.foot-links { max-width: 1180px; margin: 18px auto 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { color: var(--muted); font-size: .84rem; font-weight: 600; text-decoration: none; }
.foot-links a:hover, .foot-links a:focus-visible { color: var(--gold-2); text-decoration: underline; text-underline-offset: 4px; }
/* legal pages */
.legal { max-width: 820px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) clamp(18px, 4vw, 40px) 72px; }
.legal h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 6px; letter-spacing: .03em; }
.legal .updated { color: var(--dim); font-size: .85rem; margin: 0 0 28px; }
.legal-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); }
.legal h2 { font-family: var(--display); font-size: 1.2rem; color: var(--gold-2); margin: 28px 0 8px; letter-spacing: .03em; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: #cfe3dc; }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 4px 0; }
.legal a:not(.btn) { color: var(--emerald-2); text-underline-offset: 3px; }
.legal .back { display: inline-flex; margin-top: 28px; }
.highlight { border-left: 3px solid var(--gold); padding: 10px 16px; background: rgba(232,196,108,.06); border-radius: 0 12px 12px 0; }

/* --- class launch ("coming soon") state --- */
.launch {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.2fr; align-items: center; gap: clamp(16px, 4vw, 48px);
  min-height: 520px; padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background:
    radial-gradient(600px 400px at 20% 60%, rgba(16, 185, 129, .20), transparent 70%),
    radial-gradient(500px 360px at 95% 0%, rgba(232, 196, 108, .10), transparent 70%),
    linear-gradient(160deg, rgba(10, 52, 46, .85), rgba(3, 20, 18, .9));
  border: 1px solid var(--line-gold); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.launch::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1px 1px at 30px 40px, #fff, transparent 60%), radial-gradient(1.4px 1.4px at 160px 120px, #fea, transparent 60%),
    radial-gradient(1px 1px at 260px 60px, #cfe, transparent 60%), radial-gradient(1px 1px at 90px 200px, #fff, transparent 60%);
  background-size: 300px 240px;
}
.launch-sky { position: relative; height: 420px; display: grid; place-items: center; }
.ring { position: absolute; border-radius: 50%; border: 1px dashed rgba(232, 196, 108, .28); }
.ring.r1 { width: 220px; height: 220px; animation: spinr 40s linear infinite; }
.ring.r2 { width: 320px; height: 320px; border-color: rgba(160, 230, 205, .16); animation: spinr 70s linear infinite reverse; }
.ring.r3 { width: 420px; height: 420px; border-style: solid; border-color: rgba(160, 230, 205, .06); }
.ring.r1::after { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.ring.r2::after { content: ""; position: absolute; bottom: 30px; right: 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-2); box-shadow: 0 0 12px var(--emerald-2); }
.planet { position: absolute; width: 90px; height: 90px; right: 6%; bottom: 8%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5eead4, #0f766e 55%, #042f2e); box-shadow: 0 0 40px rgba(20, 184, 166, .35); opacity: .85; }
.launch-rocket { position: relative; width: 120px; height: 220px; filter: drop-shadow(0 0 24px rgba(16, 185, 129, .35)); animation: hover 4s ease-in-out infinite; transform: rotate(8deg); }
.launch-rocket .flame { transform-origin: 60px 150px; animation: flicker .18s ease-in-out infinite alternate; }
@keyframes spinr { to { transform: rotate(360deg); } }
@keyframes hover { 0%, 100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-12px) rotate(8deg); } }
@keyframes flicker { from { transform: scaleY(.85); opacity: .85; } to { transform: scaleY(1.1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ring, .launch-rocket, .launch-rocket .flame { animation: none; } }
.launch-body { position: relative; z-index: 1; }
.launch-body h3 { font-family: var(--display); font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; margin: 0 0 16px; letter-spacing: .02em; }
.launch-body h3 span { display: block;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.launch-text { color: var(--muted); max-width: 520px; margin: 0 0 22px; }
.launch-subjects { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.launch-subjects li { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px dashed rgba(160, 230, 205, .22); min-width: 120px; }
.launch-subjects span { font-weight: 700; }
.launch-subjects small { color: var(--dim); font-size: .78rem; }
.launch-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.launch-note { color: var(--dim); font-size: .8rem; margin: 18px 0 0; }
@media (max-width: 760px) {
  .launch { grid-template-columns: 1fr; min-height: 0; text-align: left; }
  .launch-sky { height: 240px; }
  .ring.r3 { display: none; } .ring.r2 { width: 240px; height: 240px; } .ring.r1 { width: 170px; height: 170px; }
  .launch-rocket { width: 84px; height: 154px; }
  .planet { width: 60px; height: 60px; }
  .launch-actions .btn { width: 100%; }
}
