/* =====================================================================
   Midnight theme — dark glass cards floating over an aurora backdrop.
   Loaded after teacher.css; every rule is scoped to .theme-midnight.
   ===================================================================== */
.tp-root.theme-midnight {
  --accent: #8b7bff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --paper: #07080f;
  --paper-2: #0c0f1d;
  --ink: #eef0ff;
  --muted: #9aa0bd;
  --coral: var(--accent);
  --mustard: #fbbf24;
  --mint: #34d399;
  --peri: var(--accent-2);
  --pink: var(--accent-3);
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --glow: color-mix(in srgb, var(--accent) 55%, transparent);
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  background: var(--paper);
  color: var(--ink);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
}
.tp-root.theme-midnight ::selection { background: var(--accent); color: #fff; }

/* Backdrop: drifting aurora blobs + a faint grid fading out from the top */
.theme-midnight .aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.theme-midnight .aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .32; animation: mn-drift 24s ease-in-out infinite alternate; will-change: transform; }
.theme-midnight .aurora span:nth-child(1) { background: var(--accent); top: -28vmax; left: -18vmax; }
.theme-midnight .aurora span:nth-child(2) { background: var(--accent-2); top: 25vh; right: -30vmax; opacity: .18; animation-duration: 30s; }
.theme-midnight .aurora span:nth-child(3) { background: var(--accent-3); bottom: -34vmax; left: 15vw; opacity: .14; animation-duration: 36s; }
.tp-root.theme-midnight::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%); }
@keyframes mn-drift { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); } }

/* Type */
.theme-midnight h1, .theme-midnight h2, .theme-midnight h3, .theme-midnight h4 { font-family: "Space Grotesk", Inter, system-ui, sans-serif; letter-spacing: -.035em; color: var(--ink); }
.theme-midnight .it { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent !important; font-style: normal; font-weight: 600; }
.theme-midnight .eyebrow { color: var(--accent-2); font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: .22em; }
.theme-midnight .eyebrow:before { background: var(--grad); width: 36px; }
.theme-midnight .section-h { font-size: clamp(34px, 5vw, 64px); }
.theme-midnight .section-sub { color: var(--muted); }
.theme-midnight .sec { padding: 110px 0; }

