@font-face {
  font-family: Signika;
  src: url('/signika.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url('/fraunces-title.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Signika, 'Segoe UI', sans-serif;
  color: #304734;
  background: #f3eedc;
  --ink: #304734;
  --muted: #58654c;
  --wine: #593035;
  --brick: #a44731;
  --line: #766e453d;
}

* { box-sizing: border-box; }
body { margin: 0; isolation: isolate; }

.landing-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.world-background {
  --world-width: max(100vw, 141svh);
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: .4;
}

.world-background::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(2 * var(--world-width));
  background: url('/world.webp') repeat-x left center / var(--world-width) auto;
  animation: world-drift 185s linear infinite;
  content: '';
}

@keyframes world-drift {
  to { transform: translateX(calc(-1 * var(--world-width))); }
}

@media (prefers-reduced-motion: reduce) {
  .world-background::before { animation: none; }
}
button, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid #855326; outline-offset: 3px; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: #fff8e9d6;
}

.topbar-inner {
  min-height: 4.5rem;
  width: min(100% - 3rem, 79rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: clamp(1.125rem, 2vw, 1.4rem);
}

.brand img { border-radius: .55rem; }

.release-status {
  margin: 0;
  color: var(--wine);
  border: 1px solid #85525761;
  border-radius: .25rem;
  padding: .4rem .7rem;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

.journey {
  position: relative;
  width: min(100% - 3rem, 63rem);
  margin: clamp(1.4rem, 4.5vh, 3rem) auto;
}

.passport-spread {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  aspect-ratio: 10 / 7;
  padding: .32rem;
  border: 1px solid #41232b;
  border-radius: .6rem .85rem .85rem .6rem;
  background: var(--wine);
  box-shadow: 0 .22rem 0 #b4a17c, 0 .4rem 0 #59303590, 0 1rem 2rem #49332140;
}

.passport-spread::after {
  position: absolute;
  inset: .35rem auto .35rem 50%;
  z-index: 2;
  width: 2.1rem;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #49352225 49%, #49352235 50%, #fffdf034 62%, transparent);
  pointer-events: none;
  content: '';
}

.passport {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(1.45rem, 3.4vw, 2.9rem);
  border-radius: .28rem 0 0 .28rem;
  background:
    repeating-radial-gradient(ellipse at 18% 27%, #7580600d 0 1px, transparent 1px 9px),
    linear-gradient(132deg, #fff8e9, #fcf1d9);
}

.passport::before {
  position: absolute;
  inset: .45rem;
  border: 1px solid #9f825746;
  border-radius: .2rem;
  pointer-events: none;
  content: '';
}

.passport-intro:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.passport-cover {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .55rem;
  width: min(74vw, 20.5rem, 49svh);
  aspect-ratio: 5 / 7;
  padding: 1.5rem;
  transform: rotate(-4deg);
  transform-origin: left center;
  border: 1px solid #72494a;
  border-radius: .28rem .85rem .85rem .28rem;
  background:
    radial-gradient(#d7a98615 .5px, transparent .85px) 0 0 / 3px 3px,
    linear-gradient(105deg, #31151f, #532333 9%, #4b202e 47%, #411b29);
  color: #e1c38b;
  box-shadow: inset .6rem 0 .55rem #2c142078, 0 .3rem 0 #aa9a78, .5rem 1.1rem 1.8rem #24241856;
  cursor: pointer;
}

.passport-cover::before {
  position: absolute;
  inset: 1rem .9rem 1rem 1.2rem;
  border: 1px solid #dfbd7852;
  border-radius: .16rem .4rem .4rem .16rem;
  pointer-events: none;
  content: '';
}

.passport-cover img {
  width: min(62%, 9.4rem);
  height: auto;
  margin-block: .35rem;
}

.cover-brand { font-size: clamp(1.1rem, 3.8vw, 1.45rem); letter-spacing: .1em; }
.cover-title { font-size: clamp(1.55rem, 5vw, 2.1rem); letter-spacing: .17em; text-transform: uppercase; }
.cover-hint { font-size: .9rem; }

.journey[data-intro="closed"] .passport-spread { visibility: hidden; }
.journey[data-intro="opening"] .passport-cover { animation: lift-cover .8s cubic-bezier(.2, .7, .15, 1) both; }
.journey[data-intro="opening"] .passport-spread { animation: reveal-spread .75s ease both; }

@keyframes lift-cover {
  to { opacity: 0; transform: translateX(-24%) rotate(-4deg) rotateY(-155deg); }
}

@keyframes reveal-spread {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
}


.wordmark {
  font-family: Fraunces, Signika, 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: -.035em;
}

.passport-spread .passport { container-type: inline-size; }

#game-heading {
  margin: 0 0 .7rem;
  font-size: clamp(1.75rem, 12.3cqi, 3.8rem);
  line-height: 1;
}

.title-dot { color: var(--brick); }

.tagline {
  margin: 0 0 .55rem;
  font-size: clamp(1.15rem, 5.5cqi, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
}

.intro {
  max-width: 35ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.075rem, 1.6vw, 1.225rem);
  line-height: 1.42;
}

.waitlist {
  margin-top: clamp(1.75rem, 4vw, 3rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.waitlist h2 { margin: 0; font-size: 1.25rem; font-weight: 650; }

.waitlist p {
  margin: .25rem 0 .95rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}

.waitlist label { display: block; margin-bottom: .3rem; font-size: .875rem; font-weight: 600; }
.form-row { display: flex; gap: .45rem; }

.form-row input {
  width: 100%;
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid #8d987a;
  border-radius: .28rem;
  color: var(--ink);
  background: #fffaf0;
  font-size: 1rem;
}

.form-row input::placeholder { color: #6e735b; }

.form-row button {
  flex-shrink: 0;
  min-height: 2.85rem;
  padding: .55rem .85rem;
  border: 1px solid var(--brick);
  border-radius: .28rem;
  color: #fff6e5;
  background: var(--brick);
  font-weight: 600;
  cursor: pointer;
}

.form-row button:hover { background: #873923; }
.form-row button:disabled { opacity: .65; cursor: wait; }

.form-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.waitlist .form-status { margin: 0; font-weight: 600; }
.waitlist .form-status:not(:empty) { margin-top: .65rem; }
.waitlist .form-status[data-error] { color: #862d36; }

.route-view {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .6rem;
  padding: .6rem;
  min-height: 0;
  min-width: 0;
  isolation: isolate;
  overflow: hidden;
  margin: 0;
  border-radius: 0 .45rem .45rem 0;
  background: #faf0d7;
}

.route-frame {
  position: relative;
  min-height: 0;
  container-type: size;
  overflow: hidden;
  border: 1px solid #8d8d6880;
  border-radius: .3rem;
}

.route-slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 75cqh);
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
}

.route-map {
  display: block;
  width: 100%;
  height: 100%;
}

.route-player {
  position: absolute;
  left: var(--rider-x);
  top: var(--rider-y);
  width: clamp(2.45rem, 3.35vw, 3.05rem);
  aspect-ratio: 1;
  padding: .2rem;
  transform: translate(-50%, -50%);
  border: 2px solid #fff9e9;
  border-radius: 50%;
  background: conic-gradient(from 26deg, #e0b45b 0deg 106deg, #d8e7f2 106deg 116deg, #529dd6 116deg 221deg, #d8e7f2 221deg 231deg, #69a56d 231deg 351deg, #fff9e9 351deg);
  box-shadow: 0 2px 7px #263c3b65;
}

.route-player img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #fff9e9;
  border-radius: 50%;
  background: #ebdfc5;
}

.route-slide-entering { animation: map-appear .45s ease both; }

@keyframes map-appear {
  from { opacity: 0; }
}

.ride-card {
  padding: .5rem .8rem;
  border: 1px solid #87946e95;
  border-radius: .5rem;
  background: #fffae9;
  box-shadow: 0 .25rem .75rem #40341f2b;
}

.route-location {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .2rem .6rem;
  padding: .15rem .2rem 0;
}
.route-location strong { display: block; font-size: 1.25rem; line-height: 1.12; }
.route-location > span { display: flex; align-items: center; gap: .35rem; font-size: .9rem; }
.country-flag { display: block; object-fit: contain; border-radius: 2px; }

.ride-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3.4rem, 27%);
  align-items: end;
  gap: .2rem .75rem;
  width: 100%;
  font-size: .975rem;
  line-height: 1.14;
}

.ride-art {
  width: min(100%, 9rem);
  min-width: 0;
  height: 3.65rem;
  display: grid;
  justify-items: start;
  align-items: end;
}

.ride-art .fleet-art {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, calc(3.65rem * var(--fleet-aspect))) !important;
  aspect-ratio: var(--fleet-aspect);
}

.ride-art .fleet-art::before {
  position: absolute;
  inset: auto var(--fleet-shadow-end) var(--fleet-ground) var(--fleet-shadow-start);
  z-index: -1;
  height: 6px;
  transform: translateY(30%);
  border-radius: 50%;
  background: #654a3380;
  filter: blur(1.5px);
  pointer-events: none;
  content: '';
}

.ride-art .fleet-art :is(img, canvas) {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ride-art .fleet-art [hidden] { display: none; }

.ride-portrait {
  justify-self: end;
  width: 3.35rem;
  height: 3.65rem;
  object-fit: cover;
  object-position: top;
  border-radius: .45rem;
  background: #e5e6d1;
}

.ride-model {
  align-self: start;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ride-driver {
  align-self: start;
  text-align: right;
  overflow-wrap: anywhere;
}

.hitch-ride-progress { grid-column: 1 / -1; }

.ride-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .2rem;
  font-size: .875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ride-distance { color: #624331; }

.hitch-ride-road {
  position: relative;
  overflow: hidden;
  border-radius: 11px;
}

.hitch-ride-road progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 16px;
  border: 0;
  background: linear-gradient(#988963, #897b52);
}

.hitch-ride-road progress::-webkit-progress-bar { background: transparent; }
.hitch-ride-road progress::-webkit-progress-value { background: linear-gradient(#61532c, #504624); }
.hitch-ride-road progress::-moz-progress-bar { background: linear-gradient(#61532c, #504624); }

.hitch-ride-road::after {
  position: absolute;
  inset: 50% 8px auto;
  height: 2px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #fff2cc 0 12px, transparent 12px 22px);
  pointer-events: none;
  content: '';
}

.map-credits {
  align-self: flex-end;
  margin-top: auto;
  padding: 0 max(.7rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) .7rem;
  color: #3b4d3c;
  font-size: .75rem;
  line-height: 1.25;
  text-align: right;
}

.response-page main { padding: 0 1rem; }
.response-page .passport {
  max-width: 32rem;
  margin: 3rem auto;
  border: .28rem solid var(--wine);
  border-radius: .6rem;
}

@media (max-width: 55rem) {
  .journey { max-width: 34rem; }
  .passport-spread { grid-template-columns: minmax(0, 1fr); gap: .15rem; aspect-ratio: auto; }
  .passport-spread::after { inset: 50% .35rem auto; width: auto; height: 1px; transform: none; }
  .passport-spread .passport { min-height: 0; aspect-ratio: 5 / 7; border-radius: .28rem .28rem 0 0; }
  .route-view { grid-template-rows: auto auto auto; border-radius: 0 0 .35rem .35rem; }
  .route-frame { aspect-ratio: 3 / 4; }
  .passport-intro:not([hidden]) { bottom: auto; height: min(36rem, 76svh); }
}

@media (max-width: 26rem) {
  .topbar-inner, .journey { width: calc(100% - 1.5rem); }
  .topbar-inner { min-height: 3.8rem; gap: .5rem; }
  .brand { gap: .5rem; font-size: 1.05rem; }
  .release-status { padding: .35rem .5rem; }
  .brand img { width: 32px; height: 32px; }
  .journey { margin-top: 1rem; }
  .passport { padding: 1.25rem; }
  .form-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .journey[data-intro="opening"] .passport-intro { display: none; }
  .journey[data-intro="opening"] .passport-spread, .route-slide-entering { animation: none; }
}
