/* Oakdart site styles. Black page, old-style serif headings, and the Moran painting as the
   hero, with a different landscape painting in each section. Before changing the look, read docs/design-brief.md.

   Each part of the page is styled in one place, in this order: tokens and fonts, base, header,
   home hero, painting pictures, home sections, the shelf, contact, footer, text pages, motion
   and effects, and last Reduce Motion, which overrides the motion rules above it.
   motion.js and alive.js add classes at runtime: motion (on <html>, when Reduce Motion is
   off), past (header over the black page), inspecting (on <body>), close (a picture or the
   shelf that was clicked), gl (a picture drawn live by WebGL), waiting and in (text-page
   reveals), gone (the inspect hint), and the elements .hero-air, .leaves, .plane-sky,
   .inspect-hint, .rest, .plane-shadow and canvas.parked.drawn. */

/* ---------- Tokens and fonts ---------- */

/* Stand-ins shown for the instant before the web fonts arrive. Each is a common system font
   scaled to the web font's width and height, so lines do not move when the real font swaps in.
   The numbers were measured in a browser against the font files in /assets/fonts/. */
@font-face {
  font-family: "Geologica Fallback";
  src: local("Arial");
  size-adjust: 106.6%;
  ascent-override: 91.9%;
  descent-override: 25.3%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia");
  size-adjust: 76.6%;
  ascent-override: 129.2%;
  descent-override: 40.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic");
  font-style: italic;
  size-adjust: 78.7%;
  ascent-override: 125.8%;
  descent-override: 39.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geologica";
  src: url("/assets/fonts/geologica-latin-wght-normal.woff2?v=b14f1ede")
    format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-normal.woff2?v=5eb09b5a")
    format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-italic.woff2?v=5a51946d")
    format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #f7f7ef;
  --dim: rgba(247, 247, 239, 0.74);
  --line: rgba(247, 247, 239, 0.3);
  --cream: #f7f3e6;
  --ink: #2a2118;
  --gold: #e4a030;
  --serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, serif;
  --sans: "Geologica", "Geologica Fallback", system-ui, sans-serif;
  --gutter: clamp(16px, 4.5vw, 64px);
  --glass: rgba(0, 0, 0, 0.32);
  /* Edman asked for the painting's colors about 30% stronger (2026-12-02). */
  --pop: saturate(1.3);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
main {
  overflow-x: clip;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
p,
ul {
  margin: 0;
}
h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}
h1 {
  font-size: clamp(3rem, 6.4vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
/* All section headings are italic, like the hero's. */
h2 {
  font-size: clamp(2.3rem, 4.4vw, 3.7rem);
  font-style: italic;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 40;
  background: var(--cream);
  color: var(--ink);
  padding: 8px 12px;
}
/* motion.js moves --p from 0 to 1 as a scene rises; without it, scenes keep the final state. */
[data-scene] {
  --p: 1;
}
.kicker,
.eyebrow {
  font-size: 0.9375rem;
  color: var(--dim);
}

/* ---------- Header ---------- */

/* A floating pill of tinted glass over the painting, with a thin light edge and a shadow under
   the links so they read on bright sky. Over the black page (class past, from motion.js) it
   turns solid dark with an outline. */
.bar {
  --glass: rgba(10, 12, 12, 0.3);
  position: fixed;
  z-index: 30;
  top: clamp(12px, 2.4vw, 24px);
  left: var(--gutter);
  right: var(--gutter);
  height: clamp(60px, 6vw, 76px);
  padding: 8px 10px 8px clamp(12px, 1.6vw, 20px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition:
    background 0.3s,
    box-shadow 0.3s,
    opacity 0.4s;
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
}
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .bar {
    background: rgba(0, 0, 0, 0.88);
  }
}
.bar.past {
  background: #121210;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
/* A black band behind the header, on the page rather than inside it, hides what scrolls
   beneath. It is always there; motion.js fades it in with --past as the black page arrives. */
body::before {
  content: "";
  position: fixed;
  z-index: 29;
  left: 0;
  right: 0;
  top: 0;
  height: calc(clamp(12px, 2.4vw, 24px) + clamp(60px, 6vw, 76px) + 14px);
  background: linear-gradient(to bottom, #000 82%, rgba(0, 0, 0, 0));
  opacity: var(--past, 0);
  pointer-events: none;
}
.bar a {
  text-decoration: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  line-height: 1;
}
.brand img {
  width: clamp(40px, 4vw, 52px);
  transform-origin: 50% 50%;
}
.bar nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  margin-left: auto;
  margin-right: clamp(6px, 1.6vw, 24px);
  font-size: 1rem;
}
.bar nav a {
  padding: 10px 0;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}
/* Inspecting the painting: the header steps aside. */
body.inspecting .bar,
body.inspecting .hero-air {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 640px) {
  .bar {
    padding-right: 16px;
    gap: 10px;
  }
  .brand {
    gap: 8px;
  }
  .bar nav {
    margin-right: 0;
    gap: 14px;
    font-size: 0.9375rem;
  }
}
/* Small phones: a tighter header. */
@media (max-width: 420px) {
  .brand {
    font-size: 1.4rem;
    gap: 6px;
  }
  .brand img {
    width: 34px;
  }
  .bar nav {
    gap: 10px;
    font-size: 0.875rem;
  }
}
@media (max-width: 350px) {
  .bar {
    padding: 6px 10px;
    gap: 6px;
  }
  .brand {
    font-size: 1.2rem;
  }
  .brand img {
    width: 28px;
  }
  .bar nav {
    gap: 8px;
    font-size: 0.8125rem;
  }
}

/* ---------- Home hero ---------- */

/* The whole painting, edge to edge. The hero stays put while the black page rises over it like
   a heavy sheet. */
.hero {
  --h: 0;
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: var(--cream);
}
/* Inspecting: the hero sits above every other section, so Return and the credit always show. */
body.inspecting .hero {
  z-index: 35;
}
@media (min-width: 761px) {
  .hero {
    min-height: 680px;
  }
}
/* The painting is a button: a click inspects it up close. */
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: zoom-in;
}
.hero-art.close {
  cursor: zoom-out;
  touch-action: none;
}
/* Keyboard focus is drawn inside the picture, so all four sides show. */
.hero-art:focus-visible {
  outline-offset: -6px;
}
.hero-art :is(img, canvas) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 40%;
  transform-origin: 22% 30%;
  transition: scale 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.motion .hero-art :is(img, canvas) {
  transform: scale(calc(1.02 + 0.1 * var(--h)))
    translate(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -10px));
}
.hero-art.close :is(img, canvas) {
  scale: 1.5;
}
/* The live canvas zooms in its own shader, so it takes no CSS zoom. */
.hero-art.gl.close canvas {
  scale: 1;
}
/* When alive.js draws the moving painting on a canvas, the still image hides beneath it. */
.hero-art.gl img {
  opacity: 0;
}
@media (max-aspect-ratio: 4/5) {
  .hero-art img {
    object-position: 15% 40%;
  }
}

/* The hero words: a little heavier, with a tight shadow so the painting needs no dark fade. */
.hero-copy {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(72px, 9vh, 112px);
  max-width: 44rem;
  pointer-events: none;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 2px 14px rgba(0, 0, 0, 0.55);
  transition: opacity 0.4s;
}
/* As the black page rises, the hero words lift, stay whole a little longer, then fade well
   before its edge reaches them. */
.motion .hero-copy {
  opacity: calc(1.24 - var(--h) * 4);
  transform: translateY(calc(var(--h) * -70px));
}
.hero-copy a {
  pointer-events: auto;
}
.hero-copy h1 {
  font-style: italic;
  transition: opacity 0.4s;
}
.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  margin: 20px 0 16px;
  max-width: 33em;
}
.hero-copy .lede {
  font-weight: 420;
  transition: opacity 0.4s;
}
/* Inspecting: the words go, the Return control stays. */
body.inspecting .hero-copy {
  opacity: 1;
  pointer-events: none;
  transform: none;
}
body.inspecting .hero-copy h1,
body.inspecting .hero-copy .lede,
body.inspecting .hero-copy .cta {
  opacity: 0;
}

/* Hero controls, "Keep reading" and "Inspect the painting", share one row under the words on
   every screen size. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 6px;
}
.cta {
  display: inline-block;
  text-decoration: none;
}
.cta:hover {
  text-underline-offset: 5px;
}
.hero-copy .cta {
  padding: 11px 22px;
  font-weight: 500;
  letter-spacing: 0;
  text-shadow: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: opacity 0.4s;
}
.hero-copy .cta::after {
  content: " \2193";
}
.hero-copy .cta:hover {
  background: rgba(0, 0, 0, 0.45);
}
.inspect {
  position: static;
  z-index: 3;
  right: var(--gutter);
  bottom: 46px;
  font: inherit;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--cream);
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-shadow: none;
  pointer-events: auto;
  cursor: pointer;
}
/* Inspecting: Return sits in the lower left corner, level with the credit. */
body.inspecting .inspect {
  position: fixed;
  left: var(--gutter);
  right: auto;
  bottom: 14px;
  background: rgba(0, 0, 0, 0.42);
}

/* The painting's credit, in the lower right corner. */
.credit {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  background: rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-shadow: none;
  pointer-events: none;
}
.motion .credit {
  opacity: calc(1.24 - var(--h) * 4);
}
body.inspecting .credit {
  opacity: 1;
}

/* The painting's air, built by alive.js when Reduce Motion is off: the falling leaves. Mist,
   light and birds are drawn by the shader in alive.js. */
.hero-air {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s;
}
.leaves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* The hint shown on entering inspect mode; alive.js fades it out with class gone. */
.inspect-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 42px;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9375rem;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
  transition: opacity 0.8s;
}
.inspect-hint.gone {
  opacity: 0;
}

