@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Fraunces:opsz,wght,SOFT,WONK@9..144,700..900,50,1&display=swap");

:root {
  color-scheme: light;
  --ink: #11131c;
  --muted: #4f5363;
  --paper: #fff9e8;
  --coal: #11131c;
  --line: rgba(17, 19, 28, 0.18);
  --brass: #ffb000;
  --gulf: #00b9d7;
  --lake: #3557ff;
  --tomato: #ff4d32;
  --pink: #ff4f9a;
  --lime: #b7f231;
  --milk: #fffef7;
  --shadow: 0 26px 80px rgba(17, 19, 28, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 3%, rgba(255, 79, 154, 0.34), transparent 30rem),
    radial-gradient(circle at 88% 13%, rgba(0, 185, 215, 0.36), transparent 29rem),
    radial-gradient(circle at 48% 34%, rgba(183, 242, 49, 0.26), transparent 27rem),
    linear-gradient(180deg, #fff45f 0%, #fffef7 18%, #67e8ff 42%, #ff6f91 66%, #fffef7 100%);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", Verdana, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(17,19,28,0.055) 1px, transparent 1px);
  background-size: 100% 7px;
  mix-blend-mode: soft-light;
  opacity: 0.28;
}

a {
  color: inherit;
}

img,
iframe,
canvas {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.site-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 254, 247, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.wordmark span {
  display: grid;
  width: 2.5rem;
  aspect-ratio: 1;
  place-items: center;
  color: var(--coal);
  background: var(--brass);
  border-radius: 50%;
  font-weight: 700;
}

.wordmark strong,
h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  letter-spacing: 0;
}

.site-top nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-top nav a {
  text-decoration: none;
}

.site-top nav a:hover {
  color: var(--ink);
}

main {
  overflow: clip;
}

section {
  padding: clamp(3rem, 9vw, 7rem) clamp(1rem, 5vw, 5rem);
}

.hero-machine {
  min-height: calc(100vh - 4rem);
  display: grid;
  grid-template-columns: minmax(27rem, 0.72fr) minmax(24rem, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding-top: clamp(2rem, 5vw, 5rem);
}

.machine-copy {
  max-width: 38rem;
}

.small-label {
  margin: 0 0 0.65rem;
  color: var(--brass);
  font-size: 0.86rem;
  font-weight: 700;
}

h1 {
  max-width: 7.8ch;
  margin: 0;
  font-size: clamp(4.2rem, 9vw, 8rem);
  line-height: 0.78;
}

h2 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.86;
}

h3 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 0.95;
}

.machine-copy p:last-child,
.section-intro p:last-child,
.track-panel p,
.place-readout p {
  color: var(--muted);
}

.machine-shell {
  position: relative;
  min-height: clamp(24rem, 60vw, 44rem);
  border: 2px solid rgba(17, 19, 28, 0.78);
  background: #fffef7;
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

#weatherMachine {
  width: 100%;
  height: 100%;
  min-height: clamp(24rem, 60vw, 44rem);
  outline: none;
}

#weatherMachine:focus-visible {
  box-shadow: inset 0 0 0 3px var(--brass);
}

.machine-fallback {
  display: none;
}

.machine-controls {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.machine-controls button,
.track-button,
.favorite-toggle {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 254, 247, 0.82);
  min-height: 2.75rem;
  cursor: pointer;
}

.machine-controls button:hover,
.track-button:hover,
.track-button.is-active,
.favorite-toggle:hover {
  border-color: var(--brass);
  background: rgba(255, 176, 0, 0.24);
}

.weather-readouts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.place-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(255, 254, 247, 0.9);
}

.readout-big {
  text-align: right;
}

.readout-big strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.85;
  color: var(--lake);
}

.readout-big span {
  color: var(--muted);
}

.readout-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(7rem, 1fr));
  gap: 1px;
  background: var(--line);
}

.readout-item {
  min-height: 4.5rem;
  padding: 0.75rem;
  background: #fffef7;
}

.readout-item span,
figcaption span,
.source-slip span,
.history-day summary span,
.track-button span,
.track-button small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.readout-item strong,
figcaption strong {
  display: block;
}

