/* Layout: a fixed film layer (video on desktop, still on phones) behind the opening screen, a
   fixed WebGL field that takes over while scrolling, and a vertical story of five short stops.
   Fentix orange is the only accent. */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/schibsted-grotesk.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/plex-mono-500.woff2') format('woff2');
}

:root {
  --bg: #07080c;
  --fg: #f4f5f7;
  --fg-muted: #9aa3b2;
  --fg-faint: #5b6473;
  --rule: rgba(255, 255, 255, 0.1);
  --accent: #ff7a1a;
  --accent-hi: #ffa45c;
  --font-display: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Cascadia Mono', Consolas, monospace;
  --gutter: max(1.5rem, env(safe-area-inset-left, 0px));
  --gutter-r: max(1.5rem, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Film */
.film {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.film img,
.film video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The source carries its own black bars; the scale pushes them out of view. */
  transform: translate(-50%, -50%) scale(1.24);
}

.film video {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.film video.is-on {
  opacity: 1;
}

/* Field */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  opacity: 0;
}

.no-gl .scene {
  display: none;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(7, 8, 12, 0.88) 0%,
      rgba(7, 8, 12, 0.55) 40%,
      rgba(7, 8, 12, 0.2) 75%,
      rgba(7, 8, 12, 0.45) 100%
    ),
    linear-gradient(
      180deg,
      rgba(7, 8, 12, 0.7) 0%,
      rgba(7, 8, 12, 0) 26%,
      rgba(7, 8, 12, 0) 70%,
      rgba(7, 8, 12, 0.9) 100%
    ),
    radial-gradient(55% 45% at 18% 100%, rgba(255, 122, 26, 0.16), transparent 70%);
}

/* Chrome */
.bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

.status::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1px;
  background: var(--accent);
}

/* Story */
.story {
  position: relative;
  z-index: 3;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.stop {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 1.4rem;
  max-width: 72rem;
  margin-inline: auto;
  padding-block: 6rem;
  will-change: opacity, transform;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hi);
}

h1,
.stop h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.96;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 9.5vw, 7.6rem);
  max-width: 11ch;
}

.stop h2 {
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  max-width: 13ch;
}

.dot {
  color: var(--accent);
}

.sub {
  margin: 0;
  max-width: 30rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--fg-muted);
}

.hero {
  position: relative;
}

.hero .sub {
  margin-top: 0.4rem;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 2.2rem;
  width: 1px;
  height: 3.5rem;
  background: linear-gradient(180deg, var(--accent), transparent);
  transform-origin: top;
  animation: hint 2.2s ease-in-out infinite;
}

@keyframes hint {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  35% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1) translateY(1.5rem);
    opacity: 0;
  }
}

/* Close */
.close {
  gap: 2rem;
}

.close .sub {
  max-width: 34rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
}

/* 404 */
.code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.back {
  justify-self: start;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

.back:hover,
.back:focus-visible {
  border-bottom-color: var(--accent);
  outline: none;
}

@media (max-width: 48rem) {
  .stop {
    padding-block: 5rem;
  }

  h1,
  .stop h2 {
    max-width: none;
  }

  .hint {
    bottom: 1.6rem;
    height: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint {
    animation: none;
    transform: none;
  }

  .film video {
    transition: none;
  }
}
