/* The unfold kit (unfold.js, docs/standards/UNFOLD-KIT.md). Theme it with the --unfold-* variables; a page keeps its
   own type for the words it hands in. The view holds the screen while the beats scroll past under it.
   Each place bursts out of the traveler: the lead photograph fills the screen, more prints overlap it, the words on glass.
   Between places they shrink back into the traveler and the map shows, the counter high and the trail behind. */
.unfold {
  --unfold-ink: #0f1713; --unfold-paper: #fff7e9; --unfold-gold: #d7b574; --unfold-gold-2: #fce5a7; --unfold-hot: #faab56;
  --unfold-display: Georgia, serif; --unfold-top: 0px; --unfold-beat: 150svh;
  position: relative; background: var(--unfold-ink); color: var(--unfold-paper);
}
.unfold-view { position: sticky; top: var(--unfold-top); height: calc(100svh - var(--unfold-top)); overflow: hidden; isolation: isolate; }
.unfold-track { margin-top: calc(-100svh + var(--unfold-top)); }
/* Pin the entire first departure and final return before the story scrolls off screen. */
.unfold.is-still .unfold-track { padding-block: calc((100svh - var(--unfold-top)) / 2); }
.unfold-beat { height: var(--unfold-beat); }
.unfold-beat:focus { outline: none; }
.unfold-arrival-home { height: calc(100svh - var(--unfold-top)); pointer-events: none; }
.unfold-arrival-home:focus { outline: none; }
/* An inline story is a sheet that slides up over its stop's open photograph and away again. */
.unfold-arrival { position: relative; z-index: 1; padding-block: 14px; border-radius: 18px; background: var(--unfold-ink);
  box-shadow: 0 -24px 60px -18px rgb(0 0 0 / .75), 0 24px 60px -18px rgb(0 0 0 / .75); }

