@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700;900&family=Noto+Serif+KR:wght@400;700&display=swap');

/* ===== Slayer Webtoon — Dark Theme ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-elev: #14141c;
  --bg-elev-2: #1c1c28;
  --text: #e8e8ee;
  --text-dim: #a8a8b8;
  --text-faint: #6a6a78;
  --silver: #c8d4e6;
  --moon: #d6dff0;
  --crimson: #c83a3a;
  --gold: #d4a755;
  --accent-sora: #6db5d6;
  --accent-rei: #b39ddb;
  --accent-yukino: #6e5fbf;
  --accent-hotaru: #d96b3f;
  --accent-sakuya: #e08aa8;
  --border: rgba(200, 212, 230, 0.10);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--moon); text-decoration: none; }
a:hover { color: var(--gold); }

/* ===== Top Nav ===== */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.topnav .brand {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--moon);
}
.topnav .brand .sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: 8px;
  letter-spacing: 0.2em;
}
.topnav .nav-links {
  display: flex; gap: 16px;
  font-size: 13px;
}
.topnav .nav-links a {
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
.topnav .nav-links a:hover {
  color: var(--moon);
  background: rgba(200, 212, 230, 0.06);
}

/* ===== Index page hero ===== */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  background: radial-gradient(ellipse at top, rgba(109, 181, 214, 0.08) 0%, transparent 60%);
}
.hero h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: 0.06em;
  color: var(--moon);
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(214, 223, 240, 0.25);
}
.hero .kanji {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--text-dim);
  letter-spacing: 0.4em;
  margin-bottom: 28px;
}
.hero .tagline {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
}

