:root {
  /* Design typography tokens: Space Grotesk*, IBM Plex Mono* */
  --harbor-navy: #102A43;
  --sea-glass: #5BC8AF;
  --morning-mist: #DDEFF2;
  --sandstone-walk: #E7CFA3;
  --coral-signal: #FF7A6B;
  --bokeh-gold: #FFD166;
  --tide-blue: #2F80ED;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --narrative: "Outfit", Inter, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--harbor-navy);
  font-family: var(--narrative);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 209, 102, 0.42), transparent 24rem),
    linear-gradient(135deg, #DDEFF2 0%, #5BC8AF 45%, #102A43 100%);
}

button {
  font: inherit;
}

.atmosphere,
.atmosphere > * {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.atmosphere {
  z-index: 0;
  overflow: hidden;
}

#memoryCanvas {
  width: 100%;
  height: 100%;
  filter: blur(0.2px) saturate(1.1);
  opacity: 0.95;
}

.street-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(114deg, transparent 0 48%, rgba(231, 207, 163, 0.75) 48.15% 48.45%, transparent 48.6%),
    linear-gradient(0deg, transparent 0 72%, rgba(231, 207, 163, 0.5) 72.2% 72.55%, transparent 72.8%),
    linear-gradient(90deg, transparent 0 34%, rgba(221, 239, 242, 0.34) 34.1% 34.32%, transparent 34.5%);
  transform: skewY(-5deg) scale(1.08);
}

.time-tide {
  width: 140vw;
  height: 38vh;
  left: -18vw;
  top: 56vh;
  border-radius: 50%;
  border-top: 1px solid rgba(91, 200, 175, 0.46);
  border-bottom: 1px solid rgba(255, 209, 102, 0.2);
  mix-blend-mode: screen;
  animation: tideWash 14s ease-in-out infinite;
}

.tide-two {
  top: 70vh;
  border-color: rgba(47, 128, 237, 0.34);
  animation-delay: -6s;
  animation-duration: 18s;
}

.fog {
  backdrop-filter: blur(1px);
  background: linear-gradient(180deg, rgba(221, 239, 242, 0.84), rgba(221, 239, 242, 0));
}

.fog-top {
  height: 38vh;
}

.fog-low {
  top: auto;
  height: 42vh;
  background: linear-gradient(0deg, rgba(16, 42, 67, 0.42), rgba(221, 239, 242, 0));
}

.promenade {
  position: relative;
  z-index: 1;
}

.viewport {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 4rem);
}

.viewport::before,
.viewport::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.morning {
  background: linear-gradient(180deg, rgba(221, 239, 242, 0.54), rgba(91, 200, 175, 0.16) 54%, rgba(16, 42, 67, 0.2));
}

.morning::before {
  inset: 8vh -12vw auto auto;
  width: 72vw;
  height: 38vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.28), transparent 68%);
  filter: blur(20px);
}

