/*
Theme Name:  Yatriverse
Theme URI:   
Author:      Aman Gautam
Author URI:  
Description: Yatriverse — a personal universe of journeys. A cinematic sketch-artbook compass world (Notes / Wander / Within / Studio) explored as a single 2D canvas with a camera. Zero-dependency, single-page. Hand-lettered in Caveat on white paper.
Version:     0.0.2
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yatriverse
Tags:        custom-logo, full-width-template, one-column
*/

/* ═══════════════════════════════════════════════════════════════
   YATRIVERSE — The Compass World
   White-paper cinematic wonderland · ink + watercolor · Caveat
   ═══════════════════════════════════════════════════════════════ */

/* ── 0. Reset & Custom Properties ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #ffffff;
  --surface:     #f5f0e8;
  --cream:       #f7f2e8;
  --bg-card:     #f9f7f2;
  --text:        #1a0d04;
  --text-muted:  #5a3818;
  --text-dim:    #8a6440;
  --teal:        #2a8888;
  --teal-border: rgba(42,136,136,0.32);
  --rust:        #b84520;
  --gold:        #b87820;
  --sage:        #4a7845;
  --border:      rgba(50,25,8,0.15);
  --border-ink:  rgba(26,13,4,0.55);
  --ink-shadow:  3px 3px 0 rgba(26,13,4,0.08);
  --hand:        'Caveat', cursive;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  overflow: hidden;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--hand);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select { font-family: inherit; }

/* ── 1. World grid — the camera & the scenes ──────────────────── */
#viewport {
  position: fixed; inset: 0;
  overflow: hidden;
  transform-origin: 50% 50%;
  will-change: transform;
}
#world {
  position: absolute; top: 0; left: 0;
  will-change: transform;
}
.scene {
  position: absolute;
  width: 100vw; height: 100vh;
  left: calc(var(--gx) * 100vw);
  top:  calc(var(--gy) * 100vh);
  overflow: hidden;
  background: var(--bg);
  --gx: 0; --gy: 0;
}

/* Parallax layers — wrappers only, never positioned content */
.layer {
  position: absolute; inset: 0;
  pointer-events: none;
  will-change: transform;
}

/* ── 2. Scene grid coordinates (mirror of data-gx/gy) ─────────── */
#hub      { --gx: 0;  --gy: 0; }
#listen-1 { --gx: 0;  --gy: -1; }
#listen-2 { --gx: 0;  --gy: -2; }
#listen-3 { --gx: 0;  --gy: -3; }
#wander-1 { --gx: 1;  --gy: 0; }
#wander-2 { --gx: 2;  --gy: 0; }
#wander-3 { --gx: 3;  --gy: 0; }
#within-1 { --gx: 0;  --gy: 1; }
#within-2 { --gx: 0;  --gy: 2; }
#within-3 { --gx: 0;  --gy: 3; }
#create-1 { --gx: -1; --gy: 0; }
#create-2 { --gx: -2; --gy: 0; }
#create-3 { --gx: -3; --gy: 0; }

/* ── 3. Shared scene vocabulary ───────────────────────────────── */

/* Captions — positioning containers (NEVER carry .reveal themselves) */
.caption { position: absolute; z-index: 10; }
.caption--center {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.caption--lower  { top: 58%; }
.caption--above  { top: 22%; }
.caption--top-left     { top: clamp(100px, 13vh, 170px); left: 7vw; }   /* clears the fixed logo pill */
.caption--top-right    { top: clamp(3.5rem, 9vh, 6rem); right: clamp(2.5rem, 6vw, 6rem); text-align: right; }
.caption--bottom-left  { bottom: clamp(4rem, 11vh, 6.5rem); left: clamp(2.5rem, 6vw, 6rem); }
.caption--center-left  { top: 50%; left: clamp(2.5rem, 8vw, 9rem); transform: translateY(-50%); }
.caption--top-center   { text-align: center; }

.chapter-tag {
  font-family: var(--hand); font-weight: 600;
  font-size: 1.05rem; letter-spacing: 3px;
  color: var(--teal);
  margin-bottom: 0.4rem;
}
.chapter-tag--gold { color: var(--gold); }
.chapter-tag--rust { color: var(--rust); }
.chapter-tag--sage { color: var(--sage); }

.scene-title {
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(4.2rem, 8vw, 8.5rem);
  line-height: 0.95;
  color: var(--text);
}
.scene-title--small { font-size: clamp(2.4rem, 4vw, 3.4rem); font-weight: 600; }
.scene-title--airy {
  font-weight: 400; letter-spacing: 8px;
  color: var(--text-dim);
}

.tagline {
  font-family: var(--hand); font-size: 1.35rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Reveal system — --rot/--lift vars survive the entrance transform */
.reveal {
  opacity: 0;
  transform: translateY(calc(24px + var(--lift, 0px))) rotate(var(--rot, 0deg));
  transition: opacity 0.85s ease, transform 0.85s var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg));
}

/* Ink self-drawing strokes — triggered when a scene gets .lit */
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.scene.lit .draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
.scene.lit .draw-late  { transition-delay: 1.0s; }
.scene.lit .draw-later { transition-delay: 1.7s; }

