/* Professor JJ — shared Chicago night theme (landing, app, teacher pages) */
:root {
  --night: #070d1f; --bg-rgb: 7, 13, 31; --navy: #0f1a38; --navy-2: #16244b; --navy-3: #1d2f5e;
  --sky: #41b6e6; --red: #e4002b; --red-d: #a3001f; --neon: #ff2d4f;
  --cream: #f7efdf; --ink-rgb: 247, 239, 223; --gold: #ffc955; --amber: #ffb21a; --bulb: #ffe7a3;
  --card: rgba(22, 36, 75, .62); --card-2: rgba(29, 47, 94, .55); --stroke: rgba(247, 239, 223, .12); --stroke-2: rgba(247, 239, 223, .22);
  --muted: rgba(247, 239, 223, .64); --good: #4ade80; --bad: #ff6b7f;
  --menu-bg: #0d1734f5; --bubble: #f7efdf; --bubble-ink: #0b1430; --shadow: 0 20px 50px rgba(0,0,0,.4);
  --sky-bg: radial-gradient(120% 70% at 50% 108%, rgba(65,182,230,.30), transparent 60%), radial-gradient(80% 50% at 50% 100%, rgba(228,0,43,.16), transparent 70%), linear-gradient(180deg, #050a18 0%, #0a1430 45%, #14224a 78%, #1d2f5e 100%);
  --bld-far: #182650; --bld-near: #0b1330; --bld-line: #24335f; --win: #ffd27a; --star-op: 1; --beam-op: .7; --cloud-op: 0;
  --neon-glow: 0 0 6px #ff6a83, 0 0 18px rgba(228,0,43,.9), 0 0 42px rgba(228,0,43,.6);
  --display: Limelight, Georgia, serif; --marquee: "Bebas Neue", Impact, sans-serif; --led: VT323, ui-monospace, monospace;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  color-scheme: dark;
}
/* Daytime Chicago: blue sky, clouds, sunlit towers */
[data-theme="light"] {
  --night: #eef3fb; --bg-rgb: 238, 243, 251; --navy: #ffffff; --navy-2: #e6edf8; --navy-3: #d9e3f3;
  --sky: #1c92c9; --neon: #e4002b; --cream: #0f1a38; --ink-rgb: 15, 26, 56; --gold: #c47f00; --bulb: #ffd36b;
  --card: rgba(255, 255, 255, .78); --card-2: rgba(255, 255, 255, .62); --stroke: rgba(15, 26, 56, .10); --stroke-2: rgba(15, 26, 56, .18);
  --muted: rgba(15, 26, 56, .62); --good: #16a34a; --bad: #e11d48;
  --menu-bg: #fffffff5; --bubble: #ffffff; --bubble-ink: #0b1430; --shadow: 0 20px 50px rgba(30,50,90,.16);
  --sky-bg: radial-gradient(90% 60% at 80% 0%, rgba(255,255,255,.7), transparent 60%), linear-gradient(180deg, #5fb4ec 0%, #96d1f5 38%, #d6ecfb 70%, #fbefe1 100%);
  --bld-far: #a7bbd8; --bld-near: #5f7499; --bld-line: #4d6189; --win: #eaf5ff; --star-op: 0; --beam-op: 0; --cloud-op: 1;
  --neon-glow: 0 2px 0 rgba(228,0,43,.18);
  color-scheme: light;
}
.theme-anim, .theme-anim * { transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, box-shadow .45s ease !important; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--night); color: var(--cream); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- night sky scene ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background: var(--sky-bg); transition: background .6s; }
.sky.absolute { position: absolute; }
.stars { position: absolute; inset: 0 0 35% 0; opacity: var(--star-op); transition: opacity .6s; }
.star-dot { position: absolute; border-radius: 50%; background: #fff; animation: twinkle var(--d,4s) ease-in-out infinite; animation-delay: var(--o,0s); opacity: .2; }
@keyframes twinkle { 0%,100% { opacity: .15; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
.beam { position: absolute; bottom: -5vh; width: 22vh; height: 125vh; transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(255,236,190,.2), rgba(255,236,190,.05) 60%, transparent);
  clip-path: polygon(44% 100%, 56% 100%, 100% 0, 0 0); filter: blur(6px); mix-blend-mode: screen; opacity: var(--beam-op); }
.beam-l { left: 8%; animation: sweepL 11s ease-in-out infinite alternate; }
.beam-r { right: 8%; animation: sweepR 13s ease-in-out infinite alternate; }
@keyframes sweepL { from { transform: rotate(-28deg); } to { transform: rotate(14deg); } }
@keyframes sweepR { from { transform: rotate(26deg); } to { transform: rotate(-16deg); } }
.gust { position: absolute; height: 2px; border-radius: 2px; left: -30vw; background: linear-gradient(90deg, transparent, rgba(var(--ink-rgb),.32), transparent);
  animation: gust var(--d,9s) linear infinite; animation-delay: var(--o,0s); }
@keyframes gust { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateX(70vw) translateY(-14px); } 90% { opacity: .8; } 100% { transform: translateX(140vw) translateY(6px); opacity: 0; } }
.skyline { position: absolute; left: 0; width: 100%; bottom: 58px; }
.skyline.far { height: min(30vh, 280px); opacity: .7; bottom: 70px; }
.skyline.near { height: min(36vh, 340px); }
.skyline .b { fill: var(--bld-near); } .skyline.far .b { fill: var(--bld-far); }
.skyline .x { stroke: var(--bld-line); } .skyline .x2 { fill: var(--bld-line); } .skyline .mc { stroke: var(--win); }
.skyline .win { fill: var(--win); }
.clouds { position: absolute; inset: 0 0 40% 0; opacity: var(--cloud-op); transition: opacity .6s; }
.cloud { position: absolute; width: var(--w, 180px); height: calc(var(--w, 180px) * .32); border-radius: 999px; background: #fff; opacity: .85; filter: blur(1px);
  animation: drift var(--d, 70s) linear infinite; animation-delay: var(--o, 0s); }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.cloud::before { width: 45%; height: 140%; left: 16%; bottom: 30%; } .cloud::after { width: 34%; height: 110%; right: 18%; bottom: 35%; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
.sun { position: absolute; right: 12%; top: 9%; width: 110px; height: 110px; border-radius: 50%; opacity: var(--cloud-op); transition: opacity .6s;
  background: radial-gradient(circle, #fff7d1 30%, #ffe08a 55%, rgba(255,224,138,0) 72%); animation: sunPulse 6s ease-in-out infinite; }
@keyframes sunPulse { 50% { transform: scale(1.08); } }
.skyline .flick { animation: flick var(--d,7s) steps(1) infinite; animation-delay: var(--o,0s); }
@keyframes flick { 0%,100% { opacity: var(--a,.8); } 40% { opacity: .05; } 62% { opacity: var(--a,.8); } }
.skyline .tip { fill: var(--red); animation: tip 1.6s ease-in-out infinite; }
@keyframes tip { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.el { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; z-index: 1; }
.el-beam { position: absolute; left: 0; right: 0; top: 22px; height: 12px; background: linear-gradient(#3a4770, #1c2645); box-shadow: 0 2px 0 #0a0f22; }
.el-legs { position: absolute; left: 0; right: 0; top: 34px; bottom: 0;
  background: repeating-linear-gradient(90deg, transparent 0 118px, #1b2442 118px 128px),
    repeating-linear-gradient(45deg, rgba(42,53,86,.9) 0 2px, transparent 2px 15px), repeating-linear-gradient(-45deg, rgba(42,53,86,.9) 0 2px, transparent 2px 15px);
  -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.train { position: absolute; top: -6px; left: 0; display: flex; gap: 4px; animation: ride 19s linear infinite; animation-delay: 2s; transform: translateX(-110%); }
@keyframes ride { 0% { transform: translateX(-110%); } 62% { transform: translateX(110vw); } 100% { transform: translateX(110vw); } }
.car { width: 128px; height: 28px; border-radius: 7px 7px 3px 3px; position: relative; background: linear-gradient(#e9edf5, #a9b2c4 60%, #7d879b); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.car::before { content: ""; position: absolute; left: 10px; right: 10px; top: 6px; height: 9px; border-radius: 2px; background: repeating-linear-gradient(90deg, #ffd77a 0 14px, #55617e 14px 18px); box-shadow: 0 0 12px rgba(255,210,120,.7); }
.car::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 3px; background: var(--sky); }
.car:first-child { border-radius: 7px 14px 3px 3px; }
.car .sign-led { position: absolute; right: 6px; top: -1px; font: 10px/1 var(--led); color: var(--amber); background: #111; padding: 1px 3px; border-radius: 2px; text-shadow: 0 0 4px var(--amber); }
.spark { position: absolute; bottom: -4px; width: 6px; height: 6px; border-radius: 50%; background: #bfe9ff; box-shadow: 0 0 10px 4px rgba(120,210,255,.9); opacity: 0; animation: spark 1.3s steps(1) infinite; }
@keyframes spark { 0%,100% { opacity: 0; } 7% { opacity: 1; } 10% { opacity: 0; } 53% { opacity: 1; } 55% { opacity: 0; } }

/* ---------- marquee bulbs ---------- */
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--bulb);
  box-shadow: 0 0 6px 2px rgba(255,214,120,.65); animation: chase .9s linear infinite; opacity: .3; }
@keyframes chase { 0%,100% { opacity: .25; box-shadow: 0 0 2px rgba(255,214,120,.3); } 33% { opacity: 1; box-shadow: 0 0 10px 3px rgba(255,214,120,.9); } }

/* ---------- type + common pieces ---------- */
.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
.neon { color: var(--neon); text-shadow: var(--neon-glow); }
.kicker { font-family: var(--marquee); letter-spacing: .3em; font-size: 14px; color: var(--sky); display: inline-flex; align-items: center; gap: 8px; }
.kicker svg { width: 11px; height: 11px; fill: var(--red); }
.star-ico { fill: var(--red); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; transition: transform .18s, box-shadow .25s, background .25s; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.97); }
.btn-red { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, #ff2148, var(--red) 45%, var(--red-d)); border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(255,201,85,.15), 0 12px 30px rgba(228,0,43,.4), inset 0 2px 0 rgba(255,255,255,.3); font-family: var(--marquee); font-size: 22px; letter-spacing: .12em; font-weight: 400; }
.btn-red::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%,55% { left: -60%; } 100% { left: 130%; } }
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(255,201,85,.22), 0 18px 40px rgba(228,0,43,.55), inset 0 2px 0 rgba(255,255,255,.3); }
.btn-ghost { color: var(--cream); background: rgba(var(--ink-rgb),.08); border: 1px solid var(--stroke-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(var(--ink-rgb),.16); transform: translateY(-2px); }
.btn-sky { color: #06122b; background: var(--sky); box-shadow: 0 10px 26px rgba(65,182,230,.35); }
.btn-sky:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(65,182,230,.5); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(var(--ink-rgb),.07); border: 1px solid var(--stroke); color: var(--cream); transition: .2s; white-space: nowrap; }
.chip:hover { background: rgba(var(--ink-rgb),.14); }
.chip.on { background: var(--cream); color: var(--night); border-color: var(--cream); }
.flag-band { display: flex; align-items: center; gap: 10px; }
.flag-band i { flex: 1; height: 4px; border-radius: 3px; background: var(--sky); box-shadow: 0 0 10px rgba(65,182,230,.6); }
.flag-band svg { width: 15px; height: 15px; fill: var(--red); filter: drop-shadow(0 0 5px rgba(228,0,43,.8)); }
.led { font-family: var(--led); color: var(--amber); text-shadow: 0 0 6px rgba(255,178,26,.85), 0 0 16px rgba(255,140,0,.35); text-transform: uppercase; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.toast-zone { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 14px; background: var(--menu-bg); border: 1px solid var(--stroke-2); box-shadow: var(--shadow);
  font-weight: 600; font-size: 14px; animation: toastIn .35s cubic-bezier(.2,1.4,.4,1); display: flex; align-items: center; gap: 10px; }
.toast b { color: var(--gold); font-family: var(--marquee); font-size: 20px; letter-spacing: .08em; font-weight: 400; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.9); } }
.boom { position: fixed; width: 18px; height: 18px; z-index: 95; pointer-events: none; fill: var(--c); animation: boom 1.1s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes boom { from { transform: translate(-50%,-50%) scale(.4) rotate(0); opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .train, .beam, .gust { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- theme switch ---------- */
.theme-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: rgba(var(--ink-rgb), .08); border: 1px solid var(--stroke-2); color: var(--cream); transition: transform .2s, background .2s; }
.theme-btn:hover { transform: rotate(-12deg) scale(1.06); background: rgba(var(--ink-rgb), .14); }
.theme-btn span { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .5s cubic-bezier(.2,1.4,.4,1), opacity .3s; }
.theme-btn .ico { width: 20px; height: 20px; }
.theme-btn .tb-sun { color: #f5a524; transform: translateY(120%) rotate(-90deg); opacity: 0; }
.theme-btn .tb-moon { color: #cbd5ff; }
.theme-btn.is-light .tb-sun { transform: none; opacity: 1; }
.theme-btn.is-light .tb-moon { transform: translateY(-120%) rotate(90deg); opacity: 0; }

/* ---------- daytime tweaks ---------- */
[data-theme="light"] .gust { background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); }
[data-theme="light"] .card, [data-theme="light"] .panel { box-shadow: 0 10px 30px rgba(30, 50, 90, .08); }
[data-theme="light"] .btn-sky { color: #fff; }
[data-theme="light"] .btn-ghost { background: rgba(255,255,255,.7); }
[data-theme="light"] .chip { background: rgba(255,255,255,.75); }
[data-theme="light"] .chip.on { background: var(--cream); color: #fff; }
[data-theme="light"] .skyline.near { filter: drop-shadow(0 -2px 0 rgba(255,255,255,.35)); }
