/* My trips — layout refinements and motion, layered over journey.css, journey-polish.css and journey-preparation.css.
   Loaded last on trips.html and journey.html. Every animation is gated on html.motion-ok, so visitors who
   prefer reduced motion see each state at once. journey-motion.js adds the classes used here. */

/* ---------- View changes: tab, role and moment crossfade (site.js view transition, kind "journey") ---------- */
html.vt-journey::view-transition-old(root) { animation: jv-out 460ms var(--ease-out) both; }
html.vt-journey::view-transition-new(root) { animation: jv-in 640ms var(--ease-out) both; }
html.vt-journey .journey-tabs .tab-ink { view-transition-name: journey-ink; }
html.vt-journey .role-switch .pill-thumb { view-transition-name: journey-thumb; }
html.vt-journey::view-transition-group(journey-ink), html.vt-journey::view-transition-group(journey-thumb) { animation-duration: 720ms; animation-timing-function: var(--ease-soft); }
@keyframes jv-out { to { opacity: 0; } }
@keyframes jv-in { from { opacity: 0; } }

/* Waiting below the fold until it scrolls into view. */
html.motion-ok .jm-wait { opacity: 0; transform: translateY(22px); }
.jm-instant, .jm-instant * { transition: none !important; }

/* ---------- Header: tabs, role switch and the preview moment ---------- */
.journey-tabs { position: relative; scrollbar-width: none; scroll-snap-type: x proximity; }
.journey-tabs::-webkit-scrollbar { display: none; }
.journey-tabs > button { scroll-snap-align: start; transition: color var(--d-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .journey-tabs > button:hover { color: var(--ink); } }
.journey-tabs.has-ink > button[aria-selected=true]::after { opacity: 0; }
.tab-ink {
  position: absolute; left: 0; bottom: 0; width: 1px; height: 2px; border-radius: 2px;
  background: var(--accent); transform-origin: 0 50%; pointer-events: none;
}
.journey-tabs.is-scrollable:not(.at-end) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }

.role-switch, .floor-switch { position: relative; isolation: isolate; }
.role-switch button, .floor-switch button { position: relative; transition: color var(--d-ui) var(--ease-out); }
.has-thumb > button[aria-pressed=true] { background: transparent; box-shadow: none; }
.pill-thumb {
  position: absolute; z-index: -1; left: 0; top: 0; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-1); transform-origin: 0 50%; pointer-events: none;
}

.demo-control select {
  appearance: none; min-height: 44px; border-radius: var(--r-pill); padding: 8px 44px 8px 18px; font-size: 15px; font-weight: 550;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366798f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 16px;
  transition: border-color var(--d-quick) ease, box-shadow var(--d-ui) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .demo-control select:hover { border-color: var(--accent); } }

