/* 慕士塔格 · the story inside the book. Three movements, one continuous scroll:
   a ribbon of photographs (after Vante's Video Ribbon), a field-notes route map (after Halden Stories),
   and a photo sphere to end on (after Ethan Vale's Nature Portfolio). */
.mz { --paper: #F4F2ED; --ink: #1C1A17; --ink2: #3B3731; --mid: #8d8b86; --night: #060B1F; --on: #f4f2ef;
  --mz-serif: "Newsreader", "Noto Serif SC", "Songti SC", serif; --mz-sans: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --e: cubic-bezier(.22,.61,.36,1); color: var(--ink); }
.mz section { position: relative; }
.mz .stg { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
/* movements hand over like the book page does: the outgoing content lifts away, the next rises in;
   every stage is the same paper, so the seam between two stages never shows */
.mz-mapin { position: absolute; inset: 0; transform-origin: 50% 40%; }
.mz-gl, .mz-rule, .mz-bot { transform-origin: 50% 40%; }
.mz-hero { position: absolute; inset: 0; z-index: 2; transform-origin: 50% 40%; }

/* ---------- 1 · ribbon ---------- */
.mz-rb .stg { background: transparent; }
.mz-hl { position: absolute; left: 0; right: 0; font: 400 clamp(64px, 12vw, 230px)/1 var(--mz-serif); letter-spacing: .02em; white-space: nowrap; text-align: center; }
.mz-l1 { top: calc(50% - 1.02em); }
.mz-l2 { top: calc(50% + .02em); }
.mz-l1 span, .mz-l2 span { display: inline-block; }
.mz-l1 span { margin-right: 15vw; }
.mz-l2 span { margin-left: 15vw; }
.mz-cap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 16em; text-align: center; font: 500 clamp(10px, .8vw, 13px)/1.6 var(--mz-sans); letter-spacing: .12em; color: var(--ink); }
.mz-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mz-rule { position: absolute; left: 3.5vw; right: 3.5vw; top: 50%; height: 1px; background: rgba(28,26,23,.16); transform-origin: left; transform: scaleX(0); }
.mz-bot { position: absolute; left: 32px; right: 32px; bottom: 30px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; font: 400 13px/1.6 var(--mz-sans); pointer-events: none; }
.mz-bot p { max-width: 22em; }
.mz-bot .mid { font-size: 11.5px; letter-spacing: .12em; color: var(--ink2); }
.mz-bot .mid s { text-decoration: none; color: var(--mid); margin: 0 .9em; }
.mz-bot .r { justify-self: end; display: flex; gap: 12px; align-items: center; font-size: 11.5px; letter-spacing: .12em; }
.mz-bot .r::after { content: ""; width: 22px; height: 1px; background: var(--ink); }
.mz-name { position: absolute; left: 0; top: 0; padding: 6px 11px; background: var(--ink); color: var(--paper); border-radius: 99px; font: 600 12px var(--mz-sans); letter-spacing: .04em; pointer-events: none; opacity: 0; transition: opacity .16s; white-space: nowrap; z-index: 3; }

/* ---------- 2 · route map ---------- */
.mz-map .stg { background: transparent; }
.mz-frame { position: absolute; left: 50%; top: 50%; width: 1440px; height: 810px; transform-origin: 50% 50%; }
.mz-frame svg { position: absolute; inset: -20%; width: 140%; height: 140%; overflow: visible; }
.mz-mtn .ct { fill: none; stroke: var(--ink); stroke-width: .9; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.7s var(--e); opacity: .62; }
.mz-mtn .ct.k { stroke-width: 1.4; opacity: 1; }
.mz-map.drawn .mz-mtn .ct { stroke-dashoffset: 0; }
.mz-mtn .route { fill: none; stroke: var(--acc); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 2 6; stroke-linecap: round; }
.mz-mtn .walked { fill: none; stroke: var(--acc); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; transition: stroke-dashoffset 1s var(--e); }
.mz-mtn .band { opacity: 0; transition: opacity .65s var(--e); }
.mz-mtn .band.on { opacity: 1; }
.mz-mtn .stop circle { fill: var(--acc); }
.mz-mtn .stop .halo { fill: var(--acc); opacity: .18; transform-box: fill-box; transform-origin: center; animation: mzhalo 2.4s ease-out infinite; }
@keyframes mzhalo { from { transform: scale(.6); opacity: .35; } to { transform: scale(2.2); opacity: 0; } }
.mz-mtn .peak text, .mz-mtn .lab { font: 500 12px var(--mz-sans); fill: var(--ink2); letter-spacing: .08em; }
.mz-ring { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; pointer-events: none; transform: scale(0); transition: transform .7s cubic-bezier(.16,1,.3,1), left .9s var(--e), top .9s var(--e); }
.mz-ring.on { transform: scale(1); }
.mz-ring .disc { position: absolute; left: 31px; top: 31px; width: 62px; height: 62px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px var(--ink); display: grid; place-items: center; font: 300 26px/1 var(--mz-sans); color: var(--ink); }
.mz-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: mzspin 14s linear infinite; }
.mz-ring text { font: 600 9.5px var(--mz-sans); letter-spacing: .2em; fill: var(--ink); }
@keyframes mzspin { to { transform: rotate(360deg); } }

