@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Layout: one full-bleed scene. Meta row sits on the sky, the brand on the
   middle rollers, the tagline on the front asphalt. */
:root {
  --sky-top: #7fa3c6;
  --sky-low: #e9e2d6;
  --asphalt: #16171a;
  --asphalt-60: rgb(22 23 26 / 0.6);
  --chalk: #fbf8f2;
  --chalk-75: rgb(251 248 242 / 0.75);
  --coral: #ff5b47;
  /* Scene colours at the top and bottom screen edges, for browser bars. */
  --edge-top: #98bee0;
  --edge-bottom: #1f2023;

  --font-display: "Unbounded", "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --gutter: clamp(16px, 3.2vw, 44px);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

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

html,
body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

/* Browsers paint their bars and overscroll from these, so they match the
   asphalt at the bottom of the scene rather than a page colour. */
html {
  background-color: var(--edge-bottom);
}

body {
  background: var(--edge-bottom) linear-gradient(var(--sky-top), var(--sky-low) 45%) no-repeat;
  color: var(--chalk);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* Safari 26 colours its status bar and toolbar from fixed elements touching
   the screen edges and ignores theme-color. These strips sit behind the page,
   so nobody sees them, but Safari reads their colours. */
.edge-tint {
  position: fixed;
  left: 0;
  right: 0;
  z-index: -1;
  height: 2px;
  pointer-events: none;
}

.edge-tint-top {
  top: 0;
  background-color: var(--edge-top);
}

.edge-tint-bottom {
  bottom: 0;
  background-color: var(--edge-bottom);
}

.stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  min-height: 100svh;
  overflow: hidden;
  padding-top: max(var(--gutter), env(safe-area-inset-top, 0px));
  padding-bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Without WebGL2 the scene falls back to a still frame of itself. */
.no-gl .stage {
  background: var(--asphalt) url("../img/poster.jpg") center / cover no-repeat;
}

.scene,
.crew,
.rider {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  -webkit-touch-callout: none;
  user-select: none;
}

/* The BMX rider rides in front of the type, so jumps stay visible. */
.rider {
  z-index: 1;
  pointer-events: none;
}

.no-gl .scene,
.no-gl .crew,
.no-gl .rider {
  display: none;
}

/* Meta row ---------------------------------------------------------------- */

.meta dl {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0;
  color: var(--asphalt);
  font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.5rem);
  line-height: 1.3;
}

.meta div {
  display: grid;
  gap: 2px;
}

.meta div:nth-child(2) {
  text-align: center;
}

.meta div:nth-child(3) {
  text-align: right;
}

.meta dt {
  color: var(--asphalt-60);
  font-size: max(0.72em, 0.6875rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta dd {
  margin: 0;
  font-weight: 600;
}

/* Brand ------------------------------------------------------------------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 28px);
  padding-block: 24px;
  text-align: center;
}

.mark {
  width: clamp(76px, 9vw, 136px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 22px rgb(0 0 0 / 0.28));
}

.mark-track {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-rider {
  fill: var(--coral);
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1rem + 4.6vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow:
    0 1px 2px rgb(0 0 0 / 0.22),
    0 10px 48px rgb(0 0 0 / 0.38);
}

/* Tagline ----------------------------------------------------------------- */

.tagline {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.45);
}

.tagline p {
  margin: 0;
}

.tagline-lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.6rem);
  letter-spacing: -0.01em;
}

.tagline-sub {
  color: var(--chalk-75);
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 1rem);
  letter-spacing: 0.01em;
}

/* Phones ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .wordmark span {
    display: block;
  }

  .meta dl {
    gap: 8px 12px;
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  .brand {
    animation: brand-in 1.4s var(--ease-out) 0.9s both;
  }

  .mark-track {
    stroke-dasharray: 1;
    animation: track-draw 1.3s var(--ease-out) 1.1s both;
  }

  .mark-rider {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: rider-drop 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) 2s both;
  }

  .meta,
  .tagline {
    animation: fade-in 1.2s ease 1.6s both;
  }
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@keyframes track-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rider-drop {
  from {
    opacity: 0;
    transform: translateY(-60%) scale(0.6);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
