/* =========================================================
   WEAR A HELMET – Neo-brutalist one-pager
   Design tokens taken 1:1 from the Affinity flyers
   ========================================================= */

@font-face {
  font-family: "Lexend Mega";
  src: url("assets/fonts/LexendMega.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colors from the flyer SVGs */
  --red:   #FF4343;   /* rgb(255,67,67)  – "No helmet" flyer */
  --green: #107911;   /* rgb(16,121,17)  – "Thanks" flyer    */
  --gold:  #DBA926;   /* rgb(219,169,38) – badge / treat box */
  --black: #000;
  --white: #fff;

  /* Neo-brutalism tokens */
  --border: 3px solid var(--black);
  --radius: 12px;
  --shadow: 5px 5px 0 var(--black);
  --shadow-lg: 8px 8px 0 var(--black);

  --font: "Lexend Mega", system-ui, sans-serif;
  --pad: clamp(20px, 5.5vw, 48px);
  --max: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--black);
  background: var(--black);
  letter-spacing: -0.01em;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; box-shadow: 0 0 0 6px var(--white); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); position: relative; }

/* ---------- Black bars (top / bottom, like the flyer) ---------- */
.bar {
  background: var(--black);
  color: var(--white);
  font-weight: 300;
  letter-spacing: 0.04em;
  overflow: hidden;
  white-space: nowrap;
}
.topbar { position: sticky; top: 0; z-index: 10; }
.bar--top { font-size: 11px; padding: 7px 0; letter-spacing: 0.08em; }
.bar--inline { font-size: 11px; padding: 7px 0; letter-spacing: 0.08em; margin-bottom: 40px; }
.bar--bottom { text-align: center; font-size: 14px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); }
.bar--bottom a { text-decoration: none; }

.marquee { display: inline-flex; animation: marquee 22s linear infinite; }
.marquee--reverse { animation-direction: reverse; }
.marquee span { padding-right: 0.5em; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0 64px; position: relative; overflow: hidden; overflow: clip; }
.section--red   { background: var(--red); }
.section--green { background: var(--green); padding-top: 0; }
.section--gold  { background: var(--gold); border-top: var(--border); border-bottom: var(--border); }
.section--black { background: var(--black); color: var(--white); }
.section--red + .section--red { padding-top: 8px; }

/* ---------- Typography ---------- */
.display {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(32px, 12.4vw, 92px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  margin: 0 0 28px;
}
.display--md { font-size: clamp(24px, 7.4vw, 56px); line-height: 1.1; }
.display--white { color: var(--white); }

.label {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  margin: 0 0 28px;
}

.lead { font-size: 16px; max-width: 34em; margin: 0 0 28px; }
.lead--white { color: var(--white); }

.big {
  font-weight: 900;
  font-size: clamp(44px, 14vw, 96px);
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}
.src { font-size: 12px; margin: 12px 0 0; opacity: .85; }
.src--dark { opacity: 1; }
.note { font-weight: 700; font-size: 14px; margin: 28px 0 0; }

/* ---------- Hero ---------- */
.hero { padding-top: 40px; }
.hero__helmet {
  width: min(42vw, 260px);
  margin: 0 0 8px auto;
  transform: rotate(0deg);
}
.hero__helmet--green { margin-top: 0; }

/* the tilted white box "YOUR LIFE." */
.tilt-box {
  display: block;
  margin: 8px -6px 44px;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  transform: rotate(-8deg) skewX(-2deg);
  padding: 18px 18px 22px;
  text-align: center;
}
.tilt-box span {
  display: inline-block;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(26px, 9.2vw, 72px);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- Buttons (neobrutalism.dev behaviour) ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: var(--border);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.btn--white { background: var(--white); color: var(--black); }
.btn:hover { transform: translate(5px, 5px); box-shadow: none; }
.btn:active { transform: translate(5px, 5px); box-shadow: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  margin: 0 0 24px;
}
.card p { margin: 0; }
.card--tilt-l { --base-rot: -0.6deg; }
.card--tilt-r { --base-rot: 0.6deg; }

/* stat strip in "how" section */
.stat-strip {
  background: var(--black);
  color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--white);
  padding: 22px;
  margin: 0 0 36px;
}
.stat-strip p { margin: 0; }
.stat-strip .big { color: var(--gold); }

/* numbered steps */
.steps { list-style: none; padding: 0; margin: 0; }
.steps .card { position: relative; padding-top: 30px; margin-top: 28px; }
.steps h3 { font-weight: 800; font-size: 17px; line-height: 1.3; margin: 0 0 10px; text-transform: uppercase; }
.num {
  position: absolute;
  top: -22px; left: 18px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--red);
  border: var(--border);
  border-radius: 50%;
  font-weight: 900;
  font-size: 20px;
}

