/* The Journey arrival (JourneyHero.tsx + shared/homeJourney.ts journeyHeroHtml). Served byte-identical as
   /journey/journey-hero.css for the phone first paint (a test holds the two files together). Transform/opacity motion only. */
@font-face { font-family: "Atlas Display"; src: url("/atlas/fonts/libre-caslon-display-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atlas Sans"; src: url("/atlas/fonts/manrope-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atlas Sans"; src: url("/atlas/fonts/manrope-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Atlas Sans"; src: url("/atlas/fonts/manrope-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Metric-matched fallbacks (measured in Chromium 29 Oct 2026: same headline width as Libre Caslon Display / Manrope), so the
   arrival does not reflow when the brand fonts arrive. Overrides are divided by size-adjust. */
@font-face { font-family: "Atlas Display Fallback"; src: local("Georgia"); size-adjust: 83.1%; ascent-override: 116.7%; descent-override: 32.5%; line-gap-override: 0%; }
@font-face { font-family: "Atlas Display Fallback T"; src: local("Times New Roman"); size-adjust: 91.6%; ascent-override: 105.9%; descent-override: 29.5%; line-gap-override: 0%; }
@font-face { font-family: "Atlas Sans Fallback"; src: local("Arial"); size-adjust: 103.8%; ascent-override: 103.1%; descent-override: 28.9%; line-gap-override: 0%; }

.jh {
  --ink: #0a1430; --ivory: #fbf5ea; --teal: #2fd3c6; --teal-soft: #a9ece4; --copper: #f3a55a; --copper-deep: #b4531c;
  --display: "Atlas Display", "Atlas Display Fallback", "Atlas Display Fallback T", Georgia, serif; --sans: "Atlas Sans", "Atlas Sans Fallback", Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* focus point of the painting kept on screen (0..1 of the plate); the arch and the first stones stay visible */
  --fx: 0.5; --fy: 0.62;
  --p: 0; --mx: 0; --my: 0;
  position: relative; isolation: isolate; overflow: visible; display: grid; grid-template-rows: auto 1fr auto;
  min-height: max(640px, min(100svh, 1000px)); background: var(--ink); color: var(--ivory); font-family: var(--sans);
}
.jh *, .jh *::before, .jh *::after { box-sizing: border-box; }

/* ---- the painted scene: a 3:2 stage that always covers the hero, so the image, the path and Milo share coordinates */
.jh-scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; container-type: size; pointer-events: none; }
.jh-stage {
  position: absolute; aspect-ratio: 3 / 2; width: max(100cqw, 150cqh);
  left: calc(var(--fx) * 100%); top: calc(var(--fy) * 100%); translate: calc(var(--fx) * -100%) calc(var(--fy) * -100%);
}
@supports not (width: 1cqw) { .jh-stage { inset: 0; width: 100%; height: 100%; translate: none; } .jh-plate { object-fit: cover; } }
.jh-stage picture, .jh-plate { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.jh-scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    /* a soft band under the header so its links pass 4.5:1 over the bright sunset and the gateway */
    linear-gradient(180deg, rgba(6, 10, 28, 0.86) 0px, rgba(6, 10, 28, 0.62) 64px, rgba(6, 10, 28, 0.2) 120px, rgba(6, 10, 28, 0) 170px),
    linear-gradient(100deg, rgba(7, 12, 34, 0.86) 0%, rgba(7, 12, 34, 0.62) 30%, rgba(7, 12, 34, 0.12) 55%, rgba(7, 12, 34, 0) 66%),
    linear-gradient(0deg, rgba(6, 10, 28, 0.9) 0%, rgba(6, 10, 28, 0.55) 18%, rgba(6, 10, 28, 0) 38%);
}

/* ---- copy */
.jh-copy { position: relative; z-index: 3; padding: clamp(112px, 15vh, 150px) max(24px, 5vw) 0; max-width: 820px; }
.jh-eyebrow { margin: 0; font: 600 0.78rem/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal-soft); }
.jh-title {
  margin: 0.4em 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 4.7vw, 4.9rem);
  line-height: 1.03; letter-spacing: -0.012em; color: var(--ivory); text-wrap: balance; text-shadow: 0 2px 28px rgba(4, 8, 24, 0.6);
}
.jh-title__line { display: block; }
.jh-sub { margin: 0.9em 0 0; max-width: 36ch; font-size: clamp(1.06rem, 1.3vw, 1.3rem); line-height: 1.5; font-weight: 500; color: rgba(251, 245, 234, 0.92); text-shadow: 0 1px 14px rgba(4, 8, 24, 0.7); }

/* ---- Milo's question and the four path stones (the obvious next action) */
.jh-ask { position: relative; z-index: 3; grid-row: 3; padding: 0 max(24px, 5vw) clamp(24px, 4.5vh, 48px); }
.jh-bubble {
  position: relative; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.25em 0.6em; margin: 0 0 16px; padding: 12px 20px;
  border-radius: 20px 20px 20px 6px; background: var(--ivory); color: var(--ink); font: 600 1.12rem/1.3 var(--sans);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}
.jh-bubble::after { content: ""; position: absolute; right: 26px; top: -9px; width: 18px; height: 18px; background: var(--ivory); transform: rotate(45deg); border-radius: 3px; }
.jh-bubble__name { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--copper-deep); }
.jh-stones ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 1140px; margin: 0; padding: 0; list-style: none; }
.jh-stone {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 14px; row-gap: 2px;
  height: 100%; min-height: 86px; padding: 14px 18px 14px 14px; border-radius: 20px; text-decoration: none; color: var(--ivory);
  background: linear-gradient(160deg, rgba(20, 34, 72, 0.88), rgba(9, 17, 42, 0.9)); border: 1px solid rgba(243, 165, 90, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 14px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.2s ease, box-shadow 0.25s ease;
}
.jh-stone__n {
  grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font: 400 1.25rem/1 var(--display); color: #2a1205;
  background: radial-gradient(circle at 34% 30%, #ffe6b8 0%, #f3a55a 44%, #c4652a 82%);
  box-shadow: 0 0 0 3px rgba(255, 200, 130, 0.16), 0 0 24px rgba(255, 160, 70, 0.55);
}
.jh-stone__label { align-self: end; font-weight: 600; font-size: 1.04rem; line-height: 1.25; }
.jh-stone__hint { align-self: start; font-weight: 500; font-size: 0.84rem; line-height: 1.35; color: var(--teal-soft); }
.jh-stone:hover { transform: translateY(-3px); border-color: var(--copper); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(243, 165, 90, 0.5), 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 36px rgba(243, 165, 90, 0.28); }
.jh-stone:focus-visible, .jh-look:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
/* Visible on every arrival, including 320px: a real control above the doors, not a text link under them. */
.jh-look {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin: 0 0 12px; padding: 0 16px; border-radius: 999px; text-decoration: none;
  font-size: 1rem; font-weight: 600; color: var(--ivory);
  background: rgba(10, 20, 48, 0.92); border: 1px solid rgba(243, 165, 90, 0.85);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.jh-look:hover { color: var(--ivory); border-color: var(--copper); }

/* ---- living layers (React only; all decorative, absolutely positioned, so nothing shifts when they arrive) */
.jh-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.8s ease; }
.jh-layer.is-in { opacity: 1; }
.jh-move { position: absolute; inset: 0; will-change: transform; }
.jh-stage { transform: translate3d(calc(var(--mx) * -6px), calc(var(--p) * 110px + var(--my) * -4px), 0); }
.jh-move--sky { transform: translate3d(calc(var(--mx) * 4px), calc(var(--p) * 50px), 0); }
.jh-move--fore { transform: translate3d(calc(var(--mx) * -12px), calc(var(--p) * -18px + var(--my) * -6px), 0); }
.jh-move--near { transform: translate3d(calc(var(--mx) * -18px), calc(var(--p) * -60px + var(--my) * -8px), 0); }
.jh-glow { position: absolute; left: 90%; top: 18.5%; width: 26%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 222, 160, 0.6) 0%, rgba(255, 176, 90, 0.22) 38%, rgba(255, 150, 60, 0) 70%); animation: jh-breathe 5.5s ease-in-out infinite; }
.jh-mist { position: absolute; left: -10%; top: 40%; width: 80%; height: 26%; border-radius: 50%; opacity: 0.55;
  background: radial-gradient(ellipse at center, rgba(214, 222, 246, 0.26) 0%, rgba(214, 222, 246, 0) 70%); animation: jh-drift 28s ease-in-out infinite alternate; }
