:root {
  --ink: #16202a;
  --text: #263238;
  --sub: #67727a;
  --paper: #fbfcfb;
  --mist: #eef3f1;
  --night: #101822;
  --line: #d9e2df;
  --green: #29f29a;
  --green-dark: #08784d;
  --blue: #415f7a;
  --shadow: 0 20px 60px rgba(16, 24, 34, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", sans-serif;
  line-height: 1.75;
}

body.is-fullscreen-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(217, 226, 223, 0.82);
  background: rgba(251, 252, 251, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--sub);
  font-size: 0.92rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.text-link:hover {
  color: var(--green-dark);
}

.hero {
  --hero-image: url("../assets/hero/hero.png");
  position: relative;
  min-height: 88vh;
  display: grid;
  align-items: end;
  padding: 96px clamp(18px, 5vw, 64px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(16, 24, 34, 0.9), rgba(16, 24, 34, 0.58), rgba(16, 24, 34, 0.22)),
    var(--hero-image, none);
  background-size: cover;
  background-position: center right;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto clamp(18px, 5vw, 64px) 42px auto;
  width: min(360px, 42vw);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(41, 242, 154, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(41, 242, 154, 0.18), rgba(255, 255, 255, 0.06)),
    radial-gradient(circle at 68% 42%, rgba(41, 242, 154, 0.45), transparent 18%),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 40px rgba(41, 242, 154, 0.18);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.eyebrow,
.episode-number {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow,
.episode-hero .eyebrow {
  color: var(--green);
}

h1,
h2,
h3,
p,
dd {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 16px;
  color: inherit;
  font-size: clamp(3.4rem, 9vw, 7.4rem);
  line-height: 0.95;
  letter-spacing: 0.06em;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.25;
}

h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.08rem;
}

.hero h1,
.episode-hero h1 {
  color: #fff;
}

.lead {
  font-size: clamp(1.13rem, 2vw, 1.45rem);
  line-height: 1.8;
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--green-dark);
  border-radius: 6px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.hero .button {
  border-color: var(--green);
  background: var(--green);
  color: #102018;
}

.button.ghost,
.hero .button.ghost {
  background: transparent;
  color: inherit;
}

.button.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.section,
.page-hero,
.episode-layout {
  padding: 72px clamp(18px, 5vw, 64px);
}

.page-hero {
  background: var(--mist);
}

.section.muted,
.muted-section {
  background: var(--mist);
}

.section-head {
  max-width: 840px;
  margin-bottom: 30px;
}

.section-head p {
  color: var(--sub);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.feature-image,
.visual-panel {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.86)),
    url("../assets/episodes/01/page-01.png") center / cover;
  box-shadow: var(--shadow);
}

.feature-list,
.character-grid,
.episode-grid,
.learn-grid,
.music-list,
.sub-character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.episode-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.character-card {
  position: relative;
  overflow: hidden;
}

.character-portrait {
  width: 88px;
  height: 88px;
  margin: 0 0 18px;
  border: 1px solid rgba(41, 242, 154, 0.32);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 35%, rgba(41, 242, 154, 0.18), transparent 58%),
    linear-gradient(145deg, #ffffff, #eefaf4);
  box-shadow: 0 12px 28px rgba(16, 24, 34, 0.08);
  overflow: hidden;
}

.character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-portrait-stella {
  display: grid;
  place-items: center;
  border-color: rgba(41, 242, 154, 0.66);
  box-shadow: 0 0 30px rgba(41, 242, 154, 0.18);
}

.character-portrait-stella img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.feature-card,
.character-card,
.episode-card,
.mini-card,
.learn-card,
.music-card,
.sub-character-card,
.concept-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(16, 24, 34, 0.06);
}

.feature-card,
.character-card,
.mini-card,
.learn-card,
.sub-character-card,
.concept-card {
  padding: 20px;
}

.feature-card {
  position: relative;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border: 1px solid rgba(41, 242, 154, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(234, 255, 244, 0.86));
  box-shadow: 0 10px 24px rgba(16, 24, 34, 0.06);
}

.feature-icon img {
  width: 28px;
  height: 28px;
  display: block;
}

.feature-card:hover .feature-icon {
  border-color: rgba(41, 242, 154, 0.62);
  box-shadow: 0 0 28px rgba(41, 242, 154, 0.16);
}

.character-card.accent {
  border-color: rgba(41, 242, 154, 0.64);
  background: linear-gradient(145deg, #fbfffd, #eafff4);
  box-shadow: 0 0 32px rgba(41, 242, 154, 0.12);
}

.role,
.keyword {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.relation,
.muted-text,
.card-meta,
.episode-card p,
.music-card p,
.learn-card p {
  color: var(--sub);
}

.episode-card {
  overflow: hidden;
}

.episode-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--mist);
}