/* Phones: the words sit lower, the credit moves to the left, and the two controls are lighter
   glass. */
@media (max-width: 640px) {
  .hero-copy {
    bottom: 58px;
  }
  .inspect {
    right: auto;
    bottom: auto;
    padding: 11px 16px;
    background: rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  /* On a phone, Return sits just above the credit. */
  body.inspecting .inspect {
    bottom: 52px;
    padding: 11px 16px;
  }
  .credit {
    left: var(--gutter);
    right: auto;
    bottom: 16px;
  }
}
/* The credit drops the painting's title where it would not fit. */
@media (max-width: 399px) {
  .credit-title {
    display: none;
  }
}
/* Very small phones: a slightly smaller headline leaves open sky above it for the plane, and
   both hero controls stay on one row down to 320 wide. */
@media (max-width: 380px) {
  .hero-copy h1 {
    font-size: clamp(2.3rem, 11vw, 3rem);
  }
  .hero-copy .lede {
    margin: 12px 0;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-copy .cta,
  .inspect {
    padding: 10px 13px;
    font-size: 0.875rem;
  }
}
@media (max-width: 360px) {
  .hero-actions {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .hero-copy .cta,
  .inspect {
    padding: 9px 11px;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

/* ---------- Painting pictures ---------- */

/* Each section's picture is a button that looks closer. */
.painting {
  filter: var(--pop);
}
/* The live canvas does its own color boost and covers the plain image beneath it. */
canvas.painting {
  filter: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.plate {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(240px, 54vh, 580px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(247, 243, 230, 0.16);
  cursor: zoom-in;
}
.plate.close {
  cursor: zoom-out;
  touch-action: none;
}
.plate:focus-visible {
  outline-offset: -4px;
}
.plate :is(img, canvas) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.14 - 0.1 * var(--p)))
    translate(calc(var(--mx, 0) * -16px), calc(var(--my, 0) * -16px));
  transition:
    scale 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.25s ease-out;
}
.plate.close :is(img, canvas) {
  scale: 1.6;
}
.plate.gl img {
  opacity: 0;
}
/* The live canvas is framed by the shader alone, with no CSS zoom on top of it. It still gets
   its own layer: without one, Chromium can paint a newly made canvas in the wrong place for a
   frame. */
.plate.gl canvas {
  transform: translateZ(0);
}
.plate.gl.close canvas {
  scale: 1;
}
/* A quiet cue that a picture can be looked at closely. */
.plate::after {
  content: "Look closer";
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 6px 14px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  opacity: 0.85;
}
.plate.close::after {
  content: "Back";
}

/* ---------- Home sections ---------- */

/* The black page that rises over the hero. */
main > section:not(.hero) {
  position: relative;
  z-index: 1;
  background: var(--bg);
}
.chapter,
.contact {
  padding: clamp(48px, 7vw, 104px) var(--gutter);
  scroll-margin-top: calc(
    clamp(60px, 6vw, 76px) + clamp(12px, 2.4vw, 24px) + 28px
  );
}
/* Each section: the small label above its heading, a picture, then the words, and under the
   picture a line saying which detail of the painting it is, with a tiny map of where. */
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 34rem);
  grid-template-areas: "kicker kicker" "title title" "plate plate" "detail body";
  gap: 0 32px;
}
.chapter .text {
  display: contents;
}
.chapter .kicker {
  grid-area: kicker;
  padding: 0 0 8px;
}
.chapter h2 {
  grid-area: title;
  padding-bottom: 0.5em;
}
.chapter .plate {
  grid-area: plate;
}
.chapter .text > p:last-child {
  grid-area: body;
  padding-top: 18px;
}
.detail {
  grid-area: detail;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  font-size: 0.875rem;
  color: var(--dim);
  align-self: start;
}
.locator {
  position: relative;
  flex: none;
  /* A small map of the whole painting; --map is that painting's width / height. */
  width: 58px;
  aspect-ratio: var(--map, 58 / 36);
  border: 1px solid rgba(247, 243, 230, 0.4);
}
.locator i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  background: var(--gold);
  opacity: 0.85;
}

/* Oak: the pines. "Keep reading" brings the black page right to the top, with no strip of sky
   left above, and the section fits one screen: heading, picture, map and words. */
#oak {
  scroll-margin-top: 0;
  padding-top: calc(clamp(60px, 6vw, 76px) + clamp(12px, 2.4vw, 24px) + 28px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.55);
}

