/* ------------------------------------------------------------------ reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #0a0a0e;
  --bg-2: #101018;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f5f0e6;
  --ink-dim: #b7b1a6;
  --ink-faint: #8a857c;
  --gold: #e6b566;
  --gold-soft: #f0c98a;
  --film: #8fb7d6;
  --film-soft: #b8d4ea;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 22px 60px -20px rgba(0, 0, 0, 0.75);
  --maxw: 1180px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
/* layered cinematic background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      1200px 700px at 78% -8%,
      rgba(230, 181, 102, 0.1),
      transparent 60%
    ),
    radial-gradient(
      1000px 800px at 8% 4%,
      rgba(143, 183, 214, 0.08),
      transparent 55%
    ),
    radial-gradient(
      1400px 900px at 50% 120%,
      rgba(230, 181, 102, 0.06),
      transparent 60%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
}
/* subtle film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
::selection {
  background: rgba(230, 181, 102, 0.28);
}

/* kept in the tab/AT order at all times (position, not display/visibility),
   just parked off-screen until it receives focus */
.skip-link {
  position: fixed;
  top: -3rem;
  left: 1rem;
  z-index: 1000;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(
    180deg,
    rgba(10, 10, 14, 0.82),
    rgba(10, 10, 14, 0.5)
  );
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 34px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
}
.nav-group {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 3vw, 24px);
  flex: 1;
}
/* baseline alignment leaves the larger serif ~1.5px low against the nav items;
   lift it so the cap-height centres line up optically */
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5ch;
  flex-shrink: 0;
  letter-spacing: 0.01em;
  transform: translateY(-1.5px);
}
.brand b {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
}
.brand .arrow {
  color: var(--gold);
  font-size: 1.05rem;
  transform: translateY(-1px);
}
.brand .scr {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--film-soft);
}
.brand:hover .arrow {
  animation: nudge 0.6s ease;
}
@keyframes nudge {
  50% {
    transform: translate(3px, -1px);
  }
}

/* nav */
.nav-btn {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-dim);
  background: none;
  border: none;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.15s;
  flex-shrink: 0;
}
.nav-btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 2px;
}
.nav-btn:hover,
.nav-btn.active {
  color: var(--gold-soft);
}
/* the shine text is painted by a gradient, so `color` does nothing on hover and
   background-image can't be transitioned — register the two stops as custom
   properties instead, which CSS *can* interpolate */
