:root {
  --navy: #162238;
  --navy-soft: #263653;
  --off-white: #fbfaf6;
  --paper: #fffdf8;
  --gray: #e6e5df;
  --gray-soft: #f1f0eb;
  --text: #15171b;
  --muted: #62666e;
  --sage: #8da391;
  --sage-dark: #5e7564;
  --beige: #dec9a2;
  --beige-soft: #f2eadb;
  --line: rgba(22, 34, 56, 0.14);
  --shadow: 0 22px 70px rgba(22, 34, 56, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0.94), rgba(242, 234, 219, 0.62)),
    repeating-linear-gradient(90deg, rgba(22, 34, 56, 0.025) 0 1px, transparent 1px 76px);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-140%);
  background: var(--navy);
  color: var(--off-white);
  padding: 10px 14px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.hidden {
  display: none;
}

.series-view {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.hero {
  min-height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1fr);
  gap: 36px;
  align-items: center;
  padding: 28px 0 48px;
}

.hero__media {
  min-height: clamp(290px, 56vh, 545px);
}

.hero-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--beige-soft);
  box-shadow: var(--shadow);
}

.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: 18% center;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 58%, rgba(251, 250, 246, 0.18));
}

.placeholder-art {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(22, 34, 56, 0.06), rgba(141, 163, 145, 0.18)),
    linear-gradient(180deg, #f7f4ec, #ebe7dc);
  color: rgba(22, 34, 56, 0.55);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.placeholder-art::before,
.placeholder-art::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(22, 34, 56, 0.14);
  pointer-events: none;
}

.placeholder-art::after {
  inset: auto -12% 16%;
  height: 28%;
  background: linear-gradient(90deg, transparent, rgba(222, 201, 162, 0.38), transparent);
  border: 0;
  transform: rotate(-7deg);
}

.hero__content {
  padding: 20px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sage-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin: 0;
  color: var(--navy);
  font-weight: 800;
}

.series-title {
  display: grid;
  gap: 4px;
  line-height: 0.98;
}

.series-title__main {
  display: block;
  color: var(--navy);
  font-size: clamp(2.25rem, 6.6vw, 4.45rem);
  letter-spacing: 0;
  white-space: nowrap;
}

.series-title__season {
  display: block;
  width: fit-content;
  margin-top: 2px;
  color: var(--sage-dark);
  font-size: clamp(2.1rem, 6.4vw, 4.25rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 4px solid rgba(222, 201, 162, 0.95);
  padding-bottom: 4px;
}

.subtitle {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--navy-soft);
  font-size: clamp(0.92rem, 1.85vw, 1.16rem);
}

.teaser {
  max-width: 650px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1rem;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.primary-button {
  background: var(--navy);
  color: var(--off-white);
  padding: 12px 18px;
  font-weight: 700;
}

.button-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  line-height: 1;
}

.button-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.audio-player__button.is-playing .button-icon::before,
.audio-player__button.is-playing .button-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 4px;
  height: 12px;
  border: 0;
  background: currentColor;
}

.audio-player__button.is-playing .button-icon::before {
  left: 3px;
}

.audio-player__button.is-playing .button-icon::after {
  right: 3px;
}

.audio-player {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 330px);
  border: 1px solid rgba(22, 34, 56, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  padding: 9px 12px 9px 9px;
  box-shadow: 0 12px 34px rgba(22, 34, 56, 0.08);
}

.audio-player__button {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--off-white);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.audio-player__button:hover {
  transform: translateY(-1px);
  background: var(--navy-soft);
}

.audio-player__button:focus-visible {
  outline: 3px solid rgba(141, 163, 145, 0.5);
  outline-offset: 3px;
}

.audio-player__body {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.audio-player__label {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-player--episode {
  margin-top: 18px;
}

.waveform {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: center;
  gap: 3px;
  height: 30px;
  overflow: hidden;
}

.waveform span {
  --bar-fill: 0%;
  display: block;
  height: 40%;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--sage-dark) 0 var(--bar-fill),
    rgba(22, 34, 56, 0.18) var(--bar-fill) 100%
  );
}

.waveform span:nth-child(2n) { height: 64%; }
.waveform span:nth-child(3n) { height: 84%; }
.waveform span:nth-child(4n) { height: 48%; }
.waveform span:nth-child(5n) { height: 72%; }
.waveform span:nth-child(7n) { height: 92%; }

