:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(16, 20, 29, 0.82);
  --panel-strong: rgba(20, 25, 36, 0.95);
  --text: #f4efe7;
  --muted: #b9c2ca;
  --line: rgba(255, 255, 255, 0.14);
  --gold: #f1c76a;
  --red: #f05c5c;
  --cyan: #5bd5d1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  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-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(7, 9, 13, 0.2), var(--bg) 680px),
    url("../assets/hero-scales.png") top center / min(1500px, 140vw) auto no-repeat,
    radial-gradient(circle at top right, rgba(91, 213, 209, 0.18), transparent 420px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.96), rgba(7, 9, 13, 0.35) 48%, rgba(7, 9, 13, 0.85)),
    radial-gradient(circle at 20% 18%, rgba(240, 92, 92, 0.2), transparent 310px),
    radial-gradient(circle at 78% 22%, rgba(91, 213, 209, 0.18), transparent 330px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand,
.nav-link,
.button,
.back-link {
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(241, 199, 106, 0.55);
  border-radius: 50%;
  background: rgba(241, 199, 106, 0.12);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.nav-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-hero {
  min-height: 640px;
}

.hero-copy,
.scale-shell,
.site-footer,
.detail-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-copy {
  display: flex;
  min-height: 470px;
  max-width: 1180px;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0 86px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 10vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.lede {
  max-width: 640px;
  color: #dde3e5;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.hero-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.count-pill,
.pan-total,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 700;
}

.count-pill strong {
  color: var(--text);
  font-size: 1.35rem;
}

.count-pill.death strong,
.death-pan h3,
.status-badge.dies {
  color: #ff8e8e;
}

.count-pill.life strong,
.life-pan h3,
.status-badge.lives {
  color: #75f0e7;
}

.scale-section {
  padding: 0 0 56px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.scale-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 118px;
}

.death-pan {
  grid-column: 1;
  grid-row: 1;
}

.life-pan {
  grid-column: 2;
  grid-row: 1;
}

.scale-pan {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scale-pan::before {
  content: "";
  display: block;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 17px),
    linear-gradient(90deg, rgba(240, 92, 92, 0.55), rgba(241, 199, 106, 0.2));
}

.death-pan {
  border-color: rgba(240, 92, 92, 0.3);
}

.life-pan {
  border-color: rgba(91, 213, 209, 0.28);
}

.life-pan::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 17px),
    linear-gradient(90deg, rgba(241, 199, 106, 0.2), rgba(91, 213, 209, 0.55));
}

.pan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: rgba(0, 0, 0, 0.24);
}

.pan-header h3 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 18px;
}

.movie-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transform: translateY(0);
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.movie-card:hover,
.movie-card:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-10px) rotate(-1deg);
  z-index: 2;
}

.movie-card.lives:hover,
.movie-card.lives:focus-visible {
  transform: translateY(-10px) rotate(1deg);
}

.movie-card:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible,
.back-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.poster-art,
.modal-poster,
.detail-poster {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(160deg, var(--poster-a), var(--poster-b));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.28);
}

.poster-art {
  aspect-ratio: 2 / 3;
  padding: 10px;
}

.poster-art.has-image,
.modal-poster.has-image,
.detail-poster.has-image {
  background: #090b10;
  padding: 0;
}

.poster-art img,
.modal-poster img,
.detail-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-art::before,
.modal-poster::before,
.detail-poster::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  pointer-events: none;
}

.poster-art::after,
.modal-poster::after,
.detail-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 15px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.48), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.22;
  pointer-events: none;
}

.poster-year {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
}

.poster-title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  word-break: break-word;
}

.card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.movie-title {
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 850;
  line-height: 1.15;
}

.movie-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.scale-spine {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: block;
  height: 112px;
  min-height: 0;
  pointer-events: none;
}

.beam {
  position: absolute;
  top: 35px;
  left: 50%;
  width: min(760px, 88%);
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(240, 92, 92, 0.25), var(--red) 21%, var(--gold) 50%, var(--cyan) 79%, rgba(91, 213, 209, 0.25)),
    linear-gradient(#fff, #fff);
  box-shadow:
    0 0 34px rgba(241, 199, 106, 0.32),
    0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%) rotate(-1.4deg);
}

