/* ===================================================================
   Hot Wheels "Superstar Speeders" — QR landing page
   Mobile-first. Plain CSS, no build step.
   Motion uses the independent transform properties (translate / rotate /
   scale) so entrance, tilt and press effects compose without conflict.
   =================================================================== */

/* Brand headline face — Barlow Condensed Black (SIL OFL build, self-hosted).
   Only the latin italic cut is shipped; it's all the display copy uses. */
@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url("../assets/fonts/barlow-condensed-black-italic.woff2") format("woff2");
}

:root {
  --hw-red:    #e72227;   /* brand red — fill for all three CTA buttons */
  --hw-red-dk: #8b1417;   /* deep red — inner-edge glow on the CTAs */
  --hw-yellow: #ffe600;   /* brand yellow — Pantone 7499 C */
  --hw-orange: #ef8317;   /* track orange — modal option icons */
  --hw-blue:   #2a65ac;   /* brand blue — focus outlines */
  --hw-cobalt: #1d6cb0;   /* backdrop flash-guard behind the rotating burst */
  --ink:       #10131a;
  --paper:     #ffffff;

  --shadow-hard: 6px 6px 0 var(--ink);
  --radius: 18px;
  --ease-pop: cubic-bezier(.2, .8, .2, 1);
}

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

html {
  height: 100%;
  background: var(--hw-cobalt);
  /* clip the fixed decorative layers (.rays is 200vmax wide) so they
     can't create a horizontal scrollbar — body's overflow-x:hidden does
     not clip position:fixed descendants. */
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--hw-cobalt);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- rotating burst backdrop ---------------------------------------- */
/* The speed-burst that rotates behind everything — a <canvas> painted once
   from layered JS gradients (js/main.js), no image asset. Painting to a
   canvas, rather than animating a live CSS conic-gradient, means the
   compositor simply rotates a static bitmap — cheap on every screen.
   js/main.js sets --bg-x / --bg-y to the exact hero centre so the burst
   lines up with the hero starburst, and --burst-scale to blow the 1400px
   canvas up just enough to cover the viewport at every rotation angle. */
.rays {
  position: fixed;
  top: var(--bg-y, 200px);
  left: var(--bg-x, 50%);
  width: 1400px;
  height: 1400px;
  translate: -50% -50%;
  scale: var(--burst-scale, 1.7);
  animation: spin 90s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* --- ambient motion layers (decorative, behind content) ------------- */
.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
/* occasional shooting stars — streak outward from the starburst centre */
.fx-streaks i {
  position: absolute;
  top: 90px; left: 50%;                 /* the starburst centre */
  width: 64px; height: 4px;
  margin-top: -2px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0)   0%,
    rgba(255, 236, 184, .6) 58%,
    #ffffff                 100%);
  box-shadow: 0 0 10px 2px rgba(255, 240, 210, .55);
  transform-origin: left center;
  opacity: 0;
  will-change: transform, opacity;
  animation: shootingStar var(--dur, 8s) var(--d, 0s) ease-out infinite;
}
/* angle / delay / cycle per streak — irregular so they feel random */
.fx-streaks i:nth-child(1) { --a: 22deg;  --d: 0s;   --dur: 7s;   }
.fx-streaks i:nth-child(2) { --a: 58deg;  --d: 2.7s; --dur: 8.5s; }
.fx-streaks i:nth-child(3) { --a: 95deg;  --d: 5.1s; --dur: 6.5s; }
.fx-streaks i:nth-child(4) { --a: 128deg; --d: 1.4s; --dur: 9s;   }
.fx-streaks i:nth-child(5) { --a: 158deg; --d: 3.8s; --dur: 7.5s; }