.day-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.day-strip span {
  flex: 0 0 auto;
  min-width: 6.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.day-strip b {
  display: block;
  color: var(--ink);
}

.note-link {
  grid-column: 1 / -1;
  color: var(--brass);
  font-size: 0.9rem;
}

.weather-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-intro {
  max-width: 58rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(2.4rem);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-drift] {
  will-change: transform;
  transform:
    perspective(900px)
    translate3d(0, var(--drift-y, 0px), var(--view-z, 0px))
    rotateX(var(--view-x, 0deg))
    rotateY(var(--view-y, 0deg))
    rotate(var(--drift-rotate-current, 0deg))
    scale(var(--view-scale, 1));
}

.player-stage {
  display: grid;
  grid-template-columns: minmax(18rem, 1.35fr) minmax(18rem, 0.65fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(255, 176, 0, 0.28), rgba(0, 185, 215, 0.24));
  border: 2px solid rgba(17, 19, 28, 0.78);
  box-shadow: var(--shadow);
  padding: clamp(0.6rem, 1.5vw, 1rem);
}

.video-portal {
  background:
    linear-gradient(135deg, var(--brass), var(--pink) 48%, var(--gulf));
  border: 0;
  box-shadow:
    0 16px 42px rgba(17, 19, 28, 0.24),
    -0.35rem 0.35rem 0 rgba(255, 77, 50, 0.58);
  aspect-ratio: 16 / 9;
  transform: translateY(calc(var(--drift-y, 0px) * -0.18));
  padding: 0.5rem;
}

.video-portal iframe,
.video-poster {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(17, 19, 28, 0.86);
}

.video-poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--milk);
  background: #11131c;
  text-decoration: none;
}

.video-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  filter: saturate(1.25) contrast(1.05);
}

.video-poster span {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  display: grid;
  gap: 0.25rem;
  max-width: 24rem;
  padding: 1rem;
  background: rgba(17, 19, 28, 0.86);
}

.video-poster strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 0.9;
}

.video-poster small {
  color: rgba(255, 254, 247, 0.78);
}

.track-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  border-left: 2px solid var(--brass);
  padding-left: clamp(1rem, 2.5vw, 2rem);
  transform: translateY(calc(var(--drift-y, 0px) * 0.14));
  background: rgba(255, 254, 247, 0.70);
  padding-block: clamp(0.6rem, 1.5vw, 1rem);
  padding-right: clamp(0.6rem, 1.5vw, 1rem);
}

.track-list {
  display: grid;
  gap: 0.5rem;
}

.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: stretch;
}

.track-button {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.25rem 0.7rem;
  min-height: 4rem;
  padding: 0.65rem;
  text-align: left;
}

.track-link,
.watch-link {
  display: inline-grid;
  place-items: center;
  min-height: 2.75rem;
  border: 1px solid rgba(17, 19, 28, 0.24);
  background: var(--coal);
  color: var(--milk);
  font-weight: 700;
  text-decoration: none;
}

.track-link {
  min-width: 4.5rem;
  padding: 0 0.65rem;
  font-size: 0.78rem;
}

.watch-link {
  justify-self: start;
  padding: 0 1rem;
}

.track-link:hover,
.watch-link:hover {
  background: var(--tomato);
}

.track-button span {
  grid-row: span 2;
  color: var(--brass);
}

.track-button strong {
  overflow-wrap: anywhere;
}

.favorite-toggle {
  justify-self: start;
  padding: 0 1rem;
}

.cabinet-rail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  align-items: start;
  perspective: 1000px;
  transform-style: preserve-3d;
  padding-top: clamp(1.8rem, 5vw, 4rem);
}

.picture-cabinet {
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 79, 154, 0.34), transparent 28rem),
    radial-gradient(circle at 82% 30%, rgba(0, 185, 215, 0.38), transparent 26rem),
    radial-gradient(circle at 35% 72%, rgba(183, 242, 49, 0.30), transparent 24rem),
    linear-gradient(135deg, #ffe84d 0%, #58e6ff 46%, #ff7aa9 100%);
}

.picture-cabinet .section-intro,
.maggie-exhibit .section-intro {
  position: relative;
  z-index: 2;
}

.cabinet-photo {
  grid-column: span 4;
  margin: 0;
}

.cabinet-photo.lead {
  grid-column: span 7;
}

.photo-stage {
  display: grid;
  min-height: clamp(17rem, 34vw, 31rem);
  place-items: center;
  background: #fffef7;
  border: 2px solid rgba(17, 19, 28, 0.82);
  box-shadow:
    0 18px 60px rgba(17, 19, 28, 0.22),
    -0.62rem 0.62rem 0 rgba(255, 176, 0, 0.72),
    0.62rem -0.62rem 0 rgba(0, 185, 215, 0.58);
  overflow: hidden;
}

.photo-stage img,
.maggie-frame img,
.reference-photo img {
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cabinet-photo .photo-stage img {
  transform: translateY(calc(var(--drift-y, 0px) * -0.16)) scale(1.035);
}

.cabinet-photo.preserve .photo-stage img {
  transform: translateY(calc(var(--drift-y, 0px) * -0.08));
}

.cabinet-photo:hover .photo-stage img,
.maggie-case:hover .maggie-frame img,
.reference-photo:hover img {
  transform: translateY(calc(var(--drift-y, 0px) * -0.16)) scale(1.06);
}

.cabinet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cabinet-photo.preserve img {
  width: auto;
  height: auto;
  max-height: 34rem;
  object-fit: contain;
}

figcaption {
  padding: 0.75rem 0 0;
}

figcaption small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.maggie-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 16rem);
  gap: clamp(1rem, 3vw, 2rem);
  perspective: 1000px;
}

