/* =========================================================================
   CINEROS — Design System
   Direction: "the Rolex of film discovery" — an onyx-and-brass archive,
   not a streaming app. Quiet, exact, expensive. The signature device is a
   hairline "reel frame": a thin brass rule broken by small perforation
   ticks, used sparingly to bracket the most important surfaces (hero,
   poster walls, the film dossier). Everything else stays disciplined.
   ========================================================================= */

:root {
  /* ---- Color: named, not generic ---- */
  --onyx-950: #0a0b0d; /* base ground, warm-black not pure-black */
  --onyx-900: #101216;
  --onyx-800: #16191f;
  --onyx-700: #1f232b;
  --onyx-600: #2b303a;
  --hairline: rgba(201, 169, 97, 0.22); /* brass at low opacity, structural rules */
  --hairline-strong: rgba(201, 169, 97, 0.55);

  --brass-500: #c9a961; /* aged brass / champagne gold — the signature metal */
  --brass-400: #ddc27f;
  --brass-300: #eed9a6;
  --brass-050: #f7f0dd;

  --wine-600: #6e1f31; /* velvet curtain — reserved for rare emphasis only */
  --wine-500: #8a2940;

  --ivory-100: #efe9df; /* primary text on dark */
  --ivory-300: #cdc6ba; /* secondary text */
  --ivory-500: #8f8a7f; /* tertiary / meta text */
  --steel-400: #7c8794; /* cool counter-note for data/status */

  --success-500: #6f9d78;
  --danger-500: #a5473f;

  /* ---- Type: three roles, none of them defaults ---- */
  /* Display: a restrained high-contrast serif for titles — the "engraving" voice */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  /* Body: a quiet humanist sans, built for long dossiers and reviews */
  --font-body: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
  /* Utility: a mono face for data — runtime, year, rating, timestamps */
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --type-scale-1: 0.75rem; /* eyebrow / meta */
  --type-scale-2: 0.9375rem; /* body */
  --type-scale-3: 1.125rem; /* body-lg */
  --type-scale-4: 1.75rem; /* section head */
  --type-scale-5: 2.75rem; /* page head */
  --type-scale-6: 4.25rem; /* hero */

  /* ---- Layout ---- */
  --container-max: 1320px;
  --gutter: clamp(20px, 4vw, 64px);
  --radius-sm: 2px; /* deliberately near-zero — this is an archive, not an app store */
  --radius-md: 3px;
  --ease-signature: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                           */
/* ---------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--onyx-950);
  color: var(--ivory-100);
  font-family: var(--font-body);
  font-size: var(--type-scale-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ivory-100);
  margin: 0;
  letter-spacing: -0.01em;
}

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

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--brass-500);
  color: var(--onyx-950);
}

:focus-visible {
  outline: 1.5px solid var(--brass-400);
  outline-offset: 3px;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--type-scale-1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-400);
}

/* ---------------------------------------------------------------------- */
/* Signature device: the reel-frame hairline                              */
/* A thin brass rule with small perforation ticks — used to bracket only  */
/* the most important surfaces. Not decoration everywhere; a punctuation  */
/* mark reserved for real thresholds (hero, poster wall, dossier header). */
/* ---------------------------------------------------------------------- */
.reel-frame {
  position: relative;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(28px, 5vw, 56px);
}

.reel-frame::before,
.reel-frame::after {
  content: '';
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  height: 5px;
  background-image: radial-gradient(circle, var(--hairline-strong) 1.1px, transparent 1.2px);
  background-size: 14px 5px;
  background-repeat: repeat-x;
  opacity: 0.7;
}

.reel-frame::before {
  top: -3px;
}

.reel-frame::after {
  bottom: -3px;
}

/* ---------------------------------------------------------------------- */
/* Header / navigation                                                    */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 11, 13, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 76px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ivory-100);
  letter-spacing: 0.01em;
}

.brand__mark {
  color: var(--brass-400);
}

.primary-nav {
  display: flex;
  gap: 32px;
  margin-inline-start: auto;
  margin-inline-end: 8px;
}

