:root {
  --fired-clay: #A85232;
  --ochre-paper: #D7A64A;
  --dust-cream: #EFE1C4;
  --deep-peat: #2E2A1F;
  --faded-teal: #4F7C78;
  --dried-olive: #72734D;
  --smoked-glass: #B8C5B7;
  --ink-umber: #4A3428;
  --poster: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
  --warm: "Alegreya Sans", Trebuchet MS, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--deep-peat);
}

body {
  margin: 0;
  color: var(--deep-peat);
  font-family: var(--warm);
  background: var(--dust-cream);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .15;
  background-image:
    radial-gradient(circle at 20% 30%, var(--ink-umber) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, var(--fired-clay) 0 1px, transparent 1px),
    linear-gradient(90deg, transparent, rgba(74,52,40,.16), transparent);
  background-size: 19px 23px, 31px 37px, 100% 3px;
  mix-blend-mode: multiply;
}

.quest-stack { position: relative; }

.waystation {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(24px, 5vw, 72px);
  border-bottom: 8px solid rgba(74, 52, 40, .34);
  box-shadow: 0 -24px 60px rgba(46, 42, 31, .14) inset;
}

.construction-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .38;
  background-image:
    linear-gradient(90deg, rgba(74, 52, 40, .23) 1px, transparent 1px),
    linear-gradient(rgba(74, 52, 40, .18) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%, 100% 12.5vh;
}

.side-caption {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  font-family: var(--condensed);
  font-size: clamp(14px, 1.35vw, 21px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-umber);
  opacity: .82;
  z-index: 5;
}

.side-caption.right {
  left: auto;
  right: 18px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
}

.threshold {
  background: var(--dust-cream);
  display: grid;
  align-items: center;
}

.clay-sun {
  position: absolute;
  width: clamp(230px, 34vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--fired-clay);
  left: 13vw;
  top: 12vh;
  z-index: -1;
  box-shadow: -18px 14px 0 rgba(215,166,74,.35);
}

.clay-sun::after,
.ripple-source::after,
.ripple-source .ripple {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(215, 166, 74, .75);
  transform: scale(.9);
  opacity: 0;
  pointer-events: none;
}

.threshold.active .clay-sun::after,
.ripple-source.arrived::after {
  animation: cisternRipple 2.7s ease-out .3s forwards;
}

.ripple-source .ripple {
  animation: pointerRipple 1.15s ease-out forwards;
}

.teal-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 59vh;
  height: 18vh;
  background: rgba(79, 124, 120, .66);
  z-index: -1;
  transform: skewY(-1.4deg);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--poster);
  font-size: clamp(6rem, 19vw, 20rem);
  line-height: .78;
  letter-spacing: -.035em;
  color: var(--deep-peat);
  text-shadow: 8px 8px 0 rgba(168,82,50,.13);
}

.stamp-line,
.route-rule b,
.map-title p,
.glass-card span,
.cistern-target strong,
.closing-line p {
  font-family: var(--poster);
  text-transform: uppercase;
  letter-spacing: .16em;
}

.stamp-line {
  display: inline-block;
  margin: 0 0 16px 7vw;
  padding: 8px 14px 5px;
  color: var(--dust-cream);
  background: var(--fired-clay);
  font-size: clamp(1.2rem, 2.2vw, 2.3rem);
  transform: rotate(-1.5deg);
  opacity: 0;
  translate: 0 12px;
  transition: opacity .8s ease, translate .8s ease;
}

.threshold.active .stamp-line { opacity: 1; translate: 0 0; }

.route-rule {
  width: min(70vw, 930px);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  color: var(--ink-umber);
}

.route-rule span { height: 8px; flex: 1; background: var(--ink-umber); }
.route-rule b { font-size: 1.35rem; }

.poster-note {
  position: absolute;
  right: 8vw;
  bottom: 8vh;
  width: min(330px, 34vw);
  font-size: clamp(1.1rem, 1.6vw, 1.55rem);
  color: var(--ink-umber);
}

.map-table { background: var(--ochre-paper); }
.archive { background: var(--ink-umber); color: var(--dust-cream); }
.cistern { background: var(--faded-teal); color: var(--dust-cream); }
.orientation { background: var(--deep-peat); color: var(--dust-cream); }

.station-number {
  position: absolute;
  top: 4vh;
  right: 9vw;
  font-family: var(--poster);
  font-size: clamp(7rem, 17vw, 18rem);
  line-height: .8;
  color: rgba(46,42,31,.15);
  z-index: 0;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), letter-spacing .8s ease;
}

.waystation.active .station-number { transform: translateY(10px); letter-spacing: .06em; }
.archive .station-number, .cistern .station-number, .orientation .station-number { color: rgba(239,225,196,.18); }

.map-slab {
  position: relative;
  margin: 11vh auto 0;
  width: min(78vw, 1050px);
  height: 68vh;
  border: 4px solid var(--ink-umber);
  background:
    radial-gradient(circle at 25% 35%, rgba(168,82,50,.9) 0 5%, transparent 5.3%),
    radial-gradient(circle at 66% 65%, rgba(79,124,120,.8) 0 7%, transparent 7.3%),
    linear-gradient(90deg, rgba(239,225,196,.32) 0 32%, transparent 32% 65%, rgba(114,115,77,.25) 65%),
    var(--dust-cream);
  box-shadow: 22px 22px 0 rgba(74,52,40,.32);
  transform: rotate(-.7deg);
}

.map-title { position: absolute; left: 8%; bottom: 9%; width: min(620px, 72%); }
.map-title p { color: var(--fired-clay); font-size: clamp(1.3rem, 2.4vw, 2.9rem); margin: 0 0 8px; }
.map-title h2, .closing-line h2 { font-family: var(--condensed); font-size: clamp(2.6rem, 5.6vw, 6.2rem); line-height: .88; margin: 0; text-transform: uppercase; }