.scene-number,
.coordinates,
.eyebrow,
.street-tile,
.buoy,
.crosswalk-note {
  font-family: var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.scene-number {
  position: absolute;
  top: 2rem;
  left: clamp(1.25rem, 5vw, 5rem);
  color: rgba(16, 42, 67, 0.74);
  font-size: 0.78rem;
}

.wordmark {
  margin: 9vh 0 0 -0.04em;
  max-width: 11ch;
  font-family: var(--display);
  font-size: clamp(5.3rem, 17vw, 18rem);
  line-height: 0.74;
  letter-spacing: -0.09em;
  color: rgba(16, 42, 67, 0.86);
  -webkit-mask-image: linear-gradient(180deg, #000 0 58%, rgba(0,0,0,0.2) 76%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0 58%, rgba(0,0,0,0.2) 76%, transparent 96%);
}

.wordmark span {
  color: var(--coral-signal);
}

.dawn-board,
.plaza-copy,
.window-caption,
.ferry-board,
.return-copy {
  position: absolute;
  width: min(31rem, calc(100vw - 2.5rem));
  padding: clamp(1rem, 2vw, 1.6rem);
  color: var(--harbor-navy);
  border: 1px solid rgba(231, 207, 163, 0.55);
  background: rgba(221, 239, 242, 0.46);
  box-shadow: 0 2rem 5rem rgba(16, 42, 67, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(12px);
}

.dawn-board {
  right: clamp(1rem, 8vw, 7rem);
  bottom: 13vh;
  transform: rotate(-1.5deg);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--coral-signal);
  font-size: 0.78rem;
}

h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 4.7rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

p {
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.5;
}

.poetic-action {
  position: relative;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.15rem;
  color: var(--harbor-navy);
  background: var(--bokeh-gold);
  box-shadow: 0 0 0 0 rgba(255, 122, 107, 0.48), 0 1rem 2rem rgba(16, 42, 67, 0.18);
  cursor: pointer;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.poetic-action:hover,
.poetic-action.is-lit {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1.2rem rgba(255, 122, 107, 0), 0 1.4rem 2.6rem rgba(16, 42, 67, 0.26);
}

.secondary {
  background: var(--sea-glass);
}

.crosswalk-note {
  position: absolute;
  left: 8vw;
  bottom: 20vh;
  max-width: 17rem;
  color: rgba(16, 42, 67, 0.68);
  font-size: 0.72rem;
  transform: rotate(-7deg);
}

.submerged-date {
  position: absolute;
  left: -1vw;
  bottom: -5vw;
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 15rem);
  font-weight: 700;
  letter-spacing: -0.1em;
  color: rgba(221, 239, 242, 0.23);
}

.intersection {
  background: linear-gradient(160deg, rgba(221, 239, 242, 0.18), rgba(231, 207, 163, 0.33) 52%, rgba(47, 128, 237, 0.18));
}

.intersection::before {
  inset: 18vh -10vw auto auto;
  width: 75vw;
  height: 1rem;
  background: rgba(16, 42, 67, 0.5);
  transform: rotate(-25deg);
  box-shadow: 0 5.6rem 0 rgba(16, 42, 67, 0.28), 0 11.2rem 0 rgba(91, 200, 175, 0.28);
}

.street-tile {
  position: absolute;
  left: 7vw;
  top: 14vh;
  padding: 0.7rem 1.1rem;
  color: var(--morning-mist);
  background: var(--harbor-navy);
  border-left: 0.5rem solid var(--coral-signal);
}

.plaza-copy {
  left: 13vw;
  top: 34vh;
  background: rgba(231, 207, 163, 0.58);
}

.tram-wire {
  position: absolute;
  left: 0;
  right: 0;
  top: 30vh;
  height: 2px;
  background: linear-gradient(90deg, transparent, #5BC8AF, #FFD166, transparent);
  transform: rotate(-12deg);
  box-shadow: 0 0 1.5rem rgba(91, 200, 175, 0.85);
}

.pulse-marker {
  position: absolute;
  right: 18vw;
  bottom: 24vh;
  width: 6.5rem;
  height: 6.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--harbor-navy);
  background: rgba(255, 122, 107, 0.74);
  font-family: var(--mono);
  animation: pulse 2.9s ease-out infinite;
}

.crosswalk-stripes {
  position: absolute;
  right: -6vw;
  top: 43vh;
  display: grid;
  gap: 1.3rem;
  transform: rotate(-23deg);
}

.crosswalk-stripes span {
  display: block;
  width: 36rem;
  padding: 0.55rem 2rem;
  font-family: var(--mono);
  color: rgba(16, 42, 67, 0.62);
  background: rgba(221, 239, 242, 0.74);
}

.archive-window {
  background: linear-gradient(180deg, rgba(16, 42, 67, 0.2), rgba(16, 42, 67, 0.5)), radial-gradient(circle at 76% 24%, rgba(255, 209, 102, 0.34), transparent 22rem);
}

.building {
  position: absolute;
  left: 8vw;
  top: 10vh;
  width: min(35rem, 82vw);
  height: 76vh;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(221, 239, 242, 0.25);
  background: rgba(16, 42, 67, 0.44);
  transform: perspective(900px) rotateY(8deg);
}

.window {
  position: relative;
  overflow: hidden;
  background: rgba(221, 239, 242, 0.12);
  border: 1px solid rgba(221, 239, 242, 0.2);
}

.window::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle, rgba(255,255,255,0.34), transparent 42%);
  animation: windowGlow 8s ease-in-out infinite;
}

.window.lit {
  background: rgba(255, 209, 102, 0.24);
}

.window.coral {
  background: rgba(255, 122, 107, 0.28);
}

.window.gold {
  background: rgba(255, 209, 102, 0.38);
}

.window span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  font-family: var(--mono);
  color: var(--bokeh-gold);
}

.window-caption {
  right: 8vw;
  top: 25vh;
  color: var(--morning-mist);
  background: rgba(16, 42, 67, 0.52);
}

.clock-orbit {
  position: absolute;
  right: 11vw;
  bottom: 12vh;
  width: 13rem;
  height: 13rem;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(221, 239, 242, 0.48);
  border-radius: 50%;
  color: var(--bokeh-gold);
  font-family: var(--display);
  font-size: 2.4rem;
  animation: rotateClock 16s linear infinite;
}

.waterfront {
  background: linear-gradient(180deg, rgba(221, 239, 242, 0.16) 0 42%, rgba(47, 128, 237, 0.46) 43%, rgba(16, 42, 67, 0.82));
}

