/* ==========================================================================
   Strike Witches Database — style.css
   Design language: "squadron dossier" — night-flight navy & insignia gold,
   framed photographs, dossier stat readouts, flight-log episode index.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* 1. Tokens                                                               */
/* ---------------------------------------------------------------------- */
:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --container-w: 1240px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.2rem;
  --space-4: 1.8rem;
  --space-5: 2.6rem;
  --space-6: 4rem;
  --space-7: 6rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.4s;
  --dur-slow: 0.8s;

  --header-h: 78px;
  --container-pad: clamp(1.2rem, 4vw, 3rem);
}

/* Dark — default: deep navy night sky over open ocean, insignia gold */
html[data-theme='dark'] {
  --bg: #0a1220;
  --bg-soft: #0d1728;
  --bg-elevated: #121d33;
  --bg-elevated-2: #17243d;
  --text: #edf1f8;
  --text-muted: #93a1bd;
  --text-faint: #5f6d89;
  --accent: #d8b877;
  --accent-strong: #eccb8c;
  --accent-2: #6fa3d8;
  --border: rgba(216, 184, 119, 0.16);
  --border-strong: rgba(216, 184, 119, 0.32);
  --shadow: rgba(2, 6, 16, 0.55);
  --overlay: rgba(6, 10, 20, 0.72);
  --success: #7fc99a;
}

/* Light — parchment dossier paper */
html[data-theme='light'] {
  --bg: #f5f1e6;
  --bg-soft: #efe9d9;
  --bg-elevated: #fffdf8;
  --bg-elevated-2: #f1ead6;
  --text: #221d14;
  --text-muted: #5f5847;
  --text-faint: #8a8271;
  --accent: #9c6f16;
  --accent-strong: #7c5810;
  --accent-2: #2f5d85;
  --border: rgba(156, 111, 22, 0.22);
  --border-strong: rgba(156, 111, 22, 0.4);
  --shadow: rgba(60, 45, 10, 0.14);
  --overlay: rgba(245, 241, 230, 0.85);
  --success: #2f8a5b;
}

/* Anime style — pastel magical-girl dream, soft & bright */
html[data-theme='anime'] {
  --bg: #fdf1f8;
  --bg-soft: #fbe8f3;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #fdeaf4;
  --text: #3a2440;
  --text-muted: #7c6485;
  --text-faint: #ab97b3;
  --accent: #ff6fa5;
  --accent-strong: #ff4f90;
  --accent-2: #5aa9ff;
  --border: rgba(255, 111, 165, 0.25);
  --border-strong: rgba(255, 111, 165, 0.45);
  --shadow: rgba(200, 100, 160, 0.18);
  --overlay: rgba(255, 244, 250, 0.82);
  --success: #38b787;
}

/* Custom — unlocked via account, violet aurora */
html[data-theme='custom'] {
  --bg: #120a1f;
  --bg-soft: #170d28;
  --bg-elevated: #1d1130;
  --bg-elevated-2: #251740;
  --text: #f2edff;
  --text-muted: #ab9bcf;
  --text-faint: #6c5e91;
  --accent: #bd93ff;
  --accent-strong: #d4b3ff;
  --accent-2: #5ee6d0;
  --border: rgba(189, 147, 255, 0.24);
  --border-strong: rgba(189, 147, 255, 0.44);
  --shadow: rgba(6, 2, 16, 0.6);
  --overlay: rgba(12, 6, 22, 0.75);
  --success: #6fe0c3;
}

/* ---------------------------------------------------------------------- */
/* 2. Reset & base                                                        */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, dt { margin: 0; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
input, textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* Background atmosphere: soft radial vignette behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 85% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(50vw 50vw at -10% 30%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%);
  transition: background var(--dur-med) var(--ease);
}

/* ---------------------------------------------------------------------- */
/* 3. Typography helpers                                                  */
/* ---------------------------------------------------------------------- */
.eyebrow, .section-eyebrow, .hero-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent);
}

/* ---------------------------------------------------------------------- */
/* 4. Header / Navigation                                                 */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease), background-color var(--dur-med) var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 12px 30px -20px var(--shadow);
}
.header-inner {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  flex-shrink: 0;
}
.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-link {
  position: relative;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.1rem;
  transition: color var(--dur-fast) var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transition: right var(--dur-med) var(--ease);
  border-radius: 2px;
}
.nav-link:hover,
.nav-link.is-current {
  color: var(--text);
}
.nav-link:hover::after,
.nav-link.is-current::after {
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 0.9rem 0 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  max-width: 190px;
}
.account-btn:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.account-btn .material-symbols-rounded { font-size: 22px; }
.account-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-btn.is-authenticated {
  border-color: var(--border-strong);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

/* Theme switcher */
.theme-switcher { position: relative; }
.theme-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px -18px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  animation: panel-in var(--dur-fast) var(--ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.theme-panel-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  padding: 0.3rem 0.5rem 0.5rem;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.theme-option .material-symbols-rounded { font-size: 19px; }
.theme-option:hover { background: var(--bg-elevated-2); color: var(--text); }
.theme-option.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated-2)); }
.theme-option-locked { position: relative; }
.theme-lock-note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.theme-option-locked:not(.is-locked) .theme-lock-note { display: none; }
.theme-option-locked.is-locked { opacity: 0.72; }