.primary-nav a {
  font-size: 0.875rem;
  color: var(--ivory-300);
  letter-spacing: 0.02em;
  padding-block: 8px;
  border-bottom: 1px solid transparent;
  transition: color 180ms var(--ease-signature), border-color 180ms var(--ease-signature);
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brass-300);
  border-bottom-color: var(--brass-500);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: var(--ivory-500);
  font-size: 0.8125rem;
  min-width: 240px;
  cursor: pointer;
  transition: border-color 180ms var(--ease-signature);
}

.search-trigger:hover {
  border-color: var(--hairline-strong);
}

.search-trigger kbd {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ivory-500);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1px 5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--onyx-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--brass-300);
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms var(--ease-signature), background 150ms var(--ease-signature), border-color 150ms var(--ease-signature);
}

.btn:active {
  transform: translateY(1px);
}

.btn-brass {
  background: linear-gradient(180deg, var(--brass-400), var(--brass-500));
  color: var(--onyx-950);
}

.btn-brass:hover {
  background: linear-gradient(180deg, var(--brass-300), var(--brass-400));
}

.btn-ghost {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--ivory-100);
}

.btn-ghost:hover {
  border-color: var(--brass-400);
  color: var(--brass-300);
}

.btn-icon {
  padding: 9px;
  border-radius: 50%;
  background: var(--onyx-800);
  border-color: var(--hairline);
  color: var(--ivory-300);
}

.btn-icon.is-active {
  color: var(--brass-400);
  border-color: var(--brass-500);
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(64px, 10vw, 120px);
  overflow: hidden;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 78% 20%, rgba(201, 169, 97, 0.10), transparent 60%),
  linear-gradient(180deg, var(--onyx-950), var(--onyx-900) 60%, var(--onyx-950));
  z-index: -1;
}

.hero__eyebrow {
  margin-bottom: 18px;
}

.hero h1 {
  font-size: var(--type-scale-6);
  line-height: 1.05;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--brass-400);
}

.hero p.lede {
  font-size: var(--type-scale-3);
  color: var(--ivory-300);
  max-width: 46ch;
  margin-top: 22px;
  font-weight: 300;
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 36px;
}

.hero-search {
  margin-top: 48px;
  max-width: 640px;
  display: flex;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: var(--onyx-800);
  overflow: hidden;
}

.hero-search input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 16px 18px;
  color: var(--ivory-100);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.hero-search input::placeholder {
  color: var(--ivory-500);
}

.hero-search input:focus {
  outline: none;
}

.hero-search button {
  border: none;
  background: var(--brass-500);
  color: var(--onyx-950);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  padding-inline: 26px;
  cursor: pointer;
}

.hero-search button:hover {
  background: var(--brass-400);
}

/* ---------------------------------------------------------------------- */
/* Section headers                                                        */
/* ---------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: var(--type-scale-4);
}

.section-head .see-all {
  font-size: 0.8125rem;
  color: var(--brass-400);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 2px;
}

/* ---------------------------------------------------------------------- */
/* Poster wall / movie card — a museum placard, not an app-store tile     */
/* ---------------------------------------------------------------------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 28px 22px;
}

.movie-card {
  position: relative;
}

.movie-card__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  transition: border-color 220ms var(--ease-signature);
}

.movie-card:hover .movie-card__frame {
  border-color: var(--hairline-strong);
}

.movie-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease-signature);
}

.movie-card:hover .movie-card__frame img {
  transform: scale(1.045);
}

.movie-card__rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10, 11, 13, 0.82);
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--brass-300);
  padding: 3px 7px;
  letter-spacing: 0.02em;
}

.movie-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 11, 13, 0.92));
  opacity: 0;
  transition: opacity 220ms var(--ease-signature);
}

.movie-card:hover .movie-card__gradient {
  opacity: 1;
}

.movie-card__quick-actions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms var(--ease-signature), transform 220ms var(--ease-signature);
}

.movie-card:hover .movie-card__quick-actions {
  opacity: 1;
  transform: translateY(0);
}

.movie-card__quick-actions button {
  flex: 1;
  background: rgba(10, 11, 13, 0.7);
  border: 1px solid var(--hairline-strong);
  color: var(--ivory-100);
  border-radius: 3px;
  padding: 7px 0;
  font-size: 0.7rem;
  cursor: pointer;
}

.movie-card__quick-actions button:hover {
  border-color: var(--brass-400);
  color: var(--brass-300);
}

.movie-card__meta {
  margin-top: 12px;
}

.movie-card__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ivory-100);
  line-height: 1.3;
}

.movie-card__sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ivory-500);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------- */
/* Category chips                                                         */
/* ---------------------------------------------------------------------- */
.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.8125rem;
  color: var(--ivory-300);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 16px;
  transition: border-color 180ms var(--ease-signature), color 180ms var(--ease-signature);
}

