/* Sway's website. Lamplit Toy (docs/STYLE_GUIDE.md): night outside, lamplight inside.
   The harbour, the two sea bands and the footer are always night. The sections between are lamplit paper
   (in dark mode the lamp is turned low: deep blue paper, cream words). Letters, postcards and photo frames
   are things you could hold, so they stay cream in both.
   Everything is Sway's own art (img/, made by tools/SwayArt/make_site_art.py). No outside requests.
   Motion: the harbour builds up once as the page opens; idle motion runs only with site.js, only while its
   section is on the screen, stops with the pause button, and never runs with "reduce motion". */

@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka-Bold.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Sway's palette */
  --night: #0E1430;
  --navy: #1A1F3D;
  --deep: #223067;
  --sea: #1B3F63;
  --lamp: #FFB43F;
  --cream: #FFF1D0;
  --plank: #F6E2B3;
  --plank-2: #EED49C;
  --hull: #C8463D;
  --rope: #C9A46A;
  --rope-shade: #8C6A3A;
  --brass: #E5AE45;
  --photo: #FFFCF4;
  --sea-fill: #10225C;

  /* inside: lamplit paper */
  --paper: #FFF1D0;
  --ink: #1A1F3D;
  --ink-soft: #464B6B;
  --link: #223067;
  --link-line: #C8463D;
  --rule: #E3CD98;
  --head: #F6E2B3;
  --focus: #1A1F3D;
  --todo: #A8352D;
  --grain: url("img/paper-grain.webp");
  --drop: rgba(26, 31, 61, 0.42);

  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151D45;
    --ink: #FFF1D0;
    --ink-soft: #C9CDE6;
    --link: #FFB43F;
    --link-line: #FFB43F;
    --rule: #2E3D7A;
    --head: #223067;
    --focus: #FFB43F;
    --todo: #FF8A7A;
    --grain: none;
    --drop: rgba(0, 0, 0, 0.6);
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  overflow-x: clip;
}
@media (min-width: 40em) { body { font-size: 1.125rem; } }

