:root {
  --kit-accent: var(--accent);
  --bg: #0d1113;
  --fg: #e9e4da;
  --muted: #9a958b;
  --line: #262b2e;
  --accent: #e6b45c;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* minimal scrollbars: thin, no track, a quiet thumb */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 228, 218, 0.26) transparent;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(233, 228, 218, 0.26);
  border-radius: 3px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--fg);
}
body {
  margin: 0;
  font:
    400 19px/1.7 Georgia,
    'Iowan Old Style',
    'Times New Roman',
    serif;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p,
figure,
blockquote {
  margin: 0;
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 10;
}

/* cover with parallax layers */
.cover {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: grid;
  align-items: end;
}
.layer {
  position: absolute;
  inset: -10% -40px 0; /* a bleed on each side, for the pointer's lean */
  will-change: transform;
}
.layer {
  width: calc(100% + 80px);
  height: 110%;
}
.cover::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 25%;
  background: linear-gradient(transparent, var(--bg));
}
.cover-text {
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 6vw, 96px) 12svh;
  display: grid;
  gap: 16px;
  max-width: 900px;
}
.kicker {
  font:
    500 12px/1 system-ui,
    sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  font-weight: 400;
  font-size: clamp(46px, 8.5vw, 116px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.standfirst {
  font-size: clamp(19px, 2.2vw, 24px);
  color: #cfc8ba;
  max-width: 30ch;
  font-style: italic;
}

main {
  padding: 0 clamp(20px, 6vw, 96px);
}
main > p {
  max-width: 34em;
  margin: 0 auto 1.4em;
  color: #d8d2c6;
}
.lead {
  margin-top: 120px !important;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.6;
}

/* reveals: hidden only when the script runs */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* the light shifts across the five days, dusk to night to a cold dawn: the page's ground changes tone. The
   tones stay dark, so the text keeps its contrast at every step */
html {
  --tone: #0d1113;
  background: var(--tone);
  transition: --tone 1.2s;
}
html[data-day='1'] {
  --tone: #15140f;
}
html[data-day='2'] {
  --tone: #0d1218;
}
html[data-day='3'] {
  --tone: #0a0f1a;
}
html[data-day='4'] {
  --tone: #101816;
}
@property --tone {
  syntax: '<color>';
  inherits: true;
  initial-value: #0d1113;
}
/* the journey: map pinned on the left, days scroll on the right */
/* phones: the map sits on top, the days scroll underneath it */
.journey {
  display: grid;
  margin: 120px 0;
}
.map {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 46svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding-bottom: 14px;
  /* solid down to the caption, so the days scrolling underneath never show through it */
  background: linear-gradient(var(--tone) 94%, transparent);
}
.map svg {
  width: min(100%, 340px);
  height: auto;
  max-height: 32svh;
  overflow: visible;
}
.map .contour {
  fill: none;
  stroke: #1d2427;
  stroke-width: 1;
}
.north path {
  fill: var(--muted);
}
.north text {
  font:
    500 10px system-ui,
    sans-serif;
  fill: var(--muted);
}
.walker circle {
  fill: var(--accent);
}
.walker .walker-halo {
  fill: rgba(230, 180, 92, 0.18);
}
.coast {
  fill: none;
  stroke: #2f3a3d;
  stroke-width: 40;
  stroke-linecap: round;
  opacity: 0.55;
}
.route-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-dasharray: 3 6;
}
.route {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.stops circle {
  fill: var(--bg);
  stroke: var(--muted);
  stroke-width: 1.5;
  transition:
    fill 0.4s,
    stroke 0.4s;
}
.stops circle.on {
  fill: var(--accent);
  stroke: var(--accent);
}
.map figcaption {
  /* on phones too: the map is drawn for illustration, and the reader should know that at every size */
  font:
    400 11px/1.4 system-ui,
    sans-serif;
  color: var(--muted);
  text-align: center;
}
.day {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.day {
  --shift: 0;
}
.day .day-n {
  translate: 0 calc(var(--shift) * 60px);
}
.day h2 {
  translate: 0 calc(var(--shift) * 20px);
}
.day-n {
  font:
    500 12px/1 system-ui,
    sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
/* the day being read is lit by colour, not opacity, so the others still meet contrast */
.day-n,
.day h2,
.day p:last-child {
  color: var(--muted);
  transition: color 0.5s;
}
.day.on .day-n {
  color: var(--accent);
}
.day.on h2 {
  color: var(--fg);
}
.day.on p:last-child {
  color: #cfc8ba;
}
.day h2 {
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.day p:last-child {
  max-width: 28em;
}

.pull {
  max-width: 18em;
  margin: 80px auto 100px;
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
}
.end {
  color: var(--muted);
  font:
    400 13px/1.5 system-ui,
    sans-serif;
  text-align: center;
  padding: 60px 0 80px;
  border-top: 1px solid var(--line);
}

/* larger screens: the map pinned on the left, the days on the right */
@media (min-width: 761px) {
  .journey {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6vw;
  }
  .map {
    height: 100svh;
    background: none;
  }
  .map svg {
    max-height: 76svh;
  }
  .map figcaption {
    font-size: 12px;
  }
  .day {
    min-height: 100svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js:not(.motion-on) .reveal {
    transition: none;
    transform: none;
    opacity: 1;
  }
  /* every day reads at full strength, and the stops switch without a fade */
  html:not(.motion-on) :is(.day-n, .day h2, .day p:last-child) {
    transition: none;
  }
  html:not(.motion-on) .stops circle,
  html:not(.motion-on) {
    transition: none;
  }
}

/* masthead: quiet over the cover, solid once the story starts */
.mast {
  position: fixed;
  inset: 3px 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(20px, 6vw, 96px);
  font:
    500 14px/1 system-ui,
    sans-serif;
  background: color-mix(in srgb, var(--tone) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.mast-name {
  color: var(--fg);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.mast-name span {
  font:
    400 12px system-ui,
    sans-serif;
  color: var(--muted);
}
.mast nav,
.foot nav {
  display: flex;
  gap: 20px;
}
.mast nav a,
.foot nav a {
  color: var(--muted);
  text-decoration: none;
}
.mast nav a:hover,
.mast nav a:focus-visible,
.foot nav a:hover,
.foot nav a:focus-visible {
  color: var(--fg);
}
.mast nav a:nth-child(n + 3) {
  display: none;
}

/* after the story */
main section.kit,
main section.more,
main section.letter {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 0 0;
}
.kit h2,
.more h2,
.letter h2 {
  font-weight: 400;
  font-size: clamp(34px, 4.6vw, 60px);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.kit ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.kit li {
  display: grid;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.kit b {
  font-weight: 400;
  font-size: 1.3em;
  color: var(--fg);
}
.figures {
  display: grid;
  gap: 1px;
  max-width: 1100px;
  margin: 120px auto 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.figures div {
  display: grid;
  gap: 6px;
  padding: 36px 28px;
  background: var(--tone);
}
.figures b {
  font-weight: 400;
  font-size: clamp(64px, 9vw, 120px);
  line-height: 0.9;
  color: var(--accent);
}
.figures span {
  font:
    400 14px system-ui,
    sans-serif;
  color: var(--muted);
}
.cards {
  display: grid;
  gap: 28px;
}
.card {
  display: grid;
  gap: 10px;
}
.card h3 {
  margin: 0;
  font-weight: 400;
  font-size: 26px;
}
.card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}
.card-art {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  transition: transform 0.6s var(--ease);
}
.card:hover .card-art {
  transform: scale(1.02);
}
.card-art.a {
  background: radial-gradient(circle at 70% 30%, #e9e4da 0 5%, transparent 6%), linear-gradient(#1b2a33, #3d4b4f 60%, #2b3a3c 61%, #18211f);
}
.card-art.b {
  background: linear-gradient(rgba(233, 228, 218, 0.4), transparent 60%), linear-gradient(#5d6466, #2f3537);
}
.card-art.c {
  background: radial-gradient(circle at 50% 60%, #e6b45c 0 12%, transparent 13%), linear-gradient(135deg, #2a2418, #0d1113);
}
.letter {
  text-align: center;
  padding-bottom: 140px !important;
}
.letter p {
  color: var(--muted);
  margin: 0 auto 28px;
}
.btn {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 99px;
  background: var(--accent);
  color: #1a1206;
  text-decoration: none;
  font:
    600 15px system-ui,
    sans-serif;
}
.btn:hover,
.btn:focus-visible {
  filter: brightness(1.08);
}
.foot {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 48px 20px 40px;
  border-top: 1px solid var(--line);
  font:
    400 14px system-ui,
    sans-serif;
}
.foot .end {
  padding: 0;
  border: 0;
}
@media (min-width: 761px) {
  .mast nav a:nth-child(n + 3) {
    display: inline;
  }
  .kit ul {
    grid-template-columns: 1fr 1fr;
    column-gap: 48px;
  }
  .figures {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* the film layer, shared by all five projects: grain over everything, letterbox bars that close in while the
   signature moment plays (html.film, set by the script), and a fade up from black as the page opens. All of it is
   decoration, kept out of the way of the pointer and the reader, and still under reduced motion */
.grain {
  position: fixed;
  inset: -20px;
  z-index: 30;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bars {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: none;
  pointer-events: none;
}
.bars i {
  position: absolute;
  left: 0;
  right: 0;
  height: 7vh;
  background: #000;
  transform: scaleY(0);
  transition: transform 0.7s var(--ease);
}
.bars i:first-child {
  top: 0;
  transform-origin: top;
}
.bars i:last-child {
  bottom: 0;
  transform-origin: bottom;
}
html.film .bars i {
  transform: none;
}
@media (min-width: 900px) {
  .bars {
    display: block;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .grain {
    animation: gate 1s steps(4) infinite;
  }
  .js body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 40;
    background: #000;
    pointer-events: none;
    animation: curtain 1.4s var(--ease) 0.1s forwards;
  }
}
html.motion-on .grain {
  animation: gate 1s steps(4) infinite;
}
@keyframes gate {
  25% {
    transform: translate(-8px, 5px);
  }
  50% {
    transform: translate(6px, -7px);
  }
  75% {
    transform: translate(-4px, -3px);
  }
}
@keyframes curtain {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ---- the scroll kit's styles: the same in all five projects, coloured by each site's own tokens ---- */
header nav a[aria-current='location'] {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--kit-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
/* reveal on scroll: hidden only when the script runs and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js .kit-reveal {
    opacity: 0;
    translate: 0 28px;
    transition:
      opacity 0.9s var(--ease),
      translate 0.9s var(--ease);
  }
  .js .kit-reveal.kit-in {
    opacity: 1;
    translate: none;
  }
}
html.motion-on.js .kit-reveal:not(.kit-in) {
  opacity: 0;
  translate: 0 28px;
}
html.motion-on.js .kit-reveal {
  transition:
    opacity 0.9s var(--ease),
    translate 0.9s var(--ease);
}
.kit-section {
  padding: 14vh clamp(20px, 6vw, 96px);
  border-top: 1px solid var(--line);
}
.kit-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 32px;
}
.kit-head h2 {
  margin: 0;
  font-weight: inherit;
  font-size: clamp(32px, 4.8vw, 64px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.kit-buttons {
  display: flex;
  gap: 8px;
}
.kit-buttons button,
.kit-more {
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: none;
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
}
.kit-buttons button:hover,
.kit-buttons button:focus-visible,
.kit-more:hover,
.kit-more:focus-visible {
  border-color: var(--kit-accent);
}
/* scroll snap: a native horizontal track that settles on a card */
.kit-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 340px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding-bottom: 14px;
  scrollbar-width: thin;
}
.kit-track > * {
  scroll-snap-align: start;
  margin: 0;
}
.kit-card {
  display: grid;
  gap: 10px;
}
.kit-card .kit-art {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
}
.kit-card h3 {
  margin: 0;
  font-weight: inherit;
  font-size: 22px;
}
.kit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
/* zoom on scroll: the frame stays put, the picture inside settles from 1.28x to 1x */
.kit-zoom {
  overflow: hidden;
  border: 1px solid var(--line);
}
.kit-zoom > * {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(var(--zoom, 1));
  transform-origin: 50% 60%;
}
/* infinite scroll */
.kit-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.kit-list li {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 4px 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.kit-list time,
.kit-list .kit-tag {
  color: var(--kit-accent);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
}
.kit-list p {
  margin: 0;
  color: var(--muted);
}
.kit-list b {
  display: block;
  color: var(--fg);
  font-weight: inherit;
  font-size: 1.15em;
}
.kit-end {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}
.kit-more {
  display: none;
}
.js .kit-more:not([hidden]) {
  display: inline-block;
}

/* reduced motion: state changes happen at once, nothing fades or slides into place */
/* ---- the cover at dusk: the sun sets and the sky darkens as the reader leaves, the lighthouse sweeps, mist
   drifts in the valleys, stars come out and birds cross. --out is 0 on arrival and 1 when the cover has gone ---- */
.cover {
  --out: 0;
}
.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 100%, transparent, #070a0c 70%);
  opacity: calc(var(--out) * 0.85);
}
.cover-text {
  z-index: 2;
  transform: translateY(calc(var(--out) * -12svh));
  opacity: calc(1 - var(--out) * 1.4);
}
.sun,
.sun-glow {
  transform: translateY(calc(var(--out) * 220px));
}
.stars {
  opacity: calc(0.35 + var(--out) * 0.65);
}
.beam {
  transform-box: view-box;
  transform-origin: 1099px 598px;
  transform: rotate(10deg);
}
.lamp {
  transform-box: fill-box;
  transform-origin: center;
}
.birds {
  display: none;
}
/* the title arrives one word at a time */
.cover h1 .w {
  display: inline-block;
}
.moving .birds {
  display: inline;
}
.moving .bird {
  animation: fly 26s linear infinite;
}
.moving .bird:nth-child(2) {
  animation-duration: 31s;
  animation-delay: -9s;
}
.moving .bird:nth-child(3) {
  animation-duration: 29s;
  animation-delay: -17s;
}
.moving .beam {
  animation: sweep 9s ease-in-out infinite alternate;
}
.moving .lamp {
  animation: breathe 3s ease-in-out infinite;
}
.moving .fog {
  animation: drift 40s ease-in-out infinite alternate;
}
.moving .f2 {
  animation-duration: 52s;
  animation-direction: alternate-reverse;
}
.moving .f3 {
  animation-duration: 34s;
}
.moving .stars circle {
  animation: twinkle 4s ease-in-out infinite;
}
.moving .stars circle:nth-child(2n) {
  animation-delay: -1.3s;
}
.moving .stars circle:nth-child(3n) {
  animation-delay: -2.7s;
}
.moving .cover h1 .w {
  animation: word 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.35s + var(--i) * 0.12s);
}
.moving .cover :is(.kicker, .standfirst) {
  animation: word 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.moving .cover .kicker {
  animation-delay: 0.2s;
}
.moving .cover .standfirst {
  animation-delay: 0.9s;
}
@keyframes fly {
  from {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(900px, -60px);
  }
  to {
    transform: translate(1900px, 20px);
  }
}
@keyframes sweep {
  from {
    transform: rotate(-18deg);
  }
  to {
    transform: rotate(32deg);
  }
}
@keyframes breathe {
  50% {
    transform: scale(1.6);
    opacity: 0.7;
  }
}
@keyframes drift {
  to {
    transform: translateX(160px);
  }
}
@keyframes twinkle {
  50% {
    opacity: 0.2;
  }
}
@keyframes word {
  from {
    opacity: 0;
    transform: translateY(0.6em) rotate(2deg);
    filter: blur(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) *,
  html:not(.motion-on) *::before,
  html:not(.motion-on) *::after {
    transition-duration: 0s !important;
  }
}

/* inside the story's column the kit sections take the column's width and padding, not their own */
main .kit-section {
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: 0;
}