/* ---------- One design language with the planner (planner.css, altier.css) ---------- */
/* Type: headings at 600 with the site's tracking, labels in sentence case at 600, codes and figures at 650. */
.journey-page .journey-shell :is(h1, h2, h3) { font-weight: 600; letter-spacing: -.028em; }
.journey-page .eyebrow { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em; }
.journey-page :is(.prep-destination-label small, .prep-facts small, .airport-brief > small, .arrival-time > small:first-child, .family-update small, .journey-rail small, .tile-meta > span:first-child, .access-explainer > div > span, .studio-kicker, .studio-view-label) { letter-spacing: .01em; font-weight: 600; }
.journey-page :is(.airport-brief > strong, .tile-route b, .map-heading h2, .next-facts strong, .budget-strip b, .arrival-time > b, .weather-empty, .prep-countdown b, .prep-facts b, .leave-line b) { font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.journey-page .prep-destination-label strong { font-weight: 600; letter-spacing: -.04em; }
/* Cards: the planner's hairline border, radius and soft shadow. */
.journey-page :is(.card, .prep-hero, .prep-route-map, .prep-panel, .trip-tile, .library-empty, .transfer-summary) { border-radius: var(--r-xl); border-color: var(--line); box-shadow: var(--shadow-1); }
.journey-page :is(.airport-brief, .service-card, .prep-parent-callout) { border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
/* Controls: segmented switches, fields and text links shaped like the planner's. */
.journey-page :is(.role-switch, .floor-switch) { border-color: transparent; border-radius: 16px; }
.journey-page :is(.role-switch, .floor-switch) button, .journey-page .pill-thumb { border-radius: 12px; }
.journey-page .demo-control select { border-radius: var(--r-sm); }
.journey-page .text-button {
  background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 calc(100% - 5px);
  transition: background-size var(--d-ui) var(--ease-out), color var(--d-quick) ease;
}
@media (hover: hover) and (pointer: fine) { .journey-page .text-button:hover { text-decoration: none; background-size: 100% 1px; } }
/* Back to all trips: the same pill as the planner's Back. */
.journey-page .back-link {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .9rem 0 .7rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  transition: border-color var(--d-quick) ease, color var(--d-quick) ease, transform var(--d-press) var(--ease-out);
}
.journey-page .back-link .back-arrow { width: 16px; height: 16px; stroke-width: 2; transform: scaleX(-1); transition: transform var(--d-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .journey-page .back-link:hover { border-color: var(--line-strong); color: var(--ink); } .journey-page .back-link:hover .back-arrow { transform: scaleX(-1) translateX(3px); } }
.journey-page .back-link:active { transform: scale(.96); }

/* ---------- Trips library ---------- */
/* One line of type, so the brand word shares the baseline instead of becoming its own flex item. */
.eyebrow-line .brand-word { font-size: 1.12em; letter-spacing: 0; text-transform: none; }
.section-heading > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-heading > span .text-button { min-height: 0; padding: 0; }
.library-empty { display: grid; justify-items: center; }
.library-empty h2 { margin: 6px 0 8px; }
.library-empty p { margin: 0; max-width: 46ch; }
.empty-art { width: min(260px, 72%); margin: 0 auto 14px; }
.empty-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.empty-arc { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: .012 .022; }
.empty-arc-pulse { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: .12 1.2; stroke-dashoffset: .12; opacity: 0; }
.empty-from { fill: var(--accent); }
.empty-to { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 2.6 2.6; }
.empty-star { fill: var(--accent); transform-box: fill-box; transform-origin: center; }

/* Trip card: the arc is drawn by trips.js to the card's width, its ends on the codes' centre line. */
.tile-route { grid-template-columns: auto minmax(56px, 1fr) auto; align-items: start; gap: clamp(14px, 2.2vw, 28px); }
.tile-route .tile-end:last-child { text-align: right; }
.tile-arc { position: relative; align-self: stretch; min-height: 64px; }
.tile-route .tile-arc svg { position: absolute; left: 0; width: 100%; height: auto; overflow: visible; display: block; stroke: none; fill: none; }
.tile-arc path { fill: none; stroke-linecap: round; }
.tile-arc .tile-arc-line { stroke: var(--accent); stroke-width: 1.5; }
.tile-arc .tile-arc-return { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: .008 .018; opacity: .55; }
.tile-arc .tile-arc-pulse { stroke: var(--accent); stroke-width: 3; stroke-dasharray: .12 1.2; stroke-dashoffset: .12; opacity: 0; }
.tile-node { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.tile-node-end { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.tile-via circle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.8; }
.tile-via text { font: 600 11px var(--font); letter-spacing: .08em; fill: var(--ink-3); }
.tile-arc .tile-star { fill: var(--accent); stroke: none; transform-box: fill-box; transform-origin: center; }
.trip-tile { transition: transform 620ms var(--ease-soft), box-shadow 620ms var(--ease-soft), border-color var(--d-ui) ease; }
.tile-bottom > span:last-child { transition: color var(--d-quick) ease; }

/* Trips not from the demo library: a quiet status note in place of the moment picker. */
.journey-stage-bar > span { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-3); font-size: 13px; }
.journey-stage-bar > span::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
html.motion-ok .journey-stage-bar > span::before { animation: pill-pulse-accent 3.2s ease-out infinite; }
@keyframes pill-pulse-accent { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.tile-meta > span:last-child, .tile-bottom > span:last-child { white-space: nowrap; }

/* ---------- Your journey (overview) ---------- */
.next-details { width: 100%; margin: 22px 0 6px; padding: 0; border-top: 1px solid var(--line); }
.next-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.next-details dt { color: var(--ink-3); }
.next-details dd { margin: 0; color: var(--ink); font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.next-card > .button { margin-top: auto; }
.next-card .next-details { margin-bottom: 22px; }

/* Itinerary rail: nodes on one line, a connector between them, text beneath each node. */
@media (min-width: 541px) {
  .journey-page .journey-rail { gap: 0; }
  .journey-page .journey-rail li { flex-direction: column; align-items: flex-start; gap: 16px; padding-right: 18px; }
  .journey-page .journey-rail li::before { left: 52px; right: 14px; top: 19px; transform-origin: 0 50%; }
  .journey-page .journey-rail li > div:not(.connection-chip) { background: none; padding-right: 0; }
  .journey-page .journey-rail h3 { margin: 6px 0; }
  .journey-page .connection-chip {
    top: 19px; bottom: auto; left: calc(52px + (100% - 66px) / 2); transform: translate(-50%, -50%); z-index: 2;
    padding: 3px 11px 3px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
    white-space: nowrap; font-size: 12.5px;
  }
}
.connection-chip .j-icon { width: 14px; height: 14px; }
.stay-chip { color: var(--accent-ink); }

/* ---------- Your connection (transfer) ---------- */
.guide-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0 0; }
.guide-progress i { position: relative; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.guide-progress i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.guide-progress i.done::after { transform: none; }
.guide-progress i.now::after { transform: scaleX(.5); }
.guide-remaining { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.journey-page .route-guide h2 { margin-top: 18px; }
.guide-steps li > button { border-radius: 12px; transition: color var(--d-ui) var(--ease-out), background-color var(--d-ui) var(--ease-out); }
.guide-steps li > button > span { transition: background-color var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out), color var(--d-ui) ease; }
@media (hover: hover) and (pointer: fine) { .guide-steps li > button:hover { color: var(--ink-2); } }

/* ---------- Made for you: icon centred on its disc ---------- */
.service-art { height: 118px; }
.journey-page .service-art-dot { width: 88px; height: 88px; top: calc(50% - 44px); left: calc(50% - 44px); }
.journey-page .service-art-line { top: calc(50% - 100px); left: calc(50% - 170px); }
.service-art > .j-icon { transition: transform 700ms var(--ease-soft); }
.service-art-line { transition: transform 1200ms var(--ease-soft); }
.service-card { transition: transform 620ms var(--ease-soft), box-shadow 620ms var(--ease-soft), border-color var(--d-ui) ease; }
@media (hover: hover) and (pointer: fine) {
  .service-card:hover .service-art > .j-icon { transform: translateY(-4px); }
  .service-card:hover .service-art-line { transform: rotate(-12deg); }
}
.preference-pills > button { transition: background-color var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out), color var(--d-ui) ease, transform var(--d-press) var(--ease-out); }
.preference-pills > button:active { transform: scale(.97); }

/* ---------- Before you go ---------- */
.prep-orbit .prep-star {
  position: absolute; right: auto; top: 50%; left: 100%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  fill: var(--accent); transform: rotate(32deg); font-size: 0;
}
.prep-destination-label strong { text-shadow: 0 0 18px var(--accent-soft), 0 0 4px var(--accent-soft); }
.jm-letter { display: inline-block; }
.weather-empty { display: flex; align-items: flex-start; gap: 4px; font-variant-numeric: tabular-nums; }
.weather-empty small { padding: 8px 0 0; font-size: 20px; letter-spacing: 0; color: var(--ink-3); vertical-align: baseline; }
.airport-brief { transition: transform 620ms var(--ease-soft), border-color var(--d-ui) ease, box-shadow 620ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .airport-brief:hover { box-shadow: var(--shadow-2); } }
.airport-brief .brief-link { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 620ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .airport-brief:hover .brief-link { background-size: 7.5em 1px; } }
.packing-item { position: relative; border-radius: 10px; transition: background-color var(--d-ui) ease; }
.packing-item b { transition: color var(--d-ui) ease; }
.prep-parent-callout { transition: transform 620ms var(--ease-soft), box-shadow 620ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .prep-parent-callout:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); } }

/* When to leave: the planning buffer between reaching the airport and take-off. */
.leave-line { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 16px; max-width: 520px; margin-top: 30px; }
.leave-line > span { display: grid; gap: 3px; }
.leave-line > span:last-child { text-align: right; }
.leave-line b { color: var(--ink); font-size: 20px; font-weight: 550; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.leave-line small { color: var(--ink-3); font-size: 12.5px; }
.leave-line i { position: relative; height: 1.5px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); transform-origin: 0 50%; }
.leave-line i::before, .leave-line i::after { content: ""; position: absolute; top: -3.5px; width: 8px; height: 8px; border-radius: 50%; }
.leave-line i::before { left: -4px; background: var(--accent); }
.leave-line i::after { right: -4px; border: 1.5px solid var(--accent); background: var(--surface); }
.leave-line em { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); color: var(--accent-ink); font-size: 12px; font-style: normal; font-weight: 600; white-space: nowrap; }
html.motion-ok .leave-line.jm-draw i { animation: rail-draw 1300ms var(--ease-soft) var(--jm-delay, 0ms) both; }
html.motion-ok .leave-line.jm-draw em, html.motion-ok .leave-line.jm-draw > span:last-child { animation: chip-in 800ms var(--ease-soft) calc(var(--jm-delay, 0ms) + 850ms) both; }

/* ---------- Family access: the empty list is a calm, centred moment ---------- */
.access-layout > .prep-panel:first-child { display: flex; flex-direction: column; }
.access-layout .access-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 36px 12px; }
.access-empty > span { position: relative; display: grid; place-items: center; width: 104px; height: 104px; margin-bottom: 10px; line-height: 1; }
.access-empty > span::before, .access-empty > span::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 50%; transform: rotate(-30deg) scaleY(.6);
}
.access-empty > span::after { border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: rotate(30deg) scaleY(.6); }
.access-layout > .prep-panel:first-child > .prep-note { margin-top: auto; }

