/* ==========================================================================
   Waiting Alone — pure white one-page showcase
   ========================================================================== */

@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #ffffff;
  --ink: #111111;
  --body: #333333;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --line: #e8e8e8;
  --line-soft: #f0f0f0;

  --gutter: clamp(20px, 4.5vw, 64px);
  --max: 1280px;

  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'Consolas', monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--white);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2 {
  margin: 0;
}

::selection {
  background: var(--ink);
  color: var(--white);
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--white);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.2s var(--ease);
}
.skip:focus {
  transform: translateY(0);
}

.page {
  position: relative;
  min-height: 100svh;
  overflow: visible;
  background: var(--white);
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.page__inner {
  width: min(calc(100% - (var(--gutter) * 2)), var(--max));
  margin: 0 auto;
}

.page--intro,
.page--stations {
  display: grid;
  place-items: center;
}

/* The station page is fitted to the viewport height by main.js. */
.page__inner--stations {
  transform: scale(var(--s, 1));
  transform-origin: center center;
}

@media (min-width: 901px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  main {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }

  .page {
    position: absolute;
    inset: 0;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6%);
    pointer-events: none;
    transition:
      opacity 0.9s var(--ease),
      transform 0.9s var(--ease);
    will-change: opacity, transform;
  }

  .page.is-active {
    z-index: 2;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .page.is-above {
    z-index: 1;
    opacity: 0;
    transform: translateY(-6%);
  }

  .page.is-below {
    z-index: 1;
    opacity: 0;
    transform: translateY(6%);
  }
}

/* Intro ----------------------------------------------------------------- */

.intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0;
  text-align: center;
}

/* A very faint Soviet Union line map, derived from public-domain Natural
   Earth boundaries. It sits behind the title and the circle. */
.intro__map {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}
.intro__map img {
  width: auto;
  height: auto;
  max-width: min(94vw, 1280px);
  max-height: 86vh;
  opacity: 0.07;
}

.intro__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(54vmin, 472px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(17, 17, 17, 0.075);
  border-radius: 50%;
  pointer-events: none;
}

.intro__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.intro__kicker {
  max-width: 46ch;
  font: italic 400 clamp(14.25px, 1.1625vw, 16.5px) / 1.35 var(--serif);
  letter-spacing: -0.012em;
  color: #3a3a3a;
  text-wrap: balance;
}

.intro__title {
  margin-top: clamp(15px, 2.4vh, 24px);
  font: 400 clamp(48px, 8.4vw, 126px) / 0.88 var(--serif);
  letter-spacing: -0.032em;
  white-space: nowrap;
  color: var(--ink);
}
.intro__title em {
  letter-spacing: -0.045em;
}

.intro__copy {
  max-width: 62ch;
  margin-top: clamp(21px, 3.15vh, 30px);
  font-size: clamp(12px, 0.9vw, 13.5px);
  line-height: 1.66;
  color: var(--body);
  text-wrap: balance;
}

.book-link {
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s var(--ease);
}
.book-link:hover {
  opacity: 0.55;
}

/* Stations -------------------------------------------------------------- */

.stations {
  --station-gap: clamp(16px, 2.2vw, 28px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--station-gap);
  padding-top: clamp(20px, 3vw, 30px);
  border-top: 1px solid var(--line);
}

.station {
  min-width: 0;
}

.station__name {
  margin-bottom: 10px;
  font: 400 clamp(23px, 2.1vw, 30px) / 1.12 var(--serif);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.station__name span {
  margin-left: 7px;
  vertical-align: 2px;
  color: var(--faint);
  font: 400 8.5px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.station__media {
  position: relative;
}

/* Short horizontal links between the station images, like a route diagram. */
.station:not(:last-of-type) .station__media::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(-1 * var(--station-gap));
  width: var(--station-gap);
  height: 1px;
  background: var(--ink);
}

.station__frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f4f4f4;
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
}
.station__frame picture,
.station__frame img {
  display: block;
  width: 100%;
  height: 100%;
}
.station__frame img {
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease);
}

