/* ============================================================
   RIVER CITY, 2025 — styles
   Atmosphere: deep black, red bleed, soft teal cool.
   Type: Sora (title), Special Elite (tagline, typewriter).
   ============================================================ */

:root {
  --bg: #040405;
  --ink: #f3eee9;
  --ink-dim: rgba(243, 238, 233, 0.78);
  --ink-faint: rgba(243, 238, 233, 0.40);
  --red: #b8242a;
  --red-bright: #d62a31;
  --red-glow: rgba(184, 36, 42, 0.55);
  --red-deep: rgba(120, 18, 22, 0.85);
  --teal: #6f9a9d;
  --teal-soft: rgba(111, 154, 157, 0.35);

  --font-title: "DIN Alternate", "din", "Helvetica Neue", Arial, sans-serif;
  --font-display: "brandon-grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "din", "Helvetica Neue", Arial, sans-serif;

  --max: 64rem;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { min-height: 100svh; overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ---------- HERO ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(3rem, 8vh, 6rem) var(--pad-x);
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -4;
  background: #000;
  filter: contrast(1.02) saturate(0.98);
}

/* Fallback when the loop can't autoplay (iOS Low Power Mode, data saver, etc.)
   Show the hero image as a static background so we don't display the native
   play-button overlay over the page. */
.hero--static::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -4;
  background: #000 url("assets/hero.jpg") center/cover no-repeat;
  filter: contrast(1.02) saturate(0.98);
}

/* Soft scrim — just enough top/bottom darkening for type legibility */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.30) 0%,
      rgba(0, 0, 0, 0.08) 20%,
      rgba(0, 0, 0, 0.00) 45%,
      rgba(0, 0, 0, 0.18) 75%,
      rgba(0, 0, 0, 0.50) 100%
    );
}

/* Light corner vignette — keeps focus centered without crushing the image */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      transparent 55%,
      rgba(0, 0, 0, 0.25) 92%,
      rgba(0, 0, 0, 0.50) 100%
    );
}

/* Animated film grain */
.hero__grain {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  mix-blend-mode: overlay;
  animation: grain 1.6s steps(6) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-3%, 2%); }
  33%  { transform: translate(2%, -2%); }
  50%  { transform: translate(-2%, -3%); }
  66%  { transform: translate(3%, 1%); }
  83%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3.5vh, 2.5rem);
}

/* ---------- TITLE ---------- */

.title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 5.5rem);
  letter-spacing: 0.02em;
  line-height: 0.98;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  /* Subtle chromatic split — reads "title card", not glitch */
  text-shadow:
    1.2px 0 0 rgba(184, 36, 42, 0.55),
   -1.2px 0 0 rgba(111, 154, 157, 0.18),
    0 2px 30px rgba(0, 0, 0, 0.6);
  animation: title-flicker 9s ease-in-out infinite;
}

/* Almost imperceptible flicker — A24 style restraint */
@keyframes title-flicker {
  0%, 100%      { opacity: 1; }
  47%           { opacity: 1; }
  48%           { opacity: 0.86; }
  49%           { opacity: 1; }
  62%           { opacity: 1; }
  63%           { opacity: 0.93; }
  64%           { opacity: 1; }
}

/* ---------- TAGLINE ---------- */

.tagline {
  margin: 0;
  max-width: 38ch;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--ink-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

/* ---------- CTA BUTTONS ---------- */

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(243, 238, 233, 0.35);
  border-radius: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
  cursor: pointer;
}

.cta__btn:hover,
.cta__btn:focus-visible {
  background: rgba(243, 238, 233, 0.06);
  border-color: var(--ink);
  outline: none;
}

.cta__btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--ink);
  box-shadow:
    0 0 0 transparent,
    inset 0 0 24px rgba(0, 0, 0, 0.35);
  animation: pulse 3.4s ease-in-out infinite;
}

.cta__btn--primary:hover,
.cta__btn--primary:focus-visible {
  background: var(--red-bright);
  border-color: var(--red-bright);
  box-shadow:
    0 8px 36px var(--red-glow),
    inset 0 0 24px rgba(0, 0, 0, 0.20);
  transform: translateY(-1px);
  animation: none;
}

/* Heartbeat glow on the primary — slow, restrained */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 transparent, inset 0 0 24px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 0 28px var(--red-glow), inset 0 0 24px rgba(0, 0, 0, 0.20); }
}

.cta__btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  animation: none;
}

/* ---------- CREDITS ---------- */

.credits {
  margin-top: clamp(1rem, 3vh, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.credits__line {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.credits__name { color: var(--ink-dim); }
.credits__line--sub { color: var(--ink-faint); }

/* ---------- MOBILE ---------- */

@media (max-width: 720px) {
  .hero { padding: clamp(2.5rem, 7vh, 4rem) var(--pad-x); }

  .hero__content { gap: clamp(1.25rem, 3vh, 1.75rem); }

  .title {
    letter-spacing: 0.01em;
    text-shadow:
      0.6px 0 0 rgba(184, 36, 42, 0.45),
     -0.6px 0 0 rgba(111, 154, 157, 0.16),
      0 2px 20px rgba(0, 0, 0, 0.6);
  }

  .tagline { max-width: 28ch; }

  .cta { flex-direction: column; width: 100%; max-width: 22rem; gap: 0.6rem; }
  .cta__btn { width: 100%; min-width: 0; }
}

/* Very narrow phones — let the title wrap if needed */
@media (max-width: 380px) {
  .title { white-space: normal; line-height: 1.05; }
}

/* Short landscape — reduce vertical breathing so content fits */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { padding: 1.5rem var(--pad-x); }
  .hero__content { gap: 0.9rem; }
  .credits { margin-top: 0.5rem; }
}

/* Lighter grain on low-end devices to keep it smooth */
@media (max-width: 480px) {
  .hero__grain { opacity: 0.12; }
}

/* Respect reduced motion: pause grain, flicker, pulse, video */
@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
  .hero__grain { animation: none; }
  .title { animation: none; }
  .cta__btn--primary { animation: none; }
  .hero {
    background:
      linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.85)),
      url("assets/hero.jpg") center/cover no-repeat;
  }
}
