:root {
  --yellow: #f6f23c;
  --ink: #111;
  --white: #fff;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: "Big Shoulders", system-ui, sans-serif;
  color: var(--ink);
  background: var(--yellow);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Desktop: everything is placed on a % grid of the frame, like the reference */
.hero {
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: var(--yellow);
  font-size: clamp(16px, 1.5vw, 24px);
  font-weight: 600;
}

/* Big crop like a matchday poster: head cut at the top, nose at ~58% x / 45% y.
   Sized by width so the face lands in the same spot on any desktop ratio. */
.hero__player {
  position: absolute;
  top: calc(45% - 59vw);
  left: -35vw;
  width: 150vw;
  height: auto;
  will-change: transform; /* own GPU layer: the big photo glides without repainting */
}

/* Logo sits on top of the player */
.hero__mark {
  position: absolute;
  z-index: 2;
  left: -1%;
  bottom: -2%;
  width: 49%;
  height: auto;
}

.hero__brand {
  position: absolute;
  z-index: 3;
  top: 4.5%;
  left: 4%;
  font-size: clamp(26px, 2.4vw, 40px);
  font-weight: 800;
  font-style: italic; /* Big Shoulders has no italic file; browser slants it */
  text-transform: uppercase;
  line-height: 1;
}

.hero__menu {
  position: absolute;
  z-index: 3;
  top: 4.5%;
  right: 4%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.hero__menu:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Entrance: JS adds .is-ready */
.reveal,
.hero__player,
.hero__mark {
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), translate .9s cubic-bezier(.2, .7, .2, 1);
}
.hero:not(.is-ready) .reveal { opacity: 0; translate: 0 24px; }
.hero:not(.is-ready) .hero__player { opacity: 0; translate: 0 60px; }
.hero:not(.is-ready) .hero__mark { opacity: 0; translate: -80px 0; }
.hero__player { transition-delay: .1s; }
.hero__mark { transition-delay: .3s; }

/* Mobile: header on top, player + logo anchored bottom */
@media (max-width: 768px) {
  .hero { height: auto; min-height: 100svh; padding: 20px 20px 0; display: flex; flex-direction: column; gap: 16px; font-size: 18px; }
  .hero__brand { position: static; }
  .hero__menu { top: 20px; right: 20px; }
  .hero__player { position: relative; order: 1; top: auto; left: auto; height: auto; width: 100%; max-width: 420px; margin: auto auto 0 -20px; }
  .hero__mark { width: 90%; left: -6%; bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero * { transition: none !important; }
}

/* 3D scrapbook (Three.js, inline module in index.html) */
.scrapbook {
  position: absolute;
  z-index: 3;
  right: 3%;
  bottom: 2%;
  width: clamp(170px, 20vw, 360px);
  aspect-ratio: 4 / 5;
  height: auto;
  cursor: pointer;
}
.hero:not(.is-ready) .scrapbook { opacity: 0; translate: 0 24px; }
.scrapbook { transition: opacity .9s cubic-bezier(.2, .7, .2, 1) .5s, translate .9s cubic-bezier(.2, .7, .2, 1) .5s; }

@media (max-width: 768px) {
  .scrapbook { width: 30vw; right: 8px; bottom: 8px; }
}

/* Cursor dither trail: back layer sits under the player, front layer over the white logo */
.dither { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dither--front { z-index: 2; }

/* Yellow + difference = black over the yellow bg, yellow over the dark hair (matchday-poster look) */
.hero__menu { color: var(--yellow); mix-blend-mode: difference; }
.hero__brand { color: var(--yellow); }

/* Huge RB8 running slowly behind everything, sized to fill the frame height */
.hero__bignum {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-weight: 900;
  font-size: 130vh;
  line-height: 0.8;
  letter-spacing: -0.01em;
  color: #ebe530; /* a shade off the bg yellow: present but quiet; white dither "+" still reads on it */
  pointer-events: none;
}

/* Two identical halves; sliding by -50% loops seamlessly */
.hero__bignum-track { display: flex; width: max-content; animation: bignum 90s linear infinite; will-change: transform; }
.hero__bignum-track span { white-space: pre; }
@keyframes bignum { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .hero__bignum-track { animation: none; }
}
