:root {
  --night: #030b22;
  --river: #0b4f6c;
  --azure: #1aa3c4;
  --key: #f28c28;
  --glow: #ffb868;
  --bone: #f4e3b2;
  --mist: #a9c3d2;
  --display: "Chakra Petch", "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

/* Hero: the river at dusk, the pitch on the left, the box on the right. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
  column-gap: var(--gutter);
  min-height: 100svh;
  padding: clamp(20px, 3.5vh, 40px) var(--gutter) 0;
  background:
    linear-gradient(to bottom, transparent 62%, var(--night) 100%),
    linear-gradient(to right, rgb(3 11 34 / 0.72) 0%, rgb(3 11 34 / 0.25) 45%, transparent 70%),
    image-set(url("img/river-1280.webp") 1x, url("img/river-2560.webp") 2x) center 40% / cover no-repeat,
    var(--night);
}

.masthead { grid-column: 1 / -1; }
.logo { width: clamp(180px, 20vw, 280px); }

.pitch {
  align-self: center;
  max-width: 34rem;
  padding-block: 2rem 14vh;
}

h1 {
  font: 700 clamp(2.6rem, 5.4vw, 5rem)/0.98 var(--display);
  letter-spacing: -0.015em;
  color: var(--bone);
  text-wrap: balance;
}

.lede {
  margin-top: 1.5rem;
  max-width: 30rem;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  color: #d3e3ec;
}

.status {
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--key);
  font: 500 1.0625rem/1.4 var(--display);
  color: var(--glow);
}

.stage {
  position: relative;
  min-height: min(78svh, 760px);
  align-self: stretch;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  opacity: 0;
  outline: none;
}
.stage canvas.is-dragging { cursor: grabbing; }
.stage canvas:focus-visible { outline: 2px solid var(--glow); outline-offset: -6px; border-radius: 12px; }

.still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(16px, 5vh, 48px);
  text-align: center;
  font: 500 0.9375rem/1 var(--display);
  color: var(--mist);
  opacity: 0;
  pointer-events: none;
}

.stage.is-live canvas { opacity: 1; }
.stage.is-live .still { display: none; }
.stage.is-live .hint { opacity: 0.85; }

/* Three plain facts under the river. */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 104px) var(--gutter);
}

.facts h2 {
  font: 700 1.5rem/1.15 var(--display);
  color: var(--bone);
}
.facts p { margin-top: 0.6rem; max-width: 32ch; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid rgb(26 163 196 / 0.18);
  font-size: 0.9375rem;
  color: #7f9aab;
}
footer nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
footer a { color: var(--mist); text-decoration: none; }
footer a:hover { color: var(--glow); text-decoration: underline; }

a:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 3px; }

/* Privacy, terms and support: one quiet column of text. */
.doc-head { padding: clamp(20px, 3.5vh, 40px) var(--gutter) 0; }
.doc-head a { display: inline-block; }
.doc-head .logo { width: clamp(150px, 16vw, 210px); }

