:root {
    --ink: #171826;
    --thread: #C7433E;
    --vellum: #F3E7C9;
    --lichen: #788B4E;
    --teal: #2D7F7B;
    --brass: #C89B3C;
    --lavender: #B8B3D9;
    --graphite: #565866;
    --title: "Fraunces", "Lora", serif;
    --body: "Alegreya Sans", "Inter", sans-serif;
    --mono: "IBM Plex Mono", "Space Mono", monospace;
    --hand: "Caveat", cursive;
}

/* IBM Plex Mono appears sparingly for coordinate ticks and relation-code captions. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: radial-gradient(circle at 18% 12%, rgba(184,179,217,.22), transparent 24rem), radial-gradient(circle at 84% 36%, rgba(45,127,123,.2), transparent 28rem), #171826;
    color: var(--vellum);
    font-family: var(--body);
    overflow-x: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: .22;
    background-image: radial-gradient(rgba(243,231,201,.8) .6px, transparent .8px), linear-gradient(115deg, transparent 0 46%, rgba(199,67,62,.08) 47% 48%, transparent 49% 100%);
    background-size: 4px 4px, 260px 260px;
    mix-blend-mode: overlay;
}

.atlas { position: relative; }
.plate {
    min-height: 100vh;
    position: relative;
    display: grid;
    place-items: center;
    padding: 8vh 7vw;
    overflow: hidden;
}
.plate::before {
    content: "";
    position: absolute;
    inset: 6% 4%;
    border: 1px solid rgba(243,231,201,.1);
    transform: rotate(var(--tilt, -1deg));
    background: radial-gradient(circle at 50% 50%, rgba(200,155,60,.06), transparent 42%), repeating-radial-gradient(circle at 48% 52%, transparent 0 26px, rgba(243,231,201,.045) 27px 29px);
}

h1, h2, h3 { font-family: var(--title); line-height: .9; margin: 0; }
h1 { font-size: clamp(4.6rem, 13vw, 13rem); color: var(--ink); letter-spacing: -.08em; max-width: 900px; }
h2 { font-size: clamp(3rem, 8vw, 8rem); color: var(--ink); letter-spacing: -.055em; }
h3 { font-size: clamp(2rem, 4vw, 4rem); color: var(--vellum); }
p { font-size: clamp(1.18rem, 1.7vw, 1.8rem); line-height: 1.22; max-width: 670px; }
.mono, .eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; }
.stamp { color: var(--thread); transform: rotate(-2deg); margin: 0 0 1rem; }

.folded-map, .vellum-sheet, .tracing-paper, .campfire-sheet {
    position: relative;
    width: min(1120px, 88vw);
    min-height: 68vh;
    padding: clamp(2rem, 6vw, 5.5rem);
    color: var(--ink);
    background: linear-gradient(100deg, rgba(86,88,102,.12), transparent 18% 82%, rgba(86,88,102,.16)), radial-gradient(circle at 15% 22%, rgba(200,155,60,.24), transparent 16rem), var(--vellum);
    box-shadow: 0 2rem 7rem rgba(0,0,0,.43), inset 0 0 0 1px rgba(23,24,38,.18);
    isolation: isolate;
}
.folded-map::after, .vellum-sheet::after, .tracing-paper::after, .campfire-sheet::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(84deg, transparent 0 32%, rgba(23,24,38,.08) 33% 34%, transparent 35% 63%, rgba(255,255,255,.2) 64% 65%, transparent 66%);
    pointer-events: none;
}
.hero-map { transform: rotate(-3deg) perspective(1200px) rotateX(4deg); }
.invitation { color: var(--teal); font-family: var(--title); font-weight: 800; font-size: clamp(1.8rem, 3vw, 3rem); }
.field-note { font-family: var(--hand); color: var(--graphite); font-size: 2rem; transform: rotate(-5deg); position: absolute; right: 9%; bottom: 16%; max-width: 310px; }

.relative-compass {
    position: fixed;
    right: 2rem;
    top: 1.7rem;
    z-index: 30;
    display: grid;
    justify-items: center;
    gap: .35rem;
    color: var(--vellum);
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.compass-face {
    position: relative;
    width: 126px;
    height: 126px;
    border: 1px solid rgba(200,155,60,.65);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(23,24,38,.92) 0 52%, rgba(45,127,123,.42));
    box-shadow: 0 0 36px rgba(200,155,60,.18);
}
.compass-face::before { content: ""; position: absolute; inset: 17px; border: 1px dashed rgba(243,231,201,.28); border-radius: inherit; }
.compass-needle { position: absolute; left: 60px; top: 18px; width: 5px; height: 90px; background: linear-gradient(var(--thread) 0 48%, var(--brass) 49%); transform-origin: 50% 50%; clip-path: polygon(50% 0, 100% 50%, 55% 100%, 45% 100%, 0 50%); transition: transform .5s ease; }
.label { position: absolute; color: var(--vellum); text-shadow: 0 0 8px var(--ink); }
.label-n { top: -18px; left: 37px; } .label-e { right: -34px; top: 54px; } .label-s { bottom: -18px; left: 36px; } .label-w { left: -38px; top: 54px; }
#compassCaption { margin: 0; font-size: .62rem; max-width: 150px; text-align: center; color: var(--lavender); }

.origin-pin { position: absolute; left: 24%; top: 60%; width: 18px; height: 18px; border-radius: 50%; background: var(--thread); box-shadow: 0 0 0 12px rgba(199,67,62,.18), 0 0 25px rgba(199,67,62,.7); }
.origin-pin span { position: absolute; left: 50%; top: 100%; width: 2px; height: 58px; background: var(--thread); transform: translateX(-50%); }
.orbit-field { position: absolute; left: 24%; top: 60%; width: 1px; height: 1px; }
.node { position: absolute; font-family: var(--mono); color: var(--ink); font-size: .74rem; background: rgba(243,231,201,.72); border: 1px solid rgba(86,88,102,.3); padding: .25rem .45rem; border-radius: 999px; white-space: nowrap; transform: translate(-50%,-50%); }
.thread-map { position: absolute; inset: 0; z-index: -1; }
.thread-map path { fill: none; stroke: var(--thread); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 7; filter: drop-shadow(0 3px 2px rgba(23,24,38,.17)); }
.thread-map .measure { stroke: var(--graphite); stroke-width: 1.4; stroke-dasharray: 4 10; opacity: .62; }
.relation-drift { position: absolute; font-family: var(--hand); font-size: 1.65rem; color: var(--graphite); animation: drift 8s ease-in-out infinite; }
.r1 { right: 18%; top: 22%; } .r2 { left: 12%; bottom: 18%; animation-delay: -2s; } .r3 { right: 32%; bottom: 7%; animation-delay: -4s; }

.slant-left { transform: rotate(2deg); }
.wide { width: min(1180px, 90vw); }
.pin-board { position: relative; height: 360px; margin-top: 2rem; border: 1px dashed rgba(86,88,102,.38); background: repeating-radial-gradient(circle at 30% 40%, transparent 0 18px, rgba(45,127,123,.09) 19px 21px); }
.anchor { position: absolute; border: 0; border-radius: 50%; width: 32px; height: 32px; background: var(--brass); color: var(--ink); font-family: var(--mono); cursor: pointer; transform: translate(-50%,-50%); box-shadow: 0 7px 0 rgba(23,24,38,.22); }
.anchor.active { background: var(--thread); color: var(--vellum); }
.anchor:nth-of-type(1) { left: 28%; top: 38%; } .anchor:nth-of-type(2) { left: 61%; top: 28%; } .anchor:nth-of-type(3) { left: 74%; top: 66%; } .anchor:nth-of-type(4) { left: 39%; top: 72%; }
.moving-origin { position: absolute; left: 28%; top: 38%; width: 58px; height: 58px; border: 2px solid var(--thread); border-radius: 50%; transform: translate(-50%,-50%); transition: left .55s ease, top .55s ease; }
.board-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
#anchorThread { fill: none; stroke: var(--thread); stroke-width: .7; stroke-dasharray: 2 1.6; }
.marginalia { position: absolute; right: 7%; top: 12%; font-family: var(--hand); color: var(--thread); font-size: 2.5rem; transform: rotate(10deg); }

.plate-star { --tilt: 2deg; }
.tracing-paper { background: rgba(243,231,201,.78); backdrop-filter: blur(4px); transform: rotate(-1deg); }
.constellation { width: 100%; height: 45vh; margin-top: 1rem; }
.star-lines path { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 700; stroke-dashoffset: 700; animation: drawPath 7s ease-in-out infinite alternate; }
.stars circle { fill: var(--lavender); stroke: var(--ink); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(184,179,217,.8)); }
.leaf { position: absolute; width: 70px; height: 28px; background: var(--lichen); border-radius: 100% 0; opacity: .8; transform: rotate(35deg); }
.leaf-one { right: 18%; top: 18%; } .leaf-two { left: 11%; bottom: 17%; transform: rotate(-140deg); }

.valley-sheet { transform: rotate(1.5deg); }
.valley-map { height: 330px; position: relative; margin-top: 2rem; }
.valley-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.river { fill: none; stroke: var(--teal); stroke-width: 17; stroke-linecap: round; opacity: .85; }
.contour { fill: none; stroke: var(--brass); stroke-width: 2; stroke-dasharray: 7 8; }
.ridge { position: absolute; font-family: var(--title); font-size: 4rem; color: rgba(23,24,38,.18); }
.left-name { left: 8%; top: 12%; } .right-name { right: 7%; bottom: 8%; }

.plate-degrees { display: block; padding: 15vh 0; }
.degree-scroll { display: flex; gap: 2rem; overflow-x: auto; padding: 12vh 12vw; scrollbar-width: none; }
.degree-scroll article { flex: 0 0 min(520px, 78vw); min-height: 52vh; padding: 3rem; background: linear-gradient(145deg, rgba(23,24,38,.82), rgba(45,127,123,.32)); border: 1px solid rgba(243,231,201,.22); box-shadow: 0 2rem 5rem rgba(0,0,0,.35); transform: rotate(var(--r)); }
.degree-scroll article:nth-child(1) { --r: -3deg; } .degree-scroll article:nth-child(2) { --r: 2deg; } .degree-scroll article:nth-child(3) { --r: -1deg; } .degree-scroll article:nth-child(4) { --r: 3deg; }
.degree-scroll p { color: var(--lavender); }

.north-map { transform: rotate(-2deg); }
.rose { position: relative; margin: 3rem auto 1rem; width: min(430px, 70vw); height: min(430px, 70vw); border-radius: 50%; border: 2px solid var(--brass); background: repeating-conic-gradient(from 8deg, rgba(200,155,60,.18) 0 12deg, transparent 12deg 24deg); }
.rose span { position: absolute; font-family: var(--mono); font-size: .75rem; color: var(--graphite); text-transform: uppercase; }
.rose span:nth-child(1) { top: -1.4rem; left: 41%; } .rose span:nth-child(2) { right: -2.4rem; top: 48%; } .rose span:nth-child(3) { bottom: -1.4rem; left: 43%; } .rose span:nth-child(4) { left: -1.8rem; top: 48%; }
.rose i { position: absolute; left: 50%; top: 8%; width: 13px; height: 84%; background: linear-gradient(var(--thread), var(--brass)); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: translateX(-50%) rotate(var(--needle, 18deg)); transition: transform .4s ease; }
.caveat-note { font-family: var(--hand); color: var(--thread); font-size: 2.7rem; text-align: center; max-width: none; }

.overlay-card { min-height: 62vh; }
.overlay-slider { position: relative; height: 16px; margin: 3rem 0; background: linear-gradient(90deg, var(--teal), var(--brass), var(--thread), var(--lavender)); border-radius: 999px; }
#overlayHandle { position: absolute; top: 50%; left: 12%; width: 46px; height: 46px; border-radius: 50%; background: var(--vellum); border: 4px solid var(--thread); transform: translate(-50%,-50%); transition: left .22s ease; }
.interpretation-stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.interpretation-stack div { padding: 1rem; border: 1px solid rgba(23,24,38,.2); font-family: var(--mono); text-align: center; text-transform: uppercase; color: var(--graphite); }

.campfire-sheet { text-align: center; transform: rotate(.8deg); }
.campfire-sheet p { margin-left: auto; margin-right: auto; }
.camp-diagram { position: relative; width: min(520px, 74vw); height: min(520px, 74vw); margin: 2rem auto 0; border-radius: 50%; background: radial-gradient(circle, rgba(199,67,62,.18), transparent 19%), repeating-radial-gradient(circle, transparent 0 52px, rgba(23,24,38,.12) 53px 55px); }
.camp-diagram svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.camp-diagram path { stroke: var(--thread); stroke-width: 3; stroke-dasharray: 8 9; fill: none; }
.fire { position: absolute; left: 50%; top: 50%; width: 54px; height: 66px; background: radial-gradient(circle at 50% 70%, var(--brass), transparent 34%), var(--thread); clip-path: polygon(50% 0, 75% 37%, 65% 100%, 31% 100%, 22% 40%); transform: translate(-50%,-50%); filter: drop-shadow(0 0 24px rgba(199,67,62,.85)); animation: flame 1.4s ease-in-out infinite alternate; }
.camp-node { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 18px rgba(45,127,123,.8); }
.n-a { left: 16%; top: 26%; } .n-b { right: 18%; top: 18%; } .n-c { right: 14%; bottom: 25%; } .n-d { left: 22%; bottom: 18%; } .n-e { left: 50%; top: 10%; } .n-f { left: 12%; top: 53%; }

@keyframes drift { 0%,100% { transform: translate(0,0) rotate(-3deg); } 50% { transform: translate(14px,-18px) rotate(4deg); } }
@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes flame { to { transform: translate(-50%,-53%) scaleX(.86) scaleY(1.08); } }

@media (max-width: 760px) {
    .relative-compass { right: .9rem; top: .8rem; transform: scale(.74); transform-origin: top right; }
    .plate { padding: 7vh 4vw; }
    .folded-map, .vellum-sheet, .tracing-paper, .campfire-sheet { width: 94vw; padding: 2rem; min-height: 72vh; }
    .origin-pin, .orbit-field { left: 19%; top: 68%; }
    .degree-scroll { padding-left: 6vw; padding-right: 6vw; }
    .interpretation-stack { grid-template-columns: 1fr 1fr; }
}