.mz-intro { position: absolute; left: 60px; top: 50%; transform: translateY(-50%); width: 360px; }
.mz-eb { font: 600 11px var(--mz-sans); letter-spacing: .24em; color: var(--ink2); }
.mz-intro h2 { margin-top: 18px; font: 600 52px/1.12 var(--mz-serif); letter-spacing: .01em; }
.mz-intro h2 em { font-style: normal; color: var(--acc); }
.mz-st { margin-top: 34px; min-height: 9.5em; position: relative; }
.mz-st .card { position: absolute; inset: 0; }
.mz-st .k { font: 600 11px var(--mz-sans); letter-spacing: .2em; color: var(--acc); }
.mz-st h3 { margin-top: 10px; font: 600 26px/1.3 var(--mz-serif); }
.mz-st p { margin-top: 12px; font: 400 15px/1.95 var(--mz-serif); color: var(--ink2); max-width: 24em; }
.mz-st .m { overflow: hidden; }
.mz-st .m > * { display: block; transform: translateY(105%); transition: transform .8s var(--e); }
.mz-st .card.on .m > * { transform: none; transition-delay: calc(var(--d, 0) * 70ms + 120ms); }
.mz-st .card.off .m > * { transform: translateY(-105%); transition-duration: .45s; }
.mz-coord { position: absolute; right: 60px; top: 104px; text-align: right; font: 500 11px/1.8 var(--mz-sans); letter-spacing: .1em; color: var(--ink2); }
.mz-coord b { display: block; font: 400 30px/1.1 var(--mz-serif); letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.mz-zones { position: absolute; right: 60px; top: 50%; transform: translateY(-38%); display: flex; gap: 22px; align-items: stretch; }
.mz-zones .h { position: absolute; right: 0; top: -34px; font: 600 11px var(--mz-sans); letter-spacing: .24em; color: var(--ink2); }
.mz-zones ol { list-style: none; text-align: right; }
.mz-zones li { font: 400 22px/44px var(--mz-serif); color: var(--ink); cursor: pointer; transition: color .4s; white-space: nowrap; }
.mz-zones li small { font: 500 11px var(--mz-sans); letter-spacing: .08em; color: var(--mid); margin-left: 10px; }
.mz-zones li.on { color: var(--acc); }
.mz-zones li.top { color: var(--mid); cursor: default; }
.mz-ruler { position: relative; width: 10px; background: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 9px) right / 6px 100% no-repeat; }
.mz-ruler::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--ink); }
.mz-ruler i { position: absolute; right: -3px; width: 14px; height: 2px; background: var(--acc); top: 0; transition: top .7s cubic-bezier(.16,1,.3,1); }

/* ---------- 3 · photo sphere ---------- */
.mz-orb .stg { background: transparent; color: var(--ink); touch-action: pan-y; cursor: grab; perspective: var(--persp, 1150px); perspective-origin: 50% 50%; }
.mz-orb .stg:active { cursor: grabbing; }
.mz-world, .mz-ball { position: absolute; top: 50%; left: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.mz-card { opacity: 0; }   /* faded in card by card by the arrival; the 3D container itself never takes opacity */
.mz-hd { opacity: 0; }
.mz-ball { top: 0; left: 0; }
.mz-hd { position: absolute; top: 0; left: 0; width: var(--hw); margin-left: calc(var(--hw) / -2); text-align: center; font: 400 clamp(30px, 4.4vw, 64px)/1.06 var(--mz-serif); letter-spacing: .14em; color: var(--ink); text-shadow: 0 0 28px var(--paper), 0 0 10px var(--paper); pointer-events: none; user-select: none; }
.mz-hd .in { position: absolute; top: 0; left: 0; width: 100%; transform: translateY(-50%); }
.mz-hd .in span { display: inline-block; opacity: 0; transform: translateY(.42em); filter: blur(7px); transition: opacity 1.05s, transform 1.15s, filter 1.05s; transition-delay: calc(.2s + var(--i) * .085s); }
.mz-orb.seen .mz-hd .in span { opacity: 1; transform: none; filter: blur(0); }
.mz-hd small { display: block; margin-top: 14px; font: 500 11px var(--mz-sans); letter-spacing: .3em; color: var(--ink2); }
.mz-card { position: absolute; top: 0; left: 0; width: var(--cw); height: calc(var(--cw) / 1.333); margin-left: calc(var(--cw) / -2); margin-top: calc(var(--cw) / -2.666); backface-visibility: hidden; cursor: pointer; }
.mz-card.tall { height: calc(var(--cw) * 1.333); margin-top: calc(var(--cw) * -.666); }
.mz-card figure { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 3px; background: #E4E0D6; box-shadow: 0 14px 30px -18px rgba(40,30,15,.45); transition: transform .5s var(--e); }
.mz-card:hover figure { transform: scale(1.045); }
.mz-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease-out; }
.mz-card img.in { opacity: 1; }
.mz-card figure::after { content: ""; position: absolute; inset: 0; background: rgba(244,242,237,var(--d,0)); box-shadow: inset 0 0 0 1px rgba(28,26,23,.06); border-radius: 3px; pointer-events: none; }
.mz-vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 88% 92% at 50% 50%, rgba(244,242,237,0) 52%, rgba(244,242,237,.55) 82%, rgba(244,242,237,.95) 100%); }
.mz-bio { position: absolute; left: 34px; bottom: 30px; max-width: 320px; font: 400 12.5px/1.62 var(--mz-sans); color: var(--ink2); pointer-events: none; }
.mz-bio b { display: block; font: 400 19px var(--mz-serif); color: var(--ink); margin-bottom: 8px; letter-spacing: .04em; }
.mz-colo { position: absolute; right: 34px; bottom: 30px; font: 400 12.5px var(--mz-sans); color: var(--ink2); letter-spacing: .06em; }