/* Washi tape */
.washi {
  position: absolute; top: -11px; left: 50%;
  width: 74px; height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(184,120,32,0.28);
  border-left: 1px dashed rgba(255,255,255,0.6);
  border-right: 1px dashed rgba(255,255,255,0.6);
  pointer-events: none;
}
.washi--teal { background: rgba(42,136,136,0.26); transform: translateX(-50%) rotate(2.5deg); }
.washi--gold { background: rgba(184,69,32,0.22); transform: translateX(-50%) rotate(-1.5deg); }

/* ── 4. Fixed UI — logo, burger, overlay ──────────────────────── */
.nav-logo {
  position: fixed; top: 1.3rem; left: 1.6rem; z-index: 50;
  font-family: var(--hand); font-size: 1.9rem; font-weight: 700;
  padding: 0.15rem 1rem 0.3rem;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  box-shadow: var(--ink-shadow);
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.nav-logo:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 rgba(26,13,4,0.12); }
.logo-a, .wm-a { color: var(--text); }
.logo-b, .wm-b {
  font-style: italic;
  color: #6e6e6a;   /* fallback for browsers without background-clip: text */
  background: linear-gradient(120deg, #56564f 0%, #86867e 32%, #a8a89f 55%, #74746c 78%, #56564f 100%);
  background-size: 130% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.22em;
  margin-right: -0.14em;   /* cancel the padding's layout width so centering doesn't shift */
}

.nav-burger {
  position: fixed; top: 1.3rem; right: 1.6rem; z-index: 50;
  width: 48px; height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: var(--ink-shadow);
  transition: transform 0.3s var(--ease-out);
}
.nav-burger:hover { transform: translateY(-2px); }
.burger-bar {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.nav-burger.open .burger-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-burger.open .burger-bar:nth-child(2) { opacity: 0; }
.nav-burger.open .burger-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.overlay-close {
  position: absolute; top: 1.2rem; right: 1.7rem;
  font-size: 3rem; line-height: 1; color: var(--text-muted);
  transition: transform 0.3s var(--ease-out), color 0.3s;
}
.overlay-close:hover { transform: rotate(90deg); color: var(--rust); }

.toc { text-align: center; max-height: 88vh; overflow-y: auto; padding: 1rem 2rem; }
.toc-heading {
  font-size: 1.1rem; font-weight: 600;
  letter-spacing: 4px; color: var(--text-dim);
  margin-bottom: 1.6rem;
}
.toc-worlds { display: flex; flex-direction: column; gap: 1.4rem; }
.toc-title {
  font-size: 2.1rem; font-weight: 700;
  transition: color 0.25s;
}
.toc-title:hover, .toc-title--teal:hover { color: var(--teal); }
.toc-title--gold:hover { color: var(--gold); }
.toc-title--rust:hover { color: var(--rust); }
.toc-title--sage:hover { color: var(--sage); }
.toc-dir { font-size: 1.1rem; font-weight: 400; color: var(--text-dim); margin-left: 0.4rem; }
.toc-sub { display: block; font-size: 1.05rem; color: var(--text-dim); }
.toc-scenes { display: flex; gap: 1.4rem; justify-content: center; margin-top: 0.2rem; }
.toc-scenes a {
  font-size: 1.15rem; color: var(--text-muted);
  border-bottom: 1.5px dashed transparent;
  transition: color 0.25s, border-color 0.25s;
}
.toc-scenes a:hover { color: var(--teal); border-color: var(--teal-border); }

/* ── 5. Fixed UI — compass map, nav cue, corner mark ──────────── */
.compass-map {
  position: fixed; bottom: 1.4rem; right: 1.6rem; z-index: 40;
  /* width = 7px pad + (max cx 6)*13 + 10px cell + 7px pad = 102px; matches height
     for symmetric padding. Bump the max-cx term if the E/W arms ever grow. */
  width: 102px; height: 102px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: var(--ink-shadow);
}
.cm-cell {
  position: absolute;
  left: calc(7px + var(--cx) * 13px);
  top:  calc(7px + var(--cy) * 13px);
  width: 10px; height: 10px;
  border: 1.3px solid rgba(26,13,4,0.4);
  border-radius: 3px;
  background: rgba(255,255,255,0.9);
  padding: 0;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}
.cm-cell:hover { background: rgba(184,120,32,0.35); transform: scale(1.25); }
.cm-cell.active {
  background: var(--teal);
  border-color: var(--teal);
  transform: scale(1.28);
}
.cm-hub { border-radius: 50%; }

.nav-cue {
  position: fixed; bottom: 1.5rem; left: 50%; z-index: 40;
  transform: translateX(-50%);
  display: flex; gap: 0.5rem;
  transition: opacity 0.5s ease;
}
.nav-cue.hidden { opacity: 0; pointer-events: none; }
.nc-btn {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--hand); font-size: 1.12rem; font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.94);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  padding: 0.35rem 1.1rem 0.45rem;
  box-shadow: var(--ink-shadow);
  transition: transform 0.3s var(--ease-out), color 0.3s;
}
.nc-btn:hover { transform: translateY(-2px); color: var(--teal); }
.nc-arrow {
  display: inline-block;
  color: var(--teal); font-weight: 700;
  animation: cue-breathe 1.8s ease-in-out infinite;
}
@keyframes cue-breathe {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(calc(var(--ax, 0) * 5px), calc(var(--ay, 0) * 5px)); }
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.corner-mark {
  position: fixed; bottom: 1.6rem; left: 1.8rem; z-index: 40;
  font-size: 1.15rem; font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-dim); opacity: 0.75;
}

