/* The trip itinerary that builds itself on scroll. Colours in :root (the Playground palette): apricot is the route,
   the reached stops and the button, sea is the second light behind the card, everything else is a cool dark neutral.
   GSAP moves .frame, the CSS styles .card inside it; GSAP moves .stop (its lift), .stop__tile and .stop__text, the CSS
   styles .stop__face and the tile's inner square. The share of the trip done is --p on .route (moved by the script). */
:root {
  --page: #0c0e12;          /* the page */
  --page-lift: #161a21;     /* the soft lift of the page behind the card */
  --card: #15181e;          /* the card */
  --ink: #f2efe9;           /* the words */
  --muted: #858b96;         /* the small words */
  --line: rgba(255, 255, 255, 0.07); /* the hairlines */
  --sun: #ff9f63;           /* the route, the reached stops and the button */
  --sea: #4fc9bb;           /* the second light */
  --button-ink: #1b1209;    /* the words on the lit button */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); }
html, body { overflow-x: clip; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }

.trip { position: relative; height: 420vh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vh, 40px) 12px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 50% 38%, var(--page-lift), var(--page) 68%);
}
@supports (height: 100lvh) {
  .stage { height: 100lvh; }
}

/* two soft lights behind the card, apricot high on the left and sea low on the right; they drift with the trip */
.light {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(72vw, 72vh, 540px);
  height: min(72vw, 72vh, 540px);
  margin: calc(min(72vw, 72vh, 540px) / -2) 0 0 calc(min(72vw, 72vh, 540px) / -2);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(44px);
}
.light--a { background: radial-gradient(closest-side, color-mix(in srgb, var(--sun) 44%, transparent), color-mix(in srgb, var(--sun) 12%, transparent) 60%, transparent); }
.light--b { background: radial-gradient(closest-side, color-mix(in srgb, var(--sea) 36%, transparent), color-mix(in srgb, var(--sea) 10%, transparent) 60%, transparent); }
.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- the card */
.frame { width: min(100%, 420px); }
.card {
  --tilew: clamp(22px, 6.2vh, 30px);
  position: relative;
  border-radius: clamp(18px, 4.4vh, 26px);
  padding: clamp(11px, 3vh, 22px) clamp(11px, 3.4vw, 20px) clamp(11px, 2.8vh, 20px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 88%, white 4%), color-mix(in srgb, var(--card) 92%, transparent));
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 24px -10px rgba(0, 0, 0, 0.6),
    0 40px 80px -30px rgba(0, 0, 0, 0.75);
}
/* the 1px top edge that catches the light */
.card__edge {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 236, 220, 0.5), transparent);
}
/* the light under the pointer */
.card__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -30%), color-mix(in srgb, var(--sun) 9%, transparent), transparent 70%);
}
@media (hover: hover) {
  .card:hover .card__glow { opacity: 1; }
}

.head { position: relative; display: flex; align-items: center; gap: 10px; }
.head__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(26px, 7vh, 34px);
  height: clamp(26px, 7vh, 34px);
  border-radius: 10px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--sun) 86%, white), var(--sun) 55%, color-mix(in srgb, var(--sun) 70%, #b0401a));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 6px 14px -6px color-mix(in srgb, var(--sun) 80%, transparent);
}
.head__mark svg { width: 15px; height: 15px; fill: none; stroke: #2a1608; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head__text { flex: 1; min-width: 0; }
.head__title { font-size: clamp(13px, 3.4vh, 15px); font-weight: 620; font-variation-settings: 'wdth' 104; letter-spacing: -0.005em; white-space: nowrap; }
.head__text .muted { font-size: clamp(10.5px, 2.8vh, 12px); margin-top: 1px; white-space: nowrap; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.chip__num { display: inline-block; min-width: 0.6em; text-align: right; }

/* ---------------------------------------------------------------- the day tabs */
.days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: clamp(24px, 6.4vh, 32px);
  margin-top: clamp(9px, 2.6vh, 18px);
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04);
}
.days__ind {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.days__tab {
  position: relative;
  display: grid;
  place-items: center;
  font-size: clamp(10px, 2.7vh, 11.5px);
  font-weight: 560;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.35s ease, font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.days__tab.is-on { color: var(--ink); font-variation-settings: 'wdth' 108; }

/* ---------------------------------------------------------------- the route */
.route {
  --p: 0;
  position: relative;
  margin-top: clamp(8px, 2vh, 14px);
}
.route__track {
  position: absolute;
  left: calc(var(--tilew) / 2 - 0.75px);
  top: calc(100% / 12);
  bottom: calc(100% / 12);
  width: 1.5px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0 3px, transparent 3px 7px);
}
.route__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sun) 70%, transparent), var(--sun));
  box-shadow: 0 0 8px color-mix(in srgb, var(--sun) 45%, transparent);
  transform: scaleY(var(--p));
  transform-origin: 50% 0;
}

