/* The pieces of the app the page draws in code. Each is drawn on the app's own points and scaled with its stage.
   Sources: the tour's stages (NowBoarding/Onboarding/Tour), TripTileView, SyncChip, and Figma 2165:11549. */

.scene { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.scene-402 { width: 402px; height: 554px; }
.scene-696 { width: 696px; height: 500px; }
/* A graphic fades into the page over its first and last 15% */
.fade-y { -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); }
.scene .ic { display: block; }

.t-label2 { font-size: 17px; line-height: 25px; font-weight: 500; letter-spacing: -0.01em; }
.t-label3 { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; }
.t-label4 { font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; }
.t-body2 { font-size: 15px; line-height: 20px; font-weight: 400; letter-spacing: -0.01em; }
.t-body3 { font-size: 13px; line-height: 20px; font-weight: 400; letter-spacing: -0.01em; }
.t-title3 { font-size: 20px; line-height: 30px; font-weight: 500; letter-spacing: -0.02em; }
.t-tiny { font-size: 11px; line-height: 15px; font-weight: 500; letter-spacing: -0.01em; }
.t-caption { font-size: 11px; line-height: 15px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- Section 1: bookings into an itinerary (the tour's point 1) ---------- */

.it-row { position: absolute; left: 20px; width: 362px; color: var(--text-primary); white-space: nowrap; }
.it-plain { opacity: 0; transform: translateY(var(--rise, 10px)); transition: opacity var(--dur-gentle) var(--ease-gentle), transform var(--dur-gentle) var(--ease-gentle); }
.it-plain.is-open { opacity: 1; transform: none; }

.it-bound { height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: var(--r-bento); box-shadow: inset 0 0 0 1px var(--border-moderate); color: var(--text-secondary); }
.it-bound b { font-weight: 500; color: var(--text-primary); }
.it-transit, .it-stay { display: flex; align-items: center; gap: 15px; padding: 0 20px; }
.it-transit { height: 60px; }
.it-stay { height: 85px; background: var(--background-secondary); border-radius: var(--r-bento); box-shadow: var(--shadow-s), 0 0 0 1px var(--border-subtle); }
.it-transit > .ic, .it-stay > .ic:first-child { color: var(--text-secondary); }
.it-labels { flex: 1 1 0; min-width: 0; }
.it-labels span { display: block; color: var(--text-secondary); }
.it-tag { display: flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.it-stepper { display: flex; align-items: center; gap: 5px; height: 40px; }
.it-nights { position: relative; width: 65px; height: 20px; text-align: center; overflow: hidden; }
.it-nights span { position: absolute; inset: 0; transition: transform var(--dur-quick) var(--ease-quick), opacity var(--dur-quick) var(--ease-quick); }
.it-nights span:last-child { transform: translateY(100%); opacity: 0; }
.it-nights.is-rolled span:first-child { transform: translateY(-100%); opacity: 0; }
.it-nights.is-rolled span:last-child { transform: none; opacity: 1; }
.it-grab { color: var(--text-tertiary); }

/* A piece that becomes a row: its card travels to the row's place and opens out to the row's shape (TourMorph).
   --x and --y are its top-left corner in points, never a share of its own width: Safari resolves such a share
   against the width the card ends at, so the card went the wrong way while it grew, then jumped into place. */
.morph {
  position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); opacity: var(--o, 1);
  transform: translate(var(--x), var(--y)) rotate(var(--turn, 0deg));
  transition: transform var(--dur-gentle) var(--ease-gentle), width var(--dur-gentle) var(--ease-gentle), height var(--dur-gentle) var(--ease-gentle), opacity var(--dur-gentle) var(--ease-gentle);
  transition-delay: var(--wait, 0s);
}
.morph-drift { position: absolute; inset: 0; }
.morph.is-landed:not(.is-open) .morph-drift { animation: drift 5.2s ease-in-out infinite alternate; animation-delay: var(--phase, 0s); }
@keyframes drift { from { transform: translateY(-4px) rotate(-0.3deg); } to { transform: translateY(4px) rotate(0.3deg); } }
.morph-surface { position: absolute; inset: 0; background: var(--background-secondary); border-radius: var(--r-tile); opacity: 0; }
.morph-clip { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-tile); box-shadow: var(--shadow-s), 0 0 0 1px var(--border-subtle); transition: border-radius var(--dur-gentle) var(--ease-gentle), box-shadow var(--dur-gentle) var(--ease-gentle); transition-delay: var(--wait, 0s); }
/* The shadow stays one value while a booking travels and opens. The booking and the row inside carry none of their own.
   A booking that becomes a transit row, which has no card, lets its shadow go as it lands. */
.morph .bk, .morph .it-stay { box-shadow: none; }
.morph.is-open.to-transit .morph-clip { box-shadow: 0 5px 10px rgb(0 0 0 / 0), 0 0 0 1px rgb(0 0 0 / 0); }
.morph-piece, .morph-row { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.morph-row { width: 362px; opacity: 0; }
.morph-row .it-row { position: static; }
.morph.is-open .morph-surface { animation: morph-surface var(--dur-gentle) linear var(--wait, 0s) both; }
.morph.is-open .morph-clip { border-radius: var(--r-bento); }
.morph.is-open .morph-piece { opacity: 0; transition: opacity calc(var(--dur-gentle) * 0.4) ease-in-out calc(var(--wait, 0s) + var(--dur-gentle) * 0.05); }
.morph.is-open .morph-row { opacity: 1; transition: opacity calc(var(--dur-gentle) * 0.45) ease-in-out calc(var(--wait, 0s) + var(--dur-gentle) * 0.45); }
.morph.is-settled .morph-clip { overflow: visible; }
@keyframes morph-surface { 0% { opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.morph.no-anim, .morph.no-anim *, .no-anim, .no-anim * { transition: none !important; animation: none !important; }

/* A drawn booking (TourBookingArt): a boarding pass, a train ticket, a hotel booking */
.bk { display: flex; width: 176px; height: 88px; background: var(--background-secondary); border-radius: var(--r-tile); box-shadow: var(--shadow-s), 0 0 0 1px var(--border-subtle); }
.bk-main { flex: 1 1 0; min-width: 0; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.bk-head { display: flex; align-items: center; gap: 5px; color: var(--text-secondary); white-space: nowrap; }
.bk-ends { display: flex; align-items: center; gap: 5px; color: var(--text-primary); }
.bk-bar { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--border-moderate); }
.bk-bars { display: flex; gap: 5px; }
.bk-bars .bk-bar { flex: none; }
.bk-perf { width: 1px; margin: 5px 0; background: repeating-linear-gradient(to bottom, var(--border-intense) 0 3px, transparent 3px 6px); }
.bk-stub { width: 44px; display: flex; align-items: center; justify-content: center; gap: 1.5px; }
.bk-stub i { height: 34px; background: var(--text-tertiary); }

/* ---------- Section 5: chapters take the traveller's own titles and photos (the tour's point 5) ---------- */

.ch-list { position: absolute; left: 20px; top: 0; width: 362px; display: flex; flex-direction: column; gap: 10px; will-change: transform; }
.ch { position: relative; flex: none; border-radius: var(--r-card); text-align: center; opacity: 0; translate: 0 28px; transition: opacity var(--dur-gentle) var(--ease-gentle), translate var(--dur-gentle) var(--ease-gentle); transition-delay: var(--wait, 0s); }
.ch.is-shown { opacity: 1; translate: 0 0; }
.ch-transit { height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 15px; background: var(--background-primary); box-shadow: inset 0 0 0 1px var(--border-moderate); color: var(--text-secondary); }
.ch-stay { height: 150px; overflow: hidden; background: var(--tint); box-shadow: var(--shadow-m), 0 0 0 1px var(--border-subtle); isolation: isolate; }
.ch-stay > * { position: absolute; inset: 0; }
.ch-tint-own { background: var(--tint-own); }
.ch-cover { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.ch-band { inset: auto 0 0 0 !important; height: 80px; background: linear-gradient(rgb(var(--band), 0), rgb(var(--band), 0.2) 25%, rgb(var(--band), 0.6) 50%, rgb(var(--band), 0.85) 75%, rgb(var(--band)));  }
.ch-words { inset: auto 15px 15px 15px !important; color: var(--text-inverse-secondary); }
.ch-words .ch-title { color: var(--text-inverse-primary); }
.ch-title { display: grid; color: var(--text-primary); white-space: nowrap; }
.ch-title > span { grid-area: 1 / 1; overflow: hidden; text-overflow: ellipsis; }
/* The app's own and the traveller's own, one cross-fading into the other through a blur */
.ch .is-plain, .ch .is-own { transition: opacity var(--dur-standard) var(--ease-standard), filter var(--dur-standard) var(--ease-standard); }
.ch .is-own, .ch.wears-own .is-plain { opacity: 0; filter: blur(2px); }
.ch.wears-own .is-own { opacity: 1; filter: none; }
.ch.wears-own .ch-cover.is-own { opacity: 0.6; }
.ch-cover.is-plain { opacity: 0.6; }
.ch.wears-own .ch-cover.is-plain { opacity: 0; }

/* ---------- Section 6: the sync pill (SyncChip; the tour's point 4) ---------- */

.sy { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.sy > * { position: absolute; left: 0; top: 0; }
/* Figma's soft white light behind the pill */
.sy-halo { width: 600px; height: 600px; margin: -300px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.5) 20%, rgba(255, 255, 255, 0)); pointer-events: none; }
.sy-glow { width: 400px; height: 400px; margin: -200px; border-radius: 50%; background: radial-gradient(closest-side, var(--success), rgba(9, 170, 89, 0)); filter: blur(50px); opacity: 0; pointer-events: none; }
/* The anchor is 0 wide, so the page's max-width: 100% on a canvas would draw it 0 wide */
.sy-motes { width: 400px; height: 400px; max-width: none; margin: -200px; pointer-events: none; }
.sy-ring { border: 1px solid var(--success); border-radius: 999px; opacity: 0; transform: translate(-50%, -50%); pointer-events: none; }
.sy-pill {
  display: flex; align-items: center; gap: 5px; height: 40px; padding: 0 15px; white-space: nowrap; color: var(--text-primary);
  background: linear-gradient(var(--background-secondary), var(--background-primary)); border-radius: var(--r-pill); box-shadow: var(--shadow-m), inset 0 0 0 1px var(--border-subtle);
  transform: translate(-50%, -50%) scale(var(--s, 1)); opacity: 0; filter: blur(2px);
  transition: opacity var(--dur-gentle) var(--ease-gentle), filter var(--dur-gentle) var(--ease-gentle), transform var(--dur-press) var(--ease-press);
}
.sy-pill.is-shown { opacity: 1; filter: none; }
.sy-glyphs { position: relative; width: 15px; height: 15px; }
.sy-glyphs .ic { position: absolute; inset: 0; transition: opacity var(--dur-quick) var(--ease-quick); }
.sy-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sy-words { display: grid; }
.sy-words span { grid-area: 1 / 1; transition: opacity var(--dur-quick) var(--ease-quick); }
.sy-pill .is-synced, .sy-pill.is-in-sync .is-syncing { opacity: 0; }
.sy-pill.is-in-sync .is-synced { opacity: 1; }
.sy-pill.is-in-sync .sy-spin { animation-play-state: paused; }

/* ---------- Maps: one static image of the land, with the moving parts as layers over it ---------- */

/* A plane holds one map and its layers in the map's own points. --mx, --my and --mz crop, shift and zoom it. */
.map-plane { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; transform: translate(var(--mx, 0px), var(--my, 0px)) scale(var(--mz, 1)); }
.map-plane > img { position: absolute; max-width: none; pointer-events: none; }
.map-plane > svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.map-dots { fill: none; stroke: var(--text-secondary); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 6; }
.map-glow { fill: none; stroke: var(--gradient-1); stroke-opacity: 0.18; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.map-route { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.map-town { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--background-secondary); box-shadow: inset 0 0 0 1.5px var(--text-tertiary); transition: box-shadow var(--dur-quick) var(--ease-quick); }
.map-name { position: absolute; white-space: nowrap; color: var(--text-secondary); opacity: 0.45; transform: translate(var(--ax), var(--ay)); transition: opacity var(--dur-quick) var(--ease-quick), color var(--dur-quick) var(--ease-quick); }
.map-town.is-reached { box-shadow: inset 0 0 0 1.5px var(--gradient-2); }
.map-name.is-reached { opacity: 1; color: var(--text-primary); }
.map-region { position: absolute; white-space: nowrap; color: var(--text-tertiary); transform: translate(-50%, -50%); }

/* The route's head: a white point in a blue ring, with a slow halo (TourMapHead) */
.map-head { position: absolute; width: 0; height: 0; transition: opacity var(--dur-standard) var(--ease-standard); }
.map-head::before { content: ""; position: absolute; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: var(--gradient-1); animation: halo 2.2s linear infinite; }
.map-head::after { content: ""; position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--background-secondary); border: 3px solid var(--gradient-1); box-shadow: var(--shadow-i); }
@keyframes halo { from { transform: scale(0.3); opacity: 0.28; } to { transform: scale(1); opacity: 0; } }

/* The map's own place pin: a white drop with a glyph; blue when it is the live place (MapPlacePin) */
.map-pin { position: absolute; width: 30px; height: 40px; margin: -40px 0 0 -15px; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.15)); }
.map-pin svg { position: absolute; inset: 0; overflow: visible; }
.map-pin .drop { fill: var(--background-secondary); transition: fill var(--dur-standard) var(--ease-standard); }
.map-pin .ic { position: absolute; left: 5px; top: 5px; width: 20px; height: 20px; color: var(--text-secondary); transition: color var(--dur-standard) var(--ease-standard); }
.map-pin.is-active .drop { fill: var(--gradient-1); }
.map-pin.is-active .ic { color: #fff; }
.map-ring { position: absolute; border: 1px solid var(--gradient-1); border-radius: 50%; opacity: 0; transform: translate(-50%, -50%); pointer-events: none; }

/* ---------- Section 3: the app's tile (TripTileView), on the cover shader's dark colours ----------
   At the size Trip Home draws it on a 402-wide phone: 362 by 160 (TripHomeMetrics). The tour draws it 40 narrower. */

/* A map fills the part of the scene its stage shows (--crop-left, --crop-width), and fades into the page on all four
   edges of it. A mask clips to its own box, so the box spans that part, and its layers move back by its left edge. */
.scene-402 { --scene-width: 402px; }
.scene-696 { --scene-width: 696px; }
.tk-maps {
  position: absolute; top: 0; bottom: 0; left: calc(var(--crop-left) * 1px); width: calc(var(--crop-width) * 1px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent), linear-gradient(transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent), linear-gradient(transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.tk-maps > * { inset: 0 auto 0 calc(var(--crop-left) * -1px) !important; width: var(--scene-width); }
.tk-plane { position: absolute; inset: 0; transform-origin: var(--ox) var(--oy); will-change: transform, opacity; }
.tk-fly { transition: opacity var(--dur-gentle) var(--ease-gentle); }

.tile {
  position: absolute; left: 167px; top: 340px; width: 362px; height: 160px; overflow: hidden; border-radius: var(--r-bento); isolation: isolate;
  background: linear-gradient(var(--gradient-2), var(--black-absolute));
  /* Figma 2210:13452: two shadows, one over the other */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  opacity: 0; transition: opacity var(--dur-standard) var(--ease-standard);
}
.tile.is-shown { opacity: 1; }
.tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 1s ease; }
.tile canvas.is-live { opacity: 1; }
.tile-face { position: absolute; inset: 0; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; opacity: 0; filter: blur(6px); pointer-events: none; transition: opacity var(--dur-standard) var(--ease-standard), filter var(--dur-standard) var(--ease-standard); }
.tile-face.is-on { opacity: 1; filter: none; }
.tile-text { display: flex; flex-direction: column; gap: 5px; }
.tile-text p:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text p + p { color: rgba(255, 255, 255, 0.6); }
/* AppButton, primary, as the dark tile draws it */
.tile-btn { align-self: flex-start; display: flex; align-items: center; gap: 5px; height: 40px; padding: 0 15px; border-radius: var(--r-pill); color: #fff; background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2)); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.tile-strip { display: flex; align-items: center; height: 40px; padding: 0 5px; }
.tile-end { min-width: 60px; }
.tile-end:last-child { text-align: right; }
.tile-end b { display: block; font-weight: 500; background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6)) text; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tile-end span { display: block; color: rgba(255, 255, 255, 0.6); }
.tile-span { flex: 1 1 0; display: flex; align-items: center; gap: 5px; color: rgba(255, 255, 255, 0.6); }
.tile-span i { flex: 1 1 0; height: 1px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 2px); }
.tile-arc { position: absolute; left: 0; top: 60px; width: 100%; height: 40px; overflow: visible; }

/* ---------- Section 4: photo pins that open into postcards (TourPhotoPin) ---------- */

.ph-pin { position: absolute; width: 0; height: 0; transition: opacity var(--dur-standard) var(--ease-standard); z-index: var(--z, 1); }
.ph-sway { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.ph-pin.is-shown:not(.is-open) .ph-sway { animation: sway 5.2s ease-in-out infinite alternate; animation-delay: var(--phase, 0s); }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.ph-grow { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: scale(0.01); opacity: 0; transition: transform var(--dur-gentle) var(--ease-gentle), opacity var(--dur-gentle) var(--ease-gentle); transition-delay: var(--wait, 0s); }
.ph-pin.is-shown .ph-grow { transform: none; opacity: 1; }
.ph-tail { position: absolute; left: -5px; top: -5.5px; width: 0; height: 0; border: solid transparent; border-width: 5.5px 5px 0; border-top-color: var(--background-secondary); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.12)); transition: opacity var(--dur-quick) var(--ease-quick); }
.ph-card {
  position: absolute; left: 0; top: -5px; width: var(--side, 40px); height: var(--side, 40px); padding: var(--pad, 2px); cursor: pointer; pointer-events: auto;
  background: var(--background-secondary); border-radius: var(--round, 10px); box-shadow: var(--shadow-i);
  transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% + var(--dy, 0px)));
  transition: width var(--dur-standard) var(--ease-standard), height var(--dur-standard) var(--ease-standard), padding var(--dur-standard) var(--ease-standard), border-radius var(--dur-standard) var(--ease-standard), transform var(--dur-standard) var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}
.ph-card img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--round-in, 8px); transition: border-radius var(--dur-standard) var(--ease-standard); pointer-events: none; }
.ph-pin.is-open { z-index: 10000; }
.ph-pin.is-open .ph-card { --side: 180px; --pad: 6px; --round: 15px; --round-in: 10px; }
.ph-pin.is-open.is-moved .ph-tail { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .morph.is-landed .morph-drift, .ph-pin .ph-sway, .map-head::before, .sy-spin { animation: none !important; }
  .map-head::before { transform: scale(0.6); opacity: 0.28; }
}
