:root {
  /* Typography from Google Fonts; Interactions should feel like touching wet paper: hover states darken. */
  --harbor: #081A24;
  --glass: #B9D6D2;
  --paper: #E7E1D2;
  --concrete: #6F7C7E;
  --amber: #F2B66D;
  --coral: #D95F4C;
  --spine: min(78vw, 860px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--paper);
  font-family: "EB Garamond", Garamond, Georgia, serif;
  background:
    radial-gradient(circle at 50% 12%, rgba(185,214,210,.18), transparent 42%),
    radial-gradient(ellipse at 50% 95%, rgba(242,182,109,.14), transparent 38%),
    linear-gradient(180deg, #081A24 0%, #0b202a 46%, #081A24 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(185,214,210,.035) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: .45;
  z-index: 20;
}

.weather-field, .grain, .beacon, .drift-map {
  position: fixed;
  pointer-events: none;
}

.weather-field { inset: 0; overflow: hidden; z-index: 0; }

.grain {
  inset: -15%;
  background-image:
    radial-gradient(circle, rgba(231,225,210,.12) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(111,124,126,.1) 0 1px, transparent 1px);
  background-size: 37px 41px, 53px 47px;
  animation: grainDrift 18s steps(6) infinite;
  opacity: .24;
}

.beacon {
  right: 9vw;
  bottom: 17vh;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 26px 10px rgba(242,182,109,.34);
  animation: beaconPulse 4.8s ease-in-out infinite;
}

.drift-map {
  font-family: "IBM Plex Mono", monospace;
  color: var(--concrete);
  font-size: .68rem;
  letter-spacing: .08em;
  opacity: .52;
  transform: rotate(-3deg);
}

.map-a { left: 6vw; top: 18vh; }
.map-b { right: 4vw; top: 42vh; transform: rotate(4deg); }

.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 14vh 5vw;
  isolation: isolate;
  overflow: hidden;
}

.scene::before {
  content: attr(data-chapter);
  position: absolute;
  top: 7vh;
  left: 50%;
  transform: translateX(calc(-1 * var(--spine) / 2));
  font-family: "IBM Plex Mono", monospace;
  color: rgba(185,214,210,.38);
  font-size: .72rem;
  letter-spacing: .22em;
}

.scene::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgba(185,214,210,.22), transparent);
  opacity: .5;
  z-index: -1;
}

.spine {
  width: var(--spine);
  max-width: 860px;
  text-align: center;
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.3s ease, transform 1.3s ease;
}

.scene.in-view .spine { opacity: 1; transform: translateY(0); }

h1, h2 {
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-weight: 600;
  margin: 0;
  line-height: .86;
  letter-spacing: -.045em;
  text-shadow: 0 18px 46px rgba(0,0,0,.42);
}

h1 { font-size: clamp(4.8rem, 15vw, 12rem); }
h2 { font-size: clamp(3.4rem, 9vw, 8rem); }

p {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.55;
  max-width: 62ch;
  margin: 1.2rem auto 0;
}

.lead { max-width: 48ch; color: var(--glass); }
.mono { font-family: "IBM Plex Mono", monospace; }
.stamp, .caption, .bulletin, .closing {
  font-size: .72rem;
  line-height: 1.5;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--glass);
}

.stamp { margin-bottom: 1.1rem; opacity: .74; }
.bulletin { color: var(--amber); }
.closing { margin-top: 2.2rem; color: var(--concrete); }

.draw-line {
  width: min(72vw, 620px);
  height: 62px;
  margin: -.2rem auto .6rem;
  display: block;
  overflow: visible;
}

.draw-line path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  filter: drop-shadow(0 0 12px rgba(242,182,109,.3));
  transition: stroke-dashoffset 1.8s cubic-bezier(.23,1,.32,1), stroke 1s ease;
}

.scene.in-view .draw-line path { stroke-dashoffset: 0; }
.final-scene .draw-line path { stroke: var(--glass); stroke-width: 3; }

.caption {
  position: absolute;
  bottom: 12vh;
  color: rgba(185,214,210,.55);
  z-index: 4;
}
.caption.left { left: 7vw; }
.caption.right { right: 7vw; text-align: right; }

.collage, .lens-scrap, .scrap, .rail-lines, .receipt-strip, .notice-stack, .correction, .quiet-horizon, .siren-speaker, .window-grid {
  position: absolute;
  z-index: 1;
}

.skyline {
  left: 50%;
  bottom: -3vh;
  width: min(90vw, 1100px);
  height: 28vh;
  transform: translateX(-50%);
  opacity: .48;
  display: flex;
  align-items: end;
  gap: 9px;
  mix-blend-mode: screen;
}

.skyline span {
  flex: 1;
  min-width: 42px;
  background: linear-gradient(180deg, rgba(185,214,210,.16), rgba(111,124,126,.04));
  border-top: 1px solid rgba(185,214,210,.26);
  clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
}
.skyline span:nth-child(2) { height: 74%; }
.skyline span:nth-child(3) { height: 48%; }
.skyline span:nth-child(4) { height: 91%; }
.skyline span:nth-child(5) { height: 56%; }
.skyline span:nth-child(6) { height: 68%; }
.skyline span:nth-child(1) { height: 38%; }

.harbor-scan {
  right: 11vw;
  top: 19vh;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(185,214,210,.24);
  background: repeating-linear-gradient(180deg, rgba(185,214,210,.11) 0 2px, transparent 2px 9px), radial-gradient(circle, rgba(185,214,210,.12), transparent 60%);
  opacity: .56;
}

.window-grid {
  width: min(82vw, 760px);
  height: 58vh;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 17px 21px;
  opacity: .62;
  transform: rotate(-2deg);
}