.chip:hover, .chip.is-active {
  border-color: var(--brass-500);
  color: var(--brass-300);
}

/* ---------------------------------------------------------------------- */
/* Movie dossier (detail page)                                            */
/* ---------------------------------------------------------------------- */
.dossier-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
}

.dossier-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
}

.dossier-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--onyx-950) 8%, rgba(10, 11, 13, 0.55) 45%, rgba(10, 11, 13, 0.15)),
  linear-gradient(90deg, rgba(10, 11, 13, 0.75), transparent 60%);
}

.dossier-hero__content {
  position: relative;
  padding-block: 56px 44px;
  display: flex;
  gap: 36px;
  align-items: flex-end;
}

.dossier-hero__poster {
  width: 200px;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.dossier-hero__title {
  font-size: var(--type-scale-5);
  max-width: 20ch;
}

.dossier-hero__facts {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ivory-300);
}

.dossier-hero__facts .dot {
  color: var(--hairline-strong);
}

.dossier-hero__score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  color: var(--brass-300);
}

.dossier-hero__score b {
  font-size: 1.5rem;
  color: var(--brass-400);
}

.dossier-hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.dossier-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  padding-block: 48px;
}

.dossier-body h3 {
  font-size: 1.125rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

.synopsis {
  color: var(--ivory-300);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 68ch;
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.cast-card__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--hairline);
  margin-bottom: 8px;
}

.cast-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cast-card__role {
  font-size: 0.75rem;
  color: var(--ivory-500);
}

.cast-card__fav {
  position: relative;
}

.cast-card__fav button {
  position: absolute;
  top: -4px;
  right: 14px;
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: var(--ivory-500);
  font-size: 12px;
  cursor: pointer;
}

.cast-card__fav button.is-active {
  color: var(--brass-400);
  border-color: var(--brass-500);
}

.sidebar-card {
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
}

.sidebar-card h4 {
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.fact-list {
  display: grid;
  gap: 9px;
  font-size: 0.8125rem;
}

.fact-list div {
  display: flex;
  justify-content: space-between;
  color: var(--ivory-300);
}

.fact-list span:first-child {
  color: var(--ivory-500);
}

.ai-panel {
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, rgba(201, 169, 97, 0.06), transparent);
}

.ai-panel .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-panel p {
  font-size: 0.8125rem;
  color: var(--ivory-300);
  margin-top: 8px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------- */
/* Reviews                                                                */
/* ---------------------------------------------------------------------- */
.review {
  border-top: 1px solid var(--hairline);
  padding-block: 22px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
}

.review__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--onyx-700);
  border: 1px solid var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--brass-300);
}

.review__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review__author {
  font-weight: 700;
  font-size: 0.875rem;
}

.review__rating {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brass-400);
}

.review__date {
  font-size: 0.75rem;
  color: var(--ivory-500);
  margin-inline-start: auto;
}

.review__body {
  color: var(--ivory-300);
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.65;
}

.review__spoiler {
  filter: blur(6px);
  cursor: pointer;
}

.review__spoiler.is-revealed {
  filter: none;
}