@property --shine-base {
  syntax: "<color>";
  inherits: false;
  initial-value: #b7b1a6;
}
@property --shine-peak {
  syntax: "<color>";
  inherits: false;
  initial-value: #ffffff;
}
.nav-shine {
  --shine-base: var(--ink-dim);
  --shine-peak: #fff;
  background: linear-gradient(
    90deg,
    var(--shine-base) 0%,
    var(--shine-base) 35%,
    var(--shine-peak) 50%,
    var(--shine-base) 65%,
    var(--shine-base) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 6s ease-in-out infinite;
  transition:
    --shine-base 0.18s ease,
    --shine-peak 0.18s ease;
}
.nav-shine:hover {
  --shine-base: var(--gold);
  --shine-peak: #fff3dc;
}
@keyframes shine {
  0%,
  100% {
    background-position: 200% 0;
  }
  50% {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-shine {
    animation: none;
    background-position: 0 0;
  }
}
.nav-btn.active {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 4px;
}

/* collections panel */
.coll-panel {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.25s ease,
    padding 0.25s ease;
  border-top: 1px solid transparent;
}
.coll-panel.open {
  max-height: 300px;
  padding: 16px 0;
  border-top-color: var(--line);
}
.coll-panel-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* search */
.search-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.nav-right {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 3vw, 24px);
  margin-left: auto;
  flex-shrink: 0;
}
.search {
  position: relative;
  flex: 1;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 16px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.search-box:focus-within {
  border-color: rgba(230, 181, 102, 0.6);
  box-shadow: 0 0 0 4px rgba(230, 181, 102, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.search-box svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--ink-faint);
}
.search input {
  border: none;
  background: none;
  outline: none;
  color: var(--ink);
  font-size: 0.95rem;
  width: 100%;
}
.search input::placeholder {
  color: var(--ink-faint);
}
.search kbd {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  flex-shrink: 0;
}
/* dropdown */
.results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(18, 18, 26, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: 0.16s ease;
}
.results.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.res {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.res:last-child {
  border-bottom: none;
}
.res.active,
.res:hover {
  background: rgba(230, 181, 102, 0.1);
}
.res img {
  width: 34px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--surface-2);
  flex-shrink: 0;
}
.res .rt {
  font-weight: 500;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.res .rs {
  font-size: 0.76rem;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.res .rinfo {
  min-width: 0;
  flex: 1;
}
.badge {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  vertical-align: middle;
}
.badge.book {
  color: var(--gold-soft);
  background: rgba(230, 181, 102, 0.14);
  border: 1px solid rgba(230, 181, 102, 0.25);
}
.badge.movie {
  color: var(--film-soft);
  background: rgba(143, 183, 214, 0.14);
  border: 1px solid rgba(143, 183, 214, 0.25);
}
.badge.tv {
  color: #c9b6f2;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.32);
}
.res-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

/* ------------------------------------------------------------------ hero */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 34px);
}
.hero {
  text-align: center;
  padding: clamp(30px, 5vw, 64px) 0 clamp(30px, 5vw, 56px);
}
.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
  font-weight: 600;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold-soft);
}
.hero p {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--ink-dim);
  font-size: clamp(1rem, 2vw, 1.14rem);
}
.hero .cta {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 18px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.hero-search-box:focus-within {
  border-color: rgba(230, 181, 102, 0.6);
  box-shadow: 0 0 0 4px rgba(230, 181, 102, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.hero-search-box svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--ink-faint);
}
.hero-search-box input {
  border: none;
  background: none;
  outline: none;
  color: var(--ink);
  font-size: 1rem;
  width: 100%;
}
.hero-search-box input::placeholder {
  color: var(--ink-faint);
}
.btn-surprise {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(35, 26, 12, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(230, 181, 102, 0.4);
  color: var(--gold-soft);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
  overflow: hidden;
}
.btn-surprise::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  animation: btn-shine 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-shine {
  0%,
  100% {
    left: -100%;
  }
  50% {
    left: 150%;
  }
}
.btn-surprise:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow:
    0 0 18px rgba(230, 181, 102, 0.5),
    0 0 40px rgba(230, 181, 102, 0.25);
  border-color: rgba(230, 181, 102, 0.6);
}
.btn-surprise svg {
  width: 16px;
  height: 16px;
  transform: rotate(0deg);
}
.btn-surprise:hover svg {
  animation: dice-spin 3.2s ease-in-out;
}
@keyframes dice-spin {
  to {
    transform: rotate(1080deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn-surprise:hover svg {
    animation: none;
  }
  .btn-surprise::after {
    animation: none;
    display: none;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.92rem;
  transition:
    transform 0.15s,
    background 0.2s,
    border-color 0.2s;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.btn.primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #231a0c;
  border: none;
  font-weight: 600;
}
.btn.primary:hover {
  box-shadow: 0 12px 30px -10px rgba(230, 181, 102, 0.5);
}
.btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------- gallery */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 24px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}
.section-head .muted {
  color: var(--ink-faint);
  font-size: 0.86rem;
  margin-top: 4px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* direction filter — only rendered when the dataset holds more than one */
.origin-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.origin-row:empty {
  display: none;
}
.chip {
  font-size: 0.8rem;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: var(--surface);
  transition: 0.18s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.chip.on {
  background: rgba(230, 181, 102, 0.15);
  border-color: rgba(230, 181, 102, 0.4);
  color: var(--gold-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: clamp(14px, 2vw, 22px);
  padding-bottom: 60px;
}
.tile {
  display: block;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  aspect-ratio: 2/3;
  border: 1px solid var(--line);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.28s,
    border-color 0.28s;
  animation: rise 0.5s both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.tile:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}
.tile .frame,
.tile .frame img {
  width: 100%;
  height: 100%;
}
.tile .frame img {
  object-fit: cover;
  transition:
    transform 0.5s ease,
    filter 0.4s;
}
.tile:hover .frame img,
.tile:focus-visible .frame img {
  transform: scale(1.06);
}
.tile .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 13px;
  background: linear-gradient(
    0deg,
    rgb(6 6 10) 2%,
    rgb(6 6 10 / 75%) 46%,
    transparent
  );
  transform: translateY(0);
  transition: 0.3s;
}
.tile .cap .mt {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tile .cap .my {
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 3px;
}
.tile .src {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: 0.32s ease;
}
.tile:hover .src,
.tile:focus-visible .src {
  max-height: 60px;
  opacity: 1;
}
.tile .src img {
  width: 26px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
.tile .src span {
  font-size: 0.72rem;
  color: var(--ink-dim);
  line-height: 1.25;
}
.tile .src span b {
  color: var(--gold-soft);
  font-weight: 600;
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.tile .tags {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.tile .tv-tag,
.tile .nov-tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.tile .tv-tag {
  color: #c9b6f2;
  background: rgba(30, 20, 50, 0.82);
  border: 1px solid rgba(167, 139, 250, 0.35);
}
.tile .nov-tag {
  color: var(--film-soft);
  background: rgba(14, 24, 34, 0.84);
  border: 1px solid rgba(143, 183, 214, 0.4);
}
.tile .pin {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #231a0c;
  background: var(--gold-soft);
  padding: 4px 8px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: 0.25s;
}
.tile:hover .pin,
.tile:focus-visible .pin {
  opacity: 1;
  transform: none;
}

/* image frame + fallback */
.frame {
  position: relative;
  background: linear-gradient(145deg, #1a1a24, #111119);
  overflow: hidden;
}
.frame__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-dim);
  background: linear-gradient(145deg, #1c1c26, #121219);
  line-height: 1.3;
}
.frame.is-empty img {
  display: none;
}
.frame.is-empty .frame__fallback {
  display: flex;
}
.frame.is-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 12px,
    rgba(255, 255, 255, 0.02) 12px,
    rgba(255, 255, 255, 0.02) 24px
  );
}

/* ---------------------------------------------------------------- detail */
.detail {
  position: relative;
  padding: 24px 0 90px;
  animation: fade 0.4s both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center 22%;
  filter: blur(42px) saturate(120%);
  opacity: 0.22;
  transform: scale(1.25);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 14, 0.55), var(--bg) 78%);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-dim);
  font-size: 0.9rem;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: 0.18s;
  margin-bottom: 30px;
}
.back:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateX(-3px);
}
.back svg {
  width: 16px;
  height: 16px;
}

.dline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
/* moved here on every route change so screen readers announce the new view.
   `.show-focus-ring` is added by JS only when that navigation was keyboard-driven
   (see lastInputWasKeyboard) — :focus-visible can't be trusted here since these
   headings are focused programmatically, not by the user tabbing to them directly */
.dline.show-focus-ring:focus,
#shelfTitle.show-focus-ring:focus {
  outline: 2px solid var(--gold-soft);
  outline-offset: 4px;
  border-radius: 4px;
}
.dline em {
  font-style: italic;
  color: var(--gold-soft);
}
.dline .film {
  color: var(--film-soft);
  font-style: italic;
}
.dsub {
  color: var(--ink-faint);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.pairing {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(20px, 4vw, 54px);
  align-items: start;
}
.side-label {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-label.book {
  color: var(--gold);
}
.side-label.film {
  color: var(--film);
}
.side-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.work {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.work .frame {
  width: clamp(120px, 20vw, 190px);
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line-strong);
  aspect-ratio: 2/3;
}
.work .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work .meta h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.work .meta .by {
  color: var(--ink-dim);
  font-size: 1rem;
  margin-top: 6px;
  font-style: italic;
  font-family: var(--serif);
}
.work .facts {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fact .k {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.fact .v {
  font-size: 0.94rem;
  color: var(--ink);
}
.ext {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: 0.18s;
  align-self: flex-start;
}
.ext:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
}
.ext.gr:hover {
  border-color: rgba(230, 181, 102, 0.5);
  color: var(--gold-soft);
}
.ext.imdb:hover {
  border-color: rgba(143, 183, 214, 0.5);
  color: var(--film-soft);
}
.ext svg {
  width: 15px;
  height: 15px;
}

/* connector */
.connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 52px;
  color: var(--ink-faint);
}
.connector .rail {
  width: 1px;
  flex: 1;
  background: linear-gradient(var(--gold), var(--film));
  min-height: 60px;
  opacity: 0.5;
}
.connector .node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}
.connector .ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  background: var(--surface);
}
.connector .ring svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
}
/* novelisation — the screen work leads, so the rail runs film -> book */
.pairing.reversed .connector .rail {
  background: linear-gradient(var(--film), var(--gold));
}
.pairing.reversed .connector .ring svg {
  color: var(--film);
}

/* multi-film */
.films {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.films.multi .work .frame {
  width: clamp(104px, 15vw, 150px);
}

/* footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 30px clamp(16px, 4vw, 34px);
  max-width: var(--maxw);
  margin: 0 auto;
  color: var(--ink-faint);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot a {
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line-strong);
}
.foot a:hover {
  color: var(--gold-soft);
}

/* responsive */
@media (max-width: 940px) {
  .search {
    margin-left: 0;
  }
  .header-inner {
    flex-wrap: wrap;
  }
  .search kbd {
    display: none;
  }
  .nav-right {
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
  }
  .pairing {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .connector {
    flex-direction: row;
    padding: 20px 0;
  }
  .connector .rail {
    width: 60px;
    height: 1px;
    flex: none;
    min-height: 0;
    background: linear-gradient(90deg, var(--gold), var(--film));
  }
  .pairing.reversed .connector .rail {
    background: linear-gradient(90deg, var(--film), var(--gold));
  }
  .work {
    gap: 16px;
  }
}
@media (max-width: 460px) {
  .work {
    flex-direction: column;
  }
  .work .frame {
    width: 130px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}
.hidden {
  display: none !important;
}

/* collections */
.chip .n {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}
.chip.on .n {
  color: var(--gold-soft);
  opacity: 0.6;
}
.badge.collection {
  color: #c9b6f2;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.32);
}
.coll-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(230, 181, 102, 0.35);
  background: rgba(230, 181, 102, 0.1);
  color: var(--gold-soft);
  transition: 0.18s;
}
.coll-chip:hover {
  background: rgba(230, 181, 102, 0.18);
  transform: translateY(-2px);
}
.coll-chip svg {
  width: 14px;
  height: 14px;
}