/* ---------- Videos (2-click facade) ---------- */
.videos { display: grid; gap: 32px; }
.video { margin: 0; }
.video__facade {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(-45deg, #111 0 14px, #1c1c1c 14px 28px);
  color: var(--white);
  border: 3px solid var(--white);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--red);
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}
.video__facade:hover { transform: translate(5px, 5px); box-shadow: none; }
.video__play {
  width: 76px; height: 76px;
  background: var(--red);
  border: 3px solid var(--black);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--black);
  position: relative;
}
.video__play::after {
  content: "";
  position: absolute;
  left: 29px; top: 21px;
  border-style: solid;
  border-width: 15px 0 15px 24px;
  border-color: transparent transparent transparent var(--black);
}
.video__hint {
  position: absolute;
  bottom: 12px; left: 12px;
  background: var(--white);
  color: var(--black);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}
.video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--white);
  border-radius: var(--radius);
  display: block;
}
.video figcaption { margin-top: 14px; font-size: 13px; line-height: 1.5; }
.video figcaption strong { display: block; font-size: 15px; font-weight: 700; }
.video figcaption span { opacity: .8; }
.privacy-note { font-size: 12px; opacity: .8; margin: 32px 0 0; }

/* ---------- FAQ / Myths ---------- */
.faq {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  padding: 18px 56px 18px 18px;
  position: relative;
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 12px; top: calc(50% - 16px);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--gold);
  border: 3px solid var(--black);
  border-radius: 50%;
  font-weight: 900;
}

.faq[open] summary { border-bottom: var(--border); }
.faq p { margin: 0; padding: 16px 18px 0; }
.faq p:last-child { padding-bottom: 18px; }
.faq .src { padding-top: 8px; }

/* ---------- Fit 2-2-2 ---------- */
.fit-grid { display: grid; gap: 8px; }
.fit { padding-top: 26px; position: relative; margin-top: 18px; }
.fit__tag {
  position: absolute;
  top: -18px; left: 16px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  transform: rotate(-3deg);
}

/* ---------- Green "thanks" section ---------- */
.section--green .display { margin-top: 8px; }
.claim {
  font-weight: 900;
  font-size: clamp(22px, 6.4vw, 40px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-align: right;
  margin: 36px 0 0;
}

/* ---------- Footer ---------- */
.footer { background: var(--black); color: var(--white); padding-top: 40px; }
.sources ol { font-size: 12px; line-height: 1.6; padding-left: 20px; margin: 0 0 24px; }
.sources li { margin-bottom: 10px; }
.footer__project { font-size: 12px; opacity: .8; margin: 16px 0; }
.footer__links { display: flex; gap: 24px; font-size: 13px; padding-bottom: 28px; }
.footer__links a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  body { font-size: 16px; }
  .hero__helmet { width: 240px; margin-bottom: -8px; }
  .tilt-box { margin: 16px 0 56px; }
  .fit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .steps .card { margin-top: 28px; }
}

.nowrap { white-space: nowrap; }


/* =========================================================
   SCROLL EXPERIENCE
   Hidden start states only apply when JS runs (.js) and the
   user has not asked for reduced motion.
   ========================================================= */