/* ── 6. The travelling wagon ───────────────────────────────────
   .van-layer covers the viewport; #van-holder is positioned each frame
   by updateVan() (translate/rotate/scale), its SVG offset by (-75,-66)
   so the transform pivots on the wheels' base point. Bob/wheel/puff are
   constant ambient loops (gated only by reduced-motion). */
.van-layer {
  position: fixed; inset: 0; z-index: 30;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.55s ease;
}
.van-layer.on-road { opacity: 1; }
.van-holder { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.van-svg { position: absolute; left: -75px; top: -66px; overflow: visible; }
.van-bob { animation: van-bob 0.55s ease-in-out infinite; }
.van-wheel { transform-box: fill-box; transform-origin: center; animation: van-wheel 1.1s linear infinite; }
.van-puff { transform-box: fill-box; transform-origin: center; animation: van-puff 1.6s linear infinite; }
@keyframes van-bob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.8px); } }
@keyframes van-wheel { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes van-puff  {
  0%   { opacity: 0.26; transform: translate(0, 0) scale(0.6); }
  100% { opacity: 0;    transform: translate(-26px, -14px) scale(1.5); }
}

/* ── 7. HUB · the crossroads ──────────────────────────────────── */
/* time-of-day wash tint — set by the inline head script via html[data-tod] */
:root {
  --hubwash-a: rgba(184,120,32,0.10);
  --hubwash-b: rgba(42,136,136,0.06);
}
html[data-tod="dawn"]  { --hubwash-a: rgba(219,120,110,0.16); --hubwash-b: rgba(184,120,32,0.10); }
html[data-tod="day"]   { --hubwash-a: rgba(184,120,32,0.10);  --hubwash-b: rgba(42,136,136,0.06); }
html[data-tod="dusk"]  { --hubwash-a: rgba(184,69,32,0.18);   --hubwash-b: rgba(107,63,160,0.12); }
html[data-tod="night"] { --hubwash-a: rgba(42,60,136,0.16);   --hubwash-b: rgba(42,90,120,0.10); }

.hub-wash {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  width: clamp(340px, 54vw, 620px); height: clamp(340px, 54vw, 620px);
  background: radial-gradient(ellipse at center,
    var(--hubwash-a) 0%,
    var(--hubwash-b) 40%,
    transparent 68%);
  filter: blur(54px);
  animation: wash-breathe 9s ease-in-out infinite;
  transition: background 2.4s ease;
}
@keyframes wash-breathe {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* night sky — moon, stars, dimmed daytime birds */
html[data-tod="night"] .drift-birds { opacity: 0.12; transition: opacity 2.4s ease; }
html[data-tod="night"] .drift-clouds { opacity: 0.35; transition: opacity 2.4s ease; }
.night-sky {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; transition: opacity 2.4s ease;
}
html[data-tod="night"] .night-sky { opacity: 1; }
.hub-moon { position: absolute; top: 15%; left: 10%; width: 52px; height: 52px; opacity: 0.85; }
.hstar {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(26,13,4,0.55);
  animation: star-twinkle var(--tw, 3.5s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

/* fireflies — night only, lazy drifting glow */
.fireflies {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; transition: opacity 2.4s ease;
}
html[data-tod="night"] .fireflies { opacity: 1; }
.firefly {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,220,120,0.95), rgba(184,220,120,0) 70%);
  animation: firefly-drift var(--fdur, 14s) ease-in-out infinite,
             firefly-glow 2.4s ease-in-out infinite;
  animation-delay: var(--d, 0s), var(--d, 0s);
}
@keyframes firefly-drift {
  0%, 100%  { transform: translate(0, 0); }
  25%       { transform: translate(16px, -14px); }
  50%       { transform: translate(-8px, -26px); }
  75%       { transform: translate(-20px, -6px); }
}
@keyframes firefly-glow {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

/* Drifting abstract clouds — same treatment as the birds (SVG line-art, slow
   parallax drift), just larger, softer and slower. Drift on the wrapper,
   gentle vertical bob on the inner svg so the two transforms don't fight. */
.drift-clouds { position: absolute; inset: 0; overflow: hidden; }
.dcloud {
  position: absolute; width: 150px;
  animation: cloud-drift var(--dur, 120s) linear infinite;
  opacity: 0;
}
.dcloud svg { width: 100%; display: block; animation: cloud-bob var(--bob, 10s) ease-in-out infinite; }
.dcloud-1 { top: 13%; --dur: 118s; width: 156px; }
.dcloud-2 { top: 24%; --dur: 154s; --bob: 12s; animation-delay: -52s; width: 116px; }
.dcloud-3 { top: 7%;  --dur: 196s; --bob: 14s; animation-delay: -104s; width: 92px; }
@keyframes cloud-drift {
  0%   { transform: translateX(-18vw); opacity: 0; }
  9%   { opacity: 1; }
  91%  { opacity: 1; }
  100% { transform: translateX(116vw); opacity: 0; }
}
@keyframes cloud-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

.drift-birds { position: absolute; inset: 0; overflow: hidden; }
.dbird {
  position: absolute; width: 34px;
  animation: bird-drift var(--dur, 52s) linear infinite;
  opacity: 0;
}
.dbird svg { width: 100%; animation: bird-flap 1.6s ease-in-out infinite; }
.dbird-1 { top: 16%; --dur: 48s; }
.dbird-2 { top: 26%; --dur: 64s; animation-delay: -22s; width: 26px; }
.dbird-3 { top: 11%; --dur: 74s; animation-delay: -40s; width: 22px; }
.dbird-4 { top: 33%; --dur: 88s; animation-delay: -10s; width: 18px; }
@keyframes bird-drift {
  0%   { transform: translateX(-6vw); opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { transform: translateX(106vw); opacity: 0; }
}
@keyframes bird-flap {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.62); }
}

.hub-rose {
  position: absolute; top: 50%; left: 50%;
  width: clamp(380px, 62vh, 640px); height: clamp(380px, 62vh, 640px);
  animation: rose-turn 240s linear infinite;
}
@keyframes rose-turn {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.hub-center {
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(-54%);
  text-align: center;
}
.hub-eyebrow {
  font-size: 1.1rem; font-weight: 600; letter-spacing: 3px;
  color: var(--text-dim); opacity: 0.85;
  margin-bottom: 0.6rem;
}
.hub-title {
  font-size: clamp(5.2rem, 12vw, 11rem);
  font-weight: 700; line-height: 0.9;
  letter-spacing: -0.01em;
}
.hub-underline { width: clamp(240px, 26vw, 360px); margin: 0.4rem auto 0; display: block; }
.hub-tagline {
  font-size: 1.4rem; color: var(--text-muted);
  margin-top: 0.7rem;
}

/* Edge cues — living doorways to each world */
.edge-cue {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  pointer-events: auto;
  cursor: pointer;
  padding: 0.8rem 1.2rem;
}
.cue-n { top: 1.6rem; left: 50%; transform: translateX(-50%); }
.cue-s { bottom: 4.6rem; left: 50%; transform: translateX(-50%); }
.cue-e { right: 1.4rem; top: 50%; transform: translateY(-50%); }
.cue-w { left: 1.4rem; top: 50%; transform: translateY(-50%); }

.ec-art { width: 90px; height: 34px; overflow: visible; }
.ec-arrow {
  font-size: 1.3rem; font-weight: 700; color: var(--teal);
  animation: cue-breathe 2.2s ease-in-out infinite;
}
.cue-n .ec-arrow { --ay: -1; }
.cue-s .ec-arrow { --ay: 1; }
.cue-e .ec-arrow { --ax: 1; }
.cue-w .ec-arrow { --ax: -1; }
.ec-title {
  font-size: 1.7rem; font-weight: 700; color: var(--text);
  transition: color 0.3s;
}
.ec-sub { font-size: 1.02rem; color: var(--text-dim); transition: color 0.3s; }
.edge-cue:hover .ec-title { color: var(--teal); }
.edge-cue:hover .ec-sub { color: var(--text-muted); }

/* wake animations on hover */
.cue-n:hover .ecn-b1 { animation: bird-flap 0.55s ease-in-out infinite; }
.cue-n:hover .ecn-b2 { animation: bird-flap 0.7s ease-in-out infinite; }
.ece-body { transition: transform 0.5s var(--ease-out); }
.cue-e:hover .ece-body { transform: translateX(7px); }
.ecs-r1, .ecs-r2, .ecs-r3 { stroke-dasharray: 1; stroke-dashoffset: 0.35; transition: stroke-dashoffset 0.7s ease; }
.cue-s:hover .ecs-r1, .cue-s:hover .ecs-r2, .cue-s:hover .ecs-r3 { stroke-dashoffset: 0; }
.ecw-stroke { stroke-dasharray: 1; stroke-dashoffset: 0.3; transition: stroke-dashoffset 0.7s ease; }
.cue-w:hover .ecw-stroke { stroke-dashoffset: 0; }

/* ── 8. NORTH · LISTEN ────────────────────────────────────────── */
.sky-sun {
  position: absolute; top: 8%; right: 14%;
  width: clamp(180px, 24vw, 320px); height: clamp(180px, 24vw, 320px);
  background: radial-gradient(circle,
    rgba(232,168,0,0.20) 0%,
    rgba(245,192,48,0.10) 42%,
    transparent 70%);
  filter: blur(14px);
  border-radius: 50%;
  animation: wash-breathe 7s ease-in-out infinite;
}
.rise-birds { position: absolute; inset: 0; width: 100%; height: 100%; }

.float-notes { position: absolute; inset: 0; }
.fnote {
  position: absolute;
  font-family: serif; font-size: 1.9rem;
  color: rgba(42,136,136,0.38);
  animation: note-float var(--fd, 10s) ease-in-out infinite;
}
.fnote--gold { color: rgba(184,120,32,0.36); }
@keyframes note-float {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  33% { transform: translate(9px, -26px) rotate(4deg); }
  66% { transform: translate(-7px, -12px) rotate(-2deg); }
}

/* N2 — the notes wall (trip articles, blogs, essays) */
.cloud-shelf { position: absolute; bottom: 0; left: 0; width: 100%; }

/* drifting pages in the north sky — reuses the note-float keyframe */
.float-pages { position: absolute; inset: 0; }
.fpage {
  position: absolute; width: 26px;
  animation: note-float var(--fd, 12s) ease-in-out infinite;
}
.fpage svg { width: 100%; display: block; }

.notes-wall {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap;
  align-items: center; align-content: center; justify-content: center;
  gap: clamp(0.9rem, 1.5vw, 1.5rem);
  padding: 6vh 4vw 11vh;
  pointer-events: none;
}
.note-card {
  pointer-events: auto; cursor: pointer;
  position: relative;
  display: flex; flex-direction: column;
  width: clamp(184px, 14.5vw, 224px);
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  box-shadow: 5px 6px 0 rgba(26,13,4,0.10);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.note-card:hover { transform: translateY(-5px); box-shadow: 7px 10px 0 rgba(26,13,4,0.15); }
.nc-photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border-bottom: 1.5px solid var(--border-ink); }
.nc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease-out); }
.note-card:hover .nc-photo img { transform: scale(1.05); }
.nc-body { padding: 0.7rem 0.9rem 0.85rem; display: flex; flex-direction: column; gap: 0.12rem; }
.nc-tag { font-size: 0.92rem; font-weight: 600; letter-spacing: 0.5px; color: var(--teal); }
.nc-title { font-size: 1.5rem; font-weight: 700; line-height: 1.04; color: var(--text); }
.nc-meta { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.nc-excerpt { font-size: 1.04rem; line-height: 1.22; color: var(--text-muted); }
.nc-read { font-size: 1.02rem; font-weight: 700; color: var(--rust); margin-top: 0.35rem; align-self: flex-start; transition: transform 0.25s var(--ease-out); }
.note-card:hover .nc-read { transform: translateX(4px); }

/* N3 — the bookshelf (book reviews) */
.shelf-plank { position: absolute; inset: 0; width: 100%; height: 100%; }
.bookshelf {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap;
  align-items: center; align-content: center; justify-content: center;
  gap: clamp(1.2rem, 3vw, 2.8rem);
  padding: 10vh 5vw 12vh;
}
.book-card {
  display: flex; gap: 0.9rem; align-items: flex-start;
  width: clamp(258px, 26vw, 340px);
  pointer-events: auto;
}
.bk-cover {
  flex: 0 0 auto;
  width: 62px; height: 92px;
  border: 1.5px solid var(--border-ink); border-left-width: 5px;
  box-shadow: 3px 4px 0 rgba(26,13,4,0.12);
  display: flex; align-items: center; justify-content: center;
  padding: 6px 5px; text-align: center;
}
.bk-cover span { font-size: 0.84rem; font-weight: 700; line-height: 1.02; color: #fff; }
.bk-cover--teal { background: var(--teal); }
.bk-cover--gold { background: var(--gold); }
.bk-cover--rust { background: var(--rust); }
.bk-cover--sage { background: var(--sage); }
.bk-info { display: flex; flex-direction: column; gap: 0.08rem; }
.bk-title { font-size: 1.35rem; font-weight: 700; line-height: 1.04; color: var(--text); }
.bk-author { font-size: 0.98rem; color: var(--text-dim); }
.bk-stars { font-size: 1.05rem; color: var(--gold); letter-spacing: 1px; }
.bk-star-dim { color: rgba(26,13,4,0.18); }
.bk-note { font-size: 1.03rem; line-height: 1.2; color: var(--text-muted); margin-top: 0.15rem; }

/* ── 9. EAST · WANDER ─────────────────────────────────────────── */
.road-svg, .horizon-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* continuous hill scroll — the horizon keeps passing by even when stationary */
.rs-scroll { animation-timing-function: linear; animation-iteration-count: infinite; }
.rs-scroll--far   { animation-name: rs-scroll-x; animation-duration: 52s; }
.rs-scroll--mid   { animation-name: rs-scroll-x; animation-duration: 34s; }
@keyframes rs-scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-1440px); }
}

/* roadside props ride the actual road-edge curve via CSS motion paths —
   each element carries its own offset-path + duration/delay inline */
.rs-ride {
  offset-rotate: 0deg;
  animation-name: rs-ride; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes rs-ride { from { offset-distance: 0%; } to { offset-distance: 100%; } }
/* no motion-path support → hide the moving props rather than misplacing them */
@supports not (offset-path: path('M0,0 L1,1')) { .rs-ride { display: none; } }

/* drifting sky in E·1 */
.rs-cloud { animation: rs-cloud 26s ease-in-out infinite alternate; }
.rs-birds { animation: rs-birds 34s ease-in-out infinite alternate; }
@keyframes rs-cloud { from { transform: translateX(0); } to { transform: translateX(48px); } }
@keyframes rs-birds { from { transform: translateX(0); } to { transform: translateX(-60px); } }

/* flowing lane-center dashes */
.road-dash-flow { animation: road-dash-flow 1.3s linear infinite; }
@keyframes road-dash-flow { to { stroke-dashoffset: -56; } }

/* E·2 postcards sit above the low road band */
.postcard-spread--road { padding-bottom: 14vh; }

/* E2 — postcards */
.postal-marks { position: absolute; inset: 0; }
.pmark {
  position: absolute;
  font-family: serif; font-size: 0.95rem; letter-spacing: 5px;
  color: rgba(184,69,32,0.30);
}
.pstamp { position: absolute; width: 70px; height: 70px; }

.postcard-spread {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.2rem, 4vw, 3.5rem);
  padding: 0 4vw;
}
.polaroid {
  position: relative;
  background: #fff;
  border: 1.5px solid rgba(26,13,4,0.35);
  padding: 12px 12px 8px;
  box-shadow: 5px 6px 0 rgba(26,13,4,0.10);
  pointer-events: auto;
  width: clamp(200px, 24vw, 320px);
}
.pol-1 { --rot: -4deg; }
.pol-2 { --rot: 2.5deg; --lift: 18px; }
.pol-3 { --rot: -1.5deg; --lift: -10px; }
.polaroid:hover { --rot: 0deg; box-shadow: 7px 9px 0 rgba(26,13,4,0.14); }
.polaroid img, .pol-ink {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 1px solid rgba(26,13,4,0.15);
  background: var(--bg-card);
}
.polaroid figcaption {
  font-size: 1.25rem; font-weight: 600; color: var(--text-muted);
  text-align: center; padding: 0.45rem 0 0.2rem;
}

/* ── 10. SOUTH · WITHIN ───────────────────────────────────────── */
.soil-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.wanderers {
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(-42%);
  display: flex; justify-content: center; gap: clamp(2rem, 8vw, 7rem);
}
.portrait { width: clamp(150px, 17vw, 210px); pointer-events: auto; }
.portrait--l { --rot: -2.5deg; }
.portrait--r { --rot: 2deg; }
.portrait svg { width: 100%; filter: drop-shadow(4px 4px 0 rgba(26,13,4,0.08)); }
.portrait figcaption {
  text-align: center; font-size: 1.3rem; font-weight: 600;
  color: var(--text-muted); margin-top: 0.5rem;
}

.wanderers-line {
  position: absolute; bottom: 12%; left: 50%;
  transform: translateX(-50%);
  width: min(760px, 86vw);
  text-align: center;
  font-size: 1.4rem; line-height: 1.55;
  color: var(--text-muted);
}

/* S3 — taproot */
.taproot-svg {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  height: 74vh;
}
.scraps { position: absolute; inset: 0; }
.scrap {
  position: absolute;
  background: var(--bg-card);
  border: 1.5px solid rgba(26,13,4,0.3);
  padding: 1rem 1.6rem;
  font-size: 1.45rem; color: var(--text-muted);
  box-shadow: 4px 4px 0 rgba(26,13,4,0.08);
}
.scrap-1 { top: 24%; left: 15%; --rot: -3deg; }
.scrap-2 { top: 40%; right: 14%; --rot: 2.2deg; }
.scrap-3 { top: 57%; left: 19%; --rot: 1.4deg; }

.taproot-end {
  position: absolute; bottom: 9%; left: 0; right: 0;
  text-align: center;
}
.end-wordmark { font-size: 2.6rem; font-weight: 700; margin: 0.4rem 0 0.6rem; }
.end-copy { font-size: 1.1rem; color: var(--text-dim); }

/* ── 11. WEST · CREATE ────────────────────────────────────────── */
.studio-blobs { position: absolute; inset: 0; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  animation: wash-breathe 8s ease-in-out infinite;
}
.blob--teal { top: 18%; left: 16%; width: 200px; height: 150px; background: rgba(42,136,136,0.13); }
.blob--gold { bottom: 22%; right: 18%; width: 240px; height: 170px; background: rgba(184,120,32,0.12); animation-delay: -3s; }
.blob--rust { bottom: 14%; left: 26%; width: 150px; height: 110px; background: rgba(184,69,32,0.10); animation-delay: -5s; }

/* W1 — the studio door */
.soundwave-svg {
  position: absolute; top: 24%; left: 8%;
  width: min(460px, 46vw);
}
.studio-scene {
  position: absolute; bottom: 4%; left: 50%;
  transform: translateX(-58%);
  width: min(420px, 58vw);
}
.studio-scene svg { width: 100%; }

/* W2 — the record shelf */
.shelf-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.record-shelf {
  position: absolute; left: 0; right: 0; bottom: 28%;
  display: flex; flex-wrap: wrap; align-items: flex-end; align-content: center; justify-content: center;
  gap: clamp(1rem, 2.4vw, 2.2rem);
  padding: 0 4vw;
}
.track-card {
  display: flex; align-items: center; gap: 1rem;
  background: #fff;
  border: 1.5px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: 4px 5px 0 rgba(26,13,4,0.10);
  padding: 0.9rem 1.1rem;
  width: clamp(250px, 24vw, 330px);
  pointer-events: auto;
  position: relative;
}
.tc-1 { --rot: -2deg; }
.tc-2 { --rot: 1.2deg; --lift: -14px; }
.tc-3 { --rot: -1deg; }
.tc-4 { --rot: 1.8deg; --lift: -8px; }
.track-card:hover { --rot: 0deg; box-shadow: 6px 8px 0 rgba(26,13,4,0.14); }
.tc-vinyl { width: 64px; height: 64px; flex-shrink: 0; }
.tc-vinyl svg { width: 100%; height: 100%; }
.track-card.playing .tc-vinyl svg { animation: vinyl-spin 2.4s linear infinite; }
@keyframes vinyl-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tc-info { flex: 1; min-width: 0; }
.tc-tag {
  display: block;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 2px;
  color: var(--sage);
}
.tc-title {
  font-family: var(--hand); font-size: 1.45rem; font-weight: 700;
  line-height: 1.05; color: var(--text);
}
.tc-meta { display: block; font-size: 0.95rem; color: var(--text-dim); }
.tc-play {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.8px solid var(--teal);
  border-radius: 50%;
  color: var(--teal); font-size: 1rem;
  background: rgba(42,136,136,0.06);
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.tc-play:hover { background: rgba(42,136,136,0.16); transform: scale(1.08); }
.track-card.playing .tc-play { background: var(--teal); color: #fff; }

/* "coming soon" pop for placeholder tracks & reels */
.soon-pop {
  position: absolute; top: -14px; left: 50%;
  font-family: var(--hand); font-size: 1.15rem; font-weight: 600;
  color: var(--gold); white-space: nowrap;
  pointer-events: none;
  animation: soon-rise 1.6s ease-out forwards;
}
@keyframes soon-rise {
  0%   { transform: translate(-50%, 6px); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(-50%, -30px); opacity: 0; }
}

/* W3 — the reel wall */
.reel-wall {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: clamp(1.2rem, 2.6vw, 2.4rem);
  padding: 9vh 3.5vw;
}
.reel-frame {
  background: #fff;
  border: 2.5px solid var(--border-ink);
  outline: 1px solid rgba(26,13,4,0.15);
  outline-offset: 4px;
  box-shadow: 5px 6px 0 rgba(26,13,4,0.10);
  padding: 10px;
  width: clamp(240px, 24vw, 345px);
  pointer-events: auto;
  cursor: pointer;
  position: relative;
}
.rf-1 { --rot: -1.8deg; }
.rf-2 { --rot: 1.4deg; --lift: 10px; }
.reel-frame:hover { --rot: 0deg; --lift: -5px; box-shadow: 7px 9px 0 rgba(26,13,4,0.15); }
.rf-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border: 1px solid rgba(26,13,4,0.12);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rf-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rf-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rf-play {
  position: relative; z-index: 2;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--border-ink);
  box-shadow: 3px 3px 0 rgba(26,13,4,0.10);
  color: var(--rust); font-size: 1.15rem;
  transition: transform 0.3s var(--ease-out);
}
.reel-frame:hover .rf-play { transform: scale(1.1); }
.reel-frame figcaption {
  text-align: center; font-size: 1.15rem; font-weight: 600;
  color: var(--text-muted); padding-top: 0.5rem;
}

/* Art / photo frames on the Studio's reel wall — same hung-frame look as the
   reels, but holding a still image instead of a video screen. */
.art-frame {
  background: #fff;
  border: 2.5px solid var(--border-ink);
  outline: 1px solid rgba(26,13,4,0.15);
  outline-offset: 4px;
  box-shadow: 5px 6px 0 rgba(26,13,4,0.10);
  padding: 10px;
  width: clamp(180px, 17vw, 240px);
  pointer-events: auto;
  position: relative;
}
.af-1 { --rot: 2.2deg; --lift: 6px; }
.af-2 { --rot: -1.6deg; --lift: -8px; }
.art-frame:hover { --rot: 0deg; box-shadow: 7px 9px 0 rgba(26,13,4,0.15); }
.art-frame img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: var(--bg-card);
  border: 1px solid rgba(26,13,4,0.12);
  display: block;
}
.art-frame figcaption {
  text-align: center; font-size: 1.1rem; font-weight: 600;
  color: var(--text-muted); padding-top: 0.5rem;
}

/* ── Global image treatment ───────────────────────────────────────
   Every content photo rests as a muted india-ink wash (nothing on the white
   paper reads as loud colour); hovering the frame brings it to life in full
   colour. Placed after the per-image rules so this transition wins the
   cascade. Keep new image types (any scene `<img>`) on these two lists. */
.nc-photo img, .polaroid img, .art-frame img {
  filter: grayscale(1) sepia(0.14) contrast(0.92) brightness(1.05);
  transition: filter 0.55s var(--ease-out), transform 0.5s var(--ease-out);
}
.note-card:hover .nc-photo img,
.polaroid:hover img,
.art-frame:hover img,
.nc-photo img:hover, .polaroid img:hover, .art-frame img:hover {
  filter: grayscale(0) sepia(0) contrast(1) brightness(1);
}

.blog-scrap {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid rgba(26,13,4,0.3);
  box-shadow: 4px 4px 0 rgba(26,13,4,0.08);
  padding: 1.2rem 1.7rem 1rem;
  width: clamp(180px, 17vw, 245px);
  pointer-events: auto;
}
.bs-1 { --rot: -2.4deg; --lift: -8px; }
.bs-2 { --rot: 2deg; }
.bs-tag {
  display: block;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 2.5px;
  color: var(--rust); margin-bottom: 0.2rem;
}
.blog-scrap p { font-size: 1.3rem; line-height: 1.3; color: var(--text-muted); }

/* ── 12. Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dbird, .dbird svg, .dcloud, .dcloud svg, .fpage, .blob, .hub-wash, .sky-sun,
  .ec-arrow, .nc-arrow, .hub-rose, .van-bob, .van-wheel, .van-puff,
  .rs-ride, .rs-cloud, .rs-birds,
  .track-card.playing .tc-vinyl svg, .rs-scroll, .road-dash-flow,
  .hstar, .firefly { animation: none !important; }
  .reveal { transition-duration: 0.2s; }
  .scene.lit .draw { transition-duration: 0.3s; transition-delay: 0s; }
}

/* ── 13. Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
  html, body { font-size: 16px; }
  .scene-title { font-size: clamp(3.4rem, 12vw, 5.5rem); }
  .hub-title { font-size: clamp(4rem, 16vw, 6.5rem); }
  .hub-rose { width: min(84vw, 420px); height: min(84vw, 420px); }
  .compass-map { transform: scale(0.82); transform-origin: bottom right; }
  .cue-e { right: 0.4rem; }
  .cue-w { left: 0.4rem; }
  .ec-art { width: 64px; }
  .postcard-spread { flex-direction: column; gap: 1.6rem; padding: 10vh 0; }
  .polaroid { width: clamp(190px, 46vw, 260px); }
  .pol-3 { display: none; }
  .wanderers { transform: translateY(-48%); }
  .scrap-1 { left: 7%; }
  .scrap-2 { right: 6%; }
  .scrap-3 { left: 9%; top: 60%; }
  /* Record shelf — 4 compact cards stacked and centred (the W·2 caption is
     hidden so the fourth card doesn't collide with it). West arm is horizontal
     swipe-nav, so no vertical-scroll conflict. */
  .record-shelf { flex-direction: column; flex-wrap: nowrap; align-items: center; bottom: auto; top: 50%; transform: translateY(-50%); gap: 0.75rem; padding: 0 4vw; }
  .track-card { width: min(88vw, 360px); padding: 0.6rem 0.9rem; gap: 0.75rem; }
  .tc-vinyl { width: 46px; height: 46px; }
  .tc-title { font-size: 1.35rem; }
  #create-2 .caption--bottom-left { display: none; }
  .soundwave-svg { top: 18%; left: 6%; width: 70vw; }
  .studio-scene { width: min(340px, 74vw); }
}
@media (max-width: 600px) {
  .nav-cue { bottom: 4.6rem; }
  .corner-mark { display: none; }
  .reel-wall { gap: 1.2rem; padding: 9vh 5vw; }
  /* Notes wall — compact horizontal cards in a vertical scroll list. The wall
     carries data-no-nav so swipes scroll it rather than navigating the (vertical)
     north arm; move between scenes with the nav-cue pills / compass / TOC. The
     N·2 caption is hidden here so it doesn't sit over the scrolling cards. */
  .notes-wall {
    flex-direction: column; flex-wrap: nowrap;
    justify-content: flex-start; align-content: flex-start;
    gap: 0.7rem; padding: 9vh 5vw 15vh;
    pointer-events: auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .note-card { flex-direction: row; width: min(92vw, 430px); flex: 0 0 auto; }
  .nc-photo { flex: 0 0 86px; aspect-ratio: 1; border-bottom: none; border-right: 1.5px solid var(--border-ink); }
  .nc-excerpt { display: none; }
  .nc-title { font-size: 1.25rem; }
  #listen-2 .caption--bottom-left { display: none; }
  .bookshelf { flex-direction: column; flex-wrap: nowrap; gap: 1rem; padding: 9vh 6vw 11vh; }
  .book-card { width: min(92vw, 400px); }
  .reel-frame { width: clamp(220px, 76vw, 300px); }
  .blog-scrap { width: clamp(180px, 40vw, 230px); }
  .toc-scenes { flex-direction: column; gap: 0.3rem; }
  .toc-worlds { gap: 1rem; }

  /* Hub reflow: on phones there's no horizontal margin, so the E/W cues
     (Create/Wander) collide with the centred wordmark + tagline. Raise the
     centre content and drop the horizontal cues into the open gap below the
     tagline — the plus becomes a clean diamond, arrows still point outward. */
  .hub-center { top: 40%; }
  .hub-title { font-size: clamp(3.4rem, 15vw, 5rem); }
  .hub-eyebrow { font-size: 0.9rem; letter-spacing: 2px; margin-bottom: 0.4rem; }
  .hub-tagline { font-size: 1.1rem; margin-top: 0.5rem; }
  .cue-n { top: 1rem; }
  .cue-e, .cue-w { top: 62%; transform: translateY(-50%); }
  .cue-e { right: 0.6rem; }
  .cue-w { left: 0.6rem; }
  .cue-s { bottom: 6.5rem; }
  .ec-title { font-size: 1.5rem; }
  .ec-sub { font-size: 0.92rem; }
  .ec-art { width: 54px; }
}
