:root {
  --design-token-sans-star: "Sans**";
  --terracotta: #B85F3F;
  --clay-shadow: #5A2E24;
  --ochre: #D89A4E;
  --cream: #F4E1C1;
  --plum: #2C2230;
  --juniper: #50644A;
  --turquoise: #39B9B6;
  --ember: #E8795F;
  --display: "Libre Baskerville", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Work Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--cream);
  background: var(--plum);
  font-family: var(--sans);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .23;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(244,225,193,.24) 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 61%, rgba(90,46,36,.28) 0 1px, transparent 1.6px),
    linear-gradient(115deg, transparent 0 47%, rgba(216,154,78,.08) 48% 49%, transparent 50% 100%);
  background-size: 21px 19px, 17px 23px, 220px 220px;
  mix-blend-mode: overlay;
}

.trail-nav {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: grid;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid rgba(244,225,193,.25);
  border-radius: 24px;
  background: rgba(44,34,48,.52);
  backdrop-filter: blur(12px);
}

.trail-nav a {
  color: var(--cream);
  text-decoration: none;
  font: 600 10px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  opacity: .58;
  transition: color .35s ease, opacity .35s ease, transform .35s ease;
}

.trail-nav a.active,
.trail-nav a:hover { color: var(--turquoise); opacity: 1; transform: translateX(-2px); }

.trail-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(28px, 5vw, 72px);
}

.trail-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 15% 10%, rgba(232,121,95,.20), transparent 28%),
    radial-gradient(circle at 82% 21%, rgba(57,185,182,.08), transparent 22%);
}

.kicker, .sky-label, .trail-tag, .faulty-sign, .napkin, .photo-card span, .stamp-output {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 600;
}

.kicker { color: var(--turquoise); font-size: 12px; }

h1, h2 {
  font-family: var(--display);
  margin: 0;
  letter-spacing: -.045em;
  line-height: .92;
}

p { line-height: 1.62; }