/* ---------------------------------------------------------------------- */
/* 5. Buttons                                                             */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn-outline {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-muted);
  margin: 0 auto;
}
.btn-outline:hover {
  color: var(--accent);
  border-color: var(--border-strong);
}

/* ---------------------------------------------------------------------- */
/* 6. Hero                                                                */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-7) 0 var(--space-6);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 55%);
}
.hero-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: var(--space-6);
  align-items: center;
}
.hero-media { position: relative; }
.hero-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: visible;
}
.hero-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -20px var(--shadow);
  transform: rotate(-2deg);
  transition: transform var(--dur-slow) var(--ease);
  background: var(--bg-elevated);
}
.hero-frame:hover .hero-cover { transform: rotate(0deg) scale(1.015); }
.hero-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 132%;
  height: 132%;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.55;
  animation: hero-spin 60s linear infinite;
}
@keyframes hero-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.hero-ring circle { fill: none; stroke: var(--accent); }
.hero-ring .ring-outer { stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 2 8; }
.hero-ring .ring-inner { stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 1 6; }
.hero-ring .ring-tick { stroke-opacity: 0.6; stroke-width: 2; }

.hero-content { min-width: 0; }
.hero-eyebrow { display: block; margin-bottom: var(--space-2); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.hero-original-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}
.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-4);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.meta-item dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.meta-item dd {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
}
.meta-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.genre-tag {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------------------------------------------------------------------- */
/* 7. Sections                                                            */
/* ---------------------------------------------------------------------- */
.section {
  padding: var(--space-6) 0;
  max-width: var(--container-w);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-top: 0.3rem;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), gap var(--dur-fast) var(--ease);
}
.section-link:hover { border-color: var(--accent); gap: 0.55rem; }
.section-link .material-symbols-rounded { font-size: 18px; }

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------- */
/* 8. Cards — characters, news, gallery                                   */
/* ---------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.character-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.character-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  box-shadow: 0 26px 46px -24px var(--shadow);
}
.character-card.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.character-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-elevated-2);
}
.character-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.character-card:hover .character-media img { transform: scale(1.06); }
.character-nation {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--overlay);
  color: var(--accent-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.character-body { padding: var(--space-3) var(--space-3) var(--space-4); }
.character-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.character-callsign {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.character-role {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.character-bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Filters (characters / gallery) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: var(--space-5);
}
.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.84rem;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.search-field {
  position: relative;
  margin-left: auto;
  flex: 1 1 220px;
  max-width: 320px;
}
.search-field input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.search-field input::placeholder { color: var(--text-faint); }
.search-field input:focus { border-color: var(--accent); }
.search-field .material-symbols-rounded {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: var(--text-faint);
  pointer-events: none;
}

/* ---------------------------------------------------------------------- */
/* 9. Episodes / flight log                                               */
/* ---------------------------------------------------------------------- */
.episode-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.episode-item {
  display: grid;
  grid-template-columns: 64px 120px 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--dur-fast) var(--ease);
}
.episode-item:hover { background: var(--bg-elevated); }
.episode-number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--text-faint);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
.episode-item:hover .episode-number { color: var(--accent); }
.episode-thumb {
  width: 120px;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.episode-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 62ch;
}
.show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}

/* ---------------------------------------------------------------------- */
/* 10. News                                                                */
/* ---------------------------------------------------------------------- */
.news-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease);
}
.news-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.news-media { aspect-ratio: 16/9; background: var(--bg-elevated-2); overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: var(--space-3); display: flex; flex-direction: column; gap: 0.5rem; }
.news-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.6rem;
}
.news-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.news-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.news-content { font-size: 0.9rem; color: var(--text-muted); }