.window-grid i {
  border: 1px solid rgba(185,214,210,.15);
  background: rgba(185,214,210,.045);
  box-shadow: inset 0 0 22px rgba(0,0,0,.25);
  animation: windowBlink 7s infinite;
}
.window-grid i:nth-child(3n), .window-grid i:nth-child(11), .window-grid i:nth-child(19) {
  background: rgba(242,182,109,.45);
  box-shadow: 0 0 24px rgba(242,182,109,.28);
}
.window-grid i:nth-child(4n) { animation-delay: 1.4s; }
.window-grid i:nth-child(5n) { animation-delay: 3.2s; }

.scrap-paper {
  left: 8vw;
  top: 22vh;
  padding: 1rem 1.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--harbor);
  background: rgba(231,225,210,.78);
  clip-path: polygon(3% 0, 100% 8%, 94% 100%, 0 88%);
  transform: rotate(-7deg);
  opacity: .72;
}

.rail-lines {
  inset: 18vh 0 auto;
  height: 50vh;
  opacity: .5;
}
.rail-lines b {
  position: absolute;
  left: -8vw;
  width: 116vw;
  height: 2px;
  background: var(--glass);
  transform: rotate(-12deg);
  box-shadow: 0 0 18px rgba(185,214,210,.22);
}
.rail-lines b:nth-child(2) { top: 20vh; transform: rotate(8deg); background: var(--amber); opacity: .55; }
.rail-lines b:nth-child(3) { top: 34vh; transform: rotate(-4deg); opacity: .38; }

.receipt-strip {
  right: 10vw;
  top: 21vh;
  padding: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .7rem;
  line-height: 1.8;
  color: var(--glass);
  background: rgba(8,26,36,.62);
  border-left: 1px dashed rgba(185,214,210,.32);
}

.notice-stack {
  width: min(72vw, 680px);
  height: 58vh;
  opacity: .35;
}
.notice-stack div {
  position: absolute;
  inset: 8% 6%;
  background: rgba(231,225,210,.18);
  border: 1px solid rgba(231,225,210,.22);
  clip-path: polygon(2% 7%, 97% 0, 100% 89%, 7% 100%);
}
.notice-stack div:nth-child(2) { transform: rotate(4deg) translate(16px, -8px); background: rgba(111,124,126,.2); }
.notice-stack div:nth-child(3) { transform: rotate(-5deg) translate(-18px, 20px); }

.correction {
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw, 1.8rem);
  text-shadow: 0 0 18px rgba(217,95,76,.36);
  animation: errorPulse 3.6s ease-in-out infinite;
}
.mark-one { left: 19vw; top: 29vh; transform: rotate(-12deg); }
.mark-two { right: 22vw; top: 35vh; transform: rotate(10deg); animation-delay: 1s; }
.mark-three { right: 16vw; bottom: 24vh; transform: rotate(-4deg); animation-delay: 2s; }

.quiet-horizon {
  left: 9vw;
  right: 9vw;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185,214,210,.72), transparent);
  box-shadow: 0 0 35px rgba(185,214,210,.2);
}
.siren-speaker {
  left: 12vw;
  top: 18vh;
  width: 76px;
  height: 48px;
  border: 1px solid rgba(185,214,210,.32);
  border-radius: 50% 50% 48% 48%;
  opacity: .36;
}
.siren-speaker::before, .siren-speaker::after {
  content: "";
  position: absolute;
  inset: 9px 18px;
  border: 1px solid rgba(185,214,210,.28);
  border-radius: 50%;
}
.siren-speaker::after { inset: 17px 30px; background: rgba(185,214,210,.25); }

.apartment-scene, .notice-scene { background: radial-gradient(circle at 50% 50%, rgba(111,124,126,.12), transparent 48%); }
.tunnel-scene { background: linear-gradient(180deg, rgba(8,26,36,0), rgba(111,124,126,.08), rgba(8,26,36,0)); }
.final-scene { background: radial-gradient(circle at 50% 64%, rgba(185,214,210,.12), transparent 42%); }

.scrap,
.notice-text,
.transcript,
.prose-block {
  transition: filter .45s ease, text-shadow .45s ease;
}

.scrap.touched,
.notice-text.touched,
.transcript.touched,
.prose-block.touched {
  filter: saturate(.82) blur(.15px);
  text-shadow: 10px 0 18px rgba(242,182,109,.08), -8px 0 14px rgba(185,214,210,.08);
}

@keyframes grainDrift {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-2%, 1%); }
  40% { transform: translate(1%, -2%); }
  60% { transform: translate(2%, 2%); }
  80% { transform: translate(-1%, -1%); }
}

@keyframes beaconPulse {
  0%, 78%, 100% { opacity: .2; transform: scale(.8); }
  8%, 18% { opacity: 1; transform: scale(1.3); }
}

@keyframes windowBlink {
  0%, 70%, 100% { opacity: .36; }
  72%, 80% { opacity: 1; }
}

@keyframes errorPulse {
  0%, 100% { opacity: .42; filter: blur(.1px); }
  50% { opacity: .95; filter: blur(.7px); }
}

@media (max-width: 760px) {
  .scene { padding: 13vh 6vw; }
  .caption { bottom: 6vh; left: 6vw !important; right: auto !important; text-align: left !important; }
  .receipt-strip, .harbor-scan { right: 4vw; transform: scale(.76); transform-origin: top right; }
  .scrap-paper { left: 4vw; top: 16vh; }
  .window-grid { width: 96vw; gap: 10px; }
  p { font-size: 1.25rem; }
}
