/* Coven+ Update 8 — homepage / academy theme layer (dark + light mode, only when Update 8 is on). */
html.u8[data-theme="dark"] body:not([data-cvx]) {
  --bg: #100D18; --bg-2: #171321; --surface: #171321; --surface-2: #21182E; --surface-3: #291F38;
  --line: rgba(245,240,250,.08); --line-2: rgba(245,240,250,.14); --line-3: rgba(245,240,250,.18);
  --text: #F5F0FA; --muted: #AAA1B5; --dim: #7E758C;
  --violet: #9B79D4; --violet-2: #B79BE3; --violet-soft: rgba(155,121,212,.14); --lav: #B79BE3; --indigo: #9B79D4;
  --gold: #C7A66A; --gold-soft: rgba(199,166,106,.14);
  --cv-btn: #9B79D4; --cv-btn-hover: #B79BE3; --accent: #9B79D4; --accent-soft: rgba(155,121,212,.14);
  --u8-btn: #F5F0FA; --u8-btn-hover: #FFFFFF; --u8-btn-ink: #16111f; --u8-wash: rgba(245,240,250,.02);
  --u8-glass: rgba(23,19,33,.8); --u8-header: rgba(16,13,24,.82); --u8-dimword: rgba(245,240,250,.2);
  --u8-moon-a: #3A2C52; --u8-moon-b: #1A1426; --u8-moon-lit: #EFE7F7; --u8-pip: #171321;
  color-scheme: dark;
}
html.u8[data-theme="light"] body:not([data-cvx]) {
  --bg: #F6F2FA; --bg-2: #FFFFFF; --surface: #FFFFFF; --surface-2: #F1EBF8; --surface-3: #E8DFF3;
  --line: rgba(23,19,33,.08); --line-2: rgba(23,19,33,.14); --line-3: rgba(23,19,33,.2);
  --text: #171321; --muted: #5E5470; --dim: #857A95;
  --violet: #7553B8; --violet-2: #5E3F9E; --violet-soft: rgba(117,83,184,.11); --lav: #7553B8; --indigo: #7553B8;
  --gold: #9A7A3A; --gold-soft: rgba(154,122,58,.12);
  --cv-btn: #7553B8; --cv-btn-hover: #5E3F9E; --accent: #7553B8; --accent-soft: rgba(117,83,184,.11);
  --u8-btn: #171321; --u8-btn-hover: #2A2236; --u8-btn-ink: #F6F2FA; --u8-wash: rgba(23,19,33,.02);
  --u8-glass: rgba(255,255,255,.85); --u8-header: rgba(246,242,250,.86); --u8-dimword: rgba(23,19,33,.18);
  --u8-moon-a: #E9DFF6; --u8-moon-b: #CFC0E6; --u8-moon-lit: #FFFFFF; --u8-pip: #FFFFFF;
  color-scheme: light;
}
html.u8[data-theme] body:not([data-cvx]) {
  --serif: "Noto Serif Display", "EB Garamond", Georgia, serif; --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-family: var(--sans);
}
html.u8[data-theme] body:not([data-cvx]) ::selection { background: color-mix(in srgb, var(--violet) 35%, transparent); }

/* hero: the moon-phase orbit replaces the photo and video */
html.u8[data-theme] body .cvh-hero { background: var(--bg); }
html.u8[data-theme] body .cvh-hero .cvh-poster, html.u8[data-theme] body .cvh-hero video { display: none !important; }
html.u8[data-theme] body .cvh-hero::before, html.u8[data-theme] body .cvh-hero::after { display: none !important; }
.u8-orbit { position: absolute; right: max(4vw, 20px); top: 50%; transform: translateY(-50%); width: min(44vw, 560px); aspect-ratio: 1; pointer-events: none; z-index: 0; }
.u8-orbit svg { width: 100%; height: 100%; }
.u8-orbit .spin { transform-origin: 200px 200px; animation: u8spin 240s linear infinite; }
@keyframes u8spin { to { transform: rotate(360deg); } }
html.u8[data-theme] body .cvh-hero-in { position: relative; z-index: 1; }
html.u8[data-theme] body .cvh-hero h1 { font-family: var(--serif); font-weight: 300; letter-spacing: -.035em; color: var(--text); max-width: 13ch; }
html.u8[data-theme] body .cvh-hero h1 em { color: var(--muted); font-style: italic; }
html.u8[data-theme] body .cvh-eyebrow { color: var(--gold); }
html.u8[data-theme] body .cvh-lead { color: var(--muted); }

/* buttons: light primary, ghost secondary */
html.u8[data-theme] body .cvh-btn.cvh-gold, html.u8[data-theme] body .btn-primary, html.u8[data-theme] body .btn.primary {
  background: var(--u8-btn) !important; color: var(--u8-btn-ink) !important; border-color: var(--u8-btn) !important;
}
html.u8[data-theme] body .cvh-btn.cvh-gold:hover { background: var(--u8-btn-hover) !important; }
html.u8[data-theme] body .cvh-btn.cvh-ghost { border-color: var(--line-3) !important; color: var(--text) !important; background: var(--u8-wash) !important; }