/* ---------------------------------------------------------------------- */
/* 11. Gallery + lightbox                                                 */
/* ---------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-3);
}
.gallery-tile {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  cursor: pointer;
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease);
}
.gallery-tile:hover img { transform: scale(1.08); }
.gallery-tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(to top, var(--overlay), transparent);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.gallery-tile:hover .gallery-tile-caption,
.gallery-tile:focus-visible .gallery-tile-caption {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.86);
  backdrop-filter: blur(6px);
  padding: var(--space-4);
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
  position: relative;
  max-width: min(900px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  object-fit: contain;
  background: var(--bg-elevated);
}
.lightbox-caption {
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { color: var(--accent); border-color: var(--border-strong); }
.lightbox-close { top: -56px; right: 0; }
.lightbox-prev { left: -56px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: -56px; top: 50%; transform: translateY(-50%); }

/* ---------------------------------------------------------------------- */
/* 12. Contact page                                                        */
/* ---------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-6);
  align-items: start;
}
.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.contact-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}
.contact-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.contact-list-item { display: flex; align-items: flex-start; gap: 0.7rem; }
.contact-list-item .material-symbols-rounded { color: var(--accent); font-size: 22px; margin-top: 2px; }
.contact-list-item strong { display: block; font-size: 0.85rem; }
.contact-list-item span { font-size: 0.85rem; color: var(--text-muted); }

.form-field { margin-bottom: var(--space-3); }
.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}
.form-field input, .form-field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
  resize: vertical;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-field .field-error {
  display: none;
  color: #e0715f;
  font-size: 0.78rem;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
}
.form-field.has-error input,
.form-field.has-error textarea { border-color: #e0715f; }
.form-field.has-error .field-error { display: block; }
.contact-form-status {
  font-size: 0.85rem;
  color: var(--success);
  margin-top: var(--space-2);
  display: none;
}
.contact-form-status.is-visible { display: block; }

/* ---------------------------------------------------------------------- */
/* 13. Empty / error / skeleton states                                    */
/* ---------------------------------------------------------------------- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-3);
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state .material-symbols-rounded { font-size: 32px; color: var(--accent); }
.empty-state p { max-width: 42ch; font-size: 0.92rem; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}
.skeleton-card {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  aspect-ratio: 3/4;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
.skeleton-row {
  height: 92px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  margin-bottom: var(--space-2);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

/* ---------------------------------------------------------------------- */
/* 14. Toast notice                                                        */
/* ---------------------------------------------------------------------- */
.swdb-notice {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 800;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  box-shadow: 0 20px 40px -18px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  max-width: 90vw;
  text-align: center;
}
.swdb-notice.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------------- */
/* 15. Page header (subpages)                                              */
/* ---------------------------------------------------------------------- */
.page-header {
  padding: var(--space-6) 0 var(--space-4);
  max-width: var(--container-w);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.page-subtitle {
  color: var(--text-muted);
  max-width: 60ch;
  font-size: 1.02rem;
}
.stripe-bar {
  width: 64px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: var(--space-3);
  background: repeating-linear-gradient(45deg, var(--accent) 0 8px, transparent 8px 16px);
}

/* ---------------------------------------------------------------------- */
/* 16. Footer                                                              */
/* ---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-7);
  padding: var(--space-5) 0 var(--space-4);
}
.footer-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}
.footer-brand { display: flex; flex-direction: column; gap: 0.3rem; max-width: 340px; }
.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.footer-brand-text { font-size: 0.85rem; color: var(--text-muted); }
.footer-nav { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-nav a { font-size: 0.88rem; color: var(--text-muted); transition: color var(--dur-fast) var(--ease); }
.footer-nav a:hover { color: var(--accent); }
.footer-meta { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.footer-copy { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.footer-note { font-size: 0.78rem; color: var(--text-faint); max-width: 320px; }

/* ---------------------------------------------------------------------- */
/* 17. Anime-style theme accents                                          */
/* ---------------------------------------------------------------------- */
html[data-theme='anime'] .hero-cover,
html[data-theme='anime'] .character-card,
html[data-theme='anime'] .news-card,
html[data-theme='anime'] .gallery-tile,
html[data-theme='anime'] .episode-thumb,
html[data-theme='anime'] .contact-card,
html[data-theme='anime'] .brand-logo {
  border-radius: var(--radius-lg);
}
html[data-theme='anime'] body::before {
  background:
    radial-gradient(50vw 50vw at 90% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(45vw 45vw at 0% 40%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 60%);
}
html[data-theme='anime'] .hero-ring circle { stroke: var(--accent); }
html[data-theme='anime'] .genre-tag,
html[data-theme='anime'] .filter-chip,
html[data-theme='anime'] .news-tag {
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------------------- */
/* 18. Custom theme accents (post-login premium feel)                      */
/* ---------------------------------------------------------------------- */
html[data-theme='custom'] .hero-title,
html[data-theme='custom'] .section-title {
  background: linear-gradient(120deg, var(--accent-strong), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme='custom'] body::before {
  background:
    radial-gradient(55vw 55vw at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(45vw 45vw at 0% 60%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
}

/* ---------------------------------------------------------------------- */
/* 19. Responsive                                                          */
/* ---------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: minmax(220px, 320px) 1fr; gap: var(--space-4); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem var(--container-pad) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link { padding: 0.85rem 0.2rem; border-bottom: 1px solid var(--border); }
  .nav-link::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .account-label { display: none; }
  .account-btn { width: 42px; padding: 0; justify-content: center; }
}

@media (max-width: 720px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { max-width: 260px; margin: 0 auto; }
  .hero-content { text-align: left; }
  .episode-item { grid-template-columns: 40px 1fr; }
  .episode-thumb { display: none; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .search-field { max-width: none; flex-basis: 100%; }
  .footer-inner { flex-direction: column; }
}

/* ---------------------------------------------------------------------- */
/* 20. Reduced motion                                                      */
/* ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-ring { animation: none; }
}