/* gabrielmerchan.com: two seasons. Winter is The Starry Night and the work; fall is paper, leaves and the art. */

@font-face { font-family: "Old Standard TT"; src: url("/fonts/old-standard-tt-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("/fonts/old-standard-tt-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("/fonts/old-standard-tt-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
/* Frank Ruhl Libre (OFL), subset to the six letters of אור חיים; its own family name so no other Hebrew on the site borrows a partial font */
@font-face { font-family: "Ohr Chaim"; src: url("/fonts/frank-ruhl-libre-ohr-chaim-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0020, U+05D0, U+05D5, U+05D7, U+05D9, U+05DD, U+05E8; }

:root {
  /* winter: The Starry Night */
  --night: #0e2238;
  --night-deep: #091726;
  --night-2: #142e50;
  --ice: #b9d3e6;
  --frost: #e9f0f6;
  --frost-2: #aec3d5;
  --starry: #f2c84b;
  --starry-ink: #1d1606;
  /* fall: paper, leaves, ink */
  --paper: #ece3d2;
  --paper-2: #fffaf0;
  --ink: #2b2118;
  --ink-2: #4a3f36;
  --pencil: #5b5048;
  --rust: #7a3618;
  --gold: #c8913a;
  --ohr-gold: #ebcf8f; /* the motto: measured on the painting behind it, 3:1 or better at every pixel (large text) */
  --umber: #5a3a24;
  --tan: #6b4a2a;

  --display: "Old Standard TT", "Iowan Old Style", Georgia, serif;
  --text: "Alegreya", "Iowan Old Style", Georgia, serif;
  --gutter: clamp(16px, 5vw, 80px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .05 0 0 0 0 .02 0 0 0 .45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pencil-grid:
    repeating-linear-gradient(45deg, transparent 0 139px, rgba(91, 80, 72, 0.18) 139px 140px),
    repeating-linear-gradient(-45deg, transparent 0 139px, rgba(91, 80, 72, 0.18) 139px 140px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
[data-season="winter"] body { background: var(--night); color: var(--frost); color-scheme: dark; scrollbar-color: #3a5577 var(--night); }
[data-season="fall"] body, body.home { background: var(--pencil-grid), var(--paper); color: var(--ink); color-scheme: light; scrollbar-color: var(--tan) var(--paper); }
body.home { color: var(--frost); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
:focus-visible { outline: 2px solid var(--starry); outline-offset: 3px; border-radius: 1px; }
/* on paper the yellow ring nearly vanishes (1.3:1), so fall pages ring in rust */
[data-season="fall"] :focus-visible, .fall-run :focus-visible { outline-color: var(--rust); }
.lightbox :focus-visible { outline-color: var(--starry); }
::selection { background: var(--starry); color: var(--starry-ink); }
.fall ::selection, .fall-run ::selection, [data-season="fall"] ::selection { background: var(--rust); color: var(--paper); }

.skip { position: absolute; left: -999px; top: 0; z-index: 20; background: var(--frost); color: var(--night); padding: 0.6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }
.skip:hover { color: var(--night); }

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1.4rem var(--gutter);
}
.home .masthead { position: absolute; top: 0; left: 0; right: 0; }
.wordmark { margin-right: auto; font: 400 0.95rem/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; }
.masthead ul { display: flex; gap: 1.6rem; margin: 0; padding: 0; list-style: none; }
.masthead nav a { font: italic 400 1.08rem/1 var(--display); text-decoration: none; padding: 0.4rem 0; opacity: 0.85; }
.masthead nav a:hover, .masthead nav a[aria-current] { opacity: 1; text-decoration: underline; }
[data-season="winter"] .masthead { color: var(--frost); }
[data-season="fall"] .masthead { color: var(--ink); }
.home .masthead { color: var(--frost); }
.write {
  display: inline-block;
  background: var(--starry);
  color: var(--starry-ink);
  font: 700 0.95rem/1 var(--text);
  padding: 0.72rem 1.1rem 0.66rem;
  border-radius: 2px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: translate 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.write:hover { translate: 0 -1px; color: var(--starry-ink); }

/* ---------- drawn symbols ---------- */

.sym { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.drift { position: absolute; z-index: 0; height: auto; aspect-ratio: 1; pointer-events: none; }
.sym-eye.drift { aspect-ratio: 3 / 2; }
.sym-violin.drift { aspect-ratio: 140 / 310; }
.winter .drift { color: var(--ice); opacity: 0.32; --knock: var(--night); }
.cv-band .drift { --knock: var(--night-2); }
.fall .drift { color: var(--pencil); opacity: 0.55; --knock: var(--paper); }

/* ---------- winter: the hero on The Starry Night ---------- */

.hero { position: relative; min-height: 100vh; overflow: clip; display: grid; align-items: center; isolation: isolate; background: var(--night); }
.painting {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/img/starry-night-1200.jpg") center 35% / cover no-repeat;
  background-image: image-set(url("/img/opt/starry-night-1200.webp") type("image/webp"), url("/img/starry-night-1200.jpg") type("image/jpeg"));
}
@media (min-width: 900px), (min-resolution: 2dppx) {
  .painting {
    background-image: url("/img/starry-night.jpg");
    background-image: image-set(url("/img/opt/starry-night-2400.webp") type("image/webp"), url("/img/starry-night.jpg") type("image/jpeg"));
  }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to right, rgba(9, 23, 38, 0.2) 0%, rgba(9, 23, 38, 0.5) 45%, rgba(9, 23, 38, 0.82) 100%),
    linear-gradient(to bottom, rgba(9, 23, 38, 0.45) 0%, transparent 22%, transparent 72%, var(--night) 100%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 88px);
  align-items: center;
  padding: clamp(110px, 16vh, 150px) var(--gutter) clamp(72px, 12vh, 120px);
}
.hero-portrait { margin: 0; padding: 10px; background: var(--night-deep); border: 1px solid var(--starry); box-shadow: 0 6px 14px rgba(4, 10, 20, 0.6); rotate: -1deg; }
.hero-portrait img { display: block; width: 100%; height: auto; }
.epigraph { margin: 0 0 1.3rem; font: italic 400 clamp(1rem, 1.5vw, 1.2rem)/1.4 var(--display); color: var(--starry); }
.hero h1 { margin: 0; font: 400 clamp(2.5rem, 6.2vw, 5.4rem)/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
/* אור חיים under the name, in gold; the gloss follows it, smaller (and is read after it) */
.motto { margin: 0.85rem 0 0; color: var(--ohr-gold); }
.motto-he { display: block; text-align: left; font: 500 clamp(2rem, 4vw, 3.4rem)/1.05 "Ohr Chaim", "Frank Ruhl Libre", "David", "Times New Roman", serif; letter-spacing: 0.03em; }
/* 24px (large text) where the bright brushwork sits behind it; phones keep it small over a darker sky */
.motto-gloss { display: block; margin-top: 0.35rem; font: italic 400 1.5rem/1.25 var(--display); letter-spacing: 0.04em; }
.lede { margin: 1.5rem 0 0; max-width: 32rem; font: italic 400 clamp(1.5rem, 2.5vw, 2.1rem)/1.3 var(--display); text-wrap: balance; }
.about { margin: 1.1rem 0 0; max-width: 35rem; font-size: 1.14rem; color: #dbe6f0; text-wrap: pretty; }
.credit { position: absolute; right: var(--gutter); bottom: 1rem; margin: 0; font: italic 400 0.8rem/1.2 var(--display); color: var(--frost-2); }

/* ---------- seasons ---------- */

.season { position: relative; padding: clamp(72px, 10vw, 140px) var(--gutter); }
.season > :not(.drift) { position: relative; z-index: 1; }
.winter { background: url("/img/starfield.svg") 0 0 / 820px repeat, var(--night); color: var(--frost); }
.cv-band { background: url("/img/starfield.svg") 400px 200px / 820px repeat, var(--night-2); }
.fall { color: var(--ink); }
.page-top { padding-top: clamp(32px, 6vh, 64px); min-height: 70vh; }

.season h1, .season > h2 {
  margin: 0 0 0.5rem;
  font: 400 clamp(2rem, 4.6vw, 3.6rem)/1.05 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-wrap: balance;
}
.winter h1, .winter > h2 { color: var(--frost); }
.season .card h2 { margin: 0; font: 700 1.08rem/1.25 var(--display); letter-spacing: 0.07em; color: var(--starry); }
.fall h1, .fall > h2 { color: var(--rust); }
.sub { margin: 0 0 2.4rem; max-width: 38rem; font: italic 400 1.2rem/1.45 var(--display); }
.winter .sub { color: var(--frost-2); }
.fall .sub { color: var(--pencil); }

/* education: Wesleyan's own full-colour logo file on a paper card, then the degree and the plan.
   Wesleyan asks for clear space of half the shield's width around the mark: the file brings
   most of it and the card's padding the rest. The grid follows the hero's, so the plan sits
   under his name. */
.education { padding-bottom: 0; }
.edu { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 88px); align-items: start; margin-top: 1.4rem; }
.edu-mark { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); color: inherit; text-decoration: none; }
.edu-mark img { flex: none; width: clamp(64px, 6vw, 84px); height: auto; }
.edu-name { font: 700 clamp(1.35rem, 2.2vw, 1.8rem)/1.15 var(--display); letter-spacing: 0.01em; }
.edu-mark:hover .edu-name, .edu-mark:focus-visible .edu-name { text-decoration: underline; text-underline-offset: 0.18em; }
.edu-degree { margin: 1.1rem 0 0; max-width: 24rem; font: italic 400 1.2rem/1.45 var(--display); color: var(--frost-2); text-wrap: pretty; }
.edu-plan { margin: 0; max-width: 38rem; font-size: clamp(1.2rem, 1.7vw, 1.42rem); line-height: 1.55; color: var(--frost); text-wrap: pretty; }

/* winter cards */

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.8rem; }
.filters button {
  font: italic 400 1rem/1 var(--display);
  color: var(--frost-2);
  background: transparent;
  border: 1px solid rgba(185, 211, 230, 0.45);
  padding: 0.65rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.filters button:hover { color: var(--frost); border-color: var(--ice); }
.filters button[aria-pressed="true"] { background: var(--starry); border-color: var(--starry); color: var(--starry-ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.1rem; align-items: start; }
.card {
  position: relative;
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--night-2);
  border: 1px solid rgba(185, 211, 230, 0.35);
  box-shadow: 0 3px 6px rgba(4, 10, 20, 0.5);
  scroll-margin-top: 2rem;
}
.card::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(185, 211, 230, 0.14); pointer-events: none; }
.card h3, .card h2 { margin: 0; font: 700 1.08rem/1.25 var(--display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--starry); text-wrap: balance; }
.card-role { margin: 0.35rem 0 0; font: italic 400 1rem/1.35 var(--display); color: var(--frost-2); }
.facts { margin: 1rem 0 0; display: grid; gap: 0.65rem; }
.facts div { display: grid; gap: 0.1rem; }
.facts dt { font: 400 0.74rem/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ice); }
.facts dd { margin: 0; line-height: 1.45; }
.card-link { margin: 0.9rem 0 0; }
.card-link a { color: var(--starry); font-style: italic; }
.card:target { outline: 2px solid var(--starry); outline-offset: 5px; animation: none; } /* a linked card lands where its scroll margin says */
.card[hidden] { display: none; }
.cards-empty { color: var(--frost-2); font-style: italic; }
picture { display: contents; }

/* the four projects he leads with */
.cards-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; align-items: stretch; }
@media (max-width: 760px) { .cards-featured { grid-template-columns: 1fr; } }
.card-featured { padding: 1.7rem 1.7rem 1.4rem; border-color: rgba(242, 200, 75, 0.55); background: linear-gradient(160deg, rgba(242, 200, 75, 0.07), transparent 45%), var(--night-2); }
.card-featured::before { border-color: rgba(242, 200, 75, 0.22); }
.card-featured h2, .card-featured h3 { font-size: 1.28rem; }
.card-result { margin: 0.9rem 0 0; font: italic 400 clamp(1.15rem, 1.6vw, 1.32rem)/1.35 var(--display); color: var(--frost); text-wrap: balance; }
.more-label { margin: 2.6rem 0 1rem; font: 400 0.82rem/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ice); }
.more-label[hidden], .cards[hidden] { display: none; }

/* the story behind a card */
.case { margin: 1rem 0 0; border-top: 1px solid rgba(185, 211, 230, 0.2); padding-top: 0.75rem; }
.case summary { cursor: pointer; width: fit-content; font: italic 400 1rem/1.3 var(--display); color: var(--starry); list-style: none; }
.case summary::-webkit-details-marker { display: none; }
.case summary::after { content: " +"; }
.case[open] summary::after { content: " \2212"; }
.case p { margin: 0.7rem 0 0.4rem; line-height: 1.5; color: var(--frost-2); }
.case ol { margin: 0; padding-left: 1.2rem; line-height: 1.5; }
.case li + li { margin-top: 0.3rem; }

.cv-line { margin: 0.2rem 0; font-size: 1.15rem; max-width: 46rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 0; }
.button {
  display: inline-block;
  font: italic 400 1.05rem/1 var(--display);
  color: var(--starry);
  border: 1px solid var(--starry);
  padding: 0.75rem 1.15rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 160ms, color 160ms;
}
.button:hover { background: var(--starry); color: var(--starry-ink); }

/* The CV page follows the resume PDF's layout: centred name and contact line, bold headings,
   organization in bold with role and location, dates at the right edge, round bullets. */
.cv { max-width: 54rem; margin-top: 2.4rem; }
.cv-name { margin: 0; text-align: center; font: 400 2rem/1.15 var(--display); color: var(--frost); }
.cv-contact { margin: 0.3rem 0 0; text-align: center; color: var(--frost-2); }
.cv-contact a { color: var(--ice); }
.cv h2 { margin: 1.7rem 0 0; font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--starry); }
.cv p, .cv li { color: var(--frost-2); }
.cv p { margin: 0.15rem 0 0; }
.cv strong { color: var(--frost); }
.cv .cv-entry { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 1.2rem; margin-top: 0.95rem; }
.cv h2 + p { margin-top: 0.7rem; }
.cv-entry .what { flex: 1 1 18rem; }
.cv-entry .when { flex: none; white-space: nowrap; text-align: right; color: var(--frost); }
.cv ul { list-style: disc; padding-left: 2.6rem; margin: 0.15rem 0 0; }
.cv li { margin: 0.15rem 0 0; padding-left: 0.2rem; }
.cv li::marker { color: var(--frost-2); }
@media (max-width: 40rem) {
  .cv ul { padding-left: 1.4rem; }
  .cv-entry .when { flex-basis: 100%; text-align: left; }
}

/* ---------- the turn between seasons ---------- */

/* Without scroll-driven motion (reduced motion, or a browser that can't) the turn is one still
   frame: half-warmed sky, everything in place. With motion it becomes a 260vh scroll. */
.turn { position: relative; height: 100vh; background: var(--night); color: var(--frost); }
.turn-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center; background: var(--night); }
.sky { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--night) 0%, #233046 30%, #6a4426 62%, #9a6232 82%, #c79a62 100%); opacity: 0.55; }
.turn-words { position: relative; z-index: 3; text-align: center; padding: 0 24px; max-width: 44rem; }
.turn-words blockquote { margin: 0; font: italic 400 clamp(1.6rem, 3.4vw, 2.8rem)/1.3 var(--display); text-wrap: balance; text-shadow: 0 1px 12px rgba(9, 23, 38, 0.6); }
.object { position: absolute; z-index: 2; color: var(--frost); }
.object svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.object .thin { stroke-width: 1.1; opacity: 0.7; }
.cup { left: 7vw; bottom: 8vh; width: clamp(130px, 14vw, 210px); }
.steam path { stroke-width: 1.6; opacity: 0.8; }
.cup .saucer { fill: rgba(233, 240, 246, 0.06); }
.cup .body { fill: rgba(233, 240, 246, 0.08); }
.cup .coffee { fill: #4a2f1f; stroke: none; }
.cup .foam { fill: #e9dcc4; stroke: none; }
.violin { right: 7vw; top: 5vh; width: clamp(230px, 25vw, 380px); }
.violin .varnish { fill: rgba(176, 98, 42, 0.32); }
.violin .fingerboard { fill: #091726; }
.violin .peg { stroke-width: 4; }
.violin .dot { fill: currentColor; stroke: none; }
.violin .strings line { stroke-width: 0.8; opacity: 0.9; }
.violin .hair { stroke-width: 1.2; opacity: 0.85; }
.violin .frog { fill: #091726; }
.violin .tailpiece { fill: #2e1c12; stroke-width: 1.4; }
.table { right: 4vw; bottom: 6vh; width: clamp(300px, 40vw, 600px); }
.table .top { fill: rgba(38, 104, 92, 0.5); }
.table .line { stroke-width: 1.1; opacity: 0.75; }
.table .net { stroke-width: 1.6; }
.table .net-mesh { stroke-width: 0.7; opacity: 0.55; }
.table .shadow { fill: #091726; stroke: none; opacity: 0; }
.paddle { transform-box: fill-box; }
.paddle-l { transform-origin: 70% 100%; }
.paddle-r { transform-origin: 30% 100%; }
.paddle .rubber { fill: #a8322a; }
.paddle .grip { stroke: #c79a62; stroke-width: 6; }
.ball { fill: #fffaf0; stroke: none; translate: 196px 146px; }

.turn.js-turn { height: 260vh; }

/* ---------- fall ---------- */

.fall-run { position: relative; overflow: clip; background: var(--pencil-grid), var(--paper); color: var(--ink); }
.home .fall-run::before { content: ""; display: block; height: 140px; background: linear-gradient(to bottom, #c79a62, rgba(236, 227, 210, 0)); }
.leaves { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fall-run > .season { z-index: 1; } /* leaves fall behind the words */
.falling { position: absolute; width: var(--size, 36px); height: var(--size, 36px); stroke: rgba(43, 33, 24, 0.55); stroke-width: 1.4; }
.tone-rust { --leaf: #a34a22; }
.tone-gold { --leaf: #c8913a; }
.tone-umber { --leaf: #6b3f1f; }
.fall a { color: var(--rust); }
.fall a:hover { color: var(--ink); }

.making, .art-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.polaroid { margin: 0; padding: 8px 8px 2.2rem; background: var(--paper-2); box-shadow: 0 3px 8px rgba(43, 33, 24, 0.3); rotate: -1.5deg; }
.polaroid img { display: block; width: 100%; height: auto; }
.polaroid figcaption { margin-top: 0.6rem; text-align: center; font: italic 400 1rem/1.2 var(--display); color: var(--pencil); }
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 2.2rem; }
.room h3 { margin: 0 0 0.35rem; font: 700 1rem/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.room p { margin: 0; color: var(--ink-2); }

.poem-wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 5vw, 80px); align-items: start; margin-top: 2rem; }
.poem-title { margin: 0 0 1rem; font: 700 1.05rem/1.3 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.poem { margin: 0 0 1.4rem; font: italic 400 clamp(1.25rem, 2vw, 1.65rem)/1.6 var(--display); }
.poem .line, .verse .line { display: block; }
.read { font: italic 400 1.12rem/1.2 var(--display); }
.poem-side { position: sticky; top: 12vh; }
.poem-side p { margin: 0 0 1rem; color: var(--ink-2); }
.board { margin: 1.6rem 0 0; padding: 8px; background: var(--paper-2); box-shadow: 0 3px 8px rgba(43, 33, 24, 0.3); rotate: 1deg; }
.board img { display: block; width: 100%; height: auto; }

.books { position: relative; display: flex; flex-wrap: wrap; gap: clamp(14px, 2.4vw, 32px); align-items: flex-end; padding: 0 0 28px; }
.books::after { content: ""; position: absolute; left: -12px; right: -12px; bottom: 0; height: 12px; background: var(--grain), var(--tan); box-shadow: 0 3px 6px rgba(43, 33, 24, 0.35); }
.book { width: clamp(104px, 13vw, 170px); box-shadow: 0 4px 8px rgba(43, 33, 24, 0.35); transform-origin: bottom center; }
.book img { display: block; width: 100%; height: auto; }

.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.gallery figure { margin: 0; padding: 6px; background: var(--paper-2); box-shadow: 0 3px 8px rgba(43, 33, 24, 0.3); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.g1 { grid-column: 1 / span 5; aspect-ratio: 4 / 3; } .g2 { grid-column: 6 / span 4; aspect-ratio: 3 / 4; } .g3 { grid-column: 10 / span 3; aspect-ratio: 3 / 4; }
.g4 { grid-column: 1 / span 3; aspect-ratio: 3 / 4; } .g5 { grid-column: 4 / span 5; aspect-ratio: 4 / 3; } .g6 { grid-column: 9 / span 4; aspect-ratio: 1; }
.g7 { grid-column: 3 / span 8; aspect-ratio: 16 / 9; }
.photo { display: block; height: 100%; cursor: zoom-in; }
.more { margin: 1.8rem 0 0; }

/* gallery page: rows of whole photographs, each at its own shape. Every figure grows in
   proportion to its width-to-height ratio, so a row shares one height and nothing is cropped. */
.wall { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 22px); --row: clamp(9rem, 22vw, 17rem); }
.wall::after { content: ""; flex-grow: 1e4; }
.wall figure { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row) + 12px); margin: 0; padding: 6px; background: var(--paper-2); box-shadow: 0 3px 8px rgba(43, 33, 24, 0.3); }
.wall img { display: block; width: 100%; height: auto; }

/* the photograph viewer (gallery.js): a print on the night sky */
html.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: clamp(10px, 2vw, 24px); border: 0; background: transparent; color: var(--frost); overflow: hidden; }
.lightbox[open] {
  display: grid;
  grid-template: "close close close" auto "prev frame next" minmax(0, 1fr) "count count count" auto / auto minmax(0, 1fr) auto;
  gap: 10px clamp(10px, 2vw, 28px);
  align-items: center;
}
.lightbox::backdrop { background: rgba(9, 23, 38, 0.95); }
.lb-frame { grid-area: frame; justify-self: center; margin: 0; padding: 8px; background: var(--paper-2); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); touch-action: pan-y; }
.lb-frame img { display: block; width: auto; height: auto; max-width: calc(100vw - 2 * clamp(10px, 2vw, 24px) - 2 * (48px + clamp(10px, 2vw, 28px)) - 16px); max-height: calc(100dvh - 2 * clamp(10px, 2vw, 24px) - 140px); transition: opacity 180ms ease-out; }
.lb-frame.loading img { opacity: 0.35; }
.lb-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--frost);
  background: rgba(9, 23, 38, 0.6);
  border: 1px solid rgba(185, 211, 230, 0.45);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 160ms, background 160ms;
}
.lb-btn:hover { border-color: var(--ice); background: rgba(233, 240, 246, 0.08); }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn[hidden] { display: none; }
.lb-close { grid-area: close; justify-self: end; }
.lb-prev { grid-area: prev; }
.lb-next { grid-area: next; }
.lb-count { grid-area: count; margin: 0; text-align: center; font: italic 400 1.05rem/1.2 var(--display); color: var(--frost-2); font-variant-numeric: lining-nums; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lb-frame { animation: lb-in 260ms cubic-bezier(0.16, 1, 0.3, 1); }
}
@keyframes lb-in { from { opacity: 0; scale: 0.97; } }
@media (max-width: 760px) {
  .lightbox[open] { grid-template: "close close close" auto "frame frame frame" minmax(0, 1fr) "prev count next" auto / auto minmax(0, 1fr) auto; }
  .lb-frame { padding: 5px; }
  .lb-frame img { max-width: calc(100vw - 2 * clamp(10px, 2vw, 24px) - 10px); max-height: calc(100dvh - 2 * clamp(10px, 2vw, 24px) - 140px); }
}

/* art page */
.art-text section + section { margin-top: 2.4rem; }
.art-text h2 { margin: 0 0 1rem; padding-bottom: 0.45rem; font: 400 0.9rem/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--rust); border-bottom: 1px solid rgba(143, 69, 35, 0.4); }
.art-text p { max-width: 42rem; color: var(--ink-2); }
.note-entry + .note-entry { margin-top: 1.6rem; }
.note-entry h3 { margin: 0 0 0.5rem; font: 700 1.12rem/1.3 var(--display); color: var(--ink); }
.note-sub { margin-left: 0.4rem; font-weight: 400; font-style: italic; color: var(--rust); }
/* art collection: each work whole, on the paper mount the photographs use */
.hang-title { margin: 1.8rem 0 0.9rem; font: 700 1.12rem/1.3 var(--display); color: var(--ink); }
h2 + .hang-title { margin-top: 0; }
.hang { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 28px); align-items: start; }
.hang-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hang figure { margin: 0; }
.hang .photo { height: auto; padding: 6px; background: var(--paper-2); box-shadow: 0 3px 8px rgba(43, 33, 24, 0.3); }
.hang img { display: block; width: 100%; height: auto; }
.hang figcaption { margin-top: 0.75rem; }
.hang .hang-cap { margin: 0; font: italic 400 1rem/1.35 var(--display); color: var(--pencil); }
.hang-cap cite { color: var(--ink); }
.hang-he { font-style: normal; color: var(--ink); }
.hang .hang-say { margin: 0.5rem 0 0; color: var(--ink-2); }
.ledger { margin: 0; }
.ledger div + div { margin-top: 0.85rem; }
.ledger dt { font: 700 1.05rem/1.3 var(--display); }
.ledger dd { margin: 0.15rem 0 0; color: var(--ink-2); max-width: 42rem; }
.works-label { margin-right: 0.5rem; font: 400 0.74rem/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--rust); }

/* writing */
.writing-list { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.writing-list li { padding: 1.4rem 0; border-top: 1px solid rgba(91, 80, 72, 0.4); }
.writing-list a { text-decoration: none; }
.w-title { font: italic 400 clamp(1.35rem, 2.6vw, 1.8rem)/1.3 var(--display); color: var(--ink); }
.writing-list a:hover .w-title { color: var(--rust); }
.writing-list p { margin: 0.4rem 0 0; color: var(--ink-2); }
.w-kind { font-weight: 700; color: var(--rust); }
.reading { max-width: 40rem; margin: 0 auto; padding-bottom: clamp(40px, 8vh, 96px); overflow-wrap: break-word; }
.reading a { overflow-wrap: anywhere; } /* long source links wrap on phones instead of running off the page */
.reading .back { margin: 0; font: italic 400 1rem/1 var(--display); }
.reading h1 { margin: 1.6rem 0 0.4rem; font: 400 clamp(1.9rem, 4.6vw, 3rem)/1.12 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink); }
.byline { margin: 0 0 2.4rem; font: italic 400 1.1rem/1.3 var(--display); color: var(--rust); }
.byline .elsewhere { white-space: nowrap; } /* "· Also on Substack" wraps as one piece on phones */
.reading p { margin: 0 0 1.2rem; font-size: 1.13rem; line-height: 1.72; text-wrap: pretty; }
.reading h2 { margin: 2.6rem 0 1rem; font: 400 0.9rem/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--rust); }
.reading .lines { margin: 0 0 2.2rem; font: italic 400 1.02rem/1.5 var(--display); color: var(--pencil); }
.verse { font: italic 400 clamp(1.12rem, 1.7vw, 1.32rem)/1.75 var(--display) !important; }

.lost { text-align: center; display: grid; align-content: center; }
.lost .sub { margin-inline: auto; }

/* ---------- imprint ---------- */

.imprint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; padding: 1.6rem var(--gutter) 2rem; border-top: 1px solid; }
[data-season="winter"] .imprint { border-color: rgba(185, 211, 230, 0.3); color: var(--frost-2); }
[data-season="fall"] .imprint, .home .imprint { border-color: rgba(91, 80, 72, 0.35); color: var(--ink-2); }
.imprint p { margin: 0; }
.mail { font: italic 400 1.1rem/1.2 var(--display); }
.imprint ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; margin: 0; padding: 0; list-style: none; }

/* ---------- motion, driven by scrolling ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .painting { animation: slow-zoom linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .drift { animation: drift linear both; animation-timeline: view(); }
    .falling { animation: leaf-fall linear both; animation-timeline: view(); }

    .turn { height: 260vh; view-timeline: --turn block; }
    .sky, .steam path, .ball, .shadow, .paddle-l, .paddle-r, .cup, .bow, .violin, .turn-words {
      animation-timeline: --turn; animation-range: contain 0% contain 100%;
      animation-fill-mode: both; animation-timing-function: linear; animation-duration: auto;
    }
    .sky { animation-name: warm; }
    .steam path { animation-name: rise; }
    .steam path:nth-child(2) { animation-name: rise-2; }
    .cup { animation-name: sip; }
    .ball { animation-name: rally; }
    .shadow { animation-name: ball-shadow; }
    .paddle-l { animation-name: swing-l; }
    .paddle-r { animation-name: swing-r; }
    .bow { animation-name: bowing; animation-timing-function: ease-in-out; }
    .violin { animation-name: sway; }
    .turn-words { animation-name: words; }

    .poem .line, .verse .line { animation: ink linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .book { animation: stand linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .book:nth-child(2) { animation-range: entry 10% entry 80%; }
    .book:nth-child(3) { animation-range: entry 20% entry 90%; }
    .book:nth-child(4) { animation-range: entry 30% entry 100%; }
    .gallery figure, .wall figure { animation: develop linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .gallery figure:nth-child(even), .wall figure:nth-child(even) { --tilt: 2deg; }
    .card { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}
@keyframes slow-zoom { to { scale: 1.12; } }
@keyframes drift { from { translate: 0 90px; rotate: -8deg; } to { translate: 0 -90px; rotate: 6deg; } }
@keyframes leaf-fall { from { translate: 0 -160px; rotate: 0deg; } to { translate: var(--drift, 30px) 200px; rotate: var(--spin, 240deg); } }
@media (max-width: 760px) { .falling.edge { --drift: 0px !important; } }
@keyframes warm { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { 0%, 50%, 100% { translate: 0 10px; opacity: 0; } 25%, 75% { opacity: 0.9; } 49.9%, 99.9% { translate: 0 -40px; opacity: 0; } }
@keyframes rise-2 { 0%, 100% { translate: 0 -15px; opacity: 0.45; } 25%, 75% { translate: 0 -40px; opacity: 0; } 26%, 76% { translate: 0 10px; opacity: 0; } 50% { translate: 0 -15px; opacity: 0.9; } }
@keyframes sip { from { translate: 0 30px; rotate: -4deg; } to { translate: 0 -20px; rotate: 3deg; } }
@keyframes bowing {
  0%, 25%, 50%, 75%, 100% { translate: -90px 0; } 12.5%, 37.5%, 62.5%, 87.5% { translate: 90px 0; }
}
@keyframes sway { 0%, 50%, 100% { rotate: 0deg; } 25% { rotate: -2.5deg; } 75% { rotate: 2.5deg; } }
@keyframes words { 0% { opacity: 0; translate: 0 24px; } 20%, 80% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -24px; } }
@keyframes ink { from { opacity: 0.1; filter: blur(2px); } to { opacity: 1; filter: none; } }
@keyframes stand { from { rotate: -14deg; translate: 0 30px; opacity: 0.2; } to { rotate: 0deg; translate: 0 0; opacity: 1; } }
@keyframes develop { from { opacity: 0.15; translate: 0 50px; rotate: var(--tilt, -2deg); filter: sepia(1) brightness(1.3); } to { opacity: 1; translate: 0 0; rotate: 0deg; filter: none; } }
@keyframes settle { from { opacity: 0.2; translate: 0 36px; } to { opacity: 1; translate: 0 0; } }

/* ---------- phones ---------- */

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .masthead { flex-wrap: wrap; gap: 0.8rem 1.2rem; padding-top: 1.1rem; }
  /* name and the yellow control share the first line; the five pages get the second */
  .wordmark { letter-spacing: 0.16em; }
  .write { order: 2; }
  .masthead nav { order: 3; flex-basis: 100%; }
  .masthead ul { gap: 0.4rem 1.1rem; flex-wrap: wrap; }
  .write { padding: 0.65rem 0.9rem; font-size: 0.92rem; }
  .hero::after { background: linear-gradient(to bottom, rgba(9, 23, 38, 0.45) 0%, rgba(9, 23, 38, 0.55) 45%, rgba(9, 23, 38, 0.85) 75%, var(--night) 100%); }
  .hero-inner, .making, .art-grid, .poem-wrap, .edu { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 150px; }
  .hero-portrait { max-width: 340px; }
  .motto-gloss { font-size: 1.05rem; } /* 4.5:1 or better here: the sky behind it is darker */
  .credit { position: static; padding: 0 var(--gutter) 1rem; }
  .rooms { grid-template-columns: 1fr; }
  .hang, .hang-mine { grid-template-columns: 1fr; }
  .hang:not(.hang-mine) figure { max-width: 22rem; }
  .poem-side { position: static; }
  .violin { right: 3vw; top: 6vh; width: 46vw; }
  .table { width: 92vw; right: 2vw; bottom: 5vh; }
  .cup { left: 5vw; top: 9vh; bottom: auto; width: 116px; }
  .violin { width: 50vw; }
  .books { gap: 10px; }
  .book { width: 20vw; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery figure { grid-column: auto !important; aspect-ratio: 3 / 4 !important; }
  .gallery .g7 { grid-column: 1 / -1 !important; aspect-ratio: 16 / 9 !important; }
  .imprint { flex-direction: column; align-items: flex-start; }
  .falling:not(.edge) { display: none; }
  .falling.edge { --size: 15px !important; opacity: 0.85; }
  .falling.edge[style*="left:9"] { left: auto !important; right: 2px; }
  .falling.edge:not([style*="left:9"]) { left: 2px !important; }
}

/* ---------- music that inspired me: a record player and a crate (music.js) ---------- */

/* the end of every page clears the record, and the console when it is open */
body { padding-bottom: var(--music-reserve, 0px); }

.music { position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 58px; pointer-events: none; }
.music[hidden] { display: none; }
.music > * { pointer-events: auto; }

.disc {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(9, 13, 20, 0.45);
  transition: scale 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.disc:hover { scale: 1.05; }
.disc:focus-visible { outline: 2px solid var(--starry); outline-offset: 2px; box-shadow: 0 3px 8px rgba(9, 13, 20, 0.45), 0 0 0 6px var(--starry-ink); }
.disc-art { display: block; width: 100%; height: 100%; }
.music .vinyl { fill: #15110e; stroke: rgba(236, 227, 210, 0.3); stroke-width: 1; }
.music .groove { fill: none; stroke: rgba(236, 227, 210, 0.12); stroke-width: 0.6; }
.music .sheen { fill: none; stroke: rgba(236, 227, 210, 0.4); stroke-width: 1.3; stroke-linecap: round; }
.music .label { fill: var(--rust); }
.music .label-ring { fill: none; stroke: var(--gold); stroke-width: 0.7; }
.music .label-print { fill: none; stroke: rgba(255, 250, 240, 0.78); stroke-width: 1.4; stroke-linecap: round; }
.music .hole { fill: var(--paper); }
.disc-tag {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  translate: 0 -50%;
  padding: 0.32rem 0.6rem 0.36rem;
  background: var(--paper-2);
  color: var(--ink);
  font: italic 400 0.98rem/1 var(--display);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(20, 14, 8, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms;
}
.disc:focus-visible .disc-tag { opacity: 1; }
@media (hover: hover) { .disc:hover .disc-tag { opacity: 1; } }
.music[data-open="true"] .disc-tag { display: none; }

/* the console: paper, like the photographs, holding the turntable, the player and the crate */
.console {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: 344px;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px); /* the visible screen, under phone toolbars */
  overflow-y: auto;
  padding: 12px 16px 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "head head" "deck deck" "start now" "spot spot" "status status" "crate crate" "read read";
  gap: 0 12px;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(20, 14, 8, 0.38);
  transform-origin: 0 100%;
  opacity: 0;
  scale: 0.2;
  visibility: hidden;
  transition: opacity 200ms ease-out, scale 300ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 300ms;
}
.console::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(91, 80, 72, 0.25); pointer-events: none; }
.music[data-open="true"] .console { opacity: 1; scale: 1; visibility: visible; transition-delay: 0s; }
.console :focus-visible { outline-color: var(--rust); }
.console ::selection { background: var(--rust); color: var(--paper); }

.m-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(91, 80, 72, 0.45);
  border-radius: 2px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
}
.m-btn:hover { color: var(--rust); border-color: var(--rust); }
.m-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-btn span { display: grid; }

.console-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -6px 8px 0; }
.console-title { margin: 0; font: italic 400 1.18rem/1.2 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink); }
.m-fold { width: 36px; height: 36px; border-color: transparent; }

/* the turntable */
.deck { grid-area: deck; }
.turntable { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 5px rgba(20, 14, 8, 0.35)); }
.turntable .plinth { fill: var(--umber); }
.turntable .plinth-edge { fill: none; stroke: rgba(255, 238, 214, 0.16); stroke-width: 1; }
.turntable .platter { fill: #b9b0a2; }
.turntable .strobe { fill: none; stroke: #74695d; stroke-width: 2; stroke-dasharray: 1.2 3.6; }
.turntable .mat { fill: #29211b; }
.turntable .groove { stroke: rgba(236, 227, 210, 0.1); }
.turntable .lp { transform-box: fill-box; transform-origin: center; opacity: 0; }
.turntable .lp-ring { fill: none; stroke: rgba(200, 145, 58, 0.85); stroke-width: 1.2; }
.turntable .lp-sheen { fill: none; stroke: rgba(236, 227, 210, 0.26); stroke-width: 2.2; stroke-linecap: round; opacity: 0; transition: opacity 400ms; }
.music[data-loaded="true"] .turntable .lp, .music[data-loaded="true"] .turntable .lp-sheen { opacity: 1; }
.turntable .spindle { fill: #ddd6c8; }
.turntable .arm-rest { fill: none; stroke: #cfc7b8; stroke-width: 3; stroke-linecap: round; }
.turntable .arm-base { fill: #3c2817; stroke: #cfc7b8; stroke-width: 1.5; }
.turntable .arm-pivot { fill: #cfc7b8; }
.turntable .weight { fill: #cfc7b8; stroke: #8f8678; stroke-width: 1; }
.turntable .tube { fill: none; stroke: #ece5d8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.turntable .shell { fill: #ece5d8; stroke: #8f8678; stroke-width: 1; }
/* the tonearm swings onto the record while it plays, and back to its rest */
.turntable .arm { transform-box: view-box; transform-origin: 250px 28px; transition: rotate 900ms cubic-bezier(0.45, 0, 0.2, 1); }
.music[data-arm="down"] .turntable .arm { rotate: 40deg; }

.m-start { grid-area: start; align-self: center; margin-top: 12px; border-radius: 50%; color: var(--paper-2); background: var(--rust); border-color: var(--rust); }
.m-start:hover { color: var(--paper-2); background: #5c2810; border-color: #5c2810; }
.m-start[aria-disabled="true"] { opacity: 0.55; }
.m-start[hidden] { display: none; }
.m-start .i-pause, .music[data-state="playing"] .m-start .i-play { display: none; }
.music[data-state="playing"] .m-start .i-pause { display: grid; }
.music[data-state="loading"] .m-start { cursor: progress; }

.now { grid-area: now; align-self: center; min-width: 0; margin-top: 12px; }
.now-title { margin: 0; font: italic 400 1.1rem/1.2 var(--display); color: var(--ink); text-wrap: balance; }
.now-artist { margin: 0.15rem 0 0; font-size: 0.88rem; line-height: 1.3; color: var(--pencil); }
.music[data-state="empty"] .now-title { font-size: 1rem; color: var(--pencil); }

/* Spotify's compact player, on screen whenever music plays */
.spot { grid-area: spot; height: 80px; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #282828; }
.spot[hidden] { display: none; }
.spot iframe { display: block; width: 100%; height: 80px; border: 0; }
.spot-note { display: grid; place-items: center; height: 100%; margin: 0; font: italic 400 0.9rem/1 var(--display); color: #d9d1c3; }

.m-status { grid-area: status; margin: 0.6rem 0 0; font: italic 400 0.86rem/1.35 var(--display); color: var(--pencil); }
.m-status:empty { display: none; }
.m-status a { color: var(--rust); }

/* the crate: covers stand in a wooden box; the one in focus, under the pointer or on the
   platter rises out of it */
.crate-box {
  grid-area: crate;
  position: relative;
  margin-top: 14px;
  padding: 0 6px;
  border-radius: 4px;
  background: linear-gradient(#3c2817, var(--umber) 70%);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45);
}
.crate-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(#7a5434, var(--tan));
  box-shadow: 0 -2px 4px rgba(20, 14, 8, 0.35), inset 0 1px 0 rgba(255, 238, 214, 0.2);
  pointer-events: none;
}
.crate {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 4px;
  padding: 12px 4px 10px;
  scrollbar-width: none;
}
.crate::-webkit-scrollbar { display: none; }
.cover {
  flex: 0 0 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: #15110e;
  scroll-snap-align: start;
  translate: 0 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: translate 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cover img { display: block; width: 100%; height: 100%; border-radius: 1px; }
.cover:hover, .cover:focus-visible, .cover[aria-pressed="true"] { translate: 0 -4px; }
.cover:focus-visible { outline: 2px solid var(--paper-2); outline-offset: 2px; }
.cover[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--gold), 0 3px 6px rgba(0, 0, 0, 0.5); }

.crate-read { grid-area: read; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 6px; margin-top: 6px; }
.read-text { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font: italic 400 0.9rem/1.3 var(--display); color: var(--pencil); }
.m-flip { width: 32px; height: 32px; border-color: transparent; }
.m-flip[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.m-flip[aria-disabled="true"]:hover { color: var(--ink); }

.m-start svg { fill: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .disc, .console, .cover, .turntable .arm, .turntable .lp-sheen { transition: none; }
}

/* phones: the record sits in the corner; open, the console runs across the bottom with the
   turntable beside the controls, and the record is tucked behind it */
@media (max-width: 760px) {
  .music { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .disc { width: 48px; height: 48px; }
  .music[data-open="true"] .disc { visibility: hidden; }
  .console {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 10px 12px;
    grid-template-columns: 168px 40px minmax(0, 1fr);
    grid-template-areas: "head head head" "deck start now" "spot spot spot" "status status status" "crate crate crate" "read read read";
    gap: 0 10px;
  }
  .console-head { margin-bottom: 6px; }
  .console-title { font-size: 1.08rem; }
  .m-start, .now { margin-top: 0; }
  .now-title { font-size: 1.02rem; }
  .now-artist { font-size: 0.84rem; }
  .spot { margin-top: 10px; }
  .crate-box { margin-top: 10px; }
  .cover { flex-basis: 56px; height: 56px; }
}
@media (max-width: 359px) {
  .console { grid-template-columns: 128px 40px minmax(0, 1fr); }
}

/* Composition videos on /art/: still + play button, swapped for the player on press. */
.video, .video-frame { display: block; width: 100%; max-width: 34rem; aspect-ratio: 16 / 9; margin: 0.9rem 0 0.35rem; border: 0; border-radius: 4px; background: #000; }
.video { position: relative; padding: 0; overflow: hidden; cursor: pointer; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; transition: opacity 0.2s; }
.video:hover img, .video:focus-visible img { opacity: 1; }
.video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 0.55rem 1rem 0.55rem 2.1rem; border-radius: 999px; background: rgba(0,0,0,0.72); color: #fff; font: 400 0.78rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.video-play::before { content: ""; position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); border-style: solid; border-width: 0.38rem 0 0.38rem 0.62rem; border-color: transparent transparent transparent #fff; }
.video:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.video-link { margin: 0; font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) { .video img { transition: none; } }