.station__frame--live:hover img,
.station__frame--live:focus-visible img {
  transform: scale(1.012);
}

.station__cta {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  transform: translate(-50%, -50%);
  background: var(--white);
  color: var(--ink);
  font: 400 8.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.station__cta span {
  transition: transform 0.3s var(--ease);
}
.station__frame--live:hover .station__cta,
.station__frame--live:focus-visible .station__cta {
  background: var(--ink);
  color: var(--white);
}
.station__frame--live:hover .station__cta span,
.station__frame--live:focus-visible .station__cta span {
  transform: translate(2px, -2px);
}

/* Locked station */
.station__frame--locked img {
  filter: grayscale(1) contrast(0.95) brightness(0.85);
}
.station__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.32);
}
.station__progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #333333;
  font: 400 9.5px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.station__progress > span {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.86);
}

/* Each station drops a line down to its own two Blender views. */
.station__renders {
  position: relative;
  margin-top: 34px;
  padding-top: 20px;
}
.station__renders::before {
  content: '';
  position: absolute;
  top: -34px;
  left: 50%;
  width: 1px;
  height: calc(34px + 20px);
  background: var(--ink);
}
.station__renders-label {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--faint);
  font: 400 9px/1.4 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.station__renders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.station__renders-grid picture,
.station__renders-grid img {
  display: block;
  width: 100%;
}
.station__renders-grid img {
  aspect-ratio: 2.35 / 1;
  height: auto;
  object-fit: cover;
  background: #f4f4f4;
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
}

/* The last stop connects to a short "More stops" line. */
.station__more {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
  color: var(--ink);
  font: 400 8.5px/1 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.station__more::before {
  content: '';
  width: 10px;
  height: 1px;
  background: var(--ink);
}

/* Footer ---------------------------------------------------------------- */

.footer {
  margin-top: clamp(44px, 5vw, 64px);
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer p {
  color: var(--faint);
  font: 400 9px/1.6 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1439px) {
  .station__more {
    position: static;
    justify-content: flex-end;
    margin-top: 9px;
    transform: none;
  }
  .station__more::before {
    width: 14px;
  }
}

@media (max-width: 900px) {
  .intro__title {
    font-size: clamp(43.5px, 9.75vw, 90px);
  }
}

@media (max-width: 700px) {
  .stations {
    grid-template-columns: 1fr;
    gap: clamp(38px, 7vw, 52px);
  }
  .station:not(:last-of-type) .station__media::after {
    display: none;
  }
  .station__name {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .intro {
    min-height: auto;
    padding: 64px 0 40px;
  }
  .intro__kicker {
    max-width: 32ch;
    font-size: 13.5px;
    line-height: 1.4;
  }
  .intro__title {
    font-size: clamp(43.5px, 12.75vw, 69px);
    line-height: 0.86;
    letter-spacing: -0.03em;
    white-space: normal;
  }
  .intro__title > span,
  .intro__title > em {
    display: block;
  }
  .intro__copy {
    max-width: 42ch;
    margin-top: 21px;
    font-size: 12px;
    line-height: 1.68;
  }
  .intro__halo {
    width: min(57vmin, 255px);
  }

  .stations {
    padding-top: 22px;
  }
  .station__name {
    margin-bottom: 9px;
    font-size: 25px;
  }
  .station__name span {
    font-size: 8px;
  }
  .station__cta {
    padding: 8px 9px;
    font-size: 8px;
    gap: 7px;
  }
  .station__progress {
    font-size: 9px;
  }
  .station__renders {
    margin-top: 28px;
    padding-top: 18px;
  }
  .station__renders::before {
    top: -28px;
    height: calc(28px + 18px);
  }
  .station__renders-label {
    font-size: 8.5px;
  }
  .station__renders-grid {
    gap: 4px;
  }
  .station__more {
    font-size: 8px;
  }

  .footer {
    margin-top: 44px;
    padding-bottom: 24px;
  }
  .footer p {
    font-size: 8px;
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