.jh-mist--2 { left: 20%; top: 52%; width: 60%; height: 18%; opacity: 0.4; animation-duration: 36s; animation-direction: alternate-reverse; }
.jh-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jh-path path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.jh-path__glow { stroke: #ffb765; stroke-width: 15; opacity: 0.22; }
.jh-path__core { stroke: #ffe1a1; stroke-width: 3.2; opacity: 0.9; }
.jh-path__spark { stroke: #ffffff; stroke-width: 5; opacity: 0; stroke-dasharray: 3 97; }
.jh[data-drawn] .jh-path__glow, .jh[data-drawn] .jh-path__core { stroke-dasharray: 100 100; stroke-dashoffset: 100; animation: jh-draw 2.2s cubic-bezier(0.55, 0.1, 0.2, 1) 0.35s forwards; }
.jh[data-drawn] .jh-path__spark { animation: jh-spark 4.8s linear 2.6s infinite; }
.jh-lanterns { position: absolute; inset: 0; }
.jh-lantern { position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff2cf 0%, #ffbf69 34%, rgba(255, 150, 60, 0) 72%); animation: jh-float var(--d) ease-in-out var(--delay) infinite; opacity: 0; }
/* Milo stands on the third painted stone (984,683 on the 1536x1024 plate): clear of the stone cards at every width */
.jh-milo { position: absolute; left: 64.06%; top: 67.2%; width: clamp(68px, 7.8%, 156px); translate: -46% -98.2%; }
.jh-milo .milo { width: 100%; filter: drop-shadow(0 6px 10px rgba(5, 10, 30, 0.45)); }
.jh-milo__in { opacity: 0; transform: translateY(26px); transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.34, 1.5, 0.64, 1); }
.jh[data-drawn] .jh-milo__in { opacity: 1; transform: none; transition-delay: 0.15s; }
.jh[data-paused] *, .jh[data-paused] *::before, .jh[data-paused] *::after { animation-play-state: paused !important; }

/* ---- desktop guide (lead round 2): Milo ~1.5x larger, standing beside his question just above the four doors; the
   bubble's tail points at him. The painted-stone Milo above is the phone placement only. */
.jh-guide { display: none; }
@media (min-width: 761px) {
  .jh-milo { display: none; }
  .jh-bubble { border-radius: 20px 20px 6px 20px; }
  .jh-bubble::after { right: -7px; top: 14px; width: 16px; height: 16px; }
  /* feet (98.2% down the art) on the doors' top edge, 16px below the bubble (its margin) */
  .jh-guide { display: block; position: absolute; left: calc(100% + 10px); bottom: calc(-16px - 0.018 * clamp(140px, 11.7vw, 200px) * 220 / 218); width: clamp(140px, 11.7vw, 200px); pointer-events: none; }
  .jh-guide .milo { width: 100%; filter: drop-shadow(0 8px 12px rgba(5, 10, 30, 0.5)); }
}

/* ---- Milo's Guide return visit (round 3): the saved door continues, one tap starts over. Same boxes as a first visit. */
.jh-ret--short { display: none; }
.jh-stone.is-continue { border-color: var(--copper); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(243, 165, 90, 0.55), 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 32px rgba(243, 165, 90, 0.3); }
.jh-stone.is-continue .jh-stone__hint { color: #ffd9a3; }
.jh-restart {
  display: inline-flex; align-items: center; min-height: 44px; margin: 8px 0 0 20px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 0.95rem/1.2 var(--sans); color: rgba(251, 245, 234, 0.88); text-decoration: underline; text-decoration-color: rgba(47, 211, 198, 0.7); text-underline-offset: 5px;
}
.jh-restart:hover { color: var(--ivory); }
.jh-restart:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
@media (max-width: 760px) {
  .jh-ret--long { display: none; }
  .jh-ret--short { display: inline; }
  .jh-restart { margin-top: 4px; }
}

@keyframes jh-draw { to { stroke-dashoffset: 0; } }
@keyframes jh-spark { 0% { stroke-dashoffset: 103; opacity: 0; } 6% { opacity: 0.95; } 70% { opacity: 0.95; } 80%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes jh-breathe { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes jh-drift { from { transform: translateX(-4%); } to { transform: translateX(6%); } }
@keyframes jh-float { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.9; } 50% { opacity: 0.55; } 85% { opacity: 0.85; } 100% { transform: translateY(-46px); opacity: 0; } }

/* ---- phones: the scene on top, then the promise, then Milo's question and the stones in a 2x2 */
@media (max-width: 760px) {
  .jh { display: block; min-height: 0; padding-bottom: 16px; --fx: 0.86; --fy: 0.5; }
  .jh-scene { position: relative; inset: auto; height: clamp(148px, 26svh, 240px); }
  .jh-scene::after { background: linear-gradient(180deg, rgba(7, 12, 34, 0.55) 0%, rgba(7, 12, 34, 0) 30%), linear-gradient(0deg, var(--ink) 0%, rgba(10, 20, 48, 0.4) 14%, rgba(10, 20, 48, 0) 26%); }
  .jh-copy { margin-top: -10px; padding: 0 20px; }
  .jh-eyebrow { display: none; }
  .jh-title { margin-top: 0; font-size: clamp(1.9rem, 8.4vw, 2.5rem); }
  .jh-title__line { display: inline; }
  .jh-sub { margin-top: 0.55em; font-size: 1rem; }
  .jh-ask { padding: 16px 20px 0; }
  .jh-bubble { margin-bottom: 12px; padding: 9px 16px; font-size: 1rem; }
  .jh-bubble::after { right: auto; left: 70%; }
  .jh-stones ol { grid-template-columns: 1fr 1fr; gap: 8px; }
  .jh-stone { column-gap: 8px; min-height: 64px; padding: 8px 10px 8px 8px; border-radius: 16px; }
  .jh-stone__n { width: 34px; height: 34px; font-size: 1rem; }
  .jh-stone__label { font-size: 1rem; }
  .jh-stone__hint { font-size: 0.8rem; }
  .jh-look { margin-bottom: 10px; }
  .jh-milo { width: 72px; }
}
@media (max-width: 360px) {
  .jh-scene { height: 108px; }
  .jh-title { font-size: 1.65rem; }
  .jh-sub { margin-top: 0.3em; font-size: 0.95rem; }
  .jh-ask { padding: 8px 12px 0; }
  .jh-bubble { margin-bottom: 8px; padding: 8px 12px; }
  .jh-look { margin-bottom: 8px; }
  .jh-stones ol { gap: 6px; }
  .jh-stone { min-height: 0; padding: 6px 8px; column-gap: 6px; }
  .jh-stone__n { width: 28px; height: 28px; font-size: 0.95rem; }
  .jh-stone__label { font-size: 0.92rem; }
  .jh-stone__hint { font-size: 0.78rem; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .jh-stones ol { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
}

/* ---- reduced motion: the path is already drawn, Milo is already there, nothing drifts */
@media (prefers-reduced-motion: reduce) {
  .jh *, .jh *::before, .jh *::after { animation: none !important; }
  .jh-move, .jh-stage { transform: none !important; }
  .jh[data-drawn] .jh-path__glow, .jh[data-drawn] .jh-path__core { stroke-dashoffset: 0; }
  .jh-milo__in { opacity: 1; transform: none; transition: opacity 0.3s ease; }
  .jh-lantern { opacity: 0.7; }
  .jh-stone { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
  .jh-stone:hover { transform: none; }
}

/* ---- the phone first paint wrapper (static shell) */
.mt-fp--journey { background: #0a1430; }
