:root {
  color-scheme: dark;
  --bg: #07080c;
  --panel: #11131a;
  --panel-strong: #171923;
  --text: #f8fafc;
  --muted: #aab0bd;
  --soft: #d4d8e1;
  --line: rgba(255, 255, 255, 0.12);
  --red: #e11d48;
  --red-dark: #9f1239;
  --gold: #f6c453;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(225, 29, 72, 0.24), transparent 28rem),
    linear-gradient(180deg, #0a0b11 0%, var(--bg) 48%, #090a0f 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  font-weight: 800;
}

.brand-mark {
  color: var(--gold);
  font-weight: 950;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a:hover {
  color: var(--text);
}

.hero-premiere {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(460px, 0.95fr);
  gap: 34px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: auto;
  margin: 0 auto;
  padding: 30px 0 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 4.7vw, 3.55rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 3.1rem);
}

.hero-description {
  display: -webkit-box;
  max-width: 690px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.56;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.hero-meta {
  display: none;
  margin-top: 16px;
}

.hero-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-meta span {
  padding: 8px 11px;
}

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

.primary-action,
.secondary-action,
.episode-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-action {
  padding: 0 20px;
  background: var(--red);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.24);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  color: var(--soft);
}

.hero-media {
  display: flex;
  justify-content: center;
}

.poster-frame,
.drama-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 26, 0.76);
  box-shadow: var(--shadow);
}

.poster-frame {
  position: relative;
  width: min(100%, 290px);
  aspect-ratio: 9 / 16;
}

.poster-play {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.poster-play::after {
  position: absolute;
  inset: auto 14px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.58);
  color: white;
  content: "Watch";
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0;
  padding: 8px 10px;
  text-align: center;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.poster-play:hover::after,
.poster-play:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.card-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-frame img {
  display: block;
  width: 100%;
  height: 100%;
  animation: posterSwap 360ms ease;
  object-fit: contain;
  background: #05060a;
  transition: transform 220ms ease, filter 220ms ease;
}

.poster-play:hover img,
.poster-play:focus-visible img {
  filter: brightness(1.08);
  transform: scale(1.015);
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
  color: white;
  cursor: pointer;
  font-size: 1.65rem;
  line-height: 1;
  transform: translateY(-50%);
}

.carousel-button:hover {
  border-color: rgba(246, 196, 83, 0.72);
  background: rgba(0, 0, 0, 0.62);
}

.carousel-button-prev {
  left: -50px;
}

.carousel-button-next {
  right: -50px;
}

@keyframes posterSwap {
  from {
    opacity: 0;
    transform: translateX(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.poster-placeholder,
.video-fallback {
  display: grid;
  min-height: 100%;
  padding: 18px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.modal-video,
.video-fallback {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background: #020204;
  object-fit: contain;
}

.episode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.episode-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-weight: 800;
}

.episode-button.is-active,
.episode-button:hover:not(:disabled) {
  border-color: rgba(246, 196, 83, 0.6);
  background: rgba(246, 196, 83, 0.14);
  color: white;
}

.episode-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.drama-shelf {
  padding: 48px 0 36px;
  scroll-margin-top: 92px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

.drama-card {
  overflow: hidden;
  box-shadow: none;
}

.drama-card.is-active {
  border-color: rgba(246, 196, 83, 0.7);
}

.card-button {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.card-rank {
  position: absolute;
  z-index: 1;
  margin: 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--gold);
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.card-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: var(--panel-strong);
}

.card-body {
  display: flex;
  min-height: auto;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  color: white;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tiktok-matrix {
  display: grid;
  gap: 8px;
}

.tiktok-matrix p {
  margin: 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tiktok-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tiktok-links a {
  border-bottom: 1px solid rgba(246, 196, 83, 0.42);
  color: var(--soft);
  font-weight: 750;
}

.tiktok-links a:hover {
  border-color: var(--gold);
  color: white;
}

.loading,
.load-error {
  width: min(1180px, calc(100% - 32px));
  margin: 120px auto;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
}

.player-modal {
  position: relative;
  display: flex;
  width: min(980px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 14, 20, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
  padding: 20px;
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: start;
}

.modal-copy {
  min-width: 0;
}

.modal-copy h2 {
  font-size: 18px;
  line-height: 1.12;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-video-shell {
  justify-self: center;
  align-self: center;
  flex: 0 0 auto;
  width: min(100%, 860px, calc(72vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: min(72vh, 720px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020204;
}

.modal-video {
  display: block;
}

.modal-episodes {
  flex: 0 0 auto;
  width: min(100%, 860px);
  align-self: center;
  padding: 0;
}

@media (max-width: 1080px) {
  .hero-premiere,
  .hero-media {
    grid-template-columns: 1fr;
  }

  .hero-premiere {
    min-height: auto;
  }

  .poster-frame {
    width: min(100%, 250px);
  }

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

@media (max-width: 720px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    padding: 12px 0;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-premiere {
    gap: 26px;
    padding-top: 22px;
    padding-bottom: 26px;
  }

  h1 {
    font-size: 1.72rem;
  }

  .hero-description {
    display: -webkit-box;
    font-size: 0.98rem;
    line-height: 1.45;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .poster-frame {
    width: min(100%, 180px);
  }

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

  .card-button {
    display: grid;
    grid-template-columns: 116px 1fr;
  }

  .card-poster {
    height: auto;
    min-height: 0;
    aspect-ratio: 9 / 16;
  }

  .card-body {
    min-height: auto;
  }

  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .modal-backdrop {
    align-items: start;
    padding: 12px;
  }

  .player-modal {
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: none;
    overflow: visible;
    padding: 14px;
  }

  .modal-copy {
    padding-right: 0;
  }

  .modal-copy h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 18px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .modal-video-shell,
  .modal-episodes {
    width: min(100%, 860px, calc((100vh - 210px) * 16 / 9));
  }

  .modal-video-shell {
    max-height: none;
  }

  .modal-video,
  .video-fallback {
    max-height: calc(100vh - 210px);
  }
}

@media (max-width: 430px) {
  .site-header,
  .hero-premiere,
  main,
  .site-footer,
  .loading,
  .load-error {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 1.92rem;
  }

  .hero-actions,
  .hero-meta {
    flex-direction: row;
  }

  .primary-action,
  .secondary-action {
    justify-content: center;
    width: auto;
  }

  .episode-row {
    gap: 7px;
    padding: 10px;
  }

  .card-button {
    grid-template-columns: 104px 1fr;
  }

  .card-body {
    padding: 11px;
  }
}