/* progress bar under the top marquee */
.progress { position: relative; height: 30px; background: var(--black); border-bottom: var(--border); }
.progress__fill { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; width: 100%; background: var(--gold); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.progress__bike { position: absolute; bottom: 4px; left: 4px; width: 38px; height: auto; transform: translateX(calc(var(--p, 0) * (100vw - 46px))); }
.progress__bike .wheel { transform: rotate(var(--wheel, 0deg)); }

/* top band scrolls at a constant speed, other bands stay still */
.marquee { animation: none; }
.bar--top .marquee { animation: marquee 40s linear infinite; }
@media (prefers-reduced-motion: reduce) { .bar--top .marquee { animation: none; } }

.scroll-hint {
  font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  margin: 40px 0 0; animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* stacked sticky fact cards */
.stack__card { position: sticky; top: calc(72px + var(--i) * 16px); transform-origin: 50% 0; }
.stack__card + .stack__card { margin-top: 28px; }
.stack { padding-bottom: 12vh; }

@media (prefers-reduced-motion: no-preference) {
  /* hero entrance */
  .js .hero__title .line { display: block; overflow: hidden; }
  .js .hero__title .line > span { display: inline-block; transform: translateY(105%); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
  .js .hero.is-in .hero__title .line > span { transform: none; }
  .js .hero.is-in .hero__title .line:nth-child(2) > span { transition-delay: .08s; }
  .js .hero.is-in .hero__title .line:nth-child(3) > span { transition-delay: .16s; }
  .js .hero.is-in .hero__title .line:nth-child(4) > span { transition-delay: .24s; }

  .js .tilt-box { opacity: 0; transform: rotate(-8deg) skewX(-2deg) scale(1.6); }
  .js .hero.is-in .tilt-box { animation: stamp .45s .55s cubic-bezier(.3,1.6,.5,1) forwards; }
  @keyframes stamp {
    0%   { opacity: 0; transform: rotate(-14deg) skewX(-2deg) scale(1.6); }
    100% { opacity: 1; transform: rotate(-8deg) skewX(-2deg) scale(1); }
  }

  .js .hero .hero__helmet { opacity: 0; translate: 0 -120px; transition: opacity .3s, translate .8s cubic-bezier(.3,1.5,.5,1); }
  .js .hero.is-in .hero__helmet { opacity: 1; translate: 0 0; }

  .js .hero__lead, .js .hero__cta, .js .scroll-hint { opacity: 0; translate: 0 20px; transition: opacity .5s ease .85s, translate .5s ease .85s; }
  .js .hero.is-in .hero__lead, .js .hero.is-in .hero__cta, .js .hero.is-in .scroll-hint { opacity: 1; translate: 0 0; }
  .js .hero.is-in .hero__cta { transition-delay: .95s; }

  /* generic reveals */
  .js [data-reveal] {
    opacity: 0;
    translate: 0 40px;
    transition: opacity .55s ease, translate .65s cubic-bezier(.2,.8,.2,1), scale .5s cubic-bezier(.3,1.5,.5,1);
    transition-delay: calc(var(--d, 0) * 110ms);
  }
  .js [data-reveal="left"]  { translate: -60px 0; }
  .js [data-reveal="right"] { translate: 60px 0; }
  .js [data-reveal="pop"]   { translate: 0 20px; scale: .85; }
  .js [data-reveal="drop"]  { translate: 0 -160px; transition-timing-function: ease, cubic-bezier(.3,1.6,.5,1); }
  .js [data-reveal].is-in   { opacity: 1; translate: 0 0; scale: 1; }

  /* number badges spin in */
  .js .steps .num { transition: rotate .6s cubic-bezier(.3,1.5,.5,1) .2s; }
  .js .steps [data-reveal]:not(.is-in) .num { rotate: -200deg; }

  /* stacked cards shrink slightly as the next one covers them */
  .stack__card { transition: scale .2s linear, filter .2s linear; }
  .stack__card.is-covered { scale: .94; filter: brightness(.92); }
}

/* ---------- Legal pages ---------- */
.legal { background: var(--white); padding: 40px 0 64px; }
.legal h1 { font-weight: 900; text-transform: uppercase; font-size: clamp(28px, 9vw, 56px); line-height: 1.05; margin: 0 0 8px; }
.legal h2 { font-weight: 800; text-transform: uppercase; font-size: 16px; letter-spacing: .03em; margin: 36px 0 10px; }
.legal h3 { font-weight: 700; font-size: 15px; margin: 24px 0 8px; }
.legal p, .legal li { font-size: 14px; line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal .card { margin-top: 24px; }
.legal .todo { background: var(--gold); padding: 0 4px; }
.back { display: inline-block; margin: 0 0 28px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Video extras ---------- */
.video__yt { display: inline-block; margin-top: 8px; font-weight: 700; font-size: 13px; }
.video__facade--de::before {
  content: "DE"; position: absolute; top: 12px; right: 12px;
  background: var(--gold); color: var(--black); border: 2px solid var(--black);
  font-weight: 900; font-size: 11px; padding: 2px 6px;
}

/* ---------- Visible sources ---------- */
.sources__title { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 15px; margin: 0 0 12px; }
.sources a { font-weight: 700; word-break: break-word; }


/* ---------- Card motion ---------- */
.card {
  rotate: calc(var(--base-rot, 0deg) + var(--tilt, 0deg));
  transition: translate .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.card:active, .card:hover { translate: 3px 3px; box-shadow: 2px 2px 0 var(--black); }
@media (hover: none) { .card:hover:not(:active) { translate: 0 0; box-shadow: var(--shadow); } }

/* ---------- Numbered references ---------- */
.ref { font-weight: 700; color: inherit; padding: 6px 2px; }
.sources li { scroll-margin-top: 80px; padding: 6px 8px; margin-left: -8px; transition: background .4s; }
.sources li.is-flash { background: var(--gold); color: var(--black); }
.sources li.is-flash a { color: var(--black); }
.sources li { transition: background .6s ease, color .6s ease; }


/* ---------- "But…" cards: tilt on scroll, press, pop open ---------- */
.faq {
  transition: translate .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.faq summary:active { background: #f3f3f3; }
.faq:has(summary:active) { translate: 4px 4px; box-shadow: 1px 1px 0 var(--black); }
.faq summary::after { transition: rotate .3s cubic-bezier(.3,1.6,.5,1), background .2s; }
.faq[open] summary::after { rotate: 45deg; background: var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .faq[open] { animation: faq-pop .45s cubic-bezier(.3,1.6,.5,1); }
  .faq[open] > p { animation: faq-in .35s ease both; }
  .faq[open] > p + p { animation-delay: .06s; }
  @keyframes faq-pop {
    0%   { scale: 1; }
    35%  { scale: 1.03; }
    100% { scale: 1; }
  }
  @keyframes faq-in { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
}

.faq summary:focus-visible { outline: 3px solid var(--black); outline-offset: -6px; box-shadow: none; border-radius: 8px; }