.episode-card-body {
  padding: 18px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
}

.episode-card dl {
  margin: 12px 0;
  display: grid;
  gap: 6px;
}

.episode-card dt {
  float: left;
  min-width: 3.2em;
  color: var(--green-dark);
  font-weight: 800;
}

.episode-card dd {
  margin: 0;
}

.music-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.music-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  align-items: center;
}

.music-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.learn-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.text-link {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

.episode-hero {
  padding: 82px clamp(18px, 5vw, 64px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(16, 24, 34, 0.92), rgba(16, 24, 34, 0.6)),
    url("../assets/episodes/01/page-01.png") center / cover;
}

.episode-hero .inner {
  max-width: 920px;
}

.episode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.episode-meta span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.88rem;
}

.episode-layout {
  max-width: 1280px;
  margin: 0 auto;
}

.episode-section {
  margin-top: 52px;
}

.intro-box {
  max-width: 840px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.viewer-shell {
  margin-top: 30px;
}

.viewer-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--green-dark) var(--mist);
}

.viewer-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.viewer-slide img {
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  cursor: zoom-in;
  background: #f4f7f6;
}

.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.viewer-button,
.play-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--green-dark);
  border-radius: 6px;
  background: var(--green-dark);
  color: #fff;
  cursor: pointer;
}

.viewer-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.counter {
  min-width: 80px;
  text-align: center;
  font-weight: 800;
}

.viewer-fullscreen {
  padding-inline: 14px;
}

.player {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 34, 0.07);
}

.player.is-playing {
  border-color: rgba(41, 242, 154, 0.65);
  box-shadow: 0 0 34px rgba(41, 242, 154, 0.16);
}

.player.is-disabled {
  background: linear-gradient(145deg, #fff, #f4f8f6);
}

.player-controls {
  display: grid;
  grid-template-columns: auto auto minmax(160px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.player input[type="range"] {
  accent-color: var(--green-dark);
}

.volume-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--sub);
  font-size: 0.9rem;
}

.audio-placeholder {
  margin: 0;
  color: var(--sub);
}

.episode-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 56px;
}

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 16, 22, 0.88);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-height: 86vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  top: 18px;
  right: 18px;
}

.fullscreen-viewer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  background: rgba(8, 13, 18, 0.96);
  color: #fff;
}

.fullscreen-viewer[hidden] {
  display: none;
}

.fullscreen-topbar,
.fullscreen-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.fullscreen-topbar {
  min-height: 52px;
}

.fullscreen-topbar strong {
  display: block;
  color: #fff;
  line-height: 1.35;
}

.fullscreen-topbar .episode-number {
  color: var(--green);
}

.fullscreen-close {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

.fullscreen-track {
  display: flex;
  width: min(1280px, 100%);
  min-height: 0;
  margin: 0 auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--green) rgba(255, 255, 255, 0.14);
  touch-action: pan-x;
}

.fullscreen-slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 0;
  margin: 0;
  scroll-snap-align: center;
}

.fullscreen-slide img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.fullscreen-controls {
  justify-content: center;
  min-height: 52px;
}

.fullscreen-controls .counter {
  color: #fff;
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.timeline span {
  display: inline-flex;
  width: 42px;
  color: var(--green-dark);
  font-weight: 800;
}

.site-footer {
  padding: 36px clamp(18px, 5vw, 64px);
  color: rgba(255, 255, 255, 0.76);
  background: var(--night);
}

.error {
  margin: 16px;
  padding: 16px;
  border: 1px solid #d86;
  border-radius: 8px;
  background: #fff4ed;
  color: #7a2f00;
}

@media (max-width: 980px) {
  .about-layout,
  .music-card {
    grid-template-columns: 1fr;
  }

  .episode-grid,
  .music-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-list,
  .character-grid,
  .sub-character-grid,
  .learn-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 82vh;
    padding-top: 72px;
  }

  .hero::after {
    display: none;
  }

  .section,
  .page-hero,
  .episode-layout {
    padding-block: 54px;
  }

  .episode-grid,
  .music-list {
    grid-template-columns: 1fr;
  }

  .player-controls {
    grid-template-columns: auto auto 1fr auto;
  }

  .volume-label {
    display: none;
  }

  .viewer-slide img {
    max-height: 68vh;
  }

  .fullscreen-viewer {
    padding: 10px;
    gap: 8px;
  }

  .fullscreen-topbar {
    align-items: flex-start;
  }

  .fullscreen-topbar strong {
    font-size: 0.96rem;
  }

  .fullscreen-close {
    min-width: auto;
    padding-inline: 12px;
  }

  .fullscreen-slide img {
    max-height: calc(100vh - 132px);
  }
}