/* ---------- Footer ---------- */
.journey-page .journey-foot { justify-content: flex-start; align-items: center; gap: 14px; margin-top: 44px; padding: 26px 0 10px; border-top: 1px solid var(--line); }
.journey-foot .foot-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.journey-foot .foot-mark .brand-word { font-size: 16px; line-height: 1; }
.journey-page .journey-foot > .foot-line { display: inline; max-width: none; text-align: left; }

/* ---------- Maps: a labelled way back to the standard view ---------- */
.studio-bottomline > span:first-child { transition: opacity var(--d-ui) ease; }
.map-studio.is-moved .studio-bottomline > span:first-child { opacity: 0; }
.studio-reset {
  position: absolute; left: -6px; bottom: -10px; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 96%, transparent); color: var(--ink);
  font: 600 13px var(--font); box-shadow: 0 6px 22px #153a5016; pointer-events: none; opacity: 0; transform: translateY(8px);
  transition: opacity 420ms var(--ease-out), transform 560ms var(--ease-soft), border-color var(--d-quick) ease;
}
.studio-reset svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.map-studio.is-moved .studio-reset { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) { .studio-reset:hover { border-color: var(--accent); } }
.map-studio.is-moved .studio-reset:active { transform: scale(.97); }

/* ---------- Dialogs ---------- */
html.motion-ok .journey-dialog[open] { animation: dialog-in 620ms var(--ease-soft) both; }
html.motion-ok .journey-dialog[open]::backdrop { animation: backdrop-in 520ms ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes backdrop-in { from { opacity: 0; } }

/* ---------- Motion ---------- */
html.motion-ok .status-pill i { animation: pill-pulse 2.8s ease-out infinite; }
html.motion-ok .status-pill.warn i { animation-name: pill-pulse-warn; }
@keyframes pill-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes pill-pulse-warn { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

html.motion-ok .journey-rail .current .rail-node { animation: node-ring 3s ease-out infinite; }
@keyframes node-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
html.motion-ok .timeline.jm-draw .journey-rail li::before { animation: rail-draw 1100ms var(--ease-soft) both; animation-delay: calc(var(--jm-delay, 0ms) + var(--i, 0) * 220ms); }
html.motion-ok .timeline.jm-draw .rail-node { animation: node-in 760ms var(--ease-soft) both; animation-delay: calc(var(--jm-delay, 0ms) + var(--i, 0) * 220ms - 140ms); }
html.motion-ok .timeline.jm-draw .journey-rail .current .rail-node { animation: node-in 760ms var(--ease-soft) both, node-ring 3s ease-out 1.6s infinite; animation-delay: calc(var(--jm-delay, 0ms) + var(--i, 0) * 220ms - 140ms), calc(var(--jm-delay, 0ms) + 1.4s); }
html.motion-ok .timeline.jm-draw .connection-chip { animation: chip-in 700ms var(--ease-soft) both; animation-delay: calc(var(--jm-delay, 0ms) + var(--i, 0) * 220ms + 560ms); }
@keyframes rail-draw { from { transform: scaleX(0); } }
@keyframes node-in { from { opacity: 0; transform: scale(.6); } }
@keyframes chip-in { from { opacity: 0; transform: translateY(4px); } }

html.motion-ok .guide-progress.jm-step i.now::after { animation: step-fill 1200ms var(--ease-soft) var(--jm-delay, 0ms) both; }
@keyframes step-fill { from { transform: scaleX(0); } }

html.motion-ok .prep-orbit.orbit-one { animation: orbit-one 18s var(--ease-in-out) infinite alternate; }
html.motion-ok .prep-orbit.orbit-two { animation: orbit-two 26s var(--ease-in-out) infinite alternate; }
html.motion-ok .prep-orbit .prep-star { animation: star-glint 6s var(--ease-in-out) infinite; }
@keyframes orbit-one { from { transform: rotate(-32deg); } to { transform: rotate(-28.5deg); } }
@keyframes orbit-two { from { transform: rotate(-48deg); } to { transform: rotate(-44deg); } }
@keyframes star-glint { 0%, 100% { transform: rotate(32deg) scale(.9); } 50% { transform: rotate(40deg) scale(1.06); } }
html.motion-ok .weather-symbol svg { animation: float-soft 7s var(--ease-in-out) infinite; }
html.motion-ok .next-card .next-icon { animation: float-soft 6.5s var(--ease-in-out) infinite; }
@keyframes float-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
html.motion-ok .family-orbit span { animation: orbit-turn 40s linear infinite; }
html.motion-ok .family-orbit span:last-child { animation-duration: 56s; animation-direction: reverse; }
@keyframes orbit-turn { from { rotate: 0deg; } to { rotate: 360deg; } }
html.motion-ok .access-empty > span::before { animation: orbit-turn 36s linear infinite; }
html.motion-ok .access-empty > span::after { animation: orbit-turn 48s linear infinite reverse; }
html.motion-ok .journey-foot .j-icon { animation: star-breathe 6s var(--ease-in-out) infinite; }

html.motion-ok .empty-arc-pulse { animation: arc-pulse 4.4s var(--ease-in-out) 1.4s infinite; }
html.motion-ok .empty-star { animation: star-breathe 5.6s var(--ease-in-out) infinite; }
html.motion-ok .empty-to { animation: dash-turn 10s linear infinite; }
@keyframes arc-pulse { 0% { stroke-dashoffset: .12; opacity: 0; } 14% { opacity: 1; } 82% { opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes star-breathe { 0%, 100% { transform: scale(.9); opacity: .82; } 50% { transform: scale(1.06) rotate(8deg); opacity: 1; } }
@keyframes dash-turn { to { stroke-dashoffset: -20.8; } }

/* Trip cards draw their route once they arrive; hovering sends a light along it. */
html.motion-ok .trip-tile:not(.is-drawn) .tile-arc-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.motion-ok .trip-tile:not(.is-drawn) :is(.tile-node, .tile-via, .tile-star, .tile-arc-return) { opacity: 0; }
html.motion-ok .trip-tile.is-drawn .tile-arc-line { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1500ms var(--ease-in-out) 120ms; }
html.motion-ok .trip-tile.is-drawn :is(.tile-node, .tile-via, .tile-arc-return) { transition: opacity 600ms ease 300ms; }
html.motion-ok .trip-tile.is-drawn .tile-node-end { transition-delay: 1350ms; }
html.motion-ok .trip-tile.is-drawn .tile-via { transition-delay: 900ms; }
html.motion-ok .trip-tile.is-drawn .tile-arc-return { transition: opacity 900ms ease 1500ms; }
html.motion-ok .trip-tile.is-drawn .tile-star { animation: star-arrive 900ms var(--ease-soft) 820ms both; }
@keyframes star-arrive { from { opacity: 0; transform: scale(.3) rotate(-60deg); } }
@media (hover: hover) and (pointer: fine) {
  html.motion-ok .trip-tile:hover .tile-arc-pulse { animation: arc-pulse 2.4s var(--ease-in-out) infinite; }
  html.motion-ok .trip-tile:hover .tile-star { animation: star-breathe 2.4s var(--ease-in-out) infinite; }
}

html.motion-ok .packing-item.jm-checked { animation: check-glow 1200ms var(--ease-soft); }
html.motion-ok .packing-item.jm-checked input { animation: check-pop 520ms var(--ease-soft); }
@keyframes check-glow { 0% { background-color: color-mix(in srgb, var(--accent) 12%, transparent); } 100% { background-color: transparent; } }
@keyframes check-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

.button .j-icon { transition: transform 520ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .button:hover .j-icon { transform: translateX(3px); } }

/* ---------- Phones and narrow tablets ---------- */
@media (max-width: 800px) {
  /* Preview moment: label and control on one line, full width. */
  .journey-page .journey-stage-bar { justify-content: stretch; margin: 6px 0 14px; }
  .journey-page .demo-control { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 14px; }
  .journey-page .demo-control select { flex: 1; min-width: 0; max-width: 280px; }

  /* Before you go: the destination becomes a banner above the copy. */
  .journey-page .prep-hero { grid-template-columns: 1fr; min-height: 0; }
  .journey-page .prep-destination { order: -1; min-height: 250px; }
  .journey-page .prep-hero-copy { padding: 26px 24px 28px; }
  .journey-page .prep-hero h2 { font-size: 34px; margin: 14px 0; }
  .prep-orbit.orbit-one { width: 400px; height: 150px; left: -70px; top: 80px; }
  .prep-orbit.orbit-two { width: 420px; height: 260px; left: -40px; top: 10px; }
  .prep-orbit .prep-star { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  .prep-destination-label { left: 24px; top: auto; bottom: 24px; gap: 4px; }
  .journey-page .prep-destination-label strong { font-size: 76px; }
  .prep-countdown { right: 16px; bottom: 18px; padding: 10px 14px; gap: 10px; }
  .prep-countdown b { font-size: 1.6rem; }

  /* Facts: a clean two-by-two grid with hairlines between cells. */
  .journey-page .prep-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; margin: 24px 0 30px; border-top: 1px solid var(--line); }
  .journey-page .prep-facts > div { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--line); align-content: start; }
  .journey-page .prep-facts > div:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--line); }
  .journey-page .prep-facts > div:nth-child(even) { padding-left: 16px; }
  .journey-page .prep-facts .text-button { justify-self: start; text-align: left; }
  .prep-route-map .section-heading { flex-wrap: wrap; row-gap: 4px; }

  .next-details { grid-column: 1 / -1; }
  .journey-page .journey-foot { flex-wrap: wrap; row-gap: 6px; }
}
@media (max-width: 640px) {
  /* Maps leave room to scroll past them; the side bar keeps zoom and tilt (rotation is in Rotate mode, reset is the pill). */
  .prep-route-map { padding: 16px; }
  .prep-route-map .journey-studio { height: 380px; }
  .terminal-scene .map-studio { height: 420px; }
  .journey-map .flight-studio, .journey-map .arrival-studio { height: 380px; }
  .map-studio .studio-controls :is([data-camera=left], [data-camera=right], [data-camera=reset]), .map-studio .studio-controls > span:first-of-type { display: none; }
  .map-studio .studio-modes { left: 14px; }
  .map-studio .studio-compass { right: 14px; }
  .map-studio .studio-controls { right: 14px; }
  .map-studio .studio-topline { left: 16px; right: 16px; }
  .map-studio .studio-bottomline { left: 16px; right: 16px; }
}
@media (max-width: 540px) {
  /* Vertical rail: the line runs through the centre of every 38px node, chips sit in the flow. */
  .journey-page .journey-rail li { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 16px; }
  .journey-page .journey-rail li::before { left: 19px; top: 38px; transform-origin: 50% 0; }
  .journey-page .connection-chip { position: static; grid-column: 2; margin-top: 10px; background: none; }
  html.motion-ok .timeline.jm-draw .journey-rail li::before { animation-name: rail-draw-down; }
  @keyframes rail-draw-down { from { transform: scaleY(0); } }

  .care-teaser > div:nth-child(2), .family-teaser > div { flex: 1 1 calc(100% - 64px); }
  .journey-page .service-art-dot { width: 72px; height: 72px; top: calc(50% - 36px); left: calc(50% - 36px); }
  .sample-heading { flex-direction: column; align-items: flex-start; gap: 6px; }
  .journey-page .sample-heading > span { max-width: none; text-align: left; }
  .tile-route .tile-arc { min-height: 56px; }
  .terminal-toolbar { align-items: flex-start; }
  .terminal-toolbar .eyebrow { white-space: nowrap; }
  .tile-meta { font-size: 12px; }
  .tile-meta > span:first-child { letter-spacing: .07em; }
  .tile-bottom { flex-wrap: wrap; row-gap: 8px; }
  .tile-bottom > span:last-child { margin-left: auto; }
}