.chains {
  position: absolute;
  inset: 47px 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.chains span {
  position: relative;
  justify-self: center;
  width: min(260px, 56%);
  height: 68px;
  border-right: 2px solid rgba(241, 199, 106, 0.65);
  border-bottom: 2px solid rgba(241, 199, 106, 0.65);
  border-left: 2px solid rgba(241, 199, 106, 0.65);
  border-radius: 0 0 70px 70px;
  background: transparent;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.chains span::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(241, 199, 106, 0.75);
  border-radius: 50%;
  background: rgba(12, 15, 21, 0.92);
  transform: translateX(-50%);
}

.fulcrum {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(241, 199, 106, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 28%),
    linear-gradient(135deg, rgba(241, 199, 106, 0.95), rgba(86, 57, 18, 0.95));
  box-shadow:
    0 0 0 8px rgba(241, 199, 106, 0.08),
    0 18px 38px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.fulcrum::after {
  content: "";
  position: absolute;
  top: 58px;
  left: 50%;
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(rgba(241, 199, 106, 0.9), rgba(241, 199, 106, 0));
  transform: translateX(-50%);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 42px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.site-footer a {
  color: var(--gold);
}

.movie-modal {
  width: min(850px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: rgba(14, 18, 27, 0.98);
  color: var(--text);
  box-shadow: var(--shadow);
}

.movie-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.movie-modal[open] {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  gap: 0;
}

.modal-poster {
  min-height: 430px;
  border: 0;
  border-radius: 0;
  padding: 24px;
}

.modal-copy {
  padding: 32px;
}

.modal-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.98;
}

.role-line,
.modal-summary,
.death-note,
.detail-summary,
.fate-box p {
  color: #dce3e5;
  line-height: 1.65;
}

.status-badge {
  margin: 8px 0 18px;
  width: fit-content;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 850;
}

.button.primary {
  border-color: rgba(241, 199, 106, 0.56);
  background: var(--gold);
  color: #19130a;
}

.button.ghost {
  color: var(--text);
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  cursor: pointer;
}

.detail-hero {
  min-height: 100px;
}

.detail-page {
  padding: 36px 0 70px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.back-link {
  display: inline-flex;
  margin: 22px;
  color: var(--gold);
  font-weight: 850;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(230px, 360px) minmax(0, 1fr);
  gap: 34px;
  padding: 0 34px 34px;
}

.detail-poster {
  min-height: 520px;
  padding: 24px;
}

.detail-poster span,
.detail-poster strong {
  position: relative;
  z-index: 1;
}

.detail-poster span {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.detail-poster strong {
  color: white;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.detail-copy {
  align-self: center;
  min-width: 0;
}

.detail-copy h1 {
  max-width: 680px;
  margin-bottom: 12px;
  font-size: clamp(2.7rem, 8vw, 6.2rem);
}

.fate-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 22px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.fate-box h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.tone-scarlet,
.tone-crimson,
.tone-blood,
.tone-brick,
.tone-rust {
  --poster-a: #ff4d4d;
  --poster-b: #2a080e;
}

.tone-teal,
.tone-sea,
.tone-sky {
  --poster-a: #64e0d7;
  --poster-b: #07313b;
}

.tone-gold,
.tone-amber,
.tone-bronze,
.tone-sun {
  --poster-a: #ffd36a;
  --poster-b: #4c2d0b;
}

.tone-steel,
.tone-slate,
.tone-chrome,
.tone-iron,
.tone-gray {
  --poster-a: #d7dde4;
  --poster-b: #1d2530;
}

.tone-smoke,
.tone-night,
.tone-ink,
.tone-ash,
.tone-blacktop {
  --poster-a: #828a94;
  --poster-b: #040506;
}

.tone-sand,
.tone-desert,
.tone-parchment,
.tone-marble,
.tone-paper {
  --poster-a: #e8d3a2;
  --poster-b: #5b4731;
}

.tone-moss,
.tone-green,
.tone-grass,
.tone-forest,
.tone-leaf,
.tone-olive,
.tone-khaki,
.tone-mud,
.tone-plague {
  --poster-a: #8bc56f;
  --poster-b: #152410;
}

.tone-violet,
.tone-wine,
.tone-royal,
.tone-magenta,
.tone-cosmic {
  --poster-a: #c782ff;
  --poster-b: #241036;
}

.tone-ice,
.tone-frost,
.tone-white,
.tone-opal {
  --poster-a: #dffaff;
  --poster-b: #305d70;
}

.tone-flame,
.tone-ember,
.tone-mars,
.tone-sunset {
  --poster-a: #ff9a4a;
  --poster-b: #4c1209;
}

.tone-storm,
.tone-cobalt,
.tone-navy,
.tone-blue {
  --poster-a: #59a7ff;
  --poster-b: #091b40;
}

.tone-money,
.tone-bee,
.tone-neon,
.tone-acid {
  --poster-a: #d2ff5d;
  --poster-b: #17360a;
}

.tone-rose {
  --poster-a: #ff9fb9;
  --poster-b: #451021;
}

@media (max-width: 980px) {
  body {
    background-size: 1250px auto;
  }

  .scale-board {
    gap: 14px;
    padding-top: 100px;
  }

  .beam {
    width: min(620px, 88%);
  }

  .chains {
    gap: 14px;
  }

  .chains span {
    width: min(210px, 62%);
    height: 58px;
  }

  .movie-modal[open],
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .modal-poster {
    min-height: 260px;
  }

  .detail-poster {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .topbar {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .hero-copy,
  .scale-shell,
  .site-footer,
  .detail-page {
    width: min(100% - 24px, 1180px);
  }

  .site-hero {
    min-height: 560px;
  }

  .hero-copy {
    min-height: 430px;
    padding-bottom: 48px;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 5.8rem);
  }

  .scale-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-top: 88px;
  }

  .scale-spine {
    height: 88px;
  }

  .beam {
    top: 28px;
    width: 94%;
    height: 8px;
  }

  .chains {
    top: 38px;
    gap: 8px;
  }

  .chains span {
    width: 68%;
    height: 47px;
    border-width: 1px;
  }

  .fulcrum {
    top: 9px;
    width: 42px;
    height: 42px;
  }

  .fulcrum::after {
    top: 42px;
    height: 34px;
  }

  .pan-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .pan-header .eyebrow {
    font-size: 0.62rem;
  }

  .pan-header h3 {
    font-size: 1.18rem;
  }

  .pan-total {
    padding: 7px 9px;
    font-size: 0.75rem;
  }

  .movie-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px;
  }

  .movie-card {
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 5px;
    background: rgba(0, 0, 0, 0.18);
  }

  .poster-art {
    width: 100%;
    min-width: 0;
  }

  .movie-title {
    font-size: 0.86rem;
    line-height: 1.05;
  }

  .movie-meta {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .modal-copy,
  .detail-layout {
    padding: 24px;
  }

  .detail-layout {
    gap: 24px;
  }

  .detail-copy h1 {
    font-size: clamp(2.5rem, 14vw, 4.4rem);
  }
}