/* Phones: one column, and each picture has its own shape: tall pines, a wide waterfall
   running edge to edge, a square around the boat. */
@media (max-width: 760px) {
  .chapter {
    grid-template-columns: 1fr;
    grid-template-areas: "kicker" "title" "plate" "detail" "body";
  }
  #oak .plate {
    height: auto;
    aspect-ratio: 4 / 5;
  }
  #dart .plate {
    height: auto;
    aspect-ratio: 16 / 10;
    width: calc(100% + 2 * var(--gutter));
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
  }
  #friend .plate {
    height: auto;
    aspect-ratio: 1;
  }
}
/* Wide screens: each section sets its picture and words side by side, alternating sides, with
   the words centred against the picture, lines of text kept to a readable length, and less
   empty black between sections. */
@media (min-width: 761px) {
  .chapter {
    padding-block: clamp(40px, 9vh, 96px);
  }
  .chapter .text > p:last-child {
    max-width: 34rem;
  }
  #oak {
    grid-template-columns: minmax(0, min(40vw, 560px)) minmax(0, 1fr);
    grid-template-areas: "plate ." "plate kicker" "plate title" "plate body" "plate ." "detail .";
    grid-template-rows: 1fr auto auto auto 1fr auto;
    column-gap: clamp(32px, 6vw, 96px);
  }
  #oak .plate {
    margin-inline: 0;
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: calc(100vh - 230px);
  }
  #oak h2 {
    font-size: clamp(2.8rem, 5.4vw, 4.8rem);
    line-height: 0.98;
  }
  /* Dart: the waterfall picture is wide, so the water is plainly its subject. */
  #dart {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: ". plate" "kicker plate" "title plate" "body plate" ". plate" ". detail";
    grid-template-rows: 1fr auto auto auto 1fr auto;
    column-gap: clamp(32px, 6vw, 96px);
  }
  #dart .plate {
    height: auto;
    aspect-ratio: 16 / 10;
    align-self: center;
  }
  #dart h2 {
    align-self: start;
    line-height: 0.98;
  }
  /* Friend: an intimate square around the wedding boat. */
  #friend {
    grid-template-columns: minmax(0, min(38vw, 520px)) minmax(0, 1fr);
    grid-template-areas: "plate ." "plate kicker" "plate title" "plate body" "plate ." "detail .";
    grid-template-rows: 1fr auto auto auto 1fr auto;
    column-gap: clamp(32px, 6vw, 96px);
  }
  #friend .plate {
    height: auto;
    aspect-ratio: 1;
  }
}
/* Very wide screens: the pictures grow. */
@media (min-width: 1500px) {
  #oak {
    grid-template-columns: minmax(0, min(40vw, 760px)) minmax(0, 1fr);
  }
  #friend {
    grid-template-columns: minmax(0, min(38vw, 700px)) minmax(0, 1fr);
  }
}