.hero {
  background:
    linear-gradient(180deg, #2C2230 0%, #5A2E24 62%, #B85F3F 100%);
  display: grid;
  align-content: center;
}

.sky-label {
  position: absolute;
  top: 34px;
  left: clamp(24px, 5vw, 70px);
  color: rgba(244,225,193,.72);
  font-size: 12px;
}

.faulty-sign {
  position: absolute;
  top: 86px;
  right: clamp(28px, 10vw, 150px);
  padding: 12px 18px;
  color: var(--plum);
  background: var(--turquoise);
  border-radius: 999px 999px 999px 20px;
  box-shadow: 0 0 28px rgba(57,185,182,.42), inset 0 -6px 12px rgba(44,34,48,.14);
  animation: signFlicker 5.8s infinite steps(1);
}

.brand {
  font-size: clamp(72px, 17vw, 245px);
  color: var(--cream);
  text-shadow: 9px 12px 0 rgba(90,46,36,.55);
  max-width: 9ch;
  transform: translateY(-4vh);
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  color: var(--turquoise);
  z-index: -1;
  clip-path: inset(18% 0 64% 0);
  animation: ridgeGlitch 6s infinite;
}

.glitch-title::after { color: var(--ember); transform: translate(5px, 3px); animation-delay: -2.1s; }

.legend-note {
  width: min(540px, 70vw);
  margin: -2vh 0 0 8vw;
  font: italic 700 clamp(24px, 3.3vw, 50px)/1.04 var(--serif);
  color: #F4E1C1;
}

.inflated-ridge {
  position: absolute;
  left: -6vw;
  right: -6vw;
  bottom: -12vh;
  height: 43vh;
  filter: drop-shadow(0 -24px 36px rgba(44,34,48,.28));
}

.inflated-ridge span {
  position: absolute;
  bottom: 0;
  width: 38vw;
  height: 33vh;
  border-radius: 54% 46% 0 0 / 78% 72% 0 0;
  background:
    radial-gradient(circle at 34% 23%, rgba(244,225,193,.35), transparent 18%),
    radial-gradient(circle at 72% 65%, rgba(90,46,36,.38), transparent 32%),
    linear-gradient(145deg, #E8795F, #B85F3F 54%, #5A2E24);
  box-shadow: inset 18px 20px 38px rgba(244,225,193,.16), inset -28px -32px 42px rgba(90,46,36,.48);
}

.inflated-ridge span:nth-child(1) { left: 0; height: 28vh; }
.inflated-ridge span:nth-child(2) { left: 23vw; height: 39vh; width: 43vw; }
.inflated-ridge span:nth-child(3) { right: 17vw; height: 31vh; }
.inflated-ridge span:nth-child(4) { right: -2vw; height: 36vh; width: 34vw; }

.trail-tag {
  position: absolute;
  bottom: 11vh;
  right: 12vw;
  color: var(--clay-shadow);
  background: var(--ochre);
  padding: 14px 22px;
  border-radius: 8px 24px 10px 24px;
  transform: rotate(-5deg);
  box-shadow: 0 14px 0 rgba(90,46,36,.32);
}

.threshold {
  background: linear-gradient(180deg, #B85F3F 0%, #D89A4E 42%, #F4E1C1 100%);
  color: var(--plum);
}

.strata-top, .sediment-wall {
  position: absolute;
  inset: auto -5vw 0;
  height: 38vh;
  background: repeating-linear-gradient(177deg, #5A2E24 0 18px, #B85F3F 18px 44px, #D89A4E 44px 68px, #F4E1C1 68px 74px);
  clip-path: polygon(0 22%, 14% 15%, 30% 30%, 48% 12%, 62% 27%, 81% 15%, 100% 31%, 100% 100%, 0 100%);
  opacity: .72;
}

.placard {
  position: relative;
  width: min(580px, 62vw);
  margin: 9vh 0 0 5vw;
  padding: clamp(24px, 4vw, 54px);
  background: rgba(244,225,193,.76);
  border: 2px solid rgba(90,46,36,.28);
  border-radius: 28px 10px 36px 16px;
  box-shadow: 22px 24px 0 rgba(90,46,36,.25);
}

.placard h2, .lookout-copy h2, .ritual-board h2, .last-note h2 { font-size: clamp(42px, 7vw, 98px); }

.puffy-arch {
  position: absolute;
  right: 7vw;
  top: 14vh;
  width: min(420px, 42vw);
  aspect-ratio: 1;
  border-radius: 50% 50% 16% 16%;
  background: radial-gradient(circle at 35% 28%, #F4E1C1, #E8795F 28%, #B85F3F 58%, #5A2E24);
  box-shadow: inset 28px 20px 45px rgba(244,225,193,.24), inset -34px -38px 54px rgba(90,46,36,.48), 0 40px 80px rgba(44,34,48,.25);
}

.arch-hole {
  position: absolute;
  inset: 24% 23% 0;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(#2C2230, #5A2E24);
}

.napkin {
  position: absolute;
  right: 13vw;
  bottom: 14vh;
  width: 220px;
  padding: 22px;
  color: var(--clay-shadow);
  background: #F4E1C1;
  transform: rotate(7deg);
  box-shadow: 0 18px 24px rgba(90,46,36,.22);
}

.counter-shadow {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16vh;
  background: linear-gradient(90deg, #50644A, #5A2E24, #2C2230);
}

.ridge-room {
  background: linear-gradient(180deg, #F4E1C1 0%, #D89A4E 48%, #5A2E24 100%);
  color: var(--plum);
}

.sticky-horizon {
  position: sticky;
  top: 18vh;
  margin: 0 -8vw;
  height: 16vh;
  background: #50644A;
  clip-path: polygon(0 66%, 11% 48%, 19% 57%, 32% 27%, 44% 49%, 57% 34%, 67% 62%, 78% 42%, 100% 60%, 100% 100%, 0 100%);
  opacity: .88;
}

.glitch-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--turquoise);
  clip-path: inherit;
  transform: translateX(0);
  mix-blend-mode: screen;
  animation: ridgeGlitch 4.7s infinite steps(1);
}

.room-copy {
  position: relative;
  z-index: 2;
  margin: 8vh 0 0 4vw;
  max-width: 640px;
}

.room-copy h2 { font-size: clamp(46px, 8vw, 118px); }

.menu-fragments {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.menu-fragments li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 16px 20px;
  border-radius: 22px 8px 22px 8px;
  background: rgba(244,225,193,.48);
  border: 1px solid rgba(90,46,36,.22);
}

.menu-fragments strong { font-family: var(--display); }

.cairn-stack {
  position: absolute;
  right: 13vw;
  bottom: 12vh;
  width: 260px;
  height: 390px;
}

.cairn-stack i, .final-cairn i {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50% 45% 48% 52%;
  background: radial-gradient(circle at 32% 22%, #F4E1C1, #E8795F 24%, #B85F3F 62%, #5A2E24);
  box-shadow: inset 18px 18px 28px rgba(244,225,193,.20), inset -22px -24px 34px rgba(90,46,36,.45), 0 24px 30px rgba(44,34,48,.18);
}

.cairn-stack i:nth-child(1) { bottom: 0; width: 240px; height: 112px; }
.cairn-stack i:nth-child(2) { bottom: 88px; width: 190px; height: 98px; }
.cairn-stack i:nth-child(3) { bottom: 166px; width: 150px; height: 88px; }
.cairn-stack i:nth-child(4) { bottom: 236px; width: 98px; height: 74px; }

.topo-token {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--cream);
  background: repeating-radial-gradient(circle, rgba(244,225,193,.22) 0 3px, transparent 4px 12px), #50644A;
  border-radius: 50%;
  box-shadow: inset 14px 16px 28px rgba(244,225,193,.18), inset -18px -20px 32px rgba(44,34,48,.34);
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
}

.token-a { right: 36vw; top: 20vh; width: 132px; height: 132px; }
.token-b { right: 8vw; top: 13vh; width: 170px; height: 170px; }

.lookout {
  background: linear-gradient(180deg, #2C2230 0%, #5A2E24 46%, #B85F3F 100%);
}

.photo-card {
  position: absolute;
  width: min(560px, 44vw);
  padding: 16px 16px 48px;
  background: #F4E1C1;
  color: var(--clay-shadow);
  box-shadow: 0 36px 80px rgba(0,0,0,.32);
  transform: translateY(70px) rotate(var(--rot, -4deg));
  opacity: .3;
  transition: transform 1.2s cubic-bezier(.18,.9,.26,1), opacity 1.2s ease;
}

.photo-card.in-view { transform: translateY(0) rotate(var(--rot, -4deg)); opacity: 1; }
.postcard-one { left: 5vw; top: 12vh; --rot: -6deg; }
.postcard-two { right: 7vw; bottom: 10vh; --rot: 5deg; }

.duotone-mountains {
  height: 330px;
  background:
    linear-gradient(rgba(184,95,63,.68), rgba(44,34,48,.38)),
    radial-gradient(circle at 25% 24%, rgba(244,225,193,.45), transparent 28%),
    linear-gradient(150deg, transparent 0 34%, #2C2230 35% 46%, transparent 47%),
    linear-gradient(18deg, #5A2E24 0 35%, #B85F3F 36% 54%, #D89A4E 55% 72%, #50644A 73% 100%);
  clip-path: polygon(0 18%, 16% 12%, 28% 31%, 42% 7%, 59% 34%, 72% 18%, 100% 37%, 100% 100%, 0 100%);
  filter: contrast(1.16) saturate(.82);
}

.duotone-mountains.alternate {
  background:
    linear-gradient(rgba(80,100,74,.65), rgba(216,154,78,.28)),
    linear-gradient(155deg, #2C2230 0 23%, #50644A 24% 52%, #B85F3F 53% 100%);
}

.photo-card span { display: block; margin-top: 12px; font-size: 11px; }

.lookout-copy {
  position: relative;
  margin: 20vh auto 0;
  width: min(760px, 70vw);
  padding: 34px;
  border-radius: 34px 10px 34px 10px;
  background: rgba(44,34,48,.58);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(244,225,193,.18);
}

.rituals {
  background: #F4E1C1;
  color: var(--plum);
}

.sediment-wall { top: 0; bottom: auto; height: 100%; clip-path: none; opacity: .24; }

.ritual-board {
  position: relative;
  z-index: 2;
  margin: 10vh auto;
  width: min(1000px, 78vw);
  padding: clamp(26px, 5vw, 72px);
  border-radius: 18px 60px 22px 44px;
  background: rgba(244,225,193,.83);
  box-shadow: 0 34px 0 rgba(184,95,63,.30), 0 62px 90px rgba(90,46,36,.18);
}

.quote-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
}

.quote-row p {
  margin: 0;
  padding: 22px;
  min-height: 190px;
  background: #D89A4E;
  border-radius: 12px 26px 16px 8px;
  font: italic 700 28px/1.05 var(--serif);
  color: var(--clay-shadow);
}

.trail-flags {
  position: absolute;
  left: 8vw;
  bottom: 12vh;
  display: flex;
  gap: 42px;
}

.trail-flags span {
  width: 5px;
  height: 150px;
  background: var(--clay-shadow);
  position: relative;
  transform: rotate(var(--lean, -5deg));
}

.trail-flags span::before {
  content: "";
  position: absolute;
  top: 8px; left: 5px;
  width: 62px; height: 38px;
  background: var(--ember);
  clip-path: polygon(0 0, 100% 15%, 78% 51%, 100% 88%, 0 100%);
}

.trail-flags span:nth-child(2) { --lean: 8deg; }
.trail-flags span:nth-child(2)::before { background: var(--juniper); }
.trail-flags span:nth-child(3) { --lean: -12deg; }
.trail-flags span:nth-child(3)::before { background: var(--turquoise); }

.bottle-cap {
  position: absolute;
  right: 12vw;
  bottom: 15vh;
  border: 0;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  color: var(--cream);
  background: radial-gradient(circle, #E8795F 0 30%, #B85F3F 31% 58%, #5A2E24 59% 100%);
  font: 700 13px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: .12em;
  box-shadow: inset 0 0 0 12px rgba(244,225,193,.20), 0 18px 38px rgba(90,46,36,.25);
  cursor: pointer;
  transition: transform .45s cubic-bezier(.2,1.2,.3,1);
}

.bottle-cap:hover, .bottle-cap.stamped { transform: rotate(12deg) scale(1.07); }

.stamp-output {
  position: absolute;
  right: 10vw;
  bottom: 7vh;
  color: var(--terracotta);
  border: 3px solid var(--terracotta);
  padding: 10px 16px;
  transform: rotate(-8deg) scale(.7);
  opacity: 0;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,1.2,.3,1);
}

.stamp-output.visible { opacity: 1; transform: rotate(-8deg) scale(1); }

.last-call {
  background: radial-gradient(circle at 72% 62%, rgba(232,121,95,.22), transparent 16%), linear-gradient(180deg, #2C2230 0%, #2C2230 70%, #5A2E24 100%);
}

.window-glow {
  position: absolute;
  right: 18vw;
  bottom: 31vh;
  width: 120px;
  height: 78px;
  background: #D89A4E;
  border-radius: 18px 18px 6px 6px;
  box-shadow: 0 0 80px rgba(216,154,78,.56), inset 0 -18px 28px rgba(184,95,63,.42);
}

.night-mountains {
  position: absolute;
  left: -6vw; right: -6vw; bottom: 0;
  height: 42vh;
  background: #50644A;
  clip-path: polygon(0 72%, 12% 49%, 22% 66%, 39% 28%, 54% 67%, 68% 38%, 84% 65%, 100% 43%, 100% 100%, 0 100%);
}

.final-cairn {
  position: absolute;
  left: 11vw;
  bottom: 18vh;
  width: 190px;
  height: 240px;
  filter: drop-shadow(0 0 30px rgba(216,154,78,.35));
}

.final-cairn i:nth-child(1) { bottom: 0; width: 180px; height: 82px; }
.final-cairn i:nth-child(2) { bottom: 64px; width: 128px; height: 74px; }
.final-cairn i:nth-child(3) { bottom: 120px; width: 74px; height: 58px; }

.last-note {
  position: relative;
  z-index: 2;
  margin: 16vh 0 0 auto;
  width: min(700px, 66vw);
  color: var(--cream);
}

[data-inflate], [data-rings] { transition: transform 1s cubic-bezier(.18,1.25,.28,1), filter 1s ease; }
[data-section]:not(.entered) [data-inflate] { transform: scale(.94) translateY(36px); filter: saturate(.8); }
[data-section].entered [data-rings] { animation: topoPulse 1.3s cubic-bezier(.18,.9,.26,1) 1; }

@keyframes signFlicker {
  0%, 92%, 100% { transform: translate(0,0); filter: brightness(1); }
  93% { transform: translate(2px,-1px); filter: brightness(1.7); }
  94% { transform: translate(-3px,1px); filter: brightness(.75); }
  95% { transform: translate(3px,0); filter: brightness(1.4); }
}

@keyframes ridgeGlitch {
  0%, 86%, 100% { transform: translateX(0); opacity: .0; }
  88% { transform: translateX(8px); opacity: .75; }
  89% { transform: translateX(-5px); opacity: .55; }
  91% { transform: translateX(2px); opacity: .35; }
}

@keyframes topoPulse {
  0% { transform: scale(.96); }
  45% { transform: scale(1.055); }
  100% { transform: scale(1); }
}

@media (max-width: 820px) {
  .trail-nav { display: none; }
  .trail-section { padding: 26px; }
  .legend-note, .placard, .lookout-copy, .last-note, .ritual-board { width: auto; max-width: none; margin-left: 0; margin-right: 0; }
  .puffy-arch { opacity: .32; right: -18vw; width: 78vw; }
  .photo-card { position: relative; width: 88vw; left: auto; right: auto; top: auto; bottom: auto; margin: 26px auto; }
  .quote-row, .menu-fragments li { grid-template-columns: 1fr; }
  .cairn-stack { opacity: .45; right: -8vw; }
  .token-a, .token-b { display: none; }
  .bottle-cap { position: relative; right: auto; bottom: auto; margin-left: auto; display: block; }
  .stamp-output { right: 32px; }
}
