:root {
  color-scheme: dark;
  --bg: #12070b;
  --bg-soft: #1d0b12;
  --card: #251019;
  --card-2: #301521;
  --text: #fff7f0;
  --muted: #d8b9c2;
  --line: rgba(255, 255, 255, 0.13);
  --red: #e63b4e;
  --red-dark: #a3162c;
  --gold: #f2c14e;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(230, 59, 78, 0.28), transparent 34rem),
    radial-gradient(circle at -10% 28%, rgba(242, 193, 78, 0.13), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
button, input, select { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(18, 7, 11, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand strong { color: var(--gold); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  box-shadow: 0 10px 28px rgba(230, 59, 78, 0.35);
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--muted); font-weight: 650; text-decoration: none; }
.site-header nav a:hover { color: var(--text); }
.watchlist-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}
.watchlist-button[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: 680px;
  padding: clamp(3rem, 8vw, 6rem) 0 4rem;
}
.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.035em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.8rem, 7vw, 5.8rem); }
h1 span { color: var(--gold); }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); }
h3 { margin: 0; font-size: 1.25rem; }
.hero-text { max-width: 680px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--red); color: white; box-shadow: 0 16px 38px rgba(230, 59, 78, 0.32); }
.button.ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); }
.stats { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0; }
.stats div { min-width: 7rem; }
.stats dt { font-size: 1.8rem; font-weight: 900; }
.stats dd { margin: 0; color: var(--muted); }
.hero-art { position: relative; min-height: 520px; }
.poster {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(270px, 58vw);
  aspect-ratio: 0.68;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 26px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 255, 255, 0.32), transparent 7rem),
    linear-gradient(160deg, transparent 30%, rgba(0, 0, 0, 0.72));
}
.poster span, .poster strong, .poster small { position: relative; }
.poster span { color: var(--gold); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.poster strong { margin: 0.45rem 0; font-size: 1.65rem; line-height: 1.08; }
.poster small { color: rgba(255, 255, 255, 0.78); font-weight: 700; }
.poster-one { top: 0; left: 4%; transform: rotate(-6deg); background: linear-gradient(150deg, #7c1d3f, #e63b4e 58%, #f2c14e); }
.poster-two { top: 90px; right: 0; transform: rotate(5deg); background: linear-gradient(150deg, #25143f, #7b2cbf 58%, #e63b4e); }
.poster-three { bottom: 0; left: 28%; transform: rotate(-2deg); background: linear-gradient(150deg, #123332, #17877b 58%, #f2c14e); }

.legal-note {
  border: 1px solid rgba(242, 193, 78, 0.35);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  background: rgba(242, 193, 78, 0.09);
  color: #ffe9b8;
}
.section { padding: clamp(3.5rem, 8vw, 6rem) 0 1rem; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-heading p { color: var(--muted); }
.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 190px;
  gap: 0.8rem;
}
.search-box, select {
  min-height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.search-box { display: flex; align-items: center; gap: 0.7rem; padding: 0 1rem; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.search-box input::placeholder { color: #b98f9b; }
select { width: 100%; padding: 0 0.9rem; }
option { color: #1d0b12; }
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0 1.5rem; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}
.chip.active { border-color: var(--gold); background: rgba(242, 193, 78, 0.14); color: var(--text); }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}
.drama-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}
.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 250px;
  padding: 1rem;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.3), transparent 5rem),
    linear-gradient(155deg, hsl(var(--hue) 72% 38%), hsl(calc(var(--hue) + 42) 78% 22%) 62%, #16080d);
}
.cover::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% 35%;
  height: 70%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}
.cover .genre, .cover strong, .cover small { position: relative; z-index: 1; }
.cover .genre { color: var(--gold); font-size: 0.7rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
.cover strong { margin: 0.4rem 0; font-size: 1.35rem; line-height: 1.12; }
.cover small { color: rgba(255, 255, 255, 0.8); font-weight: 700; }
.favorite {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  color: white;
  cursor: pointer;
  font-size: 1.05rem;
}
.favorite.active { background: var(--red); }
.card-body { padding: 1rem; }
.card-body p { min-height: 4.7rem; margin: 0 0 1rem; color: var(--muted); font-size: 0.94rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tags span {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(255, 255, 255, 0.07);
  color: #f3ccd5;
  font-size: 0.75rem;
  font-weight: 700;
}
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 0.55rem; }
.card-actions button, .card-actions a {
  min-height: 2.75rem;
  border-radius: 13px;
  padding: 0.65rem 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.detail-button { border: 1px solid var(--line); background: transparent; color: var(--text); }
.watch-button { background: var(--red); color: white; }
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.platform-card, .about {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}
.platform-card { padding: 1.4rem; }
.platform-card p { color: var(--muted); }
.platform-card a { color: var(--gold); font-weight: 850; text-decoration: none; }
.platform-badge {
  display: inline-block;
  margin-bottom: 1rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(230, 59, 78, 0.18);
  color: #ffb3bd;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
  padding: clamp(1.4rem, 4vw, 2.5rem);
}
.about-copy p { color: var(--muted); }
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
}
footer p { margin: 0.35rem 0; }

dialog {
  width: min(620px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: #211019;
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px); }
.dialog-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
}
.dialog-cover { min-height: 280px; }
.dialog-body { padding: 1.4rem; }
.dialog-body p { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 1020px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 480px; max-width: 620px; }
}
@media (max-width: 760px) {
  .site-header nav { display: none; }
  .controls, .platform-grid, .about { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: start; flex-direction: column; }
  .hero { min-height: auto; }
  .hero-art { min-height: 430px; }
  .poster { width: min(220px, 56vw); }
  .poster-three { left: 22%; }
}
@media (max-width: 480px) {
  main, footer { width: min(100% - 1.25rem, 1180px); }
  .catalog-grid { grid-template-columns: 1fr; }
  .cover { min-height: 220px; }
  .card-body p { min-height: auto; }
  .stats { gap: 1.2rem; }
  .watchlist-button { padding-inline: 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
