:root {
  /* the train */
  --train-body: #1f5c47;
  --train-cream: #f2e4c4;
  --train-roof: #2b2a30;
  --train-accent: #d24a2a;
  --window-day: #cfe6ee;
  --window-lit: #ffcf72;
  --smoke: #f7f4ee;
  /* the sky: day over the fields, dusk by the sea */
  --sky-day-top: #78bfe6;
  --sky-day-bottom: #e8f5ec;
  --sky-dusk-top: #34306a;
  --sky-dusk-bottom: #f4a06c;
  --sun-day: #fff3c4;
  --sun-dusk: #ffb36b;
  /* the land */
  --hill-far: #a6cab8;
  --hill-mid: #73aa72;
  --hill-near: #4b8452;
  --ground: #557a3c;
  --ballast: #8a7d70;
  --water: #3f86ad;
  --sea: #2f4f80;
  --rock: #3a302b;
  --rock-dark: #17120f;
  --iron: #2a2d33;
  /* the cards */
  --paper: #fbf5e8;
  --ink: #1d2126;
  --muted: #5f6670;

  --tall: 100vh;
  --stage: 100vh;
}
@supports (height: 100svh) {
  :root { --tall: 100svh; }
}
/* the sticky stage is as tall as the screen with Safari's bar tucked away */
@supports (height: 100lvh) {
  :root { --stage: 100lvh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  background: var(--sky-day-bottom);
}
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  color: var(--ink);
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- the ride */
.ride {
  position: relative;
  height: calc(var(--tall) * 9);
}
.stage {
  position: sticky;
  top: 0;
  height: var(--stage);
  overflow: hidden;
  background: var(--sky-day-bottom);
}
.world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------------------------------------------------- the bar */
.bar {
  position: absolute;
  z-index: 3;
  top: clamp(14px, 3vh, 28px);
  left: clamp(16px, 4vw, 56px);
  right: clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand,
.bar__link {
  color: var(--paper);
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}
.brand {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand span {
  font-weight: 400;
  font-style: italic;
}
.bar__link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(20, 24, 30, 0.22);
  transition: background-color 0.3s ease;
}
@media (hover: hover) {
  .bar__link:hover { background: rgba(20, 24, 30, 0.42); }
}

/* ---------------------------------------------------------------- the cards */
.cards {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}
.card {
  position: absolute;
  top: clamp(76px, 15vh, 150px);
  left: clamp(16px, 6vw, 96px);
  width: min(30rem, 40vw);
  padding: 26px 28px 28px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 18px 40px -18px rgba(20, 24, 40, 0.45);
  visibility: hidden;
  /* the punched edge of a ticket */
  -webkit-mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.card--intro,
.card--outro { pointer-events: auto; }
.card__kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--train-accent);
}
.card__title {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 600;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 96, 'SOFT' 60;
}
.card--intro .card__title { font-size: clamp(32px, 3.8vw, 56px); }
.card__title .w {
  display: inline-block;
  will-change: transform;
}
.card__text {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}
.card__hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.card__arrow {
  width: 12px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the ticket button: the fill rises with a bounce, the arrow runs ahead */
.ticket {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 22px 14px 24px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 16px;
  overflow: hidden;
  isolation: isolate;
}
.ticket__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--train-accent);
  border-radius: inherit;
}
.ticket__label { display: inline-block; }
.ticket__arrow {
  width: 20px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ticket:focus-visible {
  outline: 3px solid var(--train-accent);
  outline-offset: 4px;
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 700px) {
  .card {
    top: 64px;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 18px 20px 20px;
  }
  .card__title { font-size: clamp(24px, 7vw, 30px); }
  .card--intro .card__title { font-size: clamp(28px, 8.4vw, 36px); }
  .card__text {
    font-size: 14.5px;
    margin-top: 10px;
  }
  .brand { font-size: 17px; }
}
@media (max-height: 560px) and (min-width: 701px) {
  .card { top: 64px; padding: 18px 22px; }
  .card__text { font-size: 14px; }
}