/* Header */
.theme-midnight .tp-header { background: rgba(7, 8, 15, .55); border-bottom: 1px solid var(--line); }
.theme-midnight .tp-header.is-scrolled { box-shadow: 0 10px 40px -20px #000; }
.theme-midnight .tp-header .nav-links { color: var(--muted); }
.theme-midnight .tp-header .nav-links a:hover, .theme-midnight .nav-links a.is-active { color: #fff; }
.theme-midnight .nav-links a:after, .theme-midnight .scroll-progress { background: var(--grad); }
.theme-midnight .tp-header .pill-btn { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -8px var(--glow); }

/* Hero: split layout on desktop */
.theme-midnight .hero { padding: 72px 0 96px; overflow: visible; }
.theme-midnight .hero-inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 72px; align-items: center; text-align: left; }
.theme-midnight .portrait-wrap { width: min(100%, 400px); height: auto; aspect-ratio: 4 / 5; justify-self: center; }
.theme-midnight .portrait { border-radius: 36px; border: 1px solid var(--line); box-shadow: 0 40px 90px -30px var(--glow); background: var(--paper-2); }
.theme-midnight .portrait-wrap:before { inset: -3px; border-radius: 39px; background: var(--grad); filter: blur(28px); opacity: .55; animation: mn-breathe 6s ease-in-out infinite alternate; }
@keyframes mn-breathe { from { opacity: .35; transform: scale(.97); } to { opacity: .7; transform: scale(1.02); } }
.theme-midnight .verified-dot { bottom: 18px; right: 18px; border-color: var(--paper); background: var(--mint); color: #052e1f; }
.theme-midnight .hero-copy { align-items: flex-start; max-width: none; gap: 18px; }
.theme-midnight .hero h1 { font-size: clamp(44px, 6.2vw, 88px) !important; line-height: .96; }
.theme-midnight .hero .hero-sub { text-align: left; color: var(--muted); font-size: 19px !important; max-width: 580px; }
.theme-midnight .hero .meta-row, .theme-midnight .hero .cta-row, .theme-midnight .hero .socials { justify-content: flex-start; }
.theme-midnight .ribbon { background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.theme-midnight .ribbon .live { background: var(--mint); }
.theme-midnight .chip { background: var(--glass); border: 1px solid var(--line); color: var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.theme-midnight .chip.coral { background: var(--grad); color: #fff; border-color: transparent; }
.theme-midnight .hero .meta-row .chip.mint, .theme-midnight .chip.mint { background: rgba(52, 211, 153, .14); color: #a7f3d0; border-color: rgba(52, 211, 153, .3); }
.theme-midnight .chip.mustard { background: rgba(251, 191, 36, .14); color: #fde68a; border-color: rgba(251, 191, 36, .3); }
.theme-midnight .btn { border-radius: 14px; }
.theme-midnight .btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 12px 34px -10px var(--glow); }
.theme-midnight .btn-primary:hover { box-shadow: 0 18px 44px -10px var(--glow); transform: translateY(-2px); }
.theme-midnight .btn-ghost { background: var(--glass); border: 1px solid var(--line); color: var(--ink); }
.theme-midnight .btn-ghost:hover { background: var(--glass-strong); color: #fff; }
.theme-midnight .socials .sm { background: var(--glass); border: 1px solid var(--line); color: var(--ink); }
.theme-midnight .socials .sm:hover { background: var(--accent); color: #fff; }

/* Highlights ticker */
.theme-midnight .trust { background: rgba(255, 255, 255, .02); border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.theme-midnight .marquee { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 500; }
.theme-midnight .marquee .star { color: var(--accent); }

/* Glass surfaces shared by cards (with a pointer-following spotlight, see main.js) */
.theme-midnight :is(.stat, .facts, .feat, .award, .blog-card, .vid, .rev, .review-form, .review-thanks) {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%), var(--glass);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .3s;
}
.theme-midnight :is(.feat, .award, .blog-card, .vid, .rev):hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 24px 60px -28px var(--glow); }

/* Stats as a bento row */
.theme-midnight .stats { background: transparent; border: 0; padding: 32px 0 16px; }
.theme-midnight .stats-grid { gap: 16px; }
.theme-midnight .stat { border-radius: 24px; padding: 28px 26px; position: relative; overflow: hidden; }
.theme-midnight .stat:before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--grad); opacity: .8; }
.theme-midnight .stat .n { font-family: "Space Grotesk", Inter, sans-serif; font-size: clamp(34px, 4.4vw, 60px); letter-spacing: -.04em; color: #fff; overflow-wrap: break-word; hyphens: auto; }
.theme-midnight .stat .n .accent { color: var(--accent-2); }
.theme-midnight .stat .l { color: var(--muted); }

/* About */
.theme-midnight .about-copy, .theme-midnight .about-copy p { color: #c9cce0; }
.theme-midnight .about-copy a { color: var(--accent-2); }
.theme-midnight .facts { border-radius: 28px; }
.theme-midnight .facts h3 { color: #fff; }
.theme-midnight .facts:after { content: "✦"; color: var(--accent); opacity: .14; font-style: normal; }
.theme-midnight .fact { border-bottom: 1px solid var(--line); }
.theme-midnight .fact .k { color: var(--muted); }

/* Features */
.theme-midnight .feat { border-radius: 26px; }
.theme-midnight .feat .num { color: rgba(255, 255, 255, .05); font-family: "Space Grotesk", Inter, sans-serif; font-style: normal; }
.theme-midnight .feat .ic { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -8px var(--glow); border-radius: 16px; }
.theme-midnight .feat:nth-child(3n+2) .ic { background: linear-gradient(120deg, var(--accent-2), var(--accent-3)); }
.theme-midnight .feat:nth-child(3n) .ic { background: linear-gradient(120deg, var(--accent-3), var(--accent)); }
.theme-midnight .feat p { color: var(--muted); }

/* Awards */
.theme-midnight .awards { background: transparent; color: var(--ink); padding: 110px 0; }
.theme-midnight .awards .eyebrow { color: var(--accent-2); }
.theme-midnight .award .yr { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: "Space Grotesk", Inter, sans-serif; font-style: normal; font-weight: 700; }
.theme-midnight .award h4 { color: #fff; font-family: "Space Grotesk", Inter, sans-serif; }
.theme-midnight .award p { color: var(--muted); }

/* Blog & videos */
.theme-midnight .teacher-blog, .theme-midnight .gallery { background: transparent; }
.theme-midnight .blog-image { border-bottom: 1px solid var(--line); }
.theme-midnight .blog-link { color: var(--accent-2); }
.theme-midnight .vid h4 { color: #fff; font-family: "Space Grotesk", Inter, sans-serif; }
.theme-midnight .vid .play .core { background: var(--grad); border: 0; box-shadow: 0 0 0 8px rgba(255, 255, 255, .1), 0 12px 30px -6px var(--glow); }

/* Gallery: bento mosaic */
.theme-midnight .g-grid { gap: 14px; }
.theme-midnight .g-item { border: 1px solid var(--line); box-shadow: none; border-radius: 22px; }
.theme-midnight .g-item:hover { box-shadow: 0 20px 50px -20px var(--glow); transform: translateY(-4px); }
.theme-midnight .g-item:first-child { grid-area: span 2 / span 2; }

/* Reviews */
.theme-midnight .rev { border-radius: 24px; }
.theme-midnight .rev .stars { color: var(--mustard); }
.theme-midnight .rev .quote-t { font-family: Inter, system-ui, sans-serif; font-size: 17px; line-height: 1.6; color: #d9dbee; }
.theme-midnight .who { border-top: 1px solid var(--line); }
.theme-midnight .who .name { color: #fff; }
.theme-midnight .who .role { color: var(--muted); }
.theme-midnight .who .av { background: var(--grad); }

/* Review form */
.theme-midnight .review-form-section { background: transparent; border-top: 1px solid var(--line); }
.theme-midnight .review-form { border-radius: 26px; }
.theme-midnight .review-form input, .theme-midnight .review-form textarea { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--ink); }
.theme-midnight .review-form input:focus, .theme-midnight .review-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-midnight .review-alert.success { background: rgba(52, 211, 153, .14); color: #a7f3d0; }
.theme-midnight .review-alert.error { background: rgba(244, 114, 182, .14); color: #fbcfe8; }

/* Call to action */
.theme-midnight .cta-band { background: radial-gradient(80% 120% at 0% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%), radial-gradient(80% 120% at 100% 100%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 60%), var(--paper-2); border: 0; border-top: 1px solid var(--line); }
.theme-midnight .cta-band:before { background-image: radial-gradient(circle, rgba(255, 255, 255, .12) 1px, transparent 1px); }
.theme-midnight .cta-band h2 { font-size: clamp(40px, 6.4vw, 92px); }
.theme-midnight .cta-band .it { background: linear-gradient(120deg, #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; }
.theme-midnight .btn-white { background: #fff; color: #07080f !important; box-shadow: 0 14px 40px -12px rgba(255, 255, 255, .6); border: 0; }
.theme-midnight .btn-white:hover { transform: translateY(-2px); box-shadow: 0 20px 50px -12px rgba(255, 255, 255, .7); }

.theme-midnight .book-fab { background: var(--grad); border: 0; box-shadow: 0 12px 30px -8px var(--glow); }
.theme-midnight a:focus-visible, .theme-midnight button:focus-visible { outline-color: var(--accent-2); }

/* Responsive */
@media (width <= 880px) {
  .theme-midnight .hero { padding: 36px 0 56px; }
  .theme-midnight .hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .theme-midnight .portrait-wrap { width: min(68vw, 280px); }
  .theme-midnight .hero-copy { align-items: center; }
  .theme-midnight .hero .hero-sub { text-align: center; }
  .theme-midnight .hero .meta-row, .theme-midnight .hero .cta-row, .theme-midnight .hero .socials { justify-content: center; }
  .theme-midnight .g-item:first-child { grid-area: span 1 / span 2; }
  .theme-midnight .sec, .theme-midnight .awards { padding: 72px 0; }
}
@media (width <= 720px) {
  .theme-midnight .hero h1 { font-size: 42px !important; }
  .theme-midnight .hero .hero-sub { font-size: 16px !important; }
  .theme-midnight .aurora span { filter: blur(60px); }
  .theme-midnight .stat { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-midnight .aurora span, .theme-midnight .portrait-wrap:before { animation: none; }
}

/* Paint the page behind the profile too (overscroll bounce, short pages) */
body:has(.tp-root.theme-midnight) { background: #07080f; }
