:root {
  --ink: #120F0B;
  --ink-2: #1A150F;
  --line: #3A3122;
  --parchment: #EADFC8;
  --muted: #CDBF9F;
  --faint: #B3A385;
  --sepia: #8C7550;
  --gold: #D9A94E;
  --wax: #7E2219;
  --display: "IM Fell English", Georgia, serif;
  --display-sc: "IM Fell English SC", Georgia, serif;
  --body: Spectral, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper: grain and a darkened edge, fixed over everything, never blocking clicks */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; will-change: transform; }
body::before { background-image: url("grain.png"); background-size: 160px 160px; opacity: .45; }
body::after { background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0,0,0,.55) 100%); }

a { color: var(--parchment); text-decoration: none; }
a:hover, a:focus-visible { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }
.defs { position: absolute; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; z-index: 60; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: relative; z-index: 5;
  max-width: 1280px; margin: 0 auto; padding: 26px 48px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.mark { font-family: var(--display-sc); font-size: 26px; letter-spacing: .08em; }
.top nav { display: flex; gap: 6px; font-family: var(--display); font-size: 20px; }
.top nav a { color: var(--faint); min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.top nav a:hover { color: var(--gold); }

/* The journey and its road */
.journey { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.road { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.road-clip { position: absolute; left: 0; top: 0; width: 100%; height: 0; overflow: hidden; pointer-events: none; z-index: 0; contain: strict; }
.road-live { will-change: transform; }
.road-ghost { stroke: #2A2318; stroke-width: 2; stroke-dasharray: 2 10; stroke-linecap: round; }
.road-line { stroke: var(--sepia); stroke-width: 2.4; stroke-dasharray: 9 9; stroke-linecap: round; }
.traveller { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px 4px rgba(217,169,78,.55); opacity: 0; transition: opacity .4s; will-change: transform; z-index: 2; pointer-events: none; }
.traveller.on { opacity: 1; }
.hero, .station, .maker, .raven { position: relative; z-index: 1; }

/* Hero */
.hero { padding: 64px 0 40px; text-align: center; }
.eyebrow { margin: 0 0 18px; font-family: var(--display); font-style: italic; font-size: 24px; color: var(--gold); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(54px, 9.5vw, 132px); line-height: .95; letter-spacing: -.01em; }
.lede { margin: 28px 0 0; font-style: italic; color: var(--muted); font-size: 20px; }
.compass { display: block; width: 150px; height: 150px; margin: 56px auto 12px; }
.c-ring { fill: var(--ink); stroke: var(--sepia); stroke-width: 1.4; }
.c-ring.thin { fill: none; stroke-dasharray: 2 4; }
.c-fill { fill: #2A2218; stroke: var(--faint); stroke-width: 1.2; }
.c-fill.faint { opacity: .7; }
.c-gold { fill: var(--gold); }
.begin { margin: 0; font-family: var(--display-sc); letter-spacing: .2em; font-size: 15px; color: var(--faint); }

/* Stations */
.station {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 72px; align-items: center; padding: 140px 0; scroll-margin-top: 20px;
}
.station.flip .art { order: 2; }
.art { position: relative; contain: layout paint; }
.art svg { display: block; width: 100%; max-width: 500px; margin: 0 auto; height: auto; overflow: visible; }
.tale { max-width: 520px; }
.kicker { margin: 0; font-family: var(--display-sc); font-size: 17px; letter-spacing: .18em; color: var(--faint); }
.kicker.gold { color: var(--gold); }
.tale h2 { margin: 6px 0 22px; font-family: var(--display); font-weight: 400; font-size: clamp(56px, 6.4vw, 88px); line-height: .95; }
.tale h2 em { color: var(--gold); }
.first { margin: 0; color: var(--muted); }
.drop { float: left; font-family: var(--display); font-size: 84px; line-height: .78; padding: 8px 12px 0 0; color: var(--gold); }
.still { margin: 18px 0 0; font-family: var(--display); font-style: italic; font-size: 22px; color: var(--gold); }
.built { margin: 26px 0 10px; clear: both; font-family: var(--display-sc); font-size: 15px; letter-spacing: .16em; color: var(--gold); }
.works { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.works li { position: relative; padding-left: 22px; color: var(--muted); font-size: 16.5px; line-height: 1.55; }
.works li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border: 1px solid var(--sepia); transform: rotate(45deg); }
.works b { font-weight: 400; color: var(--parchment); }
.lore { margin: 32px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; clear: both; }
.lore div { border-top: 1px solid var(--line); padding-top: 12px; }
.lore dt { font-family: var(--body); font-size: 30px; line-height: 1.15; font-variant-numeric: lining-nums; }
.lore dd { margin: 4px 0 0; font-size: 15px; font-style: italic; color: var(--faint); }

/* Ink drawings */
.ink { fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ink .ridge { stroke: var(--parchment); stroke-width: 2; fill: #1D1711; }
.ink .faint, .ink .ridge.faint { opacity: .45; }
.ink .snowcap { fill: var(--parchment); stroke: var(--parchment); }
.ink .hatch { stroke: var(--sepia); stroke-width: 1.2; }
.ink .strip { fill: #1D1711; stroke: var(--parchment); }
.sprockets { fill: url(#sprockets); stroke: none; }
#sprockets rect { fill: var(--ink); stroke: var(--sepia); stroke-width: 1; }
.flakes path { fill: none; stroke: var(--parchment); stroke-width: 1.2; opacity: .8; }
.ink .book { fill: #2B2217; stroke: var(--parchment); }
.ink .book.alt { fill: #3A2A18; }
.ink .turret { fill: #2B2217; stroke: var(--parchment); }
.ink .quill { fill: #2B2217; stroke: var(--faint); }
.pennant { fill: var(--gold); transform-origin: 180px 36px; }
.ink .trail { stroke: var(--sepia); stroke-width: 2; stroke-dasharray: 6 7; }
.ink .post { stroke: var(--parchment); stroke-width: 3; }
.ink .board { fill: #2B2217; stroke: var(--parchment); }
.lantern { fill: var(--gold); }
.ink .cliff { fill: #1D1711; stroke: var(--parchment); stroke-width: 2; }
.ink .tower { fill: #2B2217; stroke: var(--parchment); }
.ink .note { fill: var(--parchment); stroke: var(--parchment); }
.ink .note path { fill: none; }
.beam { fill: rgba(217,169,78,.12); transform-origin: 44px 62px; }
.lamp { fill: var(--gold); }
.sea rect { fill: #4E6F86; transform-box: fill-box; transform-origin: center; }
.moon { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.ink .serpent { stroke: var(--parchment); stroke-width: 3; }
.dragons { fill: var(--sepia); font-family: var(--display); font-style: italic; font-size: 17px; letter-spacing: .06em; }

/* Snowbird: fog drifting over uncharted water */
.uncharted .art { -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%); mask-image: radial-gradient(closest-side, #000 60%, transparent 100%); }

.fog { position: absolute; left: -10%; right: -10%; height: 46%; border-radius: 50%; pointer-events: none; will-change: transform; }
.f1 { top: 34%; background: radial-gradient(closest-side, rgba(205,191,159,.2), transparent); }
.f2 { top: 58%; background: radial-gradient(closest-side, rgba(205,191,159,.15), transparent); }

/* The Maker */
.maker { max-width: 860px; margin: 0 auto; padding: 160px 0 120px; text-align: center; }
.maker-text { position: relative; background: var(--ink); box-shadow: 0 0 40px 28px var(--ink); margin: 18px 0 0; font-family: var(--display); font-size: clamp(30px, 3.6vw, 44px); line-height: 1.3; }
.maker .kicker { position: relative; z-index: 1; }

/* Raven and seal */
.raven { padding: 60px 0 72px; text-align: center; }
.seal { display: inline-block; width: 140px; height: 140px; margin-bottom: 24px; transition: transform .35s ease; }
.seal svg { width: 100%; height: 100%; display: block; overflow: visible; }
.seal:hover { transform: rotate(-8deg) scale(1.06); }
.wax { fill: var(--wax); }
.seal svg { filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.wax-ring { fill: none; stroke: #A53A2C; stroke-width: 2; }
.wax-ring.thin { stroke-width: 1; stroke-dasharray: 3 3; }
.wax-letter { fill: #C4574A; font-family: var(--display); font-size: 44px; }
.raven .kicker { margin-bottom: 10px; }
.email { display: inline-block; font-family: var(--display); font-size: clamp(30px, 5vw, 60px); overflow-wrap: anywhere; line-height: 1.2; }
.colophon { margin: 28px 0 0; font-style: italic; font-size: 14px; color: #A59878; }

/* Waypoints: a quiet rail on the right; on phones, one compass button */
.waypoints { position: fixed; right: 22px; top: 50%; z-index: 40; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.waypoints.show { opacity: 1; visibility: visible; }
.wp-toggle { display: none; }
.wp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wp-list .wp-gap { margin-top: 10px; }
.wp-list a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 36px; min-width: 44px; padding: 0 4px; color: var(--faint); }
.wp-name { font-family: var(--display); font-size: 17px; opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; white-space: nowrap; }
.pip { width: 8px; height: 8px; border: 1px solid var(--sepia); transform: rotate(45deg); transition: background .3s, border-color .3s, transform .3s; flex: none; }
.seal-pip { border-radius: 50%; transform: none; border-color: #A53A2C; }
.waypoints:hover .wp-name, .wp-list a:focus-visible .wp-name { opacity: 1; transform: none; }
.wp-list a:hover, .wp-list a:focus-visible { color: var(--gold); }
.wp-list a:hover .pip { border-color: var(--gold); }
.wp-list a.here { color: var(--parchment); }
.wp-list a.here .pip { background: var(--gold); border-color: var(--gold); transform: rotate(45deg) scale(1.25); }
.wp-list a.here .seal-pip { background: #A53A2C; transform: scale(1.25); }

@media (max-width: 900px) {
  .waypoints { top: auto; right: 16px; bottom: 16px; transform: none; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
  .wp-toggle { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(18,15,11,.92); border: 1px solid var(--line); color: var(--faint); padding: 0; cursor: pointer; }
  .wp-toggle svg { width: 26px; height: 26px; }
  .wp-toggle circle { fill: none; stroke: var(--sepia); stroke-width: 1.2; }
  .wp-toggle path { fill: var(--gold); }
  .wp-toggle[aria-expanded="true"] { border-color: var(--gold); }
  .wp-list { display: none; background: rgba(18,15,11,.96); border: 1px solid var(--line); padding: 10px 14px; border-radius: 6px; }
  .waypoints.open .wp-list { display: flex; }
  .wp-list a { min-height: 44px; }
  .wp-name { opacity: 1; transform: none; font-size: 19px; }
}

/* Motion, only for people who haven't asked their device to reduce it */
@media (prefers-reduced-motion: no-preference) {
  .c-needle { animation: needle 7s ease-in-out infinite; transform-origin: 0 0; }
  .flakes path { animation: fall 9s linear infinite; }
  .flakes path:nth-child(2) { animation-delay: -3s; animation-duration: 11s; }
  .flakes path:nth-child(3) { animation-delay: -6s; }
  .flakes path:nth-child(4) { animation-delay: -1.5s; animation-duration: 12s; }
  .pennant { animation: flutter 2.4s ease-in-out infinite alternate; }
  .lantern, .halo { animation: flicker 3s ease-in-out infinite alternate; }
  .beam { animation: sweep 6s ease-in-out infinite alternate; }
  .sea rect { animation: swell 2.2s ease-in-out infinite alternate; }
  .sea rect:nth-child(3n) { animation-delay: -.7s; }
  .sea rect:nth-child(3n+1) { animation-delay: -1.4s; }
  .sea rect:nth-child(4n) { animation-duration: 1.7s; }
  .moons { animation: drift 16s ease-in-out infinite alternate; }
  .f1 { animation: fog 18s ease-in-out infinite alternate; }
  .f2 { animation: fog 24s ease-in-out infinite alternate-reverse; }
  .js .reveal { opacity: 0; transition: opacity 1.1s ease; }
  .js .reveal .tale, .js .reveal .maker-text { transform: translateY(28px); transition: transform 1.1s ease; }
  .js .reveal.seen { opacity: 1; }
  .js .reveal.seen .tale, .js .reveal.seen .maker-text { transform: none; }
}
@keyframes needle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
@keyframes fall { from { translate: 0 -30px; opacity: 0; } 20% { opacity: .8; } to { translate: 6px 150px; opacity: 0; } }
@keyframes flutter { from { transform: skewY(-4deg) scaleX(.94); } to { transform: skewY(5deg) scaleX(1.04); } }
@keyframes flicker { from { opacity: .75; } to { opacity: 1; } }
@keyframes sweep { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }
@keyframes swell { from { transform: scaleY(.45); } to { transform: scaleY(1.05); } }
@keyframes drift { from { translate: 0 0; } to { translate: -12px 8px; } }
@keyframes fog { from { transform: translateX(-12%); } to { transform: translate(12%, -6px); } }

/* Small screens: one column, the road runs down the left edge */
@media (max-width: 900px) {
  .top { padding: 18px 20px; }
  .top nav { display: none; }
  .journey { padding: 0 20px 0 44px; }
  .hero { padding: 40px 0 24px; }
  .compass { width: 110px; height: 110px; margin-top: 40px; }
  .station { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 88px 0; }
  .station.flip .art { order: 0; }
  .drop { font-size: 64px; }
  .lore dt { font-size: 28px; }
  .maker { padding: 112px 0 88px; }
  .seal { width: 112px; height: 112px; }
}