.maggie-exhibit {
  background:
    radial-gradient(circle at 18% 16%, rgba(53, 87, 255, 0.24), transparent 26rem),
    radial-gradient(circle at 84% 32%, rgba(255, 77, 50, 0.24), transparent 24rem),
    linear-gradient(160deg, #fffef7 0%, #bff7ff 44%, #ffe36e 100%);
}

.maggie-cases {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.2rem);
}

.maggie-case {
  grid-column: span 3;
  margin: 0;
}

.maggie-case.feature {
  grid-column: span 6;
}

.maggie-frame {
  background: #fffef7;
  border: 2px solid rgba(17, 19, 28, 0.82);
  box-shadow:
    0 20px 70px rgba(17, 19, 28, 0.20),
    0.55rem 0.55rem 0 rgba(255, 77, 50, 0.62);
}

.maggie-frame img {
  width: 100%;
  height: auto;
}

.maggie-reference-strip {
  display: grid;
  align-content: start;
  gap: 1rem;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}

.reference-photo {
  margin: 0;
}

.reference-photo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fffef7;
  border: 1px solid var(--line);
}

.source-board,
.history-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.weather-notes {
  background:
    radial-gradient(circle at 78% 24%, rgba(255, 176, 0, 0.34), transparent 25rem),
    radial-gradient(circle at 16% 58%, rgba(0, 185, 215, 0.30), transparent 20rem),
    linear-gradient(120deg, #f7ff5a 0%, #fffef7 100%);
}

.archive {
  background:
    radial-gradient(circle at 20% 10%, rgba(53, 87, 255, 0.20), transparent 22rem),
    linear-gradient(180deg, #d7fbff 0%, #fffef7 100%);
}

.source-slip,
.history-day {
  background: rgba(255, 254, 247, 0.88);
}

.source-slip {
  min-height: 10rem;
  padding: 1.25rem;
  text-decoration: none;
}

.source-slip strong {
  display: block;
  max-width: 42rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
  line-height: 0.98;
}

.history-day {
  padding: 0.25rem 1rem;
}

.history-day summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: center;
  min-height: 5rem;
  cursor: pointer;
}

.history-day summary strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  line-height: 1;
}

.history-day summary em {
  color: var(--brass);
  font-style: normal;
}

.history-links {
  display: grid;
  gap: 0.35rem;
  padding: 0 0 1rem;
}

.history-links a {
  color: var(--ink);
  text-decoration-color: rgba(217, 164, 65, 0.55);
  overflow-wrap: anywhere;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 5vw, 5rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .hero-machine,
  .player-stage,
  .maggie-layout {
    grid-template-columns: 1fr;
  }

  .machine-copy {
    max-width: 44rem;
  }

  h1 {
    max-width: 9ch;
  }

  .weather-readouts,
  .source-board,
  .history-stack {
    grid-template-columns: 1fr;
  }

  .readout-grid {
    grid-template-columns: repeat(2, minmax(7rem, 1fr));
  }

  .track-panel {
    border-left: 0;
    border-top: 2px solid var(--brass);
    padding: 1rem 0 0;
  }

  .track-row {
    grid-template-columns: 1fr;
  }

  .cabinet-photo,
  .cabinet-photo.lead {
    grid-column: span 6;
  }

  .maggie-reference-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 1rem 0 0;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .site-top {
    position: static;
    align-items: flex-start;
  }

  .site-top nav {
    max-width: 12rem;
  }

  section {
    padding-inline: 1rem;
  }

  h1 {
    font-size: clamp(3.6rem, 21vw, 6.5rem);
  }

  h2 {
    font-size: clamp(2.8rem, 17vw, 5rem);
  }

  .machine-shell,
  #weatherMachine {
    min-height: 28rem;
  }

  .place-readout {
    grid-template-columns: 1fr;
  }

  .readout-big {
    text-align: left;
  }

  .readout-grid {
    grid-template-columns: 1fr;
  }

  .cabinet-photo,
  .cabinet-photo.lead,
  .maggie-case,
  .maggie-case.feature {
    grid-column: 1 / -1;
    --view-x: 0deg !important;
    --view-y: 0deg !important;
    --view-z: 0px !important;
    --view-scale: 1 !important;
  }

  .maggie-reference-strip {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  [data-reveal],
  [data-drift],
  .video-portal,
  .track-panel,
  .photo-stage img,
  .maggie-frame img,
  .reference-photo img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