.secondary-button,
.text-button {
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--line);
  padding: 10px 14px;
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.episode-card:not(.episode-card--locked):hover {
  transform: translateY(-2px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.episode-card:focus-visible {
  outline: 3px solid rgba(141, 163, 145, 0.5);
  outline-offset: 3px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 20px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 3.4rem);
}

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

.episode-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 238px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  color: inherit;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(22, 34, 56, 0.08);
}

.episode-card--locked {
  cursor: default;
  background: rgba(246, 247, 244, 0.78);
}

.episode-card--locked .episode-thumb {
  color: rgba(22, 34, 56, 0.42);
}

.episode-card--locked .episode-title {
  color: rgba(22, 34, 56, 0.66);
}

.episode-thumb {
  aspect-ratio: 16 / 10;
  min-height: 110px;
  box-shadow: none;
}

.episode-thumb--image {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--beige-soft);
}

.episode-thumb--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.episode-meta {
  display: grid;
  gap: 4px;
}

.episode-kicker {
  color: var(--sage-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.episode-title {
  color: var(--navy);
  font-size: 1.08rem;
  font-weight: 800;
}

.episode-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.reader-view {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--gray-soft), var(--off-white));
}

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 12px max(16px, calc((100vw - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(14px);
}

.reader-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.reader-icon-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.reader-icon-button:not(:disabled):hover {
  transform: translateY(-1px);
  background: var(--gray-soft);
}

.reader-icon-button:focus-visible {
  outline: 3px solid rgba(141, 163, 145, 0.5);
  outline-offset: 3px;
}

.reader-title {
  color: var(--navy);
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-shell {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.reader-intro,
.placeholder-reader {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
  box-shadow: 0 12px 36px rgba(22, 34, 56, 0.08);
}

.reader-intro h2,
.placeholder-reader h2 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: clamp(1.7rem, 7vw, 2.7rem);
}

.reader-intro p,
.placeholder-reader p {
  margin: 0;
  color: var(--muted);
}

.panel {
  margin: 12px 0;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 14px 42px rgba(22, 34, 56, 0.09);
}

.panel-image {
  aspect-ratio: 9 / 16;
  min-height: 608px;
  box-shadow: none;
  border-width: 0 0 1px;
  border-radius: 0;
}

.panel-image--art {
  aspect-ratio: auto;
  display: block;
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #f5f1e9;
}

.panel-image--art img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin-left: 0;
}

.panel-body {
  padding: 11px 14px 8px;
}

.panel-number {
  margin: 0 0 3px;
  color: var(--sage-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-body h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.28rem;
}

.image-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.webtoon-text {
  display: grid;
  gap: 3px;
}

.speech,
.caption {
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius);
  padding: 4px 10px;
  color: var(--text);
  line-height: 1.28;
}

.caption {
  background: var(--beige-soft);
  border-left: 4px solid var(--beige);
}

.speech {
  background: #f6f7f4;
  border: 1px solid rgba(22, 34, 56, 0.12);
}

.speech strong {
  color: var(--navy);
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
}

.placeholder-reader {
  min-height: 58vh;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.prep-badge {
  display: inline-block;
  margin: 0 0 14px;
  border-radius: 999px;
  background: rgba(141, 163, 145, 0.18);
  color: var(--sage-dark);
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 20px;
  }

  .hero__media {
    min-height: 290px;
  }

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

@media (max-width: 640px) {
  .series-view {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero {
    padding-bottom: 32px;
  }

  .hero__media {
    min-height: 240px;
  }

  .series-title__main {
    font-size: clamp(2rem, 12vw, 3.35rem);
  }

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

  .reader-bar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 6px;
    padding: 8px 10px;
  }

  .reader-icon-button {
    width: 40px;
    height: 40px;
    font-size: 1.55rem;
  }

  .reader-title {
    font-size: 0.9rem;
  }

  .secondary-button,
  .text-button,
  .primary-button {
    width: 100%;
  }

  .panel-image {
    min-height: min(896px, calc(100vw * 1.42));
  }

  .panel-image--art img {
    width: 100%;
    margin-left: 0;
  }

  .panel-image--art {
    aspect-ratio: auto;
    min-height: 0;
  }

  .panel-body {
    padding: 9px 10px 7px;
  }

  .speech,
  .caption {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}
