/* ==========================================================================
   Hero + intro-animatie ("de opslag")
   Tijdlijn intro: bal valt (0,15 tot 0,72 s), raakt de netband, stuit, wordt geserveerd
   (1,2 tot 1,55 s); het scherm klapt open langs de band (1,35 tot 2,1 s); daarna knalt de
   kop binnen. Alleen transform/opacity. Zonder .intro-pending (herhaalbezoek, minder beweging,
   directe link) is er geen overlay.
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + var(--space-l));
  padding-bottom: 5.5rem;
  overflow: hidden;
  background: var(--night-950);
}

main > .hero {
  padding-block: calc(var(--header-h) + var(--space-l)) 5.5rem;
}

.hero__media,
.hero__media img {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.hero__media img {
  object-fit: cover;
  object-position: 60% 30%;
  animation: hero-zoom 14s var(--ease-out-quart) both;
}

@keyframes hero-zoom {
  from {
    transform: scale(1.08);
  }
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    /* Linksboven hangt een reclameposter in de hal: die blijft in het donker */
    radial-gradient(ellipse 38% 50% at 10% 8%, rgb(4 12 32 / 0.9), rgb(4 12 32 / 0) 100%),
    linear-gradient(90deg, rgb(4 12 32 / 0.92) 0%, rgb(4 12 32 / 0.74) 32%, rgb(4 12 32 / 0.28) 62%, rgb(4 12 32 / 0.12) 100%),
    linear-gradient(0deg, rgb(4 12 32 / 0.95) 0%, rgb(4 12 32 / 0.2) 42%, rgb(4 12 32 / 0) 60%);
}

/* Lijnen van de sporthalvloer als motief, rechtsonder */
.hero__lines {
  position: absolute;
  inset: auto -10% -6% 40%;
  z-index: -1;
  height: 70%;
  background:
    linear-gradient(162deg, transparent 49.6%, rgb(226 73 66 / 0.55) 49.6%, rgb(226 73 66 / 0.55) 50%, transparent 50%),
    linear-gradient(170deg, transparent 58.7%, rgb(48 114 208 / 0.55) 58.7%, rgb(48 114 208 / 0.55) 59.1%, transparent 59.1%),
    linear-gradient(176deg, transparent 69.6%, rgb(244 205 75 / 0.5) 69.6%, rgb(244 205 75 / 0.5) 70%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  grid-template-areas:
    "kicker kicker"
    "title title"
    "lead board"
    "cta board";
  column-gap: var(--space-2xl);
  align-items: end;
}

.hero__kicker {
  grid-area: kicker;
  margin-bottom: var(--space-s);
  color: var(--petrol-200);
}

.hero__title {
  grid-area: title;
  margin-bottom: clamp(1rem, 2.5vw, 2rem);
  /* Breedte bepaalt op telefoons, hoogte op lage desktopschermen */
  font-size: clamp(2.6rem, min(14.2vw, 18.5vh), 12rem);
  font-stretch: 70%;
  color: var(--white);
}

.hero__word {
  display: inline-block;
}

.hero__word--2 {
  margin-left: 0.12em;
  font-size: 0.32em;
  font-stretch: 100%;
  color: var(--lime-400);
  vertical-align: 0.25em;
}

.hero__word--3 {
  display: block;
  color: var(--lime-400);
}

.hero__lead {
  grid-area: lead;
  max-width: 34rem;
  margin-bottom: var(--space-l);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.45;
  color: rgb(250 252 254 / 0.9);
}

.hero__cta {
  grid-area: cta;
}

/* --- Scorebord --------------------------------------------------------- */

.scoreboard {
  grid-area: board;
  align-self: end;
  padding: var(--space-m);
  border-radius: var(--radius-m);
  background: rgb(4 12 32 / 0.82);
  border: 1px solid rgb(127 203 222 / 0.22);
  box-shadow: inset 0 3px 0 var(--lime-400);
}

.scoreboard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--space-s);
  margin-bottom: var(--space-xs);
}

.scoreboard__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 110%;
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--petrol-300);
}

.scoreboard__when {
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--white);
}

.scoreboard__digits {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-family: var(--font-display);
  color: var(--lime-400);
}

.scoreboard__unit {
  display: grid;
  justify-items: center;
  min-width: 2.4ch;
}

.scoreboard__unit b {
  font-weight: 800;
  font-stretch: 62%;
  font-size: var(--step-4);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.scoreboard__unit small {
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--petrol-200);
}

