:root {
  --bg: #0b0d12;
  --surface: #11141b;
  --text: #f4f4f6;
  --muted: #a3a8b4;
  --line: #262a34;
  --chip: #151922;
  --accent: #ff5a4e;
  --accent-text: #ff6f63;
  --badge-now: #1f7a46;
  --badge-soon: #2a2f3a;
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --text: #15171c;
  --muted: #5e6470;
  --line: #e2e4e9;
  --chip: #ffffff;
  --accent-text: #d93a2e;
  --badge-soon: #3a404c;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.shell { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* Header */
.topbar { display: flex; align-items: center; gap: 48px; padding: 24px 0; }
.logo { font-weight: 700; font-size: 26px; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.logo.small { font-size: 16px; }
.nav { display: flex; gap: 32px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent-text); border-bottom-color: var(--accent); }

.theme-toggle { display: flex; background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.theme-toggle button {
  width: 44px; height: 34px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
:root[data-theme="dark"] [data-theme-set="dark"],
:root[data-theme="light"] [data-theme-set="light"] { background: var(--line); color: var(--text); }
:root[data-theme="light"] [data-theme-set="light"] { background: var(--accent); color: #fff; }

/* Hero */
.hero h1 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 52px; line-height: 1.05; margin: 16px 0 6px; letter-spacing: -0.5px; }
.hero p { font-family: "DM Serif Display", Georgia, serif; font-size: 22px; color: var(--muted); margin: 0; }

/* Week + filters */
.week-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 14px; }
.week-head h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 28px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  min-height: 40px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  background: var(--chip); border: 1px solid var(--line); color: var(--text); font-size: 14px;
  display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.select-chip { padding: 0 6px 0 14px; }
.select-chip select {
  background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding: 8px 6px; outline-offset: 4px;
}
.select-chip select option { color: #111; }

/* Cards */
.grid { display: grid; gap: 32px 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; gap: 8px; }
.poster {
  position: relative; aspect-ratio: 3 / 2.15; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover .poster img { transform: scale(1.03); }
.poster.portrait::before {
  content: ""; position: absolute; inset: -20px; z-index: 0;
  background: var(--poster-bg) center / cover; filter: blur(18px) brightness(.6);
}
.poster.portrait img { position: relative; object-fit: contain; }
.poster.fallback { display: grid; place-items: center; text-align: center; padding: 16px; }
.poster-title {
  font-family: "DM Serif Display", Georgia, serif; font-size: 36px; color: #fff; line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.status-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-size: 12px; font-weight: 600; color: #fff; padding: 4px 10px; border-radius: 999px;
  background: var(--badge-soon);
}
.status-badge.now { background: var(--badge-now); }
.card-title { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 21px; margin: 4px 0 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--line); color: var(--text); }
.card-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.card-foot .meta { color: var(--muted); font-size: 13px; }
.watch { color: var(--accent-text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.watch:hover { text-decoration: underline; }

.status { text-align: center; color: var(--muted); margin: 32px 0; }

/* Previous weeks */
.week-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.week-list a {
  display: flex; justify-content: space-between; padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.week-list a:hover { border-color: var(--accent); }

/* Footer */
.footer {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 32px; font-size: 13px;
}
.footer .divider { width: 1px; height: 18px; background: var(--line); }
.footer-nav { margin-left: auto; display: flex; gap: 28px; color: var(--muted); }
.footer-nav a:hover { color: var(--text); }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .poster { aspect-ratio: 3 / 3.5; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .topbar { gap: 16px; flex-wrap: wrap; }
  .logo { flex: 1; font-size: 22px; }
  .nav { order: 3; flex-basis: 100%; gap: 24px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 18px; }
  .card-title { font-size: 17px; }
  .poster-title { font-size: 24px; }
  .footer-nav { margin-left: 0; }
}