/* ---------------------------------------------------------------------- */
/* Forms (search / auth surfaces)                                         */
/* ---------------------------------------------------------------------- */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ivory-500);
  margin-bottom: 7px;
  text-transform: uppercase;
}

.field input, .field select, .field textarea {
  width: 100%;
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  color: var(--ivory-100);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brass-500);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                 */
/* ---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 56px 32px;
  margin-top: 96px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.site-footer h5 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory-500);
  margin-bottom: 16px;
}

.site-footer a {
  display: block;
  font-size: 0.8125rem;
  color: var(--ivory-300);
  margin-bottom: 10px;
}

.site-footer a:hover {
  color: var(--brass-400);
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.75rem;
  color: var(--ivory-500);
}

.lang-switch {
  display: flex;
  gap: 14px;
}

.lang-switch a[aria-current="true"] {
  color: var(--brass-400);
}

/* ---------------------------------------------------------------------- */
/* Search palette (built by cineros.js, triggered by header + "/")        */
/* ---------------------------------------------------------------------- */
.search-palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.search-palette.is-open {
  display: block;
}

.search-palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(4px);
}

.search-palette__panel {
  position: relative;
  max-width: 640px;
  margin: 12vh auto 0;
  background: var(--onyx-800);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.search-palette__panel input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 20px 22px;
  color: var(--ivory-100);
  font-family: var(--font-body);
  font-size: 1.0625rem;
}

.search-palette__panel input:focus {
  outline: none;
}

.search-palette__results {
  max-height: 50vh;
  overflow-y: auto;
}

.search-palette__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 22px;
  font-size: 0.875rem;
  color: var(--ivory-100);
  border-bottom: 1px solid var(--onyx-700);
}

.search-palette__row:hover {
  background: var(--onyx-700);
  color: var(--brass-300);
}

.search-palette__year {
  font-family: var(--font-mono);
  color: var(--ivory-500);
  font-size: 0.75rem;
}

/* ---------------------------------------------------------------------- */
/* Premium atmosphere: film grain + aurora glow + scroll reveal           */
/* The brief asked for "the Rolex of movie apps" — this is the layer that */
/* makes the site feel alive rather than static: a faint animated grain   */
/* (real film stock, not a flat color), a slow-drifting brass aurora      */
/* behind the hero, and a scroll-triggered reveal so content arrives with */
/* intention instead of just appearing. Everything here respects          */
/* prefers-reduced-motion (see the base reset at the top of this file).   */
/* ---------------------------------------------------------------------- */

.film-grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain-shift 1.2s steps(4) infinite;
}