.page {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 7px 18px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* --- optional fake iOS status bar (screenshot mode, ?ios) ----------- */
.ios-statusbar {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 30px 0 34px;
  background: #000;
  color: #ffffff;
}
.ios-statusbar[hidden] { display: none; }
.ios-time {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ios-battery { display: flex; align-items: center; }

/* --- top banner ----------------------------------------------------- */
.status-strip {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  height: env(safe-area-inset-top);   /* 0 on phones with no notch inset */
  background: #000;
}
.hero-banner {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  background: #000;                   /* flash guard before image paints */
  line-height: 0;                     /* drop the inline-img descender gap */
  overflow: hidden;                   /* crops the image + breathe overscale */
  /* full-bleed on mobile: just a bottom underline so the hero doesn't
     look framed on all sides — the full border returns on desktop */
  border-bottom: 4px solid var(--ink);
}
.hero-banner-img {
  display: block;
  width: 100%;                        /* full viewport width, scales up */
  height: auto;
  margin: -20px 0;                    /* crop 20px off the top + bottom */
  will-change: transform;
  animation:
    bannerIn .6s .05s var(--ease-pop) both,
    breathe 7s 1s ease-in-out infinite;
}
/* Past the 480px mobile column the full-bleed hero would stretch huge, so
   it floats as a card instead — hard black offset shadow for depth and
   softened 20px corners. (Full-bleed on phones stays square: the screen
   bezel rounds it and squaring avoids a corner gap.) Breakpoint = the
   .page width so the hero never out-runs the centred column (covers
   desktop, tablets and unfolded foldables — every phone is under 480px). */
@media (min-width: 481px) {
  .hero-banner {
    max-width: 444px;
    margin: 18px auto 0;
    border: 4px solid var(--ink);
    border-radius: 20px;
    box-shadow: var(--shadow-hard);
  }
}

/* --- intro copy ----------------------------------------------------- */
.intro {
  text-align: center;
  padding: 11px 4px 18px;
}
.headline {
  font-family: "Barlow Condensed", "Arial Black", "Helvetica Neue", Impact, sans-serif;
  font-weight: 900;
  font-size: clamp(34px, 10.6vw, 50px);
  line-height: 1.04;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: .035em;
  color: #ffffff;
  /* hard dark drop-shadow so the white headline pops off the blue burst */
  text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 rgba(0, 0, 0, .35);
  rotate: -2deg;
  animation: headlinePop .55s .2s var(--ease-pop) both;
}
.subhead {
  margin: 12px auto 0;
  max-width: 21em;
  font-size: 15px;
  line-height: 1.45;
  /* white + shadow — reads cleanly over the bright rotating burst */
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  animation: fadeUp .5s .34s ease-out both;
}

/* --- CTA cards ------------------------------------------------------ */
.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 18px 13px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard), inset 0 0 16px var(--hw-red-dk);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--paper);
  background: var(--hw-red);          /* all three CTAs share the brand red */
  rotate: -0.8deg;                    /* slight resting tilt — Hot Wheels look */
  --lift: -6px;                       /* zero-gravity float distance — tunable */
  animation:
    ctaRise .5s var(--ease-pop) both,
    var(--float) 13s ease-in-out infinite;
  transition:
    box-shadow .11s ease-out,
    scale .14s cubic-bezier(.34, 1.4, .64, 1),
    translate .11s ease-out;
}
.cta:active {
  scale: .96;
  box-shadow: 1px 1px 0 var(--ink), inset 0 0 16px var(--hw-red-dk);
  translate: 4px 4px;
}
.cta:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 3px;
}

/* All three CTAs share the track-orange fill (set on .cta). --float picks
   the per-card keyframe carrying the 1>2>3 / 3>2>1 float stagger. */
.cta--shop   { --float: float1; animation-delay: .40s, 0s; }
.cta--remind { --float: float2; animation-delay: .50s, 0s; }
.cta--share  { --float: float3; animation-delay: .60s, 0s; }

.cta-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--paper);                 /* white fill */
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);          /* hard shadow, like the buttons */
  color: var(--ink);                        /* black icon symbol */
}

.cta-text { flex: 1 1 auto; min-width: 0; }
.cta-title {
  display: block;
  font-family: "Barlow Condensed", "Arial Black", "Helvetica Neue", Impact, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 8vw, 29px);
  font-style: italic;
  line-height: 1;
  letter-spacing: .06em;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 rgba(0, 0, 0, .35);
}
.cta-sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
/* --- footer --------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 12px;
  /* white + shadow — the old muted grey washed out on the bright burst */
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  line-height: 1.5;
}
.site-footer .legal { margin-top: 6px; font-size: 11px; opacity: .85; }

/* --- toast ---------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 20;
  /* size to the message on one line; max-width is just an overflow guard.
     Without width:max-content a fixed + left:50% box shrink-fits to ~50vw
     and wraps. */
  width: max-content;
  max-width: 88vw;
  padding: 13px 20px;
  background: var(--hw-red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  animation: toastIn .25s var(--ease-pop) both;
}
.toast[hidden] { display: none; }