.pin { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--deep-peat); }
.pin::after { content: ""; position: absolute; left: 14px; top: 32px; width: 6px; height: 70px; background: var(--deep-peat); }
.pin-a { left: 18%; top: 18%; } .pin-b { right: 28%; top: 25%; } .pin-c { right: 16%; bottom: 30%; }
.survey-line { position: absolute; height: 5px; background: var(--fired-clay); transform-origin: left; opacity: .75; }
.survey-line.one { width: 72%; left: 14%; top: 42%; transform: rotate(14deg); }
.survey-line.two { width: 62%; left: 22%; top: 60%; transform: rotate(-23deg); background: var(--faded-teal); }

.pattern-band.arches {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  background: radial-gradient(circle at 24px 52px, transparent 0 23px, var(--ink-umber) 24px 27px, transparent 28px) 0 0/60px 52px;
  opacity: .55;
}

.archive-deck {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 46px);
  perspective: 1000px;
}

.glass-card {
  width: min(29vw, 350px);
  min-height: 410px;
  padding: 28px;
  border: 1px solid rgba(239,225,196,.42);
  background: rgba(184, 197, 183, .20);
  backdrop-filter: blur(12px);
  box-shadow: 18px 24px 50px rgba(46,42,31,.35), inset 0 0 0 1px rgba(184,197,183,.18);
  transition: transform .25s ease;
}
.glass-card:nth-child(1) { transform: rotate(-3deg) translateY(38px); }
.glass-card:nth-child(2) { transform: rotate(1deg) translateY(-18px); }
.glass-card:nth-child(3) { transform: rotate(4deg) translateY(28px); }
.glass-card span { color: var(--ochre-paper); font-size: 1.1rem; }
.glass-card h3 { font-family: var(--poster); font-size: clamp(3.2rem, 6vw, 5.7rem); line-height: .86; margin: 42px 0 20px; color: var(--dust-cream); }
.glass-card p { font-size: 1.22rem; line-height: 1.35; color: rgba(239,225,196,.83); }

.broken-ladder { position: absolute; left: 7vw; bottom: 8vh; width: 42vw; height: 70px; background: repeating-linear-gradient(90deg, var(--ochre-paper) 0 38px, transparent 38px 58px); opacity: .28; }

.cistern-target {
  position: absolute;
  left: 50%; top: 50%;
  width: min(62vw, 660px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 5px solid rgba(239,225,196,.82);
  background: radial-gradient(circle, rgba(239,225,196,.22) 0 12%, rgba(168,82,50,.22) 13% 25%, transparent 26%);
  display: grid;
  place-items: center;
}
.cistern-target strong { font-size: clamp(2rem, 5vw, 5.2rem); color: var(--dust-cream); }
.ring { position: absolute; border-radius: 50%; border: 3px solid rgba(239,225,196,.34); inset: 12%; }
.ring-two { inset: 27%; border-color: rgba(215,166,74,.45); } .ring-three { inset: 41%; border-color: rgba(168,82,50,.5); }
.cistern-copy { position: absolute; left: 8vw; bottom: 11vh; max-width: 360px; font-size: clamp(1.35rem, 2.3vw, 2.45rem); line-height: 1.05; }
.checker-strip { position: absolute; top: 16vh; left: 0; width: 100%; height: 40px; background: linear-gradient(90deg, var(--dust-cream) 0 50%, transparent 50%) 0 0/58px 40px; opacity: .42; }

.symbol-wall {
  position: absolute;
  inset: 11vh 7vw 22vh 35vw;
  border-left: 8px solid var(--dust-cream);
  border-bottom: 8px solid var(--dust-cream);
}
.block { position: absolute; box-shadow: 12px 12px 0 rgba(239,225,196,.12); }
.block.clay { width: 32%; height: 26%; left: 8%; top: 9%; background: var(--fired-clay); }
.block.teal { width: 24%; height: 48%; right: 18%; top: 18%; background: var(--faded-teal); }
.block.olive { width: 42%; height: 18%; left: 20%; bottom: 18%; background: var(--dried-olive); }
.block.ochre { width: 18%; height: 18%; right: 7%; bottom: 8%; background: var(--ochre-paper); }
.final-ripple { position: absolute; left: 22%; top: 28%; width: 310px; max-width: 36vw; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--ochre-paper); }
.triangle-flag { position: absolute; right: 28%; top: 3%; width: 0; height: 0; border-left: 70px solid transparent; border-right: 70px solid transparent; border-bottom: 118px solid var(--dust-cream); opacity: .82; }
.closing-line { position: absolute; left: 7vw; bottom: 8vh; width: min(620px, 52vw); }
.closing-line p { margin: 0 0 12px; color: var(--ochre-paper); font-size: clamp(1.4rem, 2.8vw, 3rem); }

@keyframes cisternRipple {
  0% { transform: scale(.92); opacity: .75; }
  100% { transform: scale(1.85); opacity: 0; }
}

@keyframes pointerRipple {
  0% { transform: scale(.08); opacity: .8; }
  100% { transform: scale(1.8); opacity: 0; }
}

@media (max-width: 760px) {
  .waystation { padding: 26px; min-height: 96vh; }
  .side-caption { display: none; }
  .hero-copy h1 { font-size: clamp(5.2rem, 27vw, 9rem); }
  .poster-note { width: 78vw; right: 26px; }
  .map-slab { width: 84vw; height: 62vh; }
  .archive-deck { flex-direction: column; padding: 12vh 0; }
  .glass-card { width: 78vw; min-height: 260px; }
  .symbol-wall { inset: 12vh 8vw 32vh 8vw; }
  .closing-line { width: 84vw; }
}