.doc {
  max-width: calc(41rem + var(--gutter) * 2);
  padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(56px, 10vh, 112px);
  color: #c5d8e3;
}
.doc h1 { font-size: clamp(2.1rem, 4.2vw, 3.1rem); line-height: 1.05; }
.doc .updated { margin-top: 0.9rem; font-size: 0.9375rem; color: #7f9aab; }
.doc .summary {
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--key);
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--bone);
}
.doc h2 {
  margin: 2.75rem 0 0;
  font: 700 1.4375rem/1.2 var(--display);
  color: var(--bone);
}
.doc h3 { margin: 1.6rem 0 0; font: 600 1.0625rem/1.4 var(--body); color: var(--bone); }
.doc p, .doc ul, .doc address { margin-top: 0.85rem; }
.doc ul { margin-bottom: 0; padding-left: 1.2rem; }
.doc li + li { margin-top: 0.4rem; }
.doc li::marker { color: var(--key); }
.doc address { font-style: normal; }
.doc a { color: var(--glow); text-underline-offset: 0.18em; }
.doc a:hover { color: var(--bone); }
.doc .contact { font: 500 clamp(1.3rem, 2.4vw, 1.75rem)/1.3 var(--display); }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    background:
      linear-gradient(to bottom, rgb(3 11 34 / 0.2) 0%, transparent 30%, transparent 60%, var(--night) 100%),
      url("img/river-1280.webp") 86% 30% / cover no-repeat,
      var(--night);
  }
  .logo { width: min(62vw, 250px); }
  .stage { grid-row: 2; min-height: min(56svh, 460px); margin-inline: calc(var(--gutter) * -0.6); }
  .hint { bottom: 4px; }
  .pitch { grid-row: 3; padding-block: 1.5rem 3rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

/* The kinds of box: a row of pictures that scrolls sideways, and the key each kind gives up. */
.aviary {
  --panel: min(1080px, 84vw, 56svh * 1.787);
  --chamfer: clamp(12px, 1.8vw, 24px);
  padding-top: clamp(48px, 8vh, 96px);
}

.aviary-head { padding-inline: var(--gutter); }
.aviary-head h2 {
  font: 700 clamp(2rem, 4.2vw, 3.5rem)/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--bone);
}
.aviary-head p { margin-top: 1rem; max-width: 34rem; color: #d3e3ec; }

.flocks {
  position: relative;
  display: flex;
  gap: clamp(12px, 2vw, 28px);
  margin-top: clamp(24px, 4vh, 44px);
  padding: 4px calc((100% - var(--panel)) / 2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.flocks::-webkit-scrollbar { display: none; }
.flocks:focus-visible { outline: 2px solid var(--glow); outline-offset: -2px; }

/* Corners cut like the facets of the boxes themselves. */
.flock {
  position: relative;
  flex: 0 0 var(--panel);
  scroll-snap-align: center;
  background: #06142f;
  clip-path: polygon(
    var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer),
    100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, var(--chamfer) 100%,
    0 calc(100% - var(--chamfer)), 0 var(--chamfer));
  transition: opacity 0.35s ease;
}
.flock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgb(3 11 34 / 0.8) 0%, rgb(3 11 34 / 0.35) 30%, transparent 52%);
  pointer-events: none;
}
.aviary.is-live .flock:not(.is-current) { opacity: 0.45; cursor: pointer; }

.flock-art { width: 100%; aspect-ratio: 1344 / 752; object-fit: cover; }

.flock-text {
  position: absolute;
  z-index: 1;
  left: clamp(28px, 5%, 64px);
  bottom: clamp(28px, 9%, 72px);
  max-width: 36%;
}
.flock-key {
  width: clamp(76px, 9vw, 132px);
  margin: 0 0 clamp(6px, 1vw, 14px) -8%;
  transform: rotate(-16deg);
  filter: drop-shadow(0 6px 18px rgb(242 140 40 / 0.45));
}
.flock h3 {
  font: 700 clamp(1.7rem, 3.5vw, 3.25rem)/0.98 var(--display);
  letter-spacing: -0.01em;
  color: var(--bone);
  text-wrap: balance;
}
.flock p {
  margin-top: 0.7rem;
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  line-height: 1.4;
  color: #d3e3ec;
  text-wrap: balance;
}

.keyring {
  display: flex;
  max-width: 1240px;
  margin: clamp(20px, 3.5vh, 36px) auto 0;
  padding-inline: var(--gutter);
}
.keyring a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 10px 4px;
  font: 500 0.875rem/1.2 var(--display);
  text-align: center;
  text-decoration: none;
  color: #7f9aab;
  transition: color 0.2s ease;
}
.keyring img {
  width: clamp(40px, 4.6vw, 60px);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.aviary.is-live .keyring img { filter: saturate(0.35) brightness(0.6); }
.keyring a:hover { color: var(--bone); }
.aviary.is-live .keyring a:hover img { filter: saturate(0.8) brightness(0.9); }
.keyring a[aria-current="true"] { color: var(--glow); }
.aviary.is-live .keyring a[aria-current="true"] img {
  transform: translateY(-5px) rotate(-14deg) scale(1.18);
  filter: drop-shadow(0 4px 12px rgb(242 140 40 / 0.55));
}

@media (max-width: 860px) {
  .keyring { flex-wrap: wrap; row-gap: 4px; }
  .keyring a { flex: 0 0 20%; }
  .keyring img { width: 46px; }
  .keyring span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Phones: the picture on top, cropped to the bird and her box, with the words underneath. */
@media (max-width: 700px) {
  .aviary { --panel: 80vw; --chamfer: 14px; }
  .flock::after { display: none; }
  .flock-art { aspect-ratio: 4 / 3; }
  .flock-text {
    position: relative;
    left: auto;
    bottom: auto;
    max-width: none;
    padding: 18px 84px 24px 22px;
  }
  .flock p { text-wrap: wrap; }
  .flock-key {
    position: absolute;
    right: 10px;
    top: -34px;
    width: 88px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flock, .keyring a, .keyring img { transition: none; }
}