@keyframes grain-shift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1%, 1%);
  }
  50% {
    transform: translate(1%, -1%);
  }
  75% {
    transform: translate(-1%, -1%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.hero__backdrop {
  background: radial-gradient(ellipse 55% 45% at 80% 15%, rgba(201, 169, 97, 0.16), transparent 60%),
  radial-gradient(ellipse 40% 40% at 10% 85%, rgba(110, 31, 49, 0.12), transparent 55%),
  linear-gradient(180deg, var(--onyx-950), var(--onyx-900) 55%, var(--onyx-950));
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: aurora-drift 22s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0% {
    background-position: 20% 10%, 0% 90%, 0 0;
  }
  100% {
    background-position: 60% 30%, 30% 70%, 0 0;
  }
}

/* Scroll reveal: elements start slightly lowered + transparent, JS adds
   .is-visible via IntersectionObserver (main.js). No-JS/reduced-motion
   fallback: the base state below is visible-enough not to hide content. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-signature), transform 700ms var(--ease-signature);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease-signature), transform 600ms var(--ease-signature);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible > *:nth-child(1) {
  transition-delay: 0ms;
}

.reveal-stagger.is-visible > *:nth-child(2) {
  transition-delay: 60ms;
}

.reveal-stagger.is-visible > *:nth-child(3) {
  transition-delay: 120ms;
}

.reveal-stagger.is-visible > *:nth-child(4) {
  transition-delay: 180ms;
}

.reveal-stagger.is-visible > *:nth-child(5) {
  transition-delay: 240ms;
}

.reveal-stagger.is-visible > *:nth-child(6) {
  transition-delay: 300ms;
}

.reveal-stagger.is-visible > *:nth-child(n+7) {
  transition-delay: 340ms;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .film-grain, .hero__backdrop {
    animation: none !important;
  }
}

/* Header: quietly gains weight once the page has scrolled, like a physical
   object settling — not a jarring color swap. */
.site-header {
  transition: background 260ms var(--ease-signature), border-color 260ms var(--ease-signature), box-shadow 260ms var(--ease-signature);
}

.site-header.is-scrolled {
  background: rgba(10, 11, 13, 0.96);
  box-shadow: 0 1px 0 var(--hairline-strong), 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

/* Hero headline: a slow, single entrance — not a bounce, a settle. */
.hero h1 {
  animation: hero-rise 900ms var(--ease-signature) both;
}

.hero .lede {
  animation: hero-rise 900ms var(--ease-signature) 120ms both;
}

.hero-search {
  animation: hero-rise 900ms var(--ease-signature) 220ms both;
}

.chip-row {
  animation: hero-rise 900ms var(--ease-signature) 320ms both;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .lede, .hero-search, .chip-row {
    animation: none;
  }
}

/* Poster cards: a touch more presence on hover — a subtle lift and a
   brass sheen sweeping across the frame, like light catching a case back. */
.movie-card__frame {
  transition: border-color 220ms var(--ease-signature), transform 320ms var(--ease-signature), box-shadow 320ms var(--ease-signature);
}

.movie-card:hover .movie-card__frame {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.55);
}

.movie-card__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(201, 169, 97, 0.16) 50%, transparent 60%);
  background-size: 250% 250%;
  background-position: 120% -20%;
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}

.movie-card:hover .movie-card__frame::after {
  opacity: 1;
  animation: sheen-sweep 900ms var(--ease-signature);
}

@keyframes sheen-sweep {
  from {
    background-position: 120% -20%;
  }
  to {
    background-position: -20% 120%;
  }
}

/* Buttons: a soft brass glow on hover instead of a flat color swap. */
.btn-brass {
  position: relative;
  overflow: hidden;
  transition: transform 150ms var(--ease-signature), box-shadow 220ms var(--ease-signature), background 150ms var(--ease-signature);
}

.btn-brass:hover {
  box-shadow: 0 8px 24px -8px rgba(201, 169, 97, 0.55);
}

/* Section heads and the AI panel breathe in on scroll too. */
.section-head, .ai-panel {
}

/* Animated numeral count-up target (used for the dossier score + admin stat tiles). */
.count-up {
  display: inline-block;
}

/* Skeleton loading state for poster cards while data streams in (used if/when
   the poster grid is populated asynchronously rather than server-rendered). */
.movie-card__frame.is-loading {
  background: linear-gradient(100deg, var(--onyx-800) 30%, var(--onyx-700) 50%, var(--onyx-800) 70%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.6s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

/* Dossier hero backdrop: gentle parallax handled in JS (transform: translateY),
   this just establishes the containing context + a soft ken-burns drift. */
.dossier-hero__backdrop {
  animation: ken-burns 16s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes ken-burns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dossier-hero__backdrop {
    animation: none;
  }
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--brass-300);
}

.ai-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-500);
  box-shadow: 0 0 0 3px rgba(111, 157, 120, 0.18);
}

.review__actions {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}

.review__helpful-btn, .review__reply-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--ivory-500);
  cursor: pointer;
  padding: 4px 0;
}

.review__helpful-btn:hover, .review__reply-toggle:hover {
  color: var(--brass-300);
}

.review__helpful-btn.is-active {
  color: var(--brass-400);
}

.review__helpful-count {
  font-family: var(--font-mono);
}

.review__comments {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid var(--hairline);
  display: grid;
  gap: 10px;
}

.review__comment {
  font-size: 0.8125rem;
}