/* ===== Section heading ===== */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px;
}
.section h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--moon);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.section h2 .kanji {
  font-size: 16px;
  color: var(--text-faint);
  margin-left: 12px;
  letter-spacing: 0.3em;
}
.section .sec-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ===== Episode grid ===== */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.ep-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex; flex-direction: column;
  color: inherit;
}
.ep-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 212, 230, 0.25);
  box-shadow: var(--shadow);
}
.ep-card .thumb {
  aspect-ratio: 3 / 2;
  background: #000;
  overflow: hidden;
}
.ep-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.ep-card:hover .thumb img { transform: scale(1.04); }
.ep-card .body {
  padding: 16px 18px 20px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.ep-card .ep-num {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 600;
}
.ep-card .ep-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px;
  color: var(--moon);
  font-weight: 600;
}
.ep-card .ep-kanji {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.18em;
}
.ep-card .ep-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== Character cards ===== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.char-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 18px 18px 20px;
}
.char-card.sora    { --accent: var(--accent-sora); }
.char-card.rei     { --accent: var(--accent-rei); }
.char-card.yukino  { --accent: var(--accent-yukino); }
.char-card.hotaru  { --accent: var(--accent-hotaru); }
.char-card.sakuya  { --accent: var(--accent-sakuya); }
.char-card .ch-name {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.char-card .ch-full {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.char-card .ch-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ===== Episode viewer ===== */
.viewer-header {
  text-align: center;
  padding: 60px 20px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(109, 181, 214, 0.05) 0%, transparent 100%);
}
.viewer-header .ep-label {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 8px;
}
.viewer-header h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(28px, 5vw, 40px);
  color: var(--moon);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.viewer-header .kanji {
  font-family: 'Noto Serif KR', serif;
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 0.3em;
  margin-top: 6px;
}

/* Panel container */
.viewer {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 80px;
}

.panel {
  position: relative;
  width: 100%;
  margin: 0 auto;
  line-height: 0;
  background: #000;
}
.panel img,
.panel video {
  display: block;
  width: 100%;
  height: auto;
}
.panel.full-page {
  max-width: 1000px;
  margin-left: auto; margin-right: auto;
}
.panel.flashback img { filter: sepia(0.55) contrast(1.05) brightness(0.95); }

.panel + .panel { margin-top: 0; }

/* Scene break */
.scene-break {
  height: 56px;
  background: var(--bg);
}
.scene-break.lg { height: 96px; }

/* Dialogue overlay */
.dialogue {
  position: absolute;
  left: 18px; right: 18px;
  bottom: 18px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px 16px 14px;
  font-size: 15px;
  line-height: 1.55;
  color: #f3f3f8;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  max-width: 86%;
}
.dialogue.right { left: auto; max-width: 86%; }
.dialogue.top { top: 18px; bottom: auto; }
.dialogue.center { left: 50%; transform: translateX(-50%); }
.dialogue .speaker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--speaker-bg, rgba(200,212,230,0.15));
  color: var(--speaker-fg, var(--moon));
}
.dialogue .speaker.sora    { --speaker-bg: rgba(109,181,214,0.22); --speaker-fg: #aedcef; }
.dialogue .speaker.rei     { --speaker-bg: rgba(179,157,219,0.22); --speaker-fg: #d4c4ee; }
.dialogue .speaker.yukino  { --speaker-bg: rgba(110,95,191,0.22); --speaker-fg: #b9aef0; }
.dialogue .speaker.hotaru  { --speaker-bg: rgba(217,107,63,0.22); --speaker-fg: #f0aa83; }
.dialogue .speaker.sakuya  { --speaker-bg: rgba(224,138,168,0.22); --speaker-fg: #f2b8cc; }
.dialogue .speaker.tamayo  { --speaker-bg: rgba(168,123,196,0.22); --speaker-fg: #d6b8e8; }
.dialogue .speaker.muzan   { --speaker-bg: rgba(200,58,58,0.22); --speaker-fg: #ee8888; }
.dialogue .speaker.shinobu { --speaker-bg: rgba(168,123,196,0.18); --speaker-fg: #d8baeb; }
.dialogue .speaker.mitsuri { --speaker-bg: rgba(228,166,200,0.22); --speaker-fg: #f4c8de; }
.dialogue .speaker.narration { --speaker-bg: rgba(200,200,210,0.10); --speaker-fg: var(--text-dim); }
.dialogue .speaker.other   { --speaker-bg: rgba(180,180,200,0.18); --speaker-fg: #cccccc; }
.dialogue .line {
  font-size: 15px;
  color: #f3f3f8;
}
.dialogue .line + .speaker { margin-top: 8px; }
.dialogue.whisper .line { font-style: italic; opacity: 0.85; font-size: 14px; }

/* Narration bar (between panels) */
.narration {
  background: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%);
  color: var(--text-dim);
  font-family: 'Noto Serif KR', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.8;
  padding: 28px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.narration .label {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* Episode footer nav */
.ep-nav {
  max-width: 800px;
  margin: 60px auto 60px;
  padding: 0 20px;
  display: flex; justify-content: space-between; gap: 12px;
}
.ep-nav a, .ep-nav span.disabled {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: left;
  transition: all 0.2s;
}
.ep-nav a:hover {
  border-color: rgba(200,212,230,0.3);
  background: var(--bg-elev-2);
  color: var(--moon);
}
.ep-nav .label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.ep-nav .next { text-align: right; }
.ep-nav .home { flex: 0 0 auto; align-items: center; justify-content: center; padding: 16px 20px; }
.ep-nav span.disabled { opacity: 0.4; cursor: default; }

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-sora), var(--moon), var(--gold));
  z-index: 200;
  transition: width 0.1s linear;
}

/* Footer */
.foot {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* Fade in panels */
.panel { opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s ease; }
.panel.in-view { opacity: 1; transform: translateY(0); }
.narration { opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s ease; }
.narration.in-view { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 600px) {
  .hero { padding: 56px 16px 40px; }
  .section { padding: 40px 16px; }
  .dialogue { font-size: 14px; padding: 10px 12px 12px; left: 10px; right: 10px; bottom: 10px; }
  .dialogue .line { font-size: 14px; }
  .narration { font-size: 14px; padding: 22px 18px; }
  .ep-nav { flex-direction: column; }
  .topnav { padding: 12px 14px; }
  .topnav .brand .sub { display: none; }
  .topnav .nav-links { gap: 8px; }
}