/* ---------- The shelf (apps section) ---------- */

/* Apps: an empty shelf above the words, all centred. */
#apps {
  grid-template-columns: 1fr;
  grid-template-areas: "plate" "kicker" "title" "body";
  justify-items: center;
  text-align: center;
  padding-block: clamp(72px, 10vw, 150px);
  padding-top: clamp(28px, 4vw, 64px);
}
#apps .kicker {
  padding-top: 44px;
  max-width: 34rem;
}
#apps h2 {
  padding: 0 0 0.2em;
}
#apps .text > p:last-child {
  padding-top: 8px;
  max-width: 34rem;
}
/* A lit oak plank, drawn without 3D transforms so every browser draws the same shape. On it,
   one empty app-shaped place is pressed into the wood, and Oakdart's paper plane rests beside
   it. Nudging the shelf (class close, toggled on each click) makes the plane hop. */
.shelf {
  grid-area: plate;
  position: relative;
  width: min(100%, 900px);
  height: clamp(250px, 30vw, 340px);
  perspective-origin: 50% 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
/* Front edge of the plank: the same grain picture as the top face, darker. */
.shelf::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 226, 170, 0.25),
      rgba(20, 10, 2, 0.5) 30%,
      rgba(10, 5, 1, 0.85)
    ),
    url("/assets/art/oak-plank.webp?v=f3900b75") center 80% / 100% 400%;
  box-shadow:
    0 34px 50px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 226, 170, 0.5);
}
/* A warm cone of light from above. */
.shelf::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: -60px;
  bottom: 30px;
  background: radial-gradient(
    ellipse 50% 100% at 50% 100%,
    rgba(244, 188, 92, 0.34),
    rgba(244, 188, 92, 0.08) 55%,
    transparent 76%
  );
  pointer-events: none;
}
/* Top face of the plank: cut to a trapezoid (far edge narrower), with the grain squeezed to
   match and no knot near the plane. */