.review__comment-author {
  font-weight: 700;
  color: var(--ivory-100);
  margin-right: 8px;
}

.review__comment-body {
  color: var(--ivory-300);
}

.review__comment-date {
  font-family: var(--font-mono);
  color: var(--ivory-500);
  font-size: 0.6875rem;
  margin-left: 8px;
}

.review__comment-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.review__comment-form input {
  flex: 1;
  background: var(--onyx-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--ivory-100);
  font-size: 0.8125rem;
}

.review__comment-form input:focus {
  outline: none;
  border-color: var(--brass-500);
}

/* ---------------------------------------------------------------------- */
/* Taste-profile "fingerprint" bars (profile page)                       */
/* ---------------------------------------------------------------------- */
.taste-bars {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.taste-bar {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 18px;
}

.taste-bar__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ivory-300);
  text-transform: capitalize;
}

.taste-bar__track {
  height: 8px;
  border-radius: 999px;
  background: var(--onyx-700);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.taste-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brass-500), var(--brass-300));
  transition: width 1100ms var(--ease-signature);
}

.reveal.is-visible .taste-bar__fill {
  width: var(--fill-pct, 0%);
}

@media (prefers-reduced-motion: reduce) {
  .taste-bar__fill {
    transition: none;
    width: var(--fill-pct, 0%);
  }
}

/* ---------------------------------------------------------------------- */
/* "Impossibly amazing" layer: cursor spotlight, magnetic buttons,        */
/* 3D poster tilt, animated gradient text. Each is small, each is real —  */
/* the goal is a site that responds to the person touching it, not just   */
/* one that loads with a flourish and then sits still.                    */
/* ---------------------------------------------------------------------- */

/* Cursor spotlight: a soft brass glow that follows the pointer within the
   hero, set via --spot-x/--spot-y custom properties from main.js. */
.hero {
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--spot-x, 50%) var(--spot-y, 20%),
  rgba(201, 169, 97, 0.10), transparent 65%);
  opacity: 0;
  transition: opacity 400ms var(--ease-signature);
}

.hero.has-pointer::before {
  opacity: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

/* Animated gradient shimmer on the hero's emphasized word. */
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--brass-300) 0%, var(--brass-500) 25%, var(--brass-300) 50%, var(--brass-500) 75%, var(--brass-300) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer-drift 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 em {
    animation: none;
    color: var(--brass-400);
    background: none;
    -webkit-text-fill-color: initial;
  }
}

@keyframes shimmer-drift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 250% 50%;
  }
}

/* Magnetic buttons: JS nudges transform: translate(x,y) toward the cursor
   within a small radius; this just establishes the smooth spring-back. */
.btn-brass, .btn-ghost {
  transition: transform 220ms var(--ease-signature), box-shadow 220ms var(--ease-signature),
  background 150ms var(--ease-signature), border-color 150ms var(--ease-signature);
}

/* 3D poster tilt: JS sets --tilt-x/--tilt-y per card on mousemove; the
   perspective wrapper + transform live here so it's one CSS-owned effect. */
.movie-card {
  perspective: 800px;
}

.movie-card__frame {
  transform: rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)) translateY(0);
  transform-style: preserve-3d;
}

.movie-card:hover .movie-card__frame {
  translate: 0 -6px;
}

@media (prefers-reduced-motion: reduce) {
  .movie-card__frame {
    transform: none !important;
  }
}

/* Cross-document view transitions: the standards-based way to cross-fade
   between full page navigations (Chrome/Edge 126+; every other browser
   ignores this at-rule harmlessly and just navigates normally — no JS
   needed, and no risk of interfering with normal navigation because
   there's no JS intercepting clicks). */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-fade-out 180ms ease-in both;
}

::view-transition-new(root) {
  animation: page-fade-in 220ms ease-out both;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */
@media (max-width: 900px) {
  .primary-nav {
    display: none;
  }

  .dossier-body {
    grid-template-columns: 1fr;
  }

  .dossier-hero__content {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}