.stops {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  height: clamp(168px, 50vh, 312px);
}
.stop {
  position: relative;
  display: grid;
  grid-template-columns: var(--tilew) 1fr;
  align-items: center;
  gap: clamp(7px, 2.2vw, 11px);
  padding: 2px 0;
  min-height: 0;
}

/* the icon tile on the route: a dark socket until the line reaches it, then a lit apricot square */
.stop__tile { position: relative; z-index: 1; width: var(--tilew); height: var(--tilew); }
.stop__tile i {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: clamp(7px, 1.9vh, 9px);
  background: #1c2027;
  color: #5d636d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 0 0 3px var(--card);
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
.stop__tile svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.stop.is-on .stop__tile i {
  background: linear-gradient(160deg, color-mix(in srgb, var(--sun) 84%, white), var(--sun) 60%);
  color: #2a1608;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 0 0 3px var(--card), 0 4px 12px -3px color-mix(in srgb, var(--sun) 70%, transparent);
}

/* the row: a dashed placeholder with two ghost bars, then a filled glass row */
.stop__face {
  position: relative;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(8px, 2.4vw, 12px);
  overflow: hidden;
  border-radius: clamp(8px, 2vh, 11px);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background 0.45s ease, box-shadow 0.45s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stop.is-on .stop__face {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
}
/* the stop the line has just reached: a warm ring and a soft shadow of its colour */
.stop.is-active .stop__face {
  background: linear-gradient(180deg, color-mix(in srgb, var(--sun) 13%, transparent), color-mix(in srgb, var(--sun) 6%, transparent));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--sun) 40%, transparent),
    inset 0 1px 0 rgba(255, 236, 220, 0.12),
    0 8px 20px -10px color-mix(in srgb, var(--sun) 55%, transparent);
}
@media (hover: hover) {
  .stop.is-on:hover .stop__face {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  }
}
.stop__ghost {
  position: absolute;
  left: clamp(8px, 2.4vw, 12px);
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-50%);
}
.stop__ghost i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.stop__ghost i:first-child { width: 92px; }
.stop__ghost i:last-child { width: 58px; height: 4px; background: rgba(255, 255, 255, 0.04); }
.stop__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 228, 205, 0.12) 45%, rgba(255, 255, 255, 0.18) 50%, transparent 65%);
}

.stop__text {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
}
.stop__text b {
  font-size: clamp(10.5px, 2.8vh, 13px);
  font-weight: 600;
  font-variation-settings: 'wdth' 98;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop__text small {
  font-size: clamp(9px, 2.3vh, 10.5px);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop__price {
  position: relative;
  flex: none;
  font-size: clamp(10.5px, 2.8vh, 12.5px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--sun) 35%, var(--ink));
  opacity: 0;
}

/* ---------------------------------------------------------------- the foot */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(9px, 2.4vh, 18px);
  padding-top: clamp(9px, 2.4vh, 16px);
  border-top: 1px solid var(--line);
}
.foot__sum { display: flex; flex-direction: column; min-width: 0; }
.foot__sum b {
  font-size: clamp(16px, 4.6vh, 22px);
  font-weight: 640;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.foot__sum span { font-size: clamp(10px, 2.6vh, 11.5px); white-space: nowrap; }

.btn {
  position: relative;
  flex: none;
  height: clamp(36px, 9.6vh, 50px);
  padding: 0 clamp(16px, 4.4vw, 22px);
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #2a2f38, #20242b);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 18px -8px rgba(0, 0, 0, 0.7);
}
.btn:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }
.btn__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sun) 82%, white), var(--sun) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.btn__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45) 50%, transparent);
}
.btn__face { position: relative; display: flex; align-items: center; gap: 8px; height: 100%; }
.btn.is-done .btn__face { color: var(--button-ink); }
.btn__face { transition: color 0.35s ease; }
.btn__words {
  font-size: clamp(12.5px, 3.3vh, 14px);
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (hover: hover) {
  .btn:hover .btn__words { font-variation-settings: 'wdth' 112; }
}
.btn__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.btn__check { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 1.7; }
.btn__spin { stroke-dasharray: 0.62 1; stroke-dashoffset: 0; opacity: 0; transform-origin: 8px 8px; }

@media (max-width: 360px) {
  .foot__sum span { display: none; }
}