.ferry-board {
  left: 7vw;
  top: 13vh;
  background: rgba(221, 239, 242, 0.6);
}

.harbor {
  position: absolute;
  left: 3vw;
  right: 3vw;
  bottom: 5vh;
  width: 94vw;
  height: 44vh;
  overflow: visible;
}

.wave {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 15 18;
  animation: drawWave 8s ease-in-out infinite;
}

.wave-a {
  stroke: #5BC8AF;
}

.wave-b {
  stroke: rgba(255, 209, 102, 0.72);
  animation-delay: -3s;
}

.ferry {
  fill: #DDEFF2;
  stroke: #102A43;
  stroke-width: 3;
  animation: ferryDrift 12s ease-in-out infinite alternate;
}

.buoy {
  position: absolute;
  width: 4.5rem;
  height: 4.5rem;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 45% 45%;
  background: var(--bokeh-gold);
  animation: buoyBob 4s ease-in-out infinite;
}

.buoy-a {
  right: 18vw;
  top: 46vh;
}

.buoy-b {
  right: 35vw;
  bottom: 18vh;
  animation-delay: -1.8s;
}

.night-return {
  color: var(--morning-mist);
  background: radial-gradient(circle at 50% 50%, rgba(91, 200, 175, 0.25), transparent 34rem), linear-gradient(180deg, rgba(16, 42, 67, 0.35), #102A43);
}

.night-map {
  position: absolute;
  inset: 10vh 8vw;
  border: 1px solid rgba(221, 239, 242, 0.16);
  background-image:
    linear-gradient(30deg, transparent 0 38%, rgba(91, 200, 175, 0.32) 38.1% 38.35%, transparent 38.5%),
    linear-gradient(100deg, transparent 0 54%, rgba(255, 209, 102, 0.22) 54.1% 54.35%, transparent 54.5%),
    radial-gradient(circle at 28% 48%, rgba(255, 209, 102, 0.34), transparent 0.55rem),
    radial-gradient(circle at 62% 32%, rgba(255, 122, 107, 0.36), transparent 0.7rem),
    radial-gradient(circle at 74% 72%, rgba(91, 200, 175, 0.34), transparent 0.6rem);
  filter: drop-shadow(0 0 2rem rgba(91, 200, 175, 0.25));
}

.map-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 209, 102, 0.4);
  animation: pulse 5s ease-out infinite;
}

.ring-a { left: 22%; top: 42%; width: 7rem; height: 7rem; }
.ring-b { left: 57%; top: 23%; width: 10rem; height: 10rem; animation-delay: -1.4s; }
.ring-c { right: 18%; bottom: 14%; width: 8rem; height: 8rem; animation-delay: -2.7s; }

.return-copy {
  right: 8vw;
  bottom: 12vh;
  color: var(--morning-mist);
  background: rgba(16, 42, 67, 0.58);
}

.coordinates {
  position: absolute;
  left: 6vw;
  bottom: 7vh;
  color: rgba(221, 239, 242, 0.72);
  font-size: 0.82rem;
}

.is-awake .pulse-marker,
.is-awake .map-ring,
.night-map.is-lit .map-ring {
  border-color: var(--coral-signal);
  box-shadow: 0 0 3rem rgba(255, 122, 107, 0.42);
}

@keyframes tideWash {
  0%, 100% { transform: translateX(-4vw) translateY(0) rotate(-2deg); opacity: 0.28; }
  50% { transform: translateX(6vw) translateY(-3vh) rotate(1deg); opacity: 0.62; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 107, 0.46); transform: scale(0.96); }
  70% { box-shadow: 0 0 0 2.4rem rgba(255, 122, 107, 0); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 107, 0); transform: scale(0.96); }
}

@keyframes windowGlow {
  0%, 100% { transform: translate(-12%, -8%); opacity: 0.35; }
  50% { transform: translate(14%, 10%); opacity: 0.7; }
}

@keyframes rotateClock {
  to { transform: rotate(360deg); }
}

@keyframes drawWave {
  0%, 100% { stroke-dashoffset: 0; opacity: 0.45; }
  50% { stroke-dashoffset: -140; opacity: 1; }
}

@keyframes ferryDrift {
  to { transform: translateX(170px) translateY(-10px); }
}

@keyframes buoyBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-1.1rem) rotate(3deg); }
}

@media (max-width: 760px) {
  .dawn-board,
  .plaza-copy,
  .window-caption,
  .ferry-board,
  .return-copy {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    margin: 48vh 0 0;
  }

  .building {
    opacity: 0.55;
  }

  .crosswalk-stripes,
  .clock-orbit {
    display: none;
  }

  .wordmark {
    margin-top: 14vh;
  }
}
