/* =========================================================
   Zell-Flix — Design tokens
   ========================================================= */
:root {
  --color-bg: #000000;
  --color-surface: #141414;
  --color-surface-raised: #1f1f1f;
  --color-accent: #FFC20E;
  --color-accent-soft: rgba(255, 194, 14, 0.35);
  --color-text: #FFFFFF;
  --color-text-muted: #B8B8B8;
  --color-scrim: rgba(0, 0, 0, 0.78);

  --font-body: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;

  --row-gap: clamp(1.5rem, 4vw, 3rem);
  --edge-pad: clamp(1rem, 4vw, 3.5rem);

  --header-h: 64px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: #000;
  padding: 0.75rem 1.25rem;
  z-index: 999;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: var(--header-h);
}

.site-header__inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--edge-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 30px; width: auto; }

.category-nav {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-nav__tab {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.category-nav__tab:hover { color: var(--color-text); }
.category-nav__tab[aria-current="true"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  height: min(78vh, 720px);
  min-height: 380px;
  overflow: hidden;
  background: var(--color-surface);
}

.hero__track {
  display: flex;
  height: 100%;
  transition: transform 0.6s var(--ease);
  will-change: transform;
}

.hero__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.hero__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 78%, rgba(0,0,0,0.92) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 80%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 0 var(--edge-pad) clamp(2.5rem, 7vw, 5rem);
  max-width: 620px;
}

.hero__logo {
  max-width: min(420px, 70vw);
  max-height: 130px;
  width: auto;
  height: auto;
  margin-bottom: 1.1rem;
}

.hero__title-fallback {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1.1rem;
}

.hero__blurb {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--color-text);
  max-width: 52ch;
  margin-bottom: 1.4rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.hero__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero__arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(2.5rem, 6vw, 4.5rem);
  border: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(0,0,0,0));
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.hero__arrow svg { width: 28px; height: 28px; }
.hero__arrow--prev { left: 0; }
.hero__arrow--next {
  right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,0.35), rgba(0,0,0,0));
}
.hero:hover .hero__arrow,
.hero:focus-within .hero__arrow { opacity: 1; }

.hero__dots {
  position: absolute;
  z-index: 2;
  bottom: 1.1rem;
  right: var(--edge-pad);
  display: flex;
  gap: 0.5rem;
}
.hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.4);
  padding: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero__dot[aria-current="true"] {
  background: var(--color-accent);
  transform: scale(1.25);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.4rem;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), opacity 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--color-accent);
  color: #140f00;
}
.btn--primary:hover { background: #ffcd35; }

.btn--ghost {
  background: rgba(255,255,255,0.12);
  color: var(--color-text);
}
.btn--ghost:hover { background: rgba(255,255,255,0.22); }

/* =========================================================
   Rows
   ========================================================= */
.rows {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 4rem;
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
}

.row__header {
  padding: 0 var(--edge-pad);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.row__title {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
}

.row__scroller-wrap { position: relative; }

.row__scroller {
  display: flex;
  gap: clamp(0.6rem, 1.4vw, 1rem);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.4rem var(--edge-pad) 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  cursor: grab;
}
.row__scroller::-webkit-scrollbar { display: none; }
.row__scroller.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.row__nav {
  position: absolute;
  top: 0;
  bottom: 1rem;
  width: 3rem;
  border: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
  color: var(--color-text);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.row__nav svg { width: 22px; height: 22px; }
.row__nav--prev { left: 0; }
.row__nav--next {
  right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
}

@media (hover: hover) and (pointer: fine) {
  .row__nav { display: flex; }
}

/* =========================================================
   Poster card
   ========================================================= */
.card {
  flex: 0 0 auto;
  width: clamp(120px, 22vw, 170px);
  scroll-snap-align: start;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  border-radius: var(--radius-sm);
}

.card__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  background: var(--color-surface);
}

.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.6rem 0.55rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.card:hover .card__frame,
.card:focus-visible .card__frame {
  transform: scale(1.08);
  border-color: var(--color-accent);
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
  z-index: 1;
}
.card:hover .card__label,
.card:focus-visible .card__label {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding: 2rem var(--edge-pad) 3rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.site-footer a { color: var(--color-text-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--color-accent); }

/* =========================================================
   Modal
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  animation: fadeIn 0.18s var(--ease) forwards;
}
.modal-backdrop[hidden] { display: none; }

@keyframes fadeIn { to { opacity: 1; } }

.modal {
  position: relative;
  width: min(880px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateY(12px);
  animation: slideUp 0.22s var(--ease) forwards;
}
@keyframes slideUp { to { transform: translateY(0); } }

.modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: rgba(0,0,0,0.85); }

.modal__art {
  position: relative;
  aspect-ratio: 16 / 8;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: flex-end;
}
.modal__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,20,20,0) 30%, rgba(20,20,20,0.85) 85%, var(--color-surface) 100%);
}
.modal__art-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem clamp(1.25rem, 3vw, 2.25rem);
  width: 100%;
}
.modal__logo {
  max-width: min(340px, 60%);
  max-height: 90px;
  width: auto;
  margin-bottom: 1rem;
}
.modal__title-fallback {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 1rem;
}
.modal__cta:empty { display: none; }

.modal__body {
  padding: 1.5rem clamp(1.25rem, 3vw, 2.25rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal__blurb {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

.modal__promo {
  border: 1px dashed var(--color-accent-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  background: rgba(255, 194, 14, 0.06);
}
.modal__promo-text { margin-bottom: 0.75rem; color: var(--color-text); }
.modal__promo-code-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.modal__promo-code {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

.modal__fact {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-style: italic;
  border-left: 2px solid var(--color-accent-soft);
  padding-left: 0.85rem;
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: #140f00;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.toast[hidden] { display: none; }

/* =========================================================
   Responsive tweaks
   ========================================================= */
@media (max-width: 640px) {
  .category-nav { gap: 1rem; }
  .hero { height: 62vh; min-height: 320px; }
  .modal__art { aspect-ratio: 16 / 10; }
}