/* forest.css: the dark landing. The page reads well on its own (no JS, no WebGL,
   reduced motion); with .forest-on each section becomes a stop on the walk. */

html:has(.forest-page) { background: #010609; overflow-x: clip; }
.forest-page {
  --f-cream: 245 240 235;
  --f-peach: 254 177 146;
  --f-jungle: 1 179 108;
  --f-forest: 1 43 29;
  background: #010609;
  color: rgb(var(--f-cream));
  font-family: 'Inter Tight', system-ui, sans-serif;
  /* clip, not hidden: hidden turns the body into a scroll container and breaks the sticky cards */
  overflow-x: clip;
}
.forest-page::after { opacity: 0.075; }
.forest-page ::selection { background: rgb(var(--f-peach)); color: rgb(var(--f-forest)); }

/* ── Backdrop: a painted sky in CSS, shown before (or instead of) the 3D forest ── */
.forest-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 74% 26%, rgba(143, 101, 86, 0.32) 0, rgba(143, 101, 86, 0) 22%),
    linear-gradient(to top, #0f2e2b 0%, #0d2a28 22%, #071718 45%, #010609 80%);
}
.forest-sky::after {
  /* Ridge of distant trees */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: #0b2421;
  -webkit-mask: linear-gradient(#000, #000) bottom / 100% 70% no-repeat, radial-gradient(circle at 50% 100%, #000 60%, transparent 62%) 0 0 / 46px 40% repeat-x;
          mask: linear-gradient(#000, #000) bottom / 100% 70% no-repeat, radial-gradient(circle at 50% 100%, #000 60%, transparent 62%) 0 0 / 46px 40% repeat-x;
  opacity: 0.9;
}
.forest-moon {
  position: absolute; left: 74%; top: 26%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, #f3ece0, #d8d1c3 72%);
  box-shadow: 0 0 80px 22px rgba(254, 177, 146, 0.14);
}
/* Once the 3D forest has faded in, retire the painted moon: the canvas lets a little of the
   page behind it through at soft edges, and a second moon would glow through the treetops */
.forest-ready .forest-moon { opacity: 0; transition: opacity 0.6s ease 2.4s; }
#forest-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: none;
  opacity: 0; transition: opacity 2.2s ease;
}
.forest-on #forest-canvas { display: block; }
.forest-ready #forest-canvas { opacity: 1; }
.forest-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 50%, rgba(0, 4, 3, 0.62) 100%);
}

/* ── Nav ── */
.forest-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: linear-gradient(rgba(1, 6, 9, 0.7), rgba(1, 6, 9, 0)); }
.forest-nav-row { max-width: 80rem; margin: 0 auto; padding: 1.5rem 2rem; display: flex; align-items: center; justify-content: space-between; }
@media (min-width: 768px) { .forest-nav-row { padding: 1.5rem 3rem; } }
.forest-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; color: rgb(var(--f-cream)); text-decoration: none; }
.forest-links { display: none; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .forest-links { display: flex; } }
.forest-page .nav-link { color: rgb(var(--f-cream) / 0.6); }
.forest-page .nav-link:hover { color: rgb(var(--f-cream)); }
.forest-toggle { color: rgb(var(--f-cream)); background: none; border: 0; padding: 0; }
@media (min-width: 768px) { .forest-toggle { display: none; } }
/* Phone menu: a solid panel of full-width buttons, with Contact as the one filled pill */
.forest-nav:has(#navToggle[aria-expanded="true"]) { background: #010609; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5); }
.forest-menu { padding: 0.25rem 1.25rem 1.5rem; display: grid; gap: 0.625rem; background: #010609; }
.forest-menu.hidden { display: none; }
.forest-page .forest-menu .nav-link {
  display: flex; align-items: center; min-height: 3.5rem; padding: 0 1.25rem; border-radius: 0.875rem;
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  color: rgb(var(--f-cream) / 0.92); background: rgb(var(--f-cream) / 0.06); border: 1px solid rgb(var(--f-cream) / 0.1);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.forest-page .forest-menu .nav-link:hover, .forest-page .forest-menu .nav-link:focus-visible { background: rgb(var(--f-cream) / 0.12); border-color: rgb(var(--f-cream) / 0.2); color: rgb(var(--f-cream)); }
.forest-page .forest-menu .forest-pill { min-height: 3.5rem; margin-top: 0.375rem; font-size: 0.875rem; border-radius: 0.875rem; }
.forest-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgb(var(--f-forest)); background: rgb(var(--f-peach)); padding: 0.5rem 1rem; border-radius: 999px;
  text-decoration: none; transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.forest-pill:hover { background: #ffc6ae; box-shadow: 0 0 24px rgba(254, 177, 146, 0.35); }
.forest-pill-lg { font-size: 0.875rem; padding: 0.9rem 1.9rem; }

/* ── Stops ── */
main#journey, .forest-footer, .forest-hud { position: relative; z-index: 3; }
.stop { padding: 22vh 2rem 6vh; overflow-x: clip; }
@media (min-width: 768px) { .stop { padding: 26vh 6vw 8vh; } }
.stop-arrival { padding-top: 30vh; }
.stop-card { position: relative; max-width: 31rem; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7); }
.stop-card::before {
  content: ''; position: absolute; inset: -34% -30% -26%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(1, 7, 6, 0.9), rgba(1, 7, 6, 0.8) 50%, rgba(1, 7, 6, 0.45) 75%, rgba(1, 7, 6, 0));
}
.stop-tag {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.8);
}
.stop-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--f-jungle)); box-shadow: 0 0 10px rgb(var(--f-jungle)); }
.stop-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(3.4rem, 10vw, 8rem); line-height: 0.92; letter-spacing: -0.035em; }
.stop-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.04; letter-spacing: -0.02em; }
.stop-lede { margin-top: 1.75rem; max-width: 27rem; font-size: 1.0625rem; line-height: 1.65; color: rgb(var(--f-cream) / 0.78); }
.stop-body { margin-top: 1.1rem; font-size: 1rem; line-height: 1.65; color: rgb(var(--f-cream) / 0.74); }
.stop-cue { margin-top: 3rem; display: flex; align-items: center; gap: 0.9rem; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.5); }
.cue-line { width: 1px; height: 38px; background: linear-gradient(rgb(var(--f-cream) / 0), rgb(var(--f-cream) / 0.6)); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.stop-link {
  display: inline-flex; gap: 0.5rem; margin-top: 1.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgb(var(--f-peach)); text-decoration: none;
}
.stop-link span { transition: transform 0.3s ease; }
.stop-link:hover span { transform: translateX(4px); }
.stop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 1.75rem; }
.stop-actions .stop-link { margin-top: 0; }

.trail-list { margin-top: 1.75rem; display: grid; gap: 1.1rem; list-style: none; padding: 0; }
.trail-list h3 { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--f-cream)); }
.trail-list p { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.55; color: rgb(var(--f-cream) / 0.66); }
@media (min-width: 900px) { .trail-list { grid-template-columns: 1fr 1fr; gap: 1.4rem 2rem; } .stop[data-stop="trails"] .stop-card { max-width: 38rem; } }

.grove-list { margin-top: 1.5rem; list-style: none; padding: 0; border-top: 1px solid rgb(var(--f-cream) / 0.12); }
.grove-list a, .grove-plain { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.8rem 0; border-bottom: 1px solid rgb(var(--f-cream) / 0.12); color: rgb(var(--f-cream) / 0.9); text-decoration: none; font-size: 0.95rem; transition: color 0.3s ease, padding 0.3s ease; }
.grove-list b { font-weight: 600; font-variant-numeric: tabular-nums; color: rgb(var(--f-cream) / 0.6); font-size: 0.85rem; }
.grove-list a:hover { color: rgb(var(--f-peach)); padding-left: 0.35rem; }
.grove-list a:hover b { color: rgb(var(--f-peach)); }
.grove-plain { color: rgb(var(--f-cream) / 0.55); }

.forest-footer { padding: 4rem 2rem 6rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; max-width: 80rem; margin: 0 auto; font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.6); }
.forest-footer a { color: inherit; text-decoration: none; }
.forest-footer a:hover { color: rgb(var(--f-cream)); }

/* ── HUD ── */
.forest-hud { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; display: flex; align-items: center; gap: 1rem; }
.hud-btn {
  font: 600 0.6875rem/1 'Inter Tight', sans-serif; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgb(var(--f-cream) / 0.62); background: rgba(1, 6, 9, 0.45); border: 1px solid rgb(var(--f-cream) / 0.16);
  padding: 0.65rem 0.95rem; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.hud-btn:hover { color: rgb(var(--f-cream)); border-color: rgb(var(--f-cream) / 0.6); }
#skipWalk, #walkAgain, .hud-loading { display: none; }
.forest-on #skipWalk { display: inline-block; }
.forest-skipped #walkAgain { display: inline-block; }
.forest-on:not(.forest-ready) .hud-loading { display: flex; }
.hud-loading { align-items: center; gap: 0.6rem; font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.5); }
.hud-bar { width: 40px; height: 1px; background: linear-gradient(90deg, rgb(var(--f-peach)) calc(var(--p, 0) * 100%), rgb(var(--f-cream) / 0.2) 0); }

/* The grove's waypost boards are links: show it */
.sign-hover, .sign-hover .stop-inner { cursor: pointer; }

/* ── The walk: each section holds its card in view while the camera moves ── */
.forest-on .stop { height: 175vh; padding: 0; }
.forest-on .stop-arrival { height: 125vh; }
.forest-on .stop-inner { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; padding: 0 2rem; }
@media (min-width: 768px) { .forest-on .stop-inner { padding: 0 6vw; } }
.forest-on .stop[data-side="right"] .stop-inner { justify-content: flex-end; }
.forest-on .stop-card { opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * var(--dy, 22px))); will-change: opacity, transform; }
.forest-on .stop-arrival .stop-card { opacity: var(--o, 1); }
/* Until the forest has drawn, keep every card readable */
.forest-on:not(.forest-ready) .stop-card { opacity: 1; transform: none; }
.forest-on .stop:not(.is-near) .stop-card { pointer-events: none; }
.forest-on .stop-arrival:not([style]) .stop-card { pointer-events: auto; }
.forest-on .forest-footer { opacity: 0.95; }

@media (max-width: 720px) {
  .forest-on .stop-inner { align-items: flex-end; padding: 0 1.25rem 12vh; }
  .forest-on .stop[data-side="right"] .stop-inner { justify-content: flex-start; }
  .stop-card::before { inset: -30% -20% -40%; }
  .forest-hud { right: 1rem; bottom: 1rem; }
}

/* Plain mode: content scrolls under the nav, so give it a backing */
.forest-off .forest-nav { background: rgba(1, 6, 9, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ── Wander mode: leave the path. The words step aside; the forest is yours. ── */
#wanderToggle { display: none; }
.forest-on.forest-ready #wanderToggle { display: inline-block; }
#wanderToggle[aria-pressed="true"] { color: rgb(var(--f-forest)); background: rgb(var(--f-peach)); border-color: rgb(var(--f-peach)); }
.forest-wander #skipWalk { display: none; }
html.forest-wander { overflow: hidden; }
.forest-wander main#journey, .forest-wander .forest-footer { opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
main#journey, .forest-footer { transition: opacity 0.9s ease; }
.forest-wander #forest-canvas { touch-action: none; cursor: grab; }
.forest-wander #forest-canvas:active { cursor: grabbing; }
.forest-wander.sign-hover #forest-canvas { cursor: pointer; }

/* A line of quiet instructions, and (later) anything else the forest wants to say */
.forest-whisper {
  position: fixed; left: 1.5rem; bottom: 1.95rem; z-index: 39; transform: translateY(6px); max-width: min(30rem, calc(100vw - 30rem));
  margin: 0; font-size: 0.75rem; line-height: 1.5; letter-spacing: 0.04em; color: rgb(var(--f-cream) / 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); opacity: 0; pointer-events: none; transition: opacity 0.8s ease, transform 0.8s ease;
}
.forest-whisper.is-on { opacity: 1; transform: none; }

/* Going into the Hollow, or up with the saucer: the page fades to night before it leaves */
.forest-fade { position: fixed; inset: 0; z-index: 45; background: #010609; opacity: 0; pointer-events: none; transition: opacity 1.1s ease; }
.forest-leaving .forest-fade { opacity: 1; pointer-events: auto; }
.forest-leaving-ufo .forest-fade { transition-delay: 0.45s; }

/* ── Field notes: a small log in the HUD ── */
.notes-btn { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; }
.notes-glyph { width: 9px; height: 11px; border: 1px solid currentColor; border-radius: 1px 2px 2px 1px; box-shadow: inset 2px 0 0 -1px currentColor; opacity: 0.8; }
.notes-n { font-variant-numeric: tabular-nums; color: rgb(var(--f-cream) / 0.45); }
.notes-dot { position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--f-jungle)); box-shadow: 0 0 10px rgb(var(--f-jungle)); }
.field-notes {
  position: fixed; right: 1.25rem; bottom: 4.4rem; z-index: 41; width: min(21rem, calc(100vw - 2rem));
  padding: 1.25rem 1.35rem 1rem; border-radius: 14px; border: 1px solid rgb(var(--f-cream) / 0.12);
  background: rgba(1, 8, 7, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8); color: rgb(var(--f-cream));
}
.field-notes[hidden] { display: none; }
.field-notes header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.notes-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.6); }
.notes-count { font-size: 0.75rem; color: rgb(var(--f-cream) / 0.45); font-variant-numeric: tabular-nums; }
.notes-sub { margin-top: 1.1rem; }
.notes-list, .notes-levels { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.55rem; }
.notes-list li { display: flex; gap: 0.7rem; align-items: baseline; font-size: 0.875rem; line-height: 1.4; }
.notes-mark { flex: none; width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgb(var(--f-cream) / 0.3); transform: translateY(-1px); }
.notes-list .is-found .notes-mark { border-color: rgb(var(--f-jungle)); background: rgb(var(--f-jungle)); box-shadow: 0 0 8px rgb(var(--f-jungle) / 0.8); }
.notes-list .is-found { color: rgb(var(--f-cream) / 0.92); }
.notes-list .is-hidden { color: rgb(var(--f-cream) / 0.42); font-style: italic; }
.notes-levels li { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.55rem; border-top: 1px solid rgb(var(--f-cream) / 0.1); font-size: 0.875rem; }
.notes-levels a { color: rgb(var(--f-peach)); text-decoration: none; }
.notes-levels a span { display: inline-block; transition: transform 0.3s ease; }
.notes-levels a:hover span { transform: translateX(3px); }
.notes-levels .is-hidden { color: rgb(var(--f-cream) / 0.42); }
.notes-lock { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; }
.field-notes footer { display: flex; justify-content: space-between; margin-top: 1.1rem; }
.field-notes footer button { background: none; border: 0; padding: 0.25rem 0; cursor: pointer; font: 600 0.6875rem/1 'Inter Tight', sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--f-cream) / 0.5); }
.field-notes footer button:hover { color: rgb(var(--f-cream)); }
.field-notes .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notes-toast {
  position: fixed; right: 1.25rem; bottom: 4.4rem; z-index: 41; margin: 0; max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.95rem; border-radius: 999px; border: 1px solid rgb(var(--f-jungle) / 0.35); background: rgba(1, 8, 7, 0.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 0.8125rem; color: rgb(var(--f-cream) / 0.9);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity 0.6s ease, transform 0.6s ease;
}
.notes-toast span { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--f-jungle)); margin-right: 0.35rem; }
.notes-toast.is-on { opacity: 1; transform: none; }
html:not(.js) .notes-btn { display: none; }

@media (max-width: 720px) {
  .forest-hud { gap: 0.5rem; }
  .notes-label { display: none; }
  .field-notes, .notes-toast { right: 1rem; bottom: 4rem; }
  .forest-whisper { left: 1rem; top: 5.25rem; bottom: auto; max-width: calc(100vw - 2rem); }
}
@media (prefers-reduced-motion: reduce) {
  .forest-whisper, .notes-toast, .forest-fade, main#journey, .forest-footer { transition: none; }
}
