@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 500 800;
  font-display: swap;
  src: url(fonts/bricolage.woff2) format("woff2");
}
@font-face {
  font-family: Inter;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/inter.woff2) format("woff2");
}

:root {
  --ink: #0d1b2a;
  --ink-soft: #3d4d60;
  --glass: rgba(255, 255, 255, 0.8);
  --line: rgba(13, 27, 42, 0.12);
  --accent: #ff5a36; /* decoration only */
  --accent-strong: #d63c14; /* text and buttons: 4.6:1 on white */
  --gold: #ffd166;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 Inter, system-ui, sans-serif;
  color: var(--ink);
  /* Same colours as the 3D sky, so the page never flashes grey while it loads */
  background: linear-gradient(#3f78bf, #9fc0e3 45%, #fde9dc 75%, #fbf4ef);
  background-attachment: fixed;
}
a { color: inherit; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1s ease;
}
[data-scene="ready"] #scene { opacity: 1; }
.no-webgl #scene { display: none; }
/* Soft vignette: keeps the eye on the rider and the cards */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 60%, rgba(13, 27, 42, 0.16));
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  /* Frosted band so cards scrolling up never sit under the links */
  background: rgba(13, 27, 42, 0.32);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 1.15rem/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #fff;
}
.brand img { border-radius: 7px; }
.links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.links a {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s, color 0.2s;
}
.links a:hover, .links a:focus-visible { background: #fff; color: var(--ink); }
.progress { position: absolute; inset: auto 0 0 0; height: 3px; background: rgba(255, 255, 255, 0.15); }
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

.hud {
  position: fixed;
  right: clamp(12px, 3vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: grid;
  justify-items: end;
  gap: 18px;
  pointer-events: none;
}
.meter {
  display: grid;
  justify-items: end;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(13, 27, 42, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: 800 1rem/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.alt { color: #fff; }
.score { color: var(--gold); }
.score.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }
.no-webgl .score, .no-webgl .steer { display: none; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; pointer-events: auto; }
.rail a {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding: 2px 0;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(13, 27, 42, 0.7);
}
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity 0.2s, transform 0.2s; }
.rail a:hover span, .rail a:focus-visible span, .rail a.on span { opacity: 1; transform: none; }
.rail a i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.15);
  transition: background 0.2s, transform 0.2s;
}
.rail a.on i { background: var(--accent); border-color: var(--accent); transform: scale(1.35); }

main { position: relative; z-index: 2; }
.stop {
  min-height: 150vh;
  display: flex;
  align-items: center;
  padding: 110px clamp(16px, 6vw, 96px);
}
.stop:nth-child(even) { justify-content: flex-end; padding-right: clamp(16px, 9vw, 140px); }
.hero { min-height: 100vh; }

.card {
  width: min(470px, 100%);
  padding: clamp(22px, 3vw, 34px);
  border-radius: 24px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 80px -20px rgba(13, 27, 42, 0.35);
  opacity: 0.25;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.6s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card.in { opacity: 1; transform: none; }
.card.wide { width: min(780px, 100%); }
.no-webgl .card { opacity: 1; transform: none; }
/* Children rise in one after another when a card arrives */
.card > * { transition: opacity 0.5s, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card:not(.in) > * { opacity: 0; transform: translateY(10px); }
.card.in > :nth-child(2) { transition-delay: 0.05s; }
.card.in > :nth-child(3) { transition-delay: 0.1s; }
.card.in > :nth-child(4) { transition-delay: 0.15s; }
.card.in > :nth-child(n + 5) { transition-delay: 0.2s; }
.no-webgl .card > * { opacity: 1; transform: none; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #11603a;
  background: rgba(22, 163, 74, 0.12);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } }

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
h1, h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h1 em { font-style: normal; color: var(--accent-strong); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
p { margin: 0 0 14px; color: var(--ink-soft); text-wrap: pretty; }
.hint { display: flex; align-items: center; font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(4px); } }

.card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 6px 0 16px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -12px rgba(13, 27, 42, 0.45);
}
.facts { margin: 0 0 16px; padding: 0; list-style: none; color: var(--ink); font-size: 0.92rem; }
.facts li { position: relative; margin-bottom: 6px; padding-left: 22px; }
.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(-45deg);
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; }
.chips li {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(13, 27, 42, 0.06);
  border: 1px solid rgba(13, 27, 42, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px 8px 0;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent-strong);
  color: #fff;
  border: 2px solid var(--accent-strong);
  box-shadow: 0 8px 20px -8px rgba(214, 60, 20, 0.7);
  transition: transform 0.15s, box-shadow 0.15s;
}
/* Small arrow on links that open another site */
.btn[target]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(214, 60, 20, 0.8); }
.btn:hover::after { transform: translateX(2px) rotate(45deg); }
.btn.ghost { background: rgba(255, 255, 255, 0.6); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover, .btn.ghost:focus-visible { background: #fff; }
a:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.small { margin: 12px 0 0; font-size: 0.85rem; }
.small a { display: inline-block; padding: 8px 0; }
.foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.75rem; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.grid a {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 10px 10px 12px;
  border-radius: 16px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.grid a:hover, .grid a:focus-visible { transform: translateY(-4px); background: #fff; box-shadow: 0 16px 30px -14px rgba(13, 27, 42, 0.4); }
.grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  margin: 0 0 8px;
  box-shadow: none;
}
.grid span { font-size: 0.8rem; color: var(--ink-soft); }

@media (max-width: 720px) {
  .links a:not(:last-child) { display: none; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 24px; height: 24px; }
  /* Phones: altitude and stars as a small pill under the top band */
  .hud { top: 70px; right: 10px; transform: none; }
  .meter { display: flex; gap: 10px; padding: 7px 11px; border-radius: 999px; font-size: 0.85rem; }
  .rail { display: none; }
  .stop, .stop:nth-child(even) {
    min-height: 140vh;
    align-items: flex-end;
    justify-content: center;
    padding: 90px 14px 48px;
  }
  .hero { min-height: 100vh; }
  .card { background: rgba(255, 255, 255, 0.9); border-radius: 20px; }
  .facts { font-size: 0.88rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid a { padding: 8px 8px 10px; }
  .grid span { font-size: 0.74rem; line-height: 1.35; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card > *, .btn, .grid a, #scene { transition: none; }
  .key, .status i { animation: none; }
}