img { max-width: 100%; height: auto; }
picture { display: block; }
picture img { display: block; width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible, .letter :focus-visible { outline-color: var(--focus); }

.skip {
  position: absolute; left: 16px; top: -4rem; z-index: 20;
  background: var(--lamp); color: var(--navy); padding: .6rem 1rem; border-radius: 10px;
  font-family: "Fredoka", sans-serif; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* the chunky headline, lettered like the game's signs: cream, a navy rim and a soft shadow */
.display {
  font-family: "Fredoka", sans-serif; font-weight: 700; line-height: 1.1; letter-spacing: .025em; word-spacing: .06em;
  color: var(--cream);
  -webkit-text-stroke: .14em var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--navy), 0 .12em .3em rgba(14, 20, 48, .38);
  text-wrap: balance;
  margin: 0;
}
h2.display { font-size: clamp(2.05rem, 1.45rem + 2.5vw, 3.35rem); }
/* on unlit (dark) paper the navy rim can't show, so the letters keep only a soft shadow */
@media (prefers-color-scheme: dark) {
  .paper .display { -webkit-text-stroke: 0; text-shadow: 0 .08em .3em rgba(0, 0, 0, .6); }
}

/* the paper */
.paper {
  position: relative;
  background-color: var(--paper);
  background-image: var(--grain);
  background-size: 256px 256px;
  color: var(--ink);
}

/* wavy edges between night and paper; the colour is the paper's */
.edge {
  position: absolute; left: 0; display: block; width: 100%;
  height: clamp(22px, 3.4vw, 48px);
  fill: var(--paper); pointer-events: none; z-index: 4;
}
.edge-paper, .edge-down, .edge-bottom { bottom: -1px; }
.edge-top, .edge-up { top: -1px; transform: scaleY(-1); }

/* ---------------------------------------------------------------- the bar at the top */

.topbar { position: relative; z-index: 10; color: var(--cream); }
.topbar-home { position: absolute; top: 0; left: 0; right: 0; }
.topbar-in {
  max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: flex-start; justify-content: space-between; gap: .25rem 1rem;
}
.brand { position: relative; display: block; flex: none; width: clamp(112px, 70px + 8vw, 168px); padding-top: clamp(16px, 3vw, 26px); }
.brand picture { position: relative; z-index: 1; transform-origin: 50% -30%; }
.brand img { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.ropes::before, .ropes::after {
  content: ""; position: absolute; top: 0; width: 4px; height: calc(clamp(16px, 3vw, 26px) + 10px);
  background: repeating-linear-gradient(160deg, var(--rope) 0 4px, var(--rope-shade) 4px 6px);
  border-radius: 2px;
}
.ropes::before { left: 17%; }
.ropes::after { right: 17%; }
.brand:focus-visible { outline-offset: 0; }

.topnav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 1.1rem; list-style: none; margin: 0; padding: .7rem 0 0; }
.topnav a {
  display: inline-block; padding: .45rem .15rem; color: var(--cream); text-decoration: none;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.0625rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
.topnav a:hover { color: var(--lamp); }
.topnav a[aria-current="page"] { color: var(--lamp); box-shadow: inset 0 -3px 0 var(--lamp); }
.topbar-home .topnav ul {
  margin-top: .7rem; padding: 0 .85rem; border-radius: 20px;
  background: rgba(14, 20, 48, .74);
}
@media (max-width: 30em) {
  .topnav ul { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 1rem; justify-content: end; }
  .topnav a { font-size: 1rem; padding: .35rem .1rem; }
}

/* the policy pages: a strip of night sky over the paper */
.page .topbar {
  background:
    radial-gradient(46rem 16rem at 72% -4rem, rgba(255, 180, 63, .16), transparent 70%),
    linear-gradient(180deg, var(--night), #142050);
  padding-bottom: clamp(2.6rem, 6vw, 4rem);
}

/* ---------------------------------------------------------------- the harbour */

.hero {
  position: relative; z-index: 2;
  height: 100vh; height: 100svh; min-height: 600px; max-height: 1020px;
  background: var(--sea-fill); color: var(--cream);
  overflow-x: clip;
}
.scene { position: absolute; inset: 0; overflow: hidden; }
.layer { position: absolute; inset: 0; }
.backdrop img { position: absolute; top: 0; left: 0; width: 100%; height: auto; }
.backdrop { animation: lights-up 1.1s ease-out both; }

/* the four plywood wave flats from the game's scene change, palest at the back; --fh is each one's painted
   height (its picture's height times about a third on phones, a half on desktops), --y where its top sits */
.flat {
  left: -90px; right: -90px; bottom: -4px; top: var(--y);
  background-image: var(--art), linear-gradient(var(--c1), var(--c2));
  background-repeat: repeat-x, no-repeat;
  background-size: auto var(--fh), 100% 100%;
  background-position: 0 0, 0 calc(var(--fh) - 3px);
  animation: rise .95s var(--spring) var(--d) both;
}
.flat-0 { --art: url("img/flat-0.webp"); --fh: clamp(49px, 23px + 4.03vw, 75px); --y: 62%; --c1: #2B6C95; --c2: #1E5584; --d: .15s; --rock: 9s; }
.flat-1 { --art: url("img/flat-1.webp"); --fh: clamp(58px, 27.2px + 4.76vw, 88px); --y: 68%; --c1: #1F558C; --c2: #183F72; --d: .3s; --rock: 7.5s; }
.flat-2 { --art: url("img/flat-2.webp"); --fh: clamp(72px, 33.8px + 5.91vw, 110px); --y: 74.5%; --c1: #0F3975; --c2: #0C2B5C; --d: .45s; --rock: 8.5s; }
.flat-3 { --art: url("img/flat-3.webp"); --fh: clamp(82px, 38.6px + 6.75vw, 125px); --y: 81.5%; --c1: #0E285A; --c2: #0B1D45; --d: .6s; --rock: 10s; }
.flat-2, .flat-3 { background-position: 37% 0, 0 calc(var(--fh) - 3px); }

/* the tug, the Sway, between the second and third flats */
.tug {
  --tw: clamp(112px, 40px + 12vw, 236px);
  position: absolute; left: clamp(4%, 14vw - 40px, 14%);
  top: calc(79% - var(--tw) * .9);
  width: var(--tw);
  animation: drop-in 1s var(--spring) .75s both;
}
.tug picture { transform-origin: 50% 85%; }
.tug-lamp {
  position: absolute; left: 22%; top: 30%; width: 62%; height: 34%;
  background: radial-gradient(closest-side, rgba(255, 196, 92, .55), rgba(255, 180, 63, 0) 100%);
  mix-blend-mode: screen; pointer-events: none;
}

/* gulls: three painted frames, wings up, out and down */
.gull {
  --gw: 58px;
  position: absolute; left: 0; top: var(--gy, 20%);
  width: var(--gw); height: calc(var(--gw) * .63);
  background: url("img/gull-sprite.webp") 0 0 / calc(var(--gw) * 3) 100% no-repeat;
  transform: translateX(-20vw);
  opacity: 0;
}
.g1 { --gy: 21%; }
.g2 { --gy: 30%; --gw: 44px; }
.g3 { --gy: 15%; --gw: 36px; }

.hero-copy {
  position: absolute; z-index: 5; left: 0; right: 0;
  top: clamp(118px, 15vh, 190px);
  padding: 0 var(--gutter); text-align: center;
}
@media (max-aspect-ratio: 4/5) { .hero-copy { top: max(150px, 22%); } }
.hero-title {
  font-size: clamp(1.5rem, .2rem + 7vw, 4.75rem);
  white-space: nowrap;
  animation: pop-in .8s var(--spring) 1.05s both;
}
.soon {
  display: inline-block; margin: 0;
  padding: .55rem 1.15rem .6rem; border-radius: 999px;
  background: rgba(14, 20, 48, .78); border: 2px solid var(--lamp); color: var(--cream);
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(.9375rem, .85rem + .35vw, 1.125rem); line-height: 1.3;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .6);
  text-wrap: balance; max-width: 100%;
}
.hero-store { margin-top: clamp(.9rem, 2vw, 1.4rem); animation: pop-in .7s var(--spring) 1.3s both; }
.store img { display: block; height: 54px; width: auto; }
.store-text { color: var(--lamp); font-family: "Fredoka", sans-serif; font-weight: 700; }

/* Skipper Wren, leaning in from the edge of the paper */
.hero-wren {
  position: absolute; z-index: 6;
  right: clamp(0px, 7vw - 60px, 7vw);
  bottom: calc(-1 * clamp(20px, 3.2vw, 46px));
  width: clamp(150px, 60px + 20vw, 350px);
}
.wren-lean { position: relative; z-index: 1; transform-origin: 52% 96%; animation: lean-in 1.5s cubic-bezier(.3, 1.25, .5, 1) .95s both; }
.hero-wren .ground { left: 16%; right: 22%; bottom: -3%; height: 9%; }

/* the pause button, a little brass button in the corner of the harbour */
.motion {
  position: absolute; z-index: 7; left: var(--gutter); bottom: clamp(30px, 4vw, 56px);
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--lamp); background: rgba(14, 20, 48, .78); color: var(--cream);
  cursor: pointer; display: grid; place-items: center;
}
.motion[hidden] { display: none; }
.motion::before, .motion::after { content: ""; display: block; }
.motion[aria-pressed="false"]::before {
  width: 14px; height: 16px;
  background: linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px, currentColor 9px 14px);
}
.motion[aria-pressed="true"]::before {
  width: 0; height: 0; margin-left: 4px;
  border-left: 14px solid currentColor; border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.motion:hover { border-color: var(--cream); }

/* ---------------------------------------------------------------- cut-outs */

.cutout { position: relative; }
.cutout > picture { position: relative; z-index: 1; }
.ground {
  position: absolute; z-index: 0; left: 14%; right: 14%; bottom: -4%; height: 10%;
  background: radial-gradient(closest-side, rgba(26, 31, 61, .42), rgba(26, 31, 61, 0));
  pointer-events: none;
}

/* ---------------------------------------------------------------- Pelly's letter */

.opener { padding: clamp(4.5rem, 10vw, 7.5rem) var(--gutter) clamp(3.5rem, 7vw, 6rem); }
.opener-in {
  max-width: 68rem; margin: 0 auto;
  display: grid; gap: 2.5rem 1.5rem; align-items: end; justify-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "letter letter" "pelly card";
}
@media (min-width: 60em) {
  .opener-in { grid-template-columns: 15rem minmax(0, 34rem) 16rem; grid-template-areas: "pelly letter card"; gap: 2.5rem; align-items: center; }
}
.letter {
  grid-area: letter; position: relative; width: 100%; max-width: 34rem;
  background: #FFFBEE; color: var(--navy);
  padding: 2.4rem clamp(1.35rem, 4vw, 2.6rem) 2rem;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(26, 31, 61, .08), 0 2px 0 #F2E6C6, 0 3px 0 rgba(26, 31, 61, .08), 0 26px 40px -22px var(--drop);
  transform: rotate(-1.4deg);
}
.letter h2 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem); line-height: 1.15; margin: 0 0 1.1rem; color: var(--deep); }
.letter p { margin: 0 0 .9rem; }
.sign-off { margin-top: 1.4rem !important; }
.signature {
  display: block; width: max-content; margin: .15rem 0 .1rem;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 2.3rem; line-height: 1.1; color: var(--deep);
  transform: rotate(-5deg); transform-origin: 0 50%;
}
.ps { font-size: .9375rem; color: #464B6B; margin: 1.2rem 0 0 !important; }
.letter :focus-visible { outline-color: var(--navy); }

.pip-peek {
  position: absolute; right: 9%; bottom: calc(100% - 14px);
  width: clamp(92px, 24%, 128px); overflow: hidden; padding-top: 8px;
}

.postcard {
  margin: 0; position: relative;
  background: var(--photo); color: var(--navy);
  padding: 10px 10px 8px; border-radius: 6px;
  box-shadow: 0 2px 0 rgba(26, 31, 61, .1), 0 18px 34px -18px var(--drop);
}
.postcard picture {
  aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden;
  background: linear-gradient(180deg, #CFE7F1 0%, #EAF3EE 60%, #F6E8C8 100%);
}
.postcard picture img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.postcard figcaption { padding: .5rem .2rem 0; line-height: 1.25; }
.card-name { display: block; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1rem; }
.card-port { display: block; font-size: .875rem; color: #464B6B; }
.pinned { grid-area: card; width: min(15rem, 100%); transform: rotate(5deg); margin-bottom: 1.5rem; }
.pin {
  position: absolute; z-index: 2; top: -9px; left: 50%; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #F59B90 0 18%, var(--hull) 50%, #7A1F19 100%);
  box-shadow: 0 4px 4px -1px rgba(0, 0, 0, .35);
}
.pelly-stand { grid-area: pelly; width: clamp(128px, 36vw, 210px); justify-self: center; }
.pelly-stand .ground { left: 20%; right: 20%; bottom: -2%; }
@media (min-width: 60em) { .pelly-stand { justify-self: end; align-self: end; width: 100%; } }

/* ---------------------------------------------------------------- feature sections */

.feature { padding: clamp(3.75rem, 9vw, 7rem) var(--gutter); }
.feature-in {
  position: relative; max-width: 68rem; margin: 0 auto;
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "photo" "extra";
}
@media (min-width: 48em) {
  .feature-in { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); grid-template-areas: "text photo" "extra photo"; gap: 1.5rem 5rem; }
  .feature-in.flip { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); grid-template-areas: "photo text" "photo extra"; }
  .feature-text { align-self: end; }
  .feature-extra { align-self: start; }
  .feature-in.solo { grid-template-areas: "text photo"; }
  .feature-in.solo.flip { grid-template-areas: "photo text"; }
  .solo .feature-text { align-self: center; }
}
.feature-text { grid-area: text; max-width: 33rem; }
.feature-text p { margin: 1.1rem 0 0; }
@media (min-width: 60em) { .feature-text p { font-size: 1.1875rem; } }
.feature-extra { grid-area: extra; position: relative; width: 100%; }

.photo {
  grid-area: photo; justify-self: center; position: relative; margin: 0;
  width: min(100%, 28rem);
  background: var(--photo);
  padding: clamp(8px, 1.3vw, 13px);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(26, 31, 61, .12), 0 26px 44px -22px var(--drop);
}
@media (max-width: 47.99em) { .photo { width: min(80%, 22rem); } }
.photo > picture img { border-radius: 3px; }
.tilt-l { transform: rotate(-2.6deg); }
.tilt-r { transform: rotate(2.4deg); }
.photo .cutout { position: absolute; z-index: 2; }

/* the cargo, sliding as the hold tilts */
.cargo-run { padding: 1.5rem 0 .5rem; max-width: 26rem; margin: 0 auto; }
@media (min-width: 48em) { .cargo-run { margin: .5rem 0 0; } }
.cargo-tilt { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; padding: 0 8% 15px; }
.cargo-tilt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 15px; border-radius: 8px;
  background: linear-gradient(180deg, var(--plank) 0 50%, var(--plank-2) 50%);
  box-shadow: inset 0 0 0 3px var(--navy), 0 10px 14px -8px var(--drop);
}
.crate { width: clamp(46px, 13vw, 64px); }
.c-barrel { width: clamp(52px, 14.5vw, 72px); }
.c-lantern { width: clamp(42px, 11.5vw, 56px); }
.crate .ground { bottom: -3%; height: 12%; }

/* a gull perched on the town's photo */
.perched { right: 8%; bottom: calc(100% - 10px); width: 31%; }

/* Pelly beside Albany's story */
.pelly-tells { left: -14%; bottom: -12%; width: 40%; transform: rotate(2.6deg); }
@media (min-width: 48em) { .pelly-tells { left: -38%; width: 52%; } }

/* Wren pointing at the Ship's Wheel */
.wren-points { left: -10%; bottom: -10%; width: 38%; transform: rotate(-2.4deg); }
@media (min-width: 48em) { .wren-points { left: auto; right: -34%; width: 48%; transform: scaleX(-1) rotate(-2.4deg); } }

/* the bigger ship, afloat on a strip of the toy sea */
.shipyard-art { position: relative; height: clamp(150px, 30vw, 200px); max-width: 26rem; margin: 0 auto; }
@media (min-width: 48em) { .shipyard-art { margin: .5rem 0 0; } }
.shipyard-art::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; border-radius: 0 0 14px 14px;
  background: url("img/flat-2.webp") 0 0 / auto 34px repeat-x, linear-gradient(#0F3975, #0F3975) 0 30px / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ship { position: absolute; z-index: 1; left: 50%; bottom: 14px; width: clamp(200px, 56vw, 290px); margin-left: calc(clamp(200px, 56vw, 290px) / -2); }
.star { position: absolute; z-index: 2; width: 36px; }
.s1 { left: 8%; top: 4%; }
.s2 { left: 76%; top: 0; width: 44px; }
.s3 { left: 88%; top: 34%; width: 28px; }

/* ---------------------------------------------------------------- the bands */

.band { position: relative; color: var(--cream); padding: clamp(5.5rem, 12vw, 9rem) var(--gutter); overflow: hidden; }
.band .feature-in { z-index: 2; }
.band .feature-text p { color: #EEF0FA; }
.band :focus-visible { outline-color: var(--lamp); }

.band-sea {
  background:
    radial-gradient(50rem 24rem at 85% 10%, rgba(255, 180, 63, .12), transparent 70%),
    linear-gradient(180deg, #0E1430 0%, #13245A 55%, #1A3B6A 100%);
}
.band-art { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.coast {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 62%; opacity: .62;
  -webkit-mask-image: linear-gradient(0deg, #000 30%, transparent);
  mask-image: linear-gradient(0deg, #000 30%, transparent);
}
.coast img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
@media (min-width: 48em) {
  .coast { top: 0; height: 100%; width: min(48%, 36rem);
    -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent); mask-image: linear-gradient(90deg, #000 45%, transparent); }
}
.lane { position: absolute; left: 0; bottom: 4%; width: 100%; height: 34%; }
.lane path { fill: none; stroke: var(--cream); stroke-width: 3; stroke-dasharray: 10 12; stroke-linecap: round; opacity: .32; vector-effect: non-scaling-stroke; }
.whale { position: absolute; top: 9%; left: 8%; width: clamp(110px, 12vw, 170px); }
.buoy { position: absolute; width: clamp(34px, 3.5vw, 50px); }
.b1 { right: 6%; top: 12%; }
.b2 { right: 34%; bottom: 7%; }
.g4 { --gy: 6%; --gw: 46px; }
.g5 { --gy: 13%; --gw: 34px; }
.band-sea .gull { opacity: 0; }

.band-friends {
  background:
    radial-gradient(40rem 20rem at 50% -2rem, rgba(255, 220, 140, .14), transparent 70%),
    linear-gradient(180deg, #1B3F63 0%, #183667 45%, #182B5E 100%);
}
.bubbles span {
  position: absolute; bottom: -20px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(255, 241, 208, .35); opacity: 0;
}
.bubbles span:nth-child(1) { left: 8%; }
.bubbles span:nth-child(2) { left: 23%; width: 7px; height: 7px; }
.bubbles span:nth-child(3) { left: 61%; width: 12px; height: 12px; }
.bubbles span:nth-child(4) { left: 79%; width: 6px; height: 6px; }
.bubbles span:nth-child(5) { left: 93%; }
.friends {
  position: relative; z-index: 2; list-style: none; padding: 0; margin: clamp(3rem, 7vw, 5rem) auto 0; max-width: 68rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.25rem;
}
@media (min-width: 60em) { .friends { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; } }
.friend { text-align: center; }
.swimmer { width: clamp(108px, 30vw, 160px); height: clamp(100px, 28vw, 150px); margin: 0 auto .75rem; display: flex; align-items: center; }
.swimmer > picture { width: 100%; }
.swimmer::after {
  content: ""; position: absolute; left: 18%; right: 18%; bottom: -6%; height: 12%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 241, 208, .22), transparent);
}
.friend h3 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(1.2rem, 1.05rem + .5vw, 1.45rem); line-height: 1.2; margin: 0; color: var(--cream); }
.friend .where { margin: .15rem 0 .5rem; color: var(--lamp); font-family: "Fredoka", sans-serif; font-weight: 700; font-size: .9375rem; }
.friend p { margin: 0; font-size: 1rem; line-height: 1.5; color: #EEF0FA; max-width: 18rem; margin-inline: auto; }

/* ---------------------------------------------------------------- postcards on a line */

.postcards { padding: clamp(4rem, 9vw, 7rem) var(--gutter) clamp(4.5rem, 10vw, 7.5rem); text-align: center; }
.postcards-in { max-width: 76rem; margin: 0 auto; }
.postcards-in > p { max-width: 36rem; margin: 1.1rem auto 0; }
.line { position: relative; margin: clamp(2.5rem, 6vw, 4rem) auto 0; max-width: 72rem; }
.cards {
  --gap: 1rem;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem var(--gap);
}
@media (min-width: 40em) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 66em) { .cards { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.card { position: relative; padding-top: 16px; text-align: left; }
.card::before {
  content: ""; position: absolute; top: 4px; left: calc(var(--gap) / -2); right: calc(var(--gap) / -2); height: 5px;
  background: repeating-linear-gradient(160deg, var(--rope) 0 4px, var(--rope-shade) 4px 6px); border-radius: 3px;
}
.card figure {
  margin: 0; background: var(--photo); color: var(--navy);
  padding: 8px 8px 7px; border-radius: 5px;
  box-shadow: 0 2px 0 rgba(26, 31, 61, .1), 0 16px 26px -16px var(--drop);
  transform-origin: 50% 0; transform: rotate(var(--r, 2deg));
}
.card:nth-child(2n) figure { --r: -2.5deg; }
.card:nth-child(3n) figure { --r: 1.2deg; }
.card picture {
  aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden;
  background: linear-gradient(180deg, #CFE7F1 0%, #EAF3EE 60%, #F6E8C8 100%);
}
.card picture img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.card figcaption { padding: .45rem .15rem 0; line-height: 1.25; }
.card .card-name { font-size: .9375rem; }
.peg {
  position: absolute; z-index: 2; top: 0; left: 50%; width: 11px; height: 26px; margin-left: -5px;
  background: linear-gradient(90deg, #A86F3A, #DDAE72 45%, #A86F3A); border-radius: 3px;
  box-shadow: 0 2px 2px rgba(0, 0, 0, .25);
}
.pip-jump { position: absolute; right: 0; bottom: -6px; width: calc(50% - 1rem); }
@media (min-width: 40em) { .pip-jump { width: calc(25% - 1rem); } }
@media (min-width: 66em) { .pip-jump { right: -1rem; bottom: -6.5rem; width: 9rem; } }

/* ---------------------------------------------------------------- the footer */

.foot { position: relative; background: var(--night); color: #C9CDE6; padding: clamp(4.5rem, 9vw, 6.5rem) var(--gutter) 3rem; font-size: .9375rem; }
.foot-in {
  max-width: 68rem; margin: 0 auto;
  display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 48em) {
  .foot-in { grid-template-columns: 17rem minmax(0, 1fr); grid-template-areas: "brand nav" "brand small"; gap: 1.5rem 3rem; }
  .foot-brand { grid-area: brand; }
  .foot-nav { grid-area: nav; }
  .foot-small { grid-area: small; }
}
.foot-sign { width: 150px; margin-bottom: 1.1rem; }
.foot-sign img { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: .1rem 2rem; }
@media (min-width: 60em) { .foot-nav ul { grid-template-columns: repeat(3, minmax(0, max-content)); } }
.foot-nav a, .foot-small a {
  color: var(--cream); text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--lamp);
}
.foot-nav a { display: inline-block; padding: .45rem 0; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.0625rem; }
.foot-nav a:hover, .foot-small a:hover { color: var(--lamp); }
.foot-small p { margin: 0 0 .75rem; max-width: 40rem; }
.foot mark.todo { color: #FF9C8F; }

/* ---------------------------------------------------------------- the policy pages */

.page-main { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(3.5rem, 8vw, 6rem); background-image: none; }
.board { max-width: 46rem; margin: 0 auto; color: var(--ink); }
.board h1 {
  font-family: "Fredoka", sans-serif; font-weight: 700; line-height: 1.1; margin: 0 0 .6rem;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3rem);
  color: var(--cream); -webkit-text-stroke: .15em var(--navy); paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--navy), 0 .12em .3em rgba(14, 20, 48, .3);
  text-wrap: balance;
}
@media (prefers-color-scheme: dark) {
  .board h1 { -webkit-text-stroke: 0; text-shadow: 0 .08em .3em rgba(0, 0, 0, .6); }
}
.board h2, .board h3 { font-family: "Fredoka", sans-serif; font-weight: 700; line-height: 1.18; text-wrap: balance; }
.board h2 { font-size: 1.55rem; margin: 2.6rem 0 .6rem; scroll-margin-top: 1rem; color: var(--ink); }
.board h3 { font-size: 1.1875rem; margin: 1.75rem 0 .35rem; }
.board h2 + h3 { margin-top: 1rem; }
.board p, .board ul, .board ol, .board blockquote { margin: 0 0 1rem; max-width: 38em; }
.board ul, .board ol { padding-left: 1.35rem; }
.board li { padding-left: .15rem; }
.board li + li { margin-top: .4rem; }
.board li > ul, .board li > ol { margin: .4rem 0 0; }
.board li::marker { color: var(--link-line); font-weight: 700; }
.board li p { margin: 0 0 .5rem; }
.board strong { font-weight: 700; }
.board hr { border: 0; border-top: 2px solid var(--rule); margin: 2rem 0; }
.board code { font-size: .9em; background: var(--head); padding: .05em .3em; border-radius: 5px; }
.board blockquote { border-left: 4px solid var(--rule); padding-left: 1rem; }
.board a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--link-line); }
.board a:hover { text-decoration-thickness: 3px; }
.status { color: var(--ink-soft); font-size: .9375rem; margin: 0 0 1.75rem; }

/* a placeholder still to settle: shown plainly so nobody mistakes it for the final words */
mark.todo {
  background: transparent; color: var(--todo);
  border: 1.5px dashed currentColor; border-radius: 6px; padding: 0 .3em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.contents { margin: 0 0 2.25rem; padding: 1rem 1.25rem 1.1rem; border: 2px solid var(--rule); border-radius: 16px; }
.board .contents h2 { font-size: 1.0625rem; margin: 0 0 .5rem; }
.contents ol { list-style: none; padding: 0; margin: 0; max-width: none; font-size: .9375rem; line-height: 1.4; }
.contents li + li { margin-top: .35rem; }
.board .contents a { text-decoration-line: none; }
.board .contents a:hover { text-decoration-line: underline; }
.contents li::marker { content: none; }
@media (min-width: 40em) { .contents ol { columns: 2; column-gap: 2rem; } .contents li { break-inside: avoid; } }

.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 2px solid var(--rule); border-radius: 14px; }
.board table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.board th { background: var(--head); text-align: left; font-family: "Fredoka", sans-serif; font-weight: 700; }
.board th, .board td { padding: .55rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }

.photos { list-style: none; padding: 0 !important; margin: 1.5rem 0; }
.photos li { padding: .9rem 0; border-top: 2px solid var(--rule); margin: 0 !important; }
.photos li:last-child { border-bottom: 2px solid var(--rule); }
.photos .place { display: block; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.125rem; margin-bottom: .15rem; }

/* ---------------------------------------------------------------- motion */

@keyframes lights-up { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes drop-in { from { transform: translateY(-60%); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lean-in {
  0% { transform: translateY(26%) scale(.8) rotate(9deg); opacity: 0; }
  40% { transform: translateY(0) scale(1.07) rotate(-7deg); opacity: 1; }
  68% { transform: scale(1.01) rotate(2deg); }
  100% { transform: rotate(-2deg); opacity: 1; }
}
@keyframes sign-drop {
  0% { transform: translateY(-140%); }
  55% { transform: translateY(6%) rotate(4deg); }
  75% { transform: translateY(-2%) rotate(-3deg); }
  100% { transform: none; }
}
@keyframes sign-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(2deg); } 75% { transform: rotate(-2deg); } }

/* idle motion: only with the script (which gives a pause button), only while on the screen */
@keyframes rock { from { transform: translate(-16px, 1px) rotate(-.25deg); } to { transform: translate(16px, -2px) rotate(.25deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2.4deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes flicker { 0%, 100% { opacity: .85; } 30% { opacity: 1; } 50% { opacity: .7; } 70% { opacity: .95; } }
@keyframes breathe { from { transform: rotate(-2deg); } to { transform: rotate(1.5deg) scale(1.025); } }
@keyframes nod { 0%, 70%, 100% { transform: none; } 78% { transform: rotate(-4deg) translateY(2px); } 86% { transform: rotate(1deg); } }
@keyframes peek { 0%, 52%, 100% { transform: translateY(78%); } 62%, 90% { transform: translateY(0); } 74% { transform: translateY(4%) rotate(-3deg); } }
@keyframes tilt { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }
@keyframes slide { from { transform: translateX(-12px); } to { transform: translateX(12px); } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(-22%) rotate(-6deg); } 80% { transform: translateY(0); } 86% { transform: translateY(-8%); } }
@keyframes twinkle { 0%, 100% { transform: scale(.85) rotate(0); opacity: .75; } 50% { transform: scale(1.1) rotate(12deg); opacity: 1; } }
@keyframes sway-card { from { transform: rotate(calc(var(--r, 2deg) - .8deg)); } to { transform: rotate(calc(var(--r, 2deg) + .8deg)); } }
@keyframes flap { to { background-position-x: calc(var(--gw) * -3); } }
@keyframes fly {
  0% { transform: translate(-20vw, 0); opacity: 1; }
  15% { transform: translate(18vw, -14px); }
  30% { transform: translate(56vw, 8px); }
  45% { transform: translate(94vw, -10px); }
  52% { transform: translate(115vw, 0); opacity: 1; }
  53%, 100% { transform: translate(115vw, 0); opacity: 0; }
}
@keyframes swim { 0% { transform: translateX(-40vw); } 100% { transform: translateX(110vw); } }
@keyframes rise-bubble { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-60vh); opacity: 0; } }

.topbar-home .brand picture { animation: sign-drop 1.1s cubic-bezier(.3, 1.1, .5, 1) .3s both; }
.js .topbar-home .brand picture { animation: sign-drop 1.1s cubic-bezier(.3, 1.1, .5, 1) .3s both, sign-swing 2.6s ease-in-out 1.4s 2; }

.js .awake .flat { animation: rise .95s var(--spring) var(--d) both, rock var(--rock) ease-in-out calc(var(--d) + 1s) infinite alternate; }
.js .awake .tug picture { animation: bob 4.6s ease-in-out infinite; }
.js .awake .tug-lamp { animation: flicker 3.2s ease-in-out infinite; }
.js .awake .g1 { animation: flap .66s steps(3) infinite, fly 30s linear 2.5s infinite; }
.js .awake .g2 { animation: flap .58s steps(3) infinite, fly 38s linear 11s infinite; }
.js .awake .g3 { animation: flap .5s steps(3) infinite, fly 34s linear 20s infinite; }
.js .awake .wren-lean { animation: lean-in 1.5s cubic-bezier(.3, 1.25, .5, 1) .95s both, breathe 3.4s ease-in-out 2.45s infinite alternate; }
.js .awake .pelly-stand picture, .js .awake .pelly-tells picture { transform-origin: 50% 95%; animation: nod 7s ease-in-out infinite; }
.js .awake .pip-peek picture { animation: peek 7.5s ease-in-out 1s infinite; }
.js .awake .cargo-tilt { animation: tilt 3.2s ease-in-out infinite alternate; }
.js .awake .crate { animation: slide 3.2s ease-in-out infinite alternate; }
.js .awake .perched picture { transform-origin: 50% 100%; animation: nod 5.5s ease-in-out infinite; }
.js .awake .wren-points picture { transform-origin: 50% 100%; animation: breathe 2.8s ease-in-out infinite alternate; }
.js .awake .ship { animation: float 5s ease-in-out infinite; }
.js .awake .star { animation: twinkle 2.4s ease-in-out infinite; }
.js .awake .s2 { animation-delay: .8s; }
.js .awake .s3 { animation-delay: 1.6s; }
.js .awake .whale { animation: swim 48s linear infinite; }
.js .awake .buoy { animation: float 3.6s ease-in-out infinite; }
.js .awake .b2 { animation-delay: 1.2s; }
.js .awake .g4 { animation: flap .6s steps(3) infinite, fly 32s linear 4s infinite; }
.js .awake .g5 { animation: flap .52s steps(3) infinite, fly 41s linear 15s infinite; }
.js .awake .swimmer picture { animation: float 4.2s ease-in-out infinite; }
.js .awake .friend:nth-child(2) .swimmer picture { animation-delay: -1.1s; }
.js .awake .friend:nth-child(3) .swimmer picture { animation-delay: -2.3s; animation-duration: 5s; }
.js .awake .friend:nth-child(4) .swimmer picture { animation-delay: -3.1s; }
.js .awake .bubbles span { animation: rise-bubble 9s linear infinite; }
.js .awake .bubbles span:nth-child(2) { animation-delay: 2.5s; animation-duration: 11s; }
.js .awake .bubbles span:nth-child(3) { animation-delay: 5s; }
.js .awake .bubbles span:nth-child(4) { animation-delay: 1.4s; animation-duration: 12s; }
.js .awake .bubbles span:nth-child(5) { animation-delay: 6.6s; }
.js .awake .card figure { animation: sway-card 4.5s ease-in-out infinite alternate; }
.js .awake .card:nth-child(2n) figure { animation-delay: -1.6s; }
.js .awake .card:nth-child(3n) figure { animation-delay: -3s; }
.js .awake .pip-jump picture { animation: hop 4s ease-in-out infinite; }

/* the pause button: everything holds still where it is */
.still *, .still *::before, .still *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gull { display: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .topbar, .foot .foot-brand, .skip, .edge { display: none; }
  .paper { background: #fff; }
  .board { color: #000; }
  .board h1 { color: #000; -webkit-text-stroke: 0; text-shadow: none; }
}

/* Explain the game before asking visitors to read Pelly's letter. */
.hero-summary {
  margin: .65rem auto 0; max-width: 34rem;
  color: var(--cream); font-size: clamp(1rem, .8rem + 1vw, 1.5rem);
  font-weight: 700; line-height: 1.4;
  text-shadow: 0 2px 5px var(--night), 0 0 12px var(--night);
}
.release-questions { padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
.questions-in { max-width: 48rem; margin: 0 auto; }
.questions-in h2 { font-family: "Fredoka", sans-serif; font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 1.5rem; }
.questions-in details { border-top: 1px solid var(--rule); }
.questions-in details:last-child { border-bottom: 1px solid var(--rule); }
.questions-in summary { cursor: pointer; min-height: 48px; padding: 1rem .5rem; font-weight: 700; }
.questions-in details p { margin: 0; padding: 0 .5rem 1.25rem; }
.questions-in a { color: var(--link); text-underline-offset: .2em; }