.scoreboard__sep {
  font-weight: 700;
  font-size: var(--step-3);
  line-height: 1.1;
  color: rgb(198 246 72 / 0.45);
}

.scoreboard__live {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 80%;
  font-size: var(--step-3);
  line-height: 1;
  text-transform: uppercase;
  color: var(--white);
}

.scoreboard.is-live {
  box-shadow: inset 0 3px 0 var(--signal);
}

.scoreboard.is-live .scoreboard__digits {
  display: none;
}

.live-dot {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse 1.6s var(--ease-out-quart) infinite;
}

.scoreboard__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  margin-top: var(--space-2xs);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--petrol-200);
  text-decoration: none;
}

.scoreboard__link:hover {
  color: var(--lime-400);
}

.scoreboard__link .icon {
  width: 1em;
  height: 1em;
}

/* --- Lichtkrant onderaan de hero -------------------------------------- */

.hero__ribbon {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 1.4rem;
  padding-block: 0.55rem;
  background: var(--lime-400);
  color: var(--night-900);
  transform: rotate(-1.6deg);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-stretch: 78%;
  font-size: var(--step-1);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.hero__ribbon .marquee__item svg {
  width: 1.05em;
  height: 1.05em;
}

/* --- Binnenkomst van de hero-inhoud ----------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
}

@keyframes slam {
  0% {
    opacity: 0;
    transform: translateY(0.25em) skewX(-14deg) scale(1.12);
  }
  60% {
    opacity: 1;
  }
}

@keyframes ribbon-in {
  from {
    transform: translateX(30%) rotate(-1.6deg);
    opacity: 0;
  }
}

/* Gewone paginalading (geen intro): korte, rustige binnenkomst */
.js .hero__word {
  animation: slam 0.9s var(--ease-out-expo) both;
}

.js .hero__word--2 { animation-delay: 0.08s; }
.js .hero__word--3 { animation-delay: 0.14s; }

.js .hero__lead,
.js .hero__cta,
.js .scoreboard {
  animation: rise 0.9s var(--ease-out-expo) 0.2s both;
}

/* Met intro: alles wacht tot het scherm open is */
.intro-pending .hero__kicker { animation: rise 0.8s var(--ease-out-expo) 1.55s both; }
.intro-pending .hero__word--1 { animation: slam 0.9s var(--ease-out-expo) 1.6s both; }
.intro-pending .hero__word--2 { animation: slam 0.9s var(--ease-out-expo) 1.72s both; }
.intro-pending .hero__word--3 { animation: slam 0.9s var(--ease-out-expo) 1.8s both; }
.intro-pending .hero__lead { animation: rise 0.9s var(--ease-out-expo) 1.95s both; }
.intro-pending .hero__cta { animation: rise 0.9s var(--ease-out-expo) 2.05s both; }
.intro-pending .scoreboard { animation: rise 0.9s var(--ease-out-expo) 2.15s both; }
.intro-pending .hero__ribbon { animation: ribbon-in 1.1s var(--ease-out-expo) 2.1s both; }
.intro-pending .hero__media img { animation: hero-zoom 3.2s var(--ease-out-quart) 1.35s both; }

/* --- Intro-overlay ----------------------------------------------------- */

.intro {
  display: none;
}

.intro-pending .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: var(--z-intro);
  overflow: hidden;
  cursor: pointer;
  animation: intro-done 0.01s linear 2.15s forwards;
}

@keyframes intro-done {
  to {
    visibility: hidden;
    pointer-events: none;
  }
}

.intro__half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background:
    radial-gradient(ellipse at 50% 100%, rgb(43 72 114 / 0.55), transparent 70%),
    var(--night-950);
  will-change: transform;
}

.intro__half--top {
  top: 0;
  animation: split-up 0.8s var(--ease-in-out) 1.35s forwards;
}

.intro__half--bottom {
  bottom: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgb(43 72 114 / 0.55), transparent 70%),
    var(--night-950);
  animation: split-down 0.8s var(--ease-in-out) 1.35s forwards;
}

@keyframes split-up {
  to {
    transform: translateY(-101%);
  }
}

@keyframes split-down {
  to {
    transform: translateY(101%);
  }
}

/* Netband: wordt getrokken op het moment dat de bal stuit */
.intro__tape {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 3px);
  height: 6px;
  background: var(--lime-400);
  transform: scaleX(0);
  animation:
    tape-draw 0.55s var(--ease-out-expo) 0.72s forwards,
    tape-fade 0.45s linear 1.45s forwards;
}

@keyframes tape-draw {
  to {
    transform: scaleX(1);
  }
}