.plank {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  height: 84px;
  transform-origin: 50% 100%;
  clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(
      ellipse 50% 130% at 50% 100%,
      rgba(255, 222, 160, 0.3),
      transparent 70%
    ),
    linear-gradient(to bottom, rgba(20, 10, 2, 0.6), rgba(20, 10, 2, 0) 70%),
    url("/assets/art/oak-plank.webp?v=f3900b75") 60% 50% / 180% 100%;
}
/* The empty place: a shallow impression with the plank's own grain showing through, leaning
   with the plank's vanishing lines. A light sweeps across it now and then. */
.app-place {
  position: absolute;
  left: 33%;
  top: 16px;
  width: clamp(96px, 12vw, 132px);
  height: 54px;
  border-radius: 18% / 32%;
  background:
    linear-gradient(
        120deg,
        transparent 40%,
        rgba(255, 240, 200, 0.18) 50%,
        transparent 60%
      )
      0 0 / 300% 100%,
    linear-gradient(to bottom, rgba(16, 8, 2, 0.52), rgba(16, 8, 2, 0.14));
  box-shadow:
    inset 0 3px 5px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 226, 170, 0.55),
    0 1px 0 rgba(255, 226, 170, 0.18);
  transform-origin: 50% 100%;
  transform: translateX(-50%) skewX(-6deg);
}
.motion .app-place {
  animation: sweep 5.5s ease-in-out infinite;
}
.shelf.close .app-place,
.shelf:not(.close)[aria-pressed="false"]:active .app-place {
  animation: sweep 5.5s ease-in-out infinite;
}
/* The plane: without alive.js, the plain logo picture sits on the shelf. */
.parked {
  position: absolute;
  z-index: 2;
  left: calc(50% + 62px);
  bottom: 44px;
  width: clamp(72px, 8vw, 96px);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.75));
  transform-origin: 40% 95%;
  transition: translate 0.25s;
}
/* Now and then the parked plane shifts on its own, so people learn it reacts. */
.motion .parked {
  animation: ruffle 8s ease-in-out infinite;
}
.shelf:hover .parked,
.shelf:focus-visible .parked {
  translate: 0 -4px;
}
/* With alive.js, a small stage (.rest) holds the folded-paper plane (canvas.parked.drawn) and
   its shadow (.plane-shadow) together, so they keep their fit at any size. The plane lies on
   one wing; its shadow starts where paper meets plank. */