/* lightbox: the plate flies from the card it came from */
.mz-lit { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: clamp(56px, 8vh, 84px) 34px; opacity: 0; pointer-events: none; transition: opacity .4s; color: #1C1A17; background: rgba(244,242,237,.82); }
.mz-lit.on { opacity: 1; pointer-events: auto; }
.mz-lit .scrim { position: absolute; inset: 0; }
.mz-plate { position: relative; width: min(72vw, 860px, (100vh - 230px) * 1.333); transition: transform .62s var(--e), opacity .42s var(--e); }
.mz-shot { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 2px; background: #E4E0D6; box-shadow: 0 40px 80px -40px rgba(40,30,15,.55); overflow: hidden; }
.mz-shot img { width: 100%; height: 100%; object-fit: cover; }
.mz-x { position: absolute; top: 12px; right: 14px; min-height: 40px; padding: 8px 14px; border: 1px solid rgba(244,242,239,.78); border-radius: 6px; background: rgba(0,0,0,.35); color: #f4f2ef; font: 500 12.5px var(--mz-sans); letter-spacing: .08em; cursor: pointer; }
.mz-x:hover { border-color: #fff; background: rgba(0,0,0,.55); }
.mz-meta { display: grid; grid-template-columns: minmax(0,.78fr) minmax(0,1.22fr); gap: clamp(22px, 3.2vw, 48px); padding-top: 16px; }
.mz-meta h2 { font: 400 clamp(22px, 2.15vw, 32px)/1.15 var(--mz-serif); letter-spacing: .02em; margin-bottom: 6px; }
.mz-meta .w { font: 400 13px var(--mz-sans); color: #6D6A63; }
.mz-meta .n { font: 400 15px/1.85 var(--mz-serif); color: #1C1A17; }

@media (max-width: 900px) {
  .mz-meta { grid-template-columns: 1fr; gap: 10px; }
  .mz-plate { width: min(92vw, (100dvh - 220px) * 1.333); }
}
@media (max-width: 760px) {
  .mz-bot { left: 18px; right: 18px; bottom: 18px; grid-template-columns: 1fr auto; } .mz-bot .mid { display: none; }
  .mz-bot p { max-width: 15em; font-size: 12px; }
    .mz-intro { left: 22px; right: 22px; top: 84px; transform: none; width: auto; }
  .mz-intro h2 { font-size: 34px; }
  .mz-st { min-height: 11em; }
  .mz-st p { font-size: 14px; }
  .mz-coord { display: none; }
  .mz-zones { left: 0; right: 0; top: auto; bottom: 22px; transform: none; overflow-x: auto; padding: 0 22px; }
  .mz-zones .h, .mz-ruler { display: none; }
  .mz-zones ol { display: flex; gap: 8px; }
  .mz-zones li { font-size: 15px; line-height: 34px; padding: 0 14px; border: 1px solid rgba(28,26,23,.25); border-radius: 99px; }
  .mz-zones li small { display: none; }
  .mz-zones li.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .mz-bio p, .mz-colo { display: none; }
  .mz-bio { left: 18px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .mz *, .mz-lit * { animation-duration: .01ms !important; transition-duration: .14s !important; }
}