/* Back: the world. Darkened so the light things on it read; its far edges fade out. */
.unfold-world { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.unfold-ground { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.unfold-near, .unfold-ground svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.unfold-near { filter: saturate(.8) brightness(.7);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent); mask-composite: intersect; }
.unfold-far { position: absolute; display: block; max-width: none; filter: saturate(.7) brightness(.55);
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent); mask-image: radial-gradient(closest-side, #000 70%, transparent); }
.unfold-ground polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.unfold-ahead { stroke: var(--unfold-paper); stroke-opacity: .7; stroke-width: 6; stroke-dasharray: 1 15; }
.unfold-casing { stroke: #08100d; stroke-opacity: .55; stroke-width: 21; }
.unfold-trail { stroke: var(--unfold-gold-2); stroke-width: 9; }
.unfold-pin { fill: #1c2b24; stroke: var(--unfold-paper); stroke-width: 4; }
.unfold-pin.passed { fill: var(--unfold-hot); }
.unfold-pin.next { fill: var(--unfold-paper); stroke: var(--unfold-hot); stroke-width: 7; }
.unfold-pin.here { opacity: 0; }
/* Where the picture was taken from: a soft gold wedge from the camera's spot. An estimated spot has dashed edges. */
.unfold-from polygon { fill: rgb(252 229 167 / .2); stroke: var(--unfold-gold-2); stroke-width: 3; stroke-linejoin: round; }
.unfold-from.is-estimated polygon { stroke-dasharray: 7 8; }
.unfold-from circle { fill: var(--unfold-gold-2); stroke: #1c2b24; stroke-width: 3; }
/* A soft evening around the edges, lightest where the traveler stands. */
.unfold-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 74% 42%, transparent 0, rgb(15 23 19 / .25) 55%, rgb(15 23 19 / .7) 100%), linear-gradient(rgb(15 23 19 / .7), transparent 22%, transparent 72%, rgb(15 23 19 / .75)); }

/* The traveler stands on one spot; the world moves under it. */
.unfold-you { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.unfold-you > * { position: absolute; display: block; border-radius: 50%; }
.unfold-halo { left: -22px; top: -22px; width: 44px; height: 44px; background: var(--unfold-hot); opacity: .28; animation: unfold-breathe 2.4s ease-in-out infinite; }
.unfold-dot { left: -11px; top: -11px; width: 22px; height: 22px; background: var(--unfold-hot); border: 3px solid #fff; box-shadow: 0 4px 12px #000b; }
@keyframes unfold-breathe { 50% { transform: scale(1.45); opacity: .12; } }

/* The counter: big, outlined, behind the print and the words. It holds while a chapter is read and counts between. */
.unfold-count { position: absolute; z-index: 3; left: 16px; top: max(10px, 2.2svh); margin: 0; pointer-events: none; display: flex; align-items: baseline; gap: .5rem; }
.unfold-count b { font: 400 clamp(56px, 16vw, 250px)/.8 var(--unfold-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: transparent; -webkit-text-stroke: 1.5px rgb(215 181 116 / .7); text-shadow: 0 0 40px rgb(15 23 19 / .7); }
.unfold-count span { font: 700 .66rem/1.2 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: rgb(241 210 160 / .85); }

/* The pieces of a chapter burst out of the place together and fill the screen, overlapping (core.js spreadPose): the
   lead photograph covers the whole view, one or two more lie over it as prints, and the words sit on glass in front.
   Each grows from and shrinks into the place's dot (its transform-origin, set by unfold.js), so place them with
   left/top/right/bottom only: a `translate` here would throw that origin off. */
.unfold-print { position: absolute; z-index: 4; inset: 0; margin: 0; overflow: hidden; border-radius: 10px; background: #1c2b24;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .9); will-change: transform, opacity; }
.unfold-print img { display: block; width: 100%; height: 100%; object-fit: cover; }
.unfold-print::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgb(15 23 19 / .3), transparent 16%, transparent 58%, rgb(15 23 19 / .55)); opacity: var(--k, 1); }
/* On a trip the lead is also its place's photo pin (--k 0, set by the kit): framed in gold while folded, the frame
   fading as it opens; the shading above comes in with it. */
.unfold-print { outline: 2px solid rgb(252 229 167 / calc(1 - 1.6 * var(--k, 1))); outline-offset: -2px; }
.unfold-print.is-whole { background: #e8dfce; }
.unfold-print.is-whole img { object-fit: contain; padding: 3svh 4vw; box-sizing: border-box; }
/* The credit reads only once the photo is nearly open (--k), never on the folded pin. */
.unfold-print figcaption { opacity: clamp(0, calc(var(--k, 1) * 4 - 3), 1); }
.unfold-print figcaption { position: absolute; z-index: 1; left: 16px; top: 12px; max-width: 60vw; margin: 0; color: rgb(255 247 233 / .88);
  font-size: 12px; line-height: 1.35; text-shadow: 0 1px 4px #000; }
.unfold-tile { position: absolute; z-index: 4; display: block; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: #1c2b24;
  outline: 3px solid rgb(255 247 233 / .92); outline-offset: -1px; box-shadow: 0 30px 60px -18px rgb(0 0 0 / .9); opacity: 0; will-change: transform, opacity; }
/* Phone: the further prints overlap down the upper half, clear of the words low on the screen. */
.unfold-tile.is-1 { right: 14px; top: 9svh; width: 54vw; }
.unfold-tile.is-2 { left: 14px; top: calc(9svh + 30vw); width: 48vw; }
/* A sequence (several views at one place): detail views fill the same frame and dissolve over the lead. */
.unfold-print .unfold-frame { position: absolute; inset: 0; opacity: 0; }
.unfold-print.is-sequence figcaption { z-index: 2; }

/* The nugget: the one gold thing, small and glowing a little, that hops from the place to each picture, to the words,
   and home (docs/design/GOLD-PATH-LOGIC.md). Not a bullet: it rests just off the headline, never on it. */
.unfold-nugget { position: absolute; left: 0; top: 0; z-index: 6; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fffaf0, var(--unfold-gold-2) 40%, var(--unfold-gold) 78%);
  box-shadow: 0 0 12px 4px rgb(252 229 167 / .7), 0 0 34px 12px rgb(215 181 116 / .3); opacity: 0; visibility: hidden; will-change: transform, opacity; }
.unfold-nugget.is-tail { box-shadow: 0 0 10px 3px rgb(252 229 167 / .45); }

/* Front: the words on glass. The world shows through, softened, so the pane belongs to the scene. */
.unfold-words { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); max-width: 620px; margin-inline: auto;
  padding: 16px 18px 16px; border-radius: 16px; border: 1px solid rgb(255 247 233 / .13);
  background: linear-gradient(160deg, rgb(255 247 233 / .07), rgb(255 247 233 / .015) 40%), rgb(12 20 16 / .5);
  -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 1px 0 rgb(255 247 233 / .08) inset, 0 24px 50px -24px rgb(0 0 0 / .8); will-change: transform, opacity; }

/* The sign at the traveler while they walk; under the pieces, which cover it when they fill the screen. */
.unfold-sign { position: absolute; left: 0; top: 0; z-index: 3; margin: 0; pointer-events: none; display: grid; gap: .1rem; width: max-content; max-width: min(17rem, 58vw);
  translate: 24px -50%; transform-origin: 0 50%; padding: .5rem .85rem .6rem .9rem; border-left: 2px solid var(--unfold-gold); border-radius: 0 10px 10px 0;
  background: rgb(12 20 16 / .5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--unfold-paper); box-shadow: 0 12px 26px -12px #000; }
.unfold-sign[data-flip] { translate: calc(-100% - 24px) -50%; transform-origin: 100% 50%; border-left: 0; border-right: 2px solid var(--unfold-gold); border-radius: 10px 0 0 10px; text-align: right; }
.unfold-sign span { font: 700 .62rem/1.3 system-ui, sans-serif; letter-spacing: .15em; text-transform: uppercase; color: #f1d2a0; }
.unfold-sign strong { font: 400 1.3rem/1.1 var(--unfold-display); }
.unfold-sign small { font-size: .74rem; color: rgb(255 247 233 / .78); }

.unfold-progress { position: absolute; z-index: 7; left: 0; right: 0; top: 0; height: 3px; background: rgb(255 247 233 / .1); }
.unfold-progress i { display: block; height: 100%; background: var(--unfold-gold); transform-origin: 0 50%; }

@media (min-width: 900px) {
  /* The counter high on the left, over the print's corner, clear of the traveler and the trail on the right. */
  .unfold-count { left: 5vw; top: 4svh; }
  .unfold-count b { font-size: clamp(96px, 9vw, 150px); }
  /* Wide: the further prints overlap high on the right, the words on glass low right, the caption low left. */
  .unfold-tile.is-1 { left: auto; right: 4vw; top: 5svh; width: min(28vw, 52svh); }
  .unfold-tile.is-2 { left: auto; right: calc(4vw + min(20vw, 37svh)); top: calc(5svh + min(14vw, 26svh)); width: min(21vw, 39svh); }
  .unfold-print figcaption { top: auto; bottom: 18px; left: 5vw; max-width: 50vw; }
  .unfold-words { left: auto; right: 5vw; bottom: 6svh; width: min(440px, 33vw); padding: 20px 22px 18px; }
}
@media (max-width: 899px) {
  .unfold-scrim { background: radial-gradient(ellipse 80% 40% at 50% 50%, transparent 0, rgb(15 23 19 / .3) 60%, rgb(15 23 19 / .7) 100%), linear-gradient(rgb(15 23 19 / .7), transparent 20%, transparent 70%, rgb(15 23 19 / .8)); }
  .unfold-sign { max-width: 56vw; padding: .4rem .65rem .45rem .7rem; translate: 18px -50%; }
  .unfold-sign[data-flip] { translate: calc(-100% - 18px) -50%; }
  .unfold-sign strong { font-size: 1.05rem; }
}
.unfold-stations { position:absolute; z-index:2; left:60%; right:4%; top:38%; display:flex; color:#cad2ca; font:600 11px/1.5 system-ui,sans-serif; }
.unfold-stations::before { content:''; position:absolute; top:3px; left:0; right:0; border-top:1px solid currentColor; opacity:.4; }
.unfold-station { position:relative; flex:1; text-align:center; color:#b2bdb6; }
.unfold-station .unfold-place-dot { position:relative; display:block; width:7px; height:7px; margin:0 auto 9px; border-radius:50%; background:#64736c; border:1px solid #abb7b0; }
.unfold-station.is-here { color:#fff8e9; }
.unfold-station.is-here .unfold-place-dot { background:#fff8e9; }
@media(max-width:899px){.unfold-stations{left:6%;right:6%;top:50%}}