@keyframes tape-fade {
  to {
    opacity: 0;
  }
}

.intro__ball {
  --size: clamp(4.5rem, 13vmin, 8rem);
  position: absolute;
  left: calc(50% - var(--size) / 2);
  top: calc(50% - 3px - var(--size));
  width: var(--size);
  height: var(--size);
  transform-origin: 50% 100%;
  animation: ball-serve 1.55s linear both;
  will-change: transform;
}

.intro__ball svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0.6rem 1.2rem rgb(0 0 0 / 0.45));
}

@keyframes ball-serve {
  0% {
    transform: translateY(-58vh) rotate(-40deg);
  }
  10% {
    transform: translateY(-58vh) rotate(-40deg);
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  46% {
    transform: translateY(0) rotate(40deg) scale(1);
    animation-timing-function: linear;
  }
  51% {
    transform: translateY(0) rotate(44deg) scale(1.22, 0.78);
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  }
  56% {
    transform: translateY(-2vh) rotate(60deg) scale(0.95, 1.06);
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  }
  76% {
    transform: translateY(-24vh) rotate(170deg) scale(1);
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  100% {
    transform: translate(58vw, -95vh) rotate(460deg) scale(0.45);
  }
}

/* Vliegspoor van de opslag */
.intro__streak {
  position: absolute;
  left: 50%;
  top: calc(50% - 24vh - 3rem);
  width: 70vmax;
  height: 3px;
  background: linear-gradient(90deg, rgb(198 246 72 / 0), var(--lime-400));
  transform-origin: 0 50%;
  transform: rotate(-52deg) scaleX(0);
  opacity: 0;
  animation: streak 0.55s var(--ease-out-expo) 1.2s forwards;
}

@keyframes streak {
  0% {
    opacity: 1;
    transform: rotate(-52deg) scaleX(0);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(-52deg) scaleX(1);
  }
}

.intro__skip {
  position: absolute;
  right: var(--gutter);
  bottom: max(var(--space-m), env(safe-area-inset-bottom));
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgb(250 252 254 / 0.3);
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgb(250 252 254 / 0.75);
  font-size: var(--step--1);
  animation: rise 0.5s var(--ease-out-expo) 0.3s both, tape-fade 0.3s linear 1.3s forwards;
}

/* Overslaan: direct naar de eindtoestand */
.intro-skip .intro {
  display: none !important;
}

.intro-skip .hero :is(.hero__kicker, .hero__word, .hero__lead, .hero__cta, .scoreboard, .hero__ribbon),
.intro-skip .hero__media img {
  animation: none !important;
}

/* --- Responsief -------------------------------------------------------- */

@media (max-width: 980px) {
  .hero__content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "kicker"
      "title"
      "lead"
      "cta"
      "board";
  }

  .scoreboard {
    justify-self: start;
    width: min(100%, 26rem);
    margin-top: var(--space-l);
  }

  .hero__shade {
    background:
      linear-gradient(90deg, rgb(4 12 32 / 0.85) 0%, rgb(4 12 32 / 0.55) 55%, rgb(4 12 32 / 0.2) 100%),
      linear-gradient(0deg, rgb(4 12 32 / 0.97) 0%, rgb(4 12 32 / 0.35) 55%, rgb(4 12 32 / 0) 75%);
  }
}

@media (max-width: 640px) {
  .hero {
    padding-bottom: 4.75rem;
  }

  main > .hero {
    padding-block: calc(var(--header-h) + var(--space-m)) 4.75rem;
  }

  .hero__media img {
    object-position: 50% 20%;
  }

  .hero__shade {
    background:
      linear-gradient(0deg, rgb(4 12 32 / 0.98) 0%, rgb(4 12 32 / 0.82) 38%, rgb(4 12 32 / 0.25) 62%, rgb(4 12 32 / 0.35) 100%);
  }

  .hero__lines {
    display: none;
  }

  .hero__lead {
    font-size: var(--step-0);
    margin-bottom: var(--space-m);
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .scoreboard {
    width: 100%;
    padding: var(--space-s);
  }

  .scoreboard__unit b {
    font-size: var(--step-3);
  }

  .hero__ribbon {
    bottom: 1rem;
    font-size: var(--step-0);
  }
}

@media (max-width: 420px) {
  .hero__kicker {
    font-size: var(--step--2);
  }

  .scoreboard__digits {
    gap: 0.2rem;
  }

  .scoreboard__sep {
    font-size: var(--step-2);
  }
}
