:root {
  --bg-deep: #060612;
  --bg-primary: #0a0a1a;
  --bg-card: #0f0f24;
  --bg-card-hover: #141430;
  --bg-glass: rgba(15, 15, 36, 0.75);
  --text-primary: #e4e4f0;
  --text-secondary: #9898b8;
  --text-muted: #5a5a7a;
  --accent-teal: #00d4aa;
  --accent-teal-dim: rgba(0, 212, 170, 0.15);
  --accent-amber: #f0a030;
  --accent-amber-dim: rgba(240, 160, 48, 0.12);
  --accent-rose: #e84080;
  --accent-violet: #8060e0;
  --season1: #00d4aa;
  --season2: #4080f0;
  --season3: #e84080;
  --season4: #f0a030;
  --season5: #b060e0;
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --font-body: 'Noto Serif SC', serif;
  --font-sans: 'Source Sans 3', sans-serif;
  --max-width: 860px;
  --nav-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(6, 6, 18, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(6, 6, 18, 0.92);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-symbol {
  font-size: 22px;
  color: var(--accent-teal);
  filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.5));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}

.nav-seasons {
  display: flex;
  gap: 4px;
}

.nav-season-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.nav-season-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-season-btn.active {
  color: var(--accent-teal);
  border-color: rgba(0, 212, 170, 0.3);
  background: var(--accent-teal-dim);
}

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-menu-btn.open span:nth-child(2) { opacity: 0; }
.nav-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(6, 6, 18, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  max-height: 70vh;
  overflow-y: auto;
}

.nav-dropdown.open { display: block; }

.nav-dropdown-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dropdown-season-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.dropdown-episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
}

.dropdown-ep-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s;
}

.dropdown-ep-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.dropdown-ep-link .ep-num {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-right: 8px;
}

/* ── MAIN ── */
#mainContent {
  flex: 1;
  margin-top: var(--nav-height);
}

/* ── HOME PAGE ── */
.home-hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 8vw, 80px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 4px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero-title .accent {
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 212, 170, 0.05));
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 40px;
  color: var(--accent-teal);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.hero-cta:hover {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.25), rgba(0, 212, 170, 0.1));
  border-color: rgba(0, 212, 170, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.15);
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
}

.hero-stat-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── SEASON SECTIONS ── */
.season-section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid;
}

.section-tag[data-season="1"] { color: var(--season1); border-color: rgba(0,212,170,0.3); background: rgba(0,212,170,0.08); }
.section-tag[data-season="2"] { color: var(--season2); border-color: rgba(64,128,240,0.3); background: rgba(64,128,240,0.08); }
.section-tag[data-season="3"] { color: var(--season3); border-color: rgba(232,64,128,0.3); background: rgba(232,64,128,0.08); }
.section-tag[data-season="4"] { color: var(--season4); border-color: rgba(240,160,48,0.3); background: rgba(240,160,48,0.08); }
.section-tag[data-season="5"] { color: var(--season5); border-color: rgba(176,96,224,0.3); background: rgba(176,96,224,0.08); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── EPISODE CARDS GRID ── */
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.ep-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.ep-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.35s;
}

.ep-card[data-season="1"]::before { background: linear-gradient(90deg, var(--season1), transparent); }
.ep-card[data-season="2"]::before { background: linear-gradient(90deg, var(--season2), transparent); }
.ep-card[data-season="3"]::before { background: linear-gradient(90deg, var(--season3), transparent); }
.ep-card[data-season="4"]::before { background: linear-gradient(90deg, var(--season4), transparent); }
.ep-card[data-season="5"]::before { background: linear-gradient(90deg, var(--season5), transparent); }

.ep-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.08);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ep-card:hover::before { opacity: 1; }

.ep-card-illustration {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}

.ep-card-illustration canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ep-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ep-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ep-card-num {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
}

.ep-card[data-season="1"] .ep-card-num { color: var(--season1); background: rgba(0,212,170,0.1); }
.ep-card[data-season="2"] .ep-card-num { color: var(--season2); background: rgba(64,128,240,0.1); }
.ep-card[data-season="3"] .ep-card-num { color: var(--season3); background: rgba(232,64,128,0.1); }
.ep-card[data-season="4"] .ep-card-num { color: var(--season4); background: rgba(240,160,48,0.1); }
.ep-card[data-season="5"] .ep-card-num { color: var(--season5); background: rgba(176,96,224,0.1); }

.ep-card-season {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
}

.ep-card-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── EPISODE DETAIL ── */
.episode-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.ep-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}

.ep-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.ep-breadcrumb a:hover { color: var(--accent-teal); }

.ep-hero {
  text-align: center;
  padding: 40px 0 48px;
}

.ep-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ep-hero-tag {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid;
}

.ep-hero-number {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.ep-hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.ep-hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto;
}

.ep-illustration-container {
  width: 100%;
  margin: 40px 0 56px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
}

.ep-illustration-container canvas {
  width: 100%;
  height: 400px;
  display: block;
}

.ep-content {
  font-size: 16.5px;
  line-height: 2;
  color: var(--text-primary);
}

.ep-content p {
  margin-bottom: 1.5em;
  text-indent: 2em;
}

.ep-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin: 2.5em 0 1em;
  padding-left: 16px;
  border-left: 3px solid var(--accent-teal);
  text-indent: 0;
}

.ep-content blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  background: rgba(0, 212, 170, 0.04);
  border-left: 3px solid rgba(0, 212, 170, 0.3);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
  text-indent: 0;
}

.ep-content blockquote p {
  margin-bottom: 0;
  text-indent: 0;
}

.ep-nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 56px 0 40px;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 56px;
}

.ep-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.25s;
  max-width: 45%;
  cursor: pointer;
}

.ep-nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.08);
}

.ep-nav-btn .nav-direction {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ep-nav-btn .nav-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.ep-nav-btn.next { margin-left: auto; text-align: right; flex-direction: row-reverse; }

/* ── FOOTER ── */
#footer {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-sep { color: var(--text-muted); margin: 0 8px; }

.footer-note {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-copyright {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  opacity: 0.7;
}

.footer-copyright a {
  color: var(--accent-teal);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-copyright a:hover {
  opacity: 1;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-enter {
  animation: fadeUp 0.5s ease forwards;
}

.stagger-in {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-seasons { display: none; }
  .nav-menu-btn { display: flex; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 28px; }
  .episodes-grid { grid-template-columns: 1fr; }
  .ep-nav-bottom { flex-direction: column; }
  .ep-nav-btn { max-width: 100%; width: 100%; }
  .ep-nav-btn.next { text-align: left; flex-direction: row; margin-left: 0; }
  .ep-illustration-container canvas { height: 260px; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 16px; }
  .section-header { margin-bottom: 36px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── SELECTION ── */
::selection { background: rgba(0, 212, 170, 0.2); color: var(--text-primary); }

/* ── LOADING ── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