.rest {
  position: absolute;
  z-index: 2;
  left: calc(50% + 6px);
  bottom: 30px;
  width: 200px;
  height: 100px;
  transform-origin: 50% 100%;
  transform: scale(1.12);
}
.rest .parked.drawn {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200px;
  height: 100px;
  filter: none;
  transform-origin: 50% 76%;
}
.rest .plane-shadow {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 200px;
  height: 100px;
  transform-origin: 50% 76%;
  pointer-events: none;
  transition:
    opacity 0.25s,
    filter 0.25s;
}
/* The shadow softens whenever the plane lifts: on hover and in its idle shuffle. */
.shelf:hover .plane-shadow,
.shelf:focus-visible .plane-shadow {
  opacity: 0.7;
  filter: blur(2px);
}
.motion .rest .plane-shadow {
  animation: ruffle-shadow 8s ease-in-out infinite;
}
@media (max-width: 760px) {
  .plank {
    height: 76px;
  }
  .app-place {
    left: 27%;
    top: 14px;
    width: clamp(78px, 24vw, 104px);
    height: 48px;
    transform: translateX(-50%) skewX(-8deg);
  }
  .parked {
    left: calc(50% + 34px);
    bottom: 40px;
  }
  .rest {
    left: calc(50% - 18px);
    bottom: 28px;
    transform: scale(0.86);
  }
}
@media (max-width: 380px) {
  .rest {
    left: calc(50% - 40px);
    transform: scale(0.72);
  }
}
@media (min-width: 1500px) {
  .shelf {
    width: min(100%, 44vw);
  }
}

/* ---------- Contact ---------- */

.contact h2 {
  padding: 6px 0 0.4em;
}
.contact > p:not(.kicker) {
  max-width: 34rem;
  margin-left: auto;
}
.inboxes {
  list-style: none;
  padding: 0;
  margin-top: 56px;
}
.inboxes li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.inboxes span {
  flex: 1 1 12rem;
  color: var(--dim);
}
.inboxes a {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  line-height: 1.1;
  text-decoration: none;
}
.inboxes a:hover {
  font-style: italic;
}
/* Copy buttons, shown by motion.js when the clipboard can be used. */
.copy {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  min-width: 5.5rem;
  cursor: pointer;
}
/* Hover looks only where there is a real pointer, so buttons do not stay lit after a tap. */
@media (hover: hover) {
  .copy:hover {
    background: var(--cream);
    color: var(--ink);
  }
}
/* The page closes on a painting: a wide band of far mountains at dusk under the addresses. */
.contact .closing {
  width: calc(100% + 2 * var(--gutter));
  margin: clamp(48px, 7vw, 96px) calc(var(--gutter) * -1) 0;
  height: clamp(220px, 46vh, 460px);
  border-radius: 0;
}
.contact > p.detail {
  max-width: none;
  margin-left: 0;
  grid-area: auto;
  grid-column: 1 / -1;
}
/* Phones: addresses and their Copy buttons line up in two tidy columns, and the closing band
   stays a wide horizon. */
@media (max-width: 760px) {
  .inboxes li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .inboxes span {
    grid-column: 1 / -1;
  }
  .contact .closing {
    height: auto;
    aspect-ratio: 16 / 7;
    min-height: 150px;
  }
}
@media (max-width: 380px) {
  .inboxes a {
    font-size: 1.35rem;
  }
}
@media (max-width: 350px) {
  .inboxes li {
    grid-template-columns: 1fr;
  }
}
/* Wide screens: heading on the left, its paragraph beside it on the right. */
@media (min-width: 960px) {
  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 32rem);
    column-gap: clamp(32px, 6vw, 96px);
  }
  .contact > * {
    grid-column: 1 / -1;
  }
  .contact > h2 {
    grid-column: 1;
    padding-bottom: 0;
  }
  .contact > h2 + p {
    grid-column: 2;
    align-self: end;
    margin-bottom: 0.5em;
  }
}
/* Very wide screens: the address list keeps to a comfortable width. */
@media (min-width: 1500px) {
  .contact {
    grid-template-columns: minmax(0, 660px) minmax(0, 32rem) minmax(0, 1fr);
  }
  .contact > .kicker,
  .contact > h2,
  .inboxes {
    max-width: 1200px;
  }
}