/* stats, manifesto, cards */
html.u8[data-theme] body .cvh-stats { background: var(--u8-glass) !important; border: 1px solid var(--line) !important; border-radius: 16px !important; }
html.u8[data-theme] body .cvh-stats b { font-family: var(--serif); font-weight: 300; }
html.u8[data-theme] body .cvh-manifesto .w { color: var(--u8-dimword); }
html.u8[data-theme] body .cvh-manifesto .w.on, html.u8[data-theme] body .cvh-manifesto .w.lit { color: var(--text); }
html.u8[data-theme] body .cvh-manifesto .w.g.on, html.u8[data-theme] body .cvh-manifesto .w.g.lit { color: var(--gold); }
html.u8[data-theme] body .cvh-path, html.u8[data-theme] body .cvh-thread, html.u8[data-theme] body .cvh-plan,
html.u8[data-theme] body .card, html.u8[data-theme] body .cvh-arts > * {
  background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 18px !important;
  transition: border-color .3s, background .3s, transform .4s cubic-bezier(.22,1,.36,1);
}
html.u8[data-theme] body .cvh-path:hover, html.u8[data-theme] body .cvh-thread:hover, html.u8[data-theme] body .cvh-plan:hover {
  background: var(--surface-2) !important; border-color: var(--line-2) !important; transform: translateY(-3px);
}
html.u8[data-theme] body .cvh-block { border-top: 1px solid var(--line); }
html.u8[data-theme] body .cvh-head h2, html.u8[data-theme] body .cvh-block h2 { font-family: var(--serif); font-weight: 300; letter-spacing: -.025em; }
html.u8[data-theme] body .cvh-head h2 em, html.u8[data-theme] body .cvh-block h2 em { color: var(--muted); }

/* top bar */
html.u8[data-theme] body .topbar, html.u8[data-theme] body .nav, html.u8[data-theme] body header {
  background: var(--u8-header); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line);
}

@media (max-width: 900px) {
  .u8-orbit { position: relative; right: auto; top: auto; transform: none; width: min(78vw, 360px); margin: 8px auto -8px; display: block; }
}
@media (prefers-reduced-motion: reduce) { .u8-orbit .spin { animation: none; } }
html.u8[data-theme] body .cvh-hero h1 { font-size: clamp(40px, 5.2vw, 80px) !important; line-height: 1.02 !important; max-width: 14ch; }
html.u8[data-theme] body .cvh-hero h1 .ln, html.u8[data-theme] body .cvh-hero h1 span { display: inline; }
@media (min-width: 901px) { .u8-orbit { width: min(38vw, 520px); top: 46%; } }

/* orbit colours follow the theme */
.u8-orbit .u8-pip { fill: var(--u8-pip); } .u8-orbit .u8-pipl { fill: var(--gold); }
.u8-orbit .u8-ma { stop-color: var(--u8-moon-a); } .u8-orbit .u8-mb { stop-color: var(--u8-moon-b); }
.u8-orbit .u8-ring { stroke: var(--line); } .u8-orbit .u8-ring2 { stroke: var(--line-2); } .u8-orbit .u8-lit { fill: var(--u8-moon-lit); }

/* ---------- Update 8.1: theme-aware homepage pieces ---------- */
html.u8[data-theme="dark"] body .cvh { --card: #171321; --gold2: #D9BC7E; }
html.u8[data-theme="light"] body .cvh { --card: #FFFFFF; --gold2: #85662A; }
html.u8[data-theme] body:not([data-area="admin"]):has(.cvh) .nav.cvh-solid { background: var(--u8-header); box-shadow: inset 0 -1px 0 var(--line); }
html.u8[data-theme] body:has(.cvh) .tabbar { background: var(--u8-header); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
html.u8[data-theme] body:not([data-area="admin"]):has(.cvh) .nav .btn-primary { background: var(--u8-btn); border-color: var(--u8-btn); color: var(--u8-btn-ink); }
html.u8[data-theme] body:not([data-area="admin"]):has(.cvh) .nav .btn-primary:hover { background: var(--u8-btn-hover); border-color: var(--u8-btn-hover); }

/* discussions: separate cards with air between them, no dark frame */
html.u8[data-theme] body .cvh-threads { background: transparent !important; border: 0 !important; border-radius: 0 !important; overflow: visible !important; display: grid; gap: 10px; }
html.u8[data-theme] body .cvh-thread { border: 1px solid var(--line) !important; border-radius: 16px !important; padding: 16px 20px !important; background: var(--surface) !important; }
html.u8[data-theme] body .cvh-thread:first-child { border-top: 1px solid var(--line) !important; }
html.u8[data-theme] body .cvh-thread:hover { background: var(--surface-2) !important; border-color: var(--line-2) !important; transform: translateY(-2px); }
html.u8[data-theme] body .cvh-thread:hover .t { color: var(--violet-2); }
html.u8[data-theme="light"] body .cvh-thread { box-shadow: 0 10px 26px -22px rgba(40,22,70,.35); }

/* the "join" panel stays a night panel in both themes, so its text is always light on dark */
html.u8[data-theme="light"] body .cvh-join {
  --text: #F5F0FA; --muted: #AAA1B5; --line: rgba(245,240,250,.1); --line-2: rgba(245,240,250,.18); --line-3: rgba(245,240,250,.22);
  --u8-btn: #F5F0FA; --u8-btn-hover: #FFFFFF; --u8-btn-ink: #16111f; --u8-wash: rgba(245,240,250,.04); --gold: #C7A66A; --gold2: #D9BC7E;
  color: var(--text); border-color: transparent;
}
@media (max-width: 760px) {
  html.u8[data-theme] body .cvh-thread { padding: 14px 16px !important; gap: 12px !important; }
}
