/* ── Root vars ── */
:root {
  --red: #c90002;
  --ink: #050505;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

.font-cine {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
}
.font-body {
  font-family: "DM Sans", sans-serif;
}
.font-data {
  font-family: "DM Mono", monospace;
}

/* ── Page fade-in ── */
@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.page-root {
  animation: page-in 0.6s ease both;
}

/* ── HERO ── */
@keyframes hero-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}
.hero-img {
  animation: hero-zoom 18s ease-in-out infinite alternate;
}

/* ── Title reveal ── */
@keyframes title-reveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0% 0 0);
    opacity: 1;
  }
}
.title-wipe {
  animation: title-reveal 1.1s cubic-bezier(0.77, 0, 0.18, 1) 0.3s both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-up-1 {
  animation: fade-up 0.7s 0.6s ease both;
}
.fade-up-2 {
  animation: fade-up 0.7s 0.75s ease both;
}
.fade-up-3 {
  animation: fade-up 0.7s 0.9s ease both;
}

/* ── FILMSTRIP ticker ── */
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.ticker-track {
  animation: ticker 30s linear infinite;
}
.ticker-track:hover {
  animation-play-state: paused;
}

/* ── Red rule ── */
.red-rule {
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--red) 30%,
    var(--red) 70%,
    transparent
  );
}

/* ── FILTER tabs ── */
.tab {
  position: relative;
  transition: color 0.3s ease;
}
.tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.77, 0, 0.18, 1);
  transform-origin: left;
}
.tab.active {
  color: #fff;
}
.tab.active::after {
  transform: scaleX(1);
}

/* ── Grain overlay ── */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: var(--grain);
  opacity: 0.6;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-thumb {
  background: rgba(201, 0, 2, 0.35);
  border-radius: 9999px;
}

/* ════════════════════════════════════════
     CATALOG GRID — redesigned
  ════════════════════════════════════════ */

.catalog-mosaic {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
}

/* Default: all full-width on mobile */
.film-card {
  grid-column: span 12;
}

@media (min-width: 768px) {
  /* 9-card repeating pattern — no card narrower than 4 cols */
  .film-card[data-slot="0"] {
    grid-column: span 7;
    grid-row: span 2;
  }
  .film-card[data-slot="1"] {
    grid-column: span 5;
  }
  .film-card[data-slot="2"] {
    grid-column: span 5;
  }
  .film-card[data-slot="3"] {
    grid-column: span 4;
  }
  .film-card[data-slot="4"] {
    grid-column: span 4;
  }
  .film-card[data-slot="5"] {
    grid-column: span 4;
  }
  .film-card[data-slot="6"] {
    grid-column: span 6;
  }
  .film-card[data-slot="7"] {
    grid-column: span 3;
  }
  .film-card[data-slot="8"] {
    grid-column: span 3;
  }
}

/* Aspect ratios: narrower cards get squarer ratio so content fits */
.film-card {
  aspect-ratio: 16/9;
  min-height: 180px;
}

@media (min-width: 768px) {
  /* The triple row (slots 3–5) — 4 col each, use 4:3 */
  .film-card[data-slot="3"],
  .film-card[data-slot="4"],
  .film-card[data-slot="5"] {
    aspect-ratio: 4/3;
  }

  /* The end pair (slots 7–8) — 3 col each, go square */
  .film-card[data-slot="7"],
  .film-card[data-slot="8"] {
    aspect-ratio: 1/1;
  }

  /* Big hero card spans 2 rows — let height be natural from row-span */
  .film-card[data-slot="0"] {
    aspect-ratio: unset;
    min-height: 400px;
  }
}

/* ── Card internals ── */
.film-card {
  position: relative;
  overflow: hidden; /* ← KEY: shutter is clipped to card bounds */
  cursor: pointer;
  background: #050505;
}

.film-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65) saturate(0.9);
  transition:
    transform 0.7s ease,
    filter 0.5s ease;
  will-change: transform;
}
.film-card:hover img {
  transform: scale(1.06);
  filter: brightness(0.45) saturate(0.8);
}

.film-card-grad {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(5, 5, 5, 0.95) 0%,
    rgba(5, 5, 5, 0.3) 45%,
    transparent 100%
  );
}

/* ── Base label (always visible, fades on hover) ── */
.film-base-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 14px 16px;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.film-card:hover .film-base-label {
  opacity: 0;
}

/* ── Card number watermark ── */
.card-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  position: absolute;
  top: -0.25rem;
  right: 0.6rem;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  transition: color 0.4s ease;
}
.film-card:hover .card-num {
  color: rgba(201, 0, 2, 0.12);
}

/* ── Scan line ── */
@keyframes scan-pass {
  from {
    top: -2px;
    opacity: 0;
  }
  5% {
    opacity: 0.7;
  }
  95% {
    opacity: 0.7;
  }
  to {
    top: 100%;
    opacity: 0;
  }
}
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 6;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 0, 2, 0.6) 40%,
    rgba(201, 0, 2, 0.6) 60%,
    transparent
  );
  pointer-events: none;
  animation: scan-pass 2s linear infinite;
  opacity: 0;
}
.film-card:hover .scan-line {
  opacity: 1;
}

/* ── SHUTTER OVERLAY ── */
/* Clips within the card (overflow:hidden on parent handles it) */
.card-shutter {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(3px);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.52s cubic-bezier(0.77, 0, 0.18, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}
.film-card:hover .card-shutter {
  clip-path: inset(0 0% 0 0);
}

/* ── Slate button ── */
.slate-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 7;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  color: rgba(255, 255, 255, 0.3);
}
.film-card:hover .slate-btn {
  opacity: 1;
}
.slate-btn.slated {
  border-color: rgba(201, 0, 2, 0.5);
  color: var(--red);
}

/* ── Shutter meta grid ── */
.shutter-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-top: 8px;
}

/* ── Login modal ── */
.login-modal-backdrop {
  background: rgba(40, 38, 38, 0.88);
  backdrop-filter: blur(8px);
}

.login-modal-card {
  background: linear-gradient(
    180deg,
    rgba(12, 12, 12, 0.96) 0%,
    rgba(5, 5, 5, 0.96) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  border-radius: 10px;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.login-input:focus {
  outline: none;
  border-color: rgba(201, 0, 2, 0.55);
  background: rgba(0, 0, 0, 0.6);
}