/* --- calendar modal ------------------------------------------------- */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 22, .74);
  animation: fadeIn .2s ease both;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 24px 20px 22px;
  animation: modalPop .3s var(--ease-pop) both;
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  color: var(--ink);
  background: var(--hw-yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .1s ease;
}
.modal-close:active { scale: .9; }
.modal-close:focus-visible { outline: 3px solid var(--hw-blue); outline-offset: 2px; }

.modal-title {
  font-family: "Barlow Condensed", "Arial Black", "Helvetica Neue", Impact, sans-serif;
  font-weight: 900;
  font-size: 25px;
  font-style: italic;
  text-transform: uppercase;
  color: var(--hw-red);
  padding-right: 36px;
}
.modal-sub {
  font-size: 14px;
  color: #45506b;
  margin: 7px 0 18px;
  line-height: 1.4;
}

.cal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: #f1f4fa;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .1s ease, box-shadow .1s ease, translate .1s ease;
}
.cal-option:active {
  scale: .97;
  box-shadow: 1px 1px 0 var(--ink);
  translate: 2px 2px;
}
.cal-option:focus-visible { outline: 3px solid var(--hw-blue); outline-offset: 2px; }

.cal-option-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 11px;
}
/* calendar modal icons are orange; share modal icons are blue */
.cal-ic--apple, .cal-ic--google, .cal-ic--outlook {
  background: var(--hw-orange);
}
.share-ic--text, .share-ic--email, .share-ic--copy {
  background: var(--hw-blue);
}

.cal-option-tx { flex: 1 1 auto; min-width: 0; }
.cal-option-tx strong { display: block; font-size: 16px; font-weight: 800; }
.cal-option-tx small  { display: block; font-size: 12px; color: #5a647d; margin-top: 2px; }

/* --- keyframes ------------------------------------------------------ */
@keyframes spin       { to   { rotate: 360deg; } }
@keyframes bannerIn   { from { opacity: 0; } }
@keyframes breathe    { 50%  { scale: 1.02; } }
@keyframes headlinePop{ from { opacity: 0; scale: .8; translate: 0 12px; } }
@keyframes fadeUp     { from { opacity: 0; translate: 0 10px; } }
@keyframes ctaRise    { from { opacity: 0; translate: 0 28px; } }
@keyframes toastIn    { from { opacity: 0; translate: -50% 14px; } }
@keyframes fadeIn     { from { opacity: 0; } }
@keyframes modalPop   { from { opacity: 0; scale: .86; translate: 0 12px; } }

/* zero-gravity float — cards drift up in sequence (1>2>3), pause 5s fully
   up, drift back down in reverse (3>2>1), pause 5s fully down. 13s loop:
   ~1.5s staggered sweeps bracketed by two 5s pauses. Each card travels ~1s
   (a slow, suspended drift). Per-card keyframes because the up/down orders
   are mirrored. Animates transform so it never fights ctaRise. */
@keyframes float1 {
  0%    { transform: translateY(0); }
  7.7%  { transform: translateY(var(--lift)); }
  53.8% { transform: translateY(var(--lift)); }
  61.5% { transform: translateY(0); }
  100%  { transform: translateY(0); }
}
@keyframes float2 {
  0%, 1.9% { transform: translateY(0); }
  9.6%     { transform: translateY(var(--lift)); }
  51.9%    { transform: translateY(var(--lift)); }
  59.6%    { transform: translateY(0); }
  100%     { transform: translateY(0); }
}
@keyframes float3 {
  0%, 3.8% { transform: translateY(0); }
  11.5%    { transform: translateY(var(--lift)); }
  50%      { transform: translateY(var(--lift)); }
  57.7%    { transform: translateY(0); }
  100%     { transform: translateY(0); }
}
/* shooting star: brief shoot near the cycle start, then idle until the
   long cycle loops — staggered durations make them feel random */
@keyframes shootingStar {
  0%   { opacity: 0; transform: rotate(var(--a)) translateX(10px)  scaleX(.15); }
  2%   { opacity: 1; }
  13%  { opacity: 0; transform: rotate(var(--a)) translateX(370px) scaleX(2.6); }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(370px) scaleX(2.6); }
}

/* --- reduced motion: keep it calm ----------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rays { animation: none; }
  .fx { display: none; }
  .hero-banner-img { animation: none !important; }
  .headline, .subhead, .toast,
  .modal-backdrop, .modal-card {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .cta {
    animation: none !important;
    transition: none;
  }
}