/* ---------- Footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 24px 48px;
  padding: clamp(48px, 7vw, 96px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.1;
}
.foot small {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--dim);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.foot nav a {
  padding: 6px 0;
}

/* ---------- Text pages: support, privacy, terms and the missing-page page ---------- */

.page-hero {
  padding: clamp(120px, 14vw, 184px) var(--gutter) 0;
}
.page-hero h1 {
  font-style: italic;
  margin: 8px 0 0;
}
.page-hero .lede {
  margin-bottom: 24px;
}
.page-hero .plate {
  margin-top: clamp(32px, 5vw, 56px);
  height: clamp(200px, 38vh, 400px);
}
.button {
  display: inline-block;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 999px;
  text-decoration: none;
}
.button:hover {
  background: #fff;
}
.prose {
  padding: clamp(40px, 6vw, 80px) var(--gutter);
}
.prose section {
  max-width: 44rem;
  margin-left: auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.prose h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  line-height: 1.1;
  margin-bottom: 12px;
}
.prose p + p,
.prose ul {
  margin-top: 12px;
}
.prose ul {
  padding-left: 1.2em;
}
.prose li + li {
  margin-top: 8px;
}
.draft-banner {
  max-width: 44rem;
  margin: 0 0 24px auto;
  padding: 14px 18px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  color: var(--gold);
  font-weight: 600;
}
/* The painter, title and year under a text page's picture. */
.plate-credit {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--dim);
}
.page-hero .draft-banner {
  margin-left: 0;
}
.meta-line {
  color: var(--dim);
}

/* ---------- Motion and effects ---------- */

/* Sections on text pages rise a little as they enter; their text is never hidden. */
/* Waiting text stays above the 4.5:1 contrast that body text needs, so it is readable even
   before it rises into place. */
.motion .reveal.waiting {
  opacity: 0.62;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.motion .reveal.waiting.in {
  opacity: 1;
  transform: none;
}
/* The plane and its trail fly on a see-through layer above everything. */
.plane-sky {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@keyframes sweep {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -60% 0;
  }
}
@keyframes ruffle {
  0%,
  86%,
  100% {
    transform: none;
  }
  90% {
    transform: translateY(-7px) rotate(-6deg);
  }
  94% {
    transform: translateY(0) rotate(3deg);
  }
}
@keyframes ruffle-shadow {
  0%,
  86%,
  94%,
  100% {
    opacity: 1;
    filter: blur(0);
  }
  90% {
    opacity: 0.58;
    filter: blur(2.5px);
  }
}

/* ---------- Reduce Motion ---------- */

/* Last, so it wins over every motion rule above: no smooth scrolling, transitions, animations
   or hover shifts, and nothing to zoom into. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .parked,
  .bar,
  .hero-copy,
  .hero-copy h1,
  .hero-copy .lede,
  .hero-copy .cta,
  .hero-air,
  .inspect-hint,
  .plate :is(img, canvas),
  .hero-art :is(img, canvas) {
    transition: none !important;
  }
  .app-place,
  .parked {
    animation: none !important;
  }
  .shelf:hover .parked,
  .shelf:focus-visible .parked {
    translate: none;
  }
  .rest .plane-shadow,
  .shelf:hover .plane-shadow {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    filter: none;
  }
  /* Nothing can be moved around, so "look closer" shows the whole picture, unzoomed. */
  .hero-art.close img {
    transform-origin: 50% 50%;
  }
  .hero-art.close img,
  .plate.close img {
    scale: 1;
  }
  /* Section pictures have no closer view without motion, so they do not offer one. */
  .plate::after {
    content: none;
  }
  .plate,
  .plate.close {
    cursor: default;
  }
}
