/* ==========================================================
   wonga.live — Andrew Wong, baroque violin
   Paper, ink and rubric red: the palette of an engraved score.
   ========================================================== */

:root {
  /* whiter paper, matching the wall in the violin photo (was #f3eee5 / #ebe4d8 / #d6cdbf) */
  --paper: #fdfcfa;
  --paper-2: #f3f0ea;
  --ink: #1c1915;
  --ink-2: #4a443c;
  --muted: #7a7166;
  --rule: #e3ded5;
  --rubric: #b0361c;
  --rubric-ink: #8f2a14;
  --night: #120f0c;
  --night-2: #1d1914;
  --night-text: #ece4d6;
  --night-muted: #a39887;
  --gilt: #c8a25e;

  --display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(17px, 1.05vw + 12px, 20px);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--rubric); color: var(--paper); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* subtle paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: .15; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type primitives ---------- */
.label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label b { color: var(--rubric); font-weight: 500; }
h2.label { margin: 0; font-weight: 400; line-height: 1.6; }
.display {
  font-family: var(--display);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.02em;
  margin: 0;
}
em, .it { font-style: italic; }
.rubric { color: var(--rubric); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .4s var(--ease), border-color .4s, transform .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: var(--rule); }
.nav.hide { transform: translateY(-100%); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--display); font-size: 22px; font-weight: 600; text-decoration: none; letter-spacing: .01em; }
.brand em { color: var(--rubric); font-weight: 400; margin-left: .2em; }
.brand-h1 { margin: 0; font: inherit; }
.nav.on-dark:not(.scrolled) .brand em { color: var(--gilt); }
@media (max-width: 360px) { .brand em { display: none; } }
.nav ul { display: flex; gap: clamp(14px, 2.4vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav ul a { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); position: relative; padding: 6px 0; }
.nav ul a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--rubric); transition: right .35s var(--ease); }
.nav ul a:hover::after, .nav ul a[aria-current]::after { right: 0; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; margin-right: -8px; cursor: pointer; color: var(--ink); }
.menu-btn span { display: block; width: 22px; height: 1.5px; background: currentColor; margin: 5px 0; transition: transform .3s var(--ease), opacity .3s; }
.nav.on-dark:not(.scrolled) { color: var(--night-text); }
.nav.on-dark:not(.scrolled) ul a { color: var(--night-text); }
.nav.on-dark:not(.scrolled) .menu-btn { color: var(--night-text); }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav ul {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 20px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .3s, transform .3s var(--ease);
  }
  .nav ul a { display: block; padding: 14px 0; font-size: 13px; color: var(--ink) !important; border-bottom: 1px solid var(--rule); }
  .nav.open ul { opacity: 1; transform: none; pointer-events: auto; }
  .nav.open { background: var(--paper); color: var(--ink) !important; }
  .nav.open .menu-btn { color: var(--ink) !important; }
  .nav.open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.open .menu-btn span:nth-child(2) { opacity: 0; }
  .nav.open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ---------- hero: one full screen; the violin rests on the bottom edge ---------- */
.hero { --name-top: clamp(132px, 24svh, 260px); --name-gap: 48px;
  position: relative; min-height: 100vh; min-height: 100svh; padding-top: 64px; background: var(--paper); overflow-x: clip; }
/* the name holds still (sticky) until the hero's bottom edge, where the next section begins, comes --name-gap below it;
   then it rides up with that section. Pure CSS, so it scrolls on the compositor without jitter. */
.hero-body { display: grid; position: sticky; z-index: 2; top: var(--name-top); margin-top: calc(var(--name-top) - 64px); margin-bottom: var(--name-gap); } /* z-index: the violin slides up underneath the name, not over it */
.intro { animation: rise 1.1s var(--ease) both; }
.intro-lede em { color: var(--rubric); }
.intro-lede { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 3.7vw, 62px); line-height: 1.04; letter-spacing: -.02em; margin: 0; max-width: 13em; text-wrap: balance; }
.intro-sub { margin: clamp(16px, 2.4vh, 28px) 0 0; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; color: var(--ink-2); max-width: 32em; }
.hero .violin {
  /* the photo (1500×458) with its table extended 320px each side so it can fade away.
     Sized so the violin itself spans the window; the faded extensions spill off-screen. */
  /* rests on the hero's bottom edge and scrolls up with the page; main.js fades it out as it nears the name */
  position: absolute; z-index: 1; bottom: 0; left: 50%; translate: -50% 0; max-width: none; height: auto; display: block;
  /* …but never taller than 56% of the screen, or than the room left under the menu and the name */
  width: min(calc(100vw * 2140 / 1500), calc(56vh * 2140 / 458), calc((100svh - 400px) * 2140 / 458));
  /* the photo melts into the page: soft top edge, and the table fades out at both sides */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%), linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%), linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-composite: intersect;
  will-change: opacity;
  transition: opacity .18s linear; /* main.js sets opacity from the scroll position; this just smooths the steps */
  animation: violin-in 1.8s var(--ease) backwards; /* fades in with filter, not opacity, so the scroll fade (opacity) works even mid-animation */
}
@keyframes rise { from { transform: translateY(30%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slidein { from { transform: translateX(3%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes violin-in { from { transform: translateX(3%); filter: opacity(0); } to { transform: none; filter: none; } }
@media (max-width: 700px) {
  .hero { --name-top: 30svh; }
  .intro-lede { font-size: 31px; }
  .intro-sub { display: none; } /* not enough height on a phone; the headline carries it */
  /* on a phone, show the violin larger and let the scroll run off the left edge */
  .hero .violin { width: 100%; height: clamp(140px, 24svh, 230px); object-fit: cover; object-position: 69% 100%;
    /* the screen edge crops the photo here, so only the top needs softening */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%); }
}

/* ---------- sections ---------- */
section { position: relative; }
/* the sections after the hero cover the name as they pass it */
.hero ~ section, main ~ footer { z-index: 1; background: var(--paper); }
/* sections are as tall as their content, with even breathing room between them */
.sec { padding: clamp(40px, 4vw, 64px) 0; }
#projects { padding-top: clamp(64px, 7vw, 104px); }
#projects > .wrap > .sec-head { margin-bottom: clamp(28px, 3.5vw, 48px); } /* same space under the heading as the other sections */
.sec-head { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: clamp(32px, 5vw, 64px); }
.sec-head h2 { font-size: clamp(40px, 5vw, 72px); }
.sec-head h2.label { font-size: 11.5px; }
.sec-head h2 em { color: var(--rubric); font-weight: 400; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* heading kept for screen readers and search engines, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* about */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { align-self: start; }
.portrait figure { margin: 0; position: relative; }
.portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(.15) contrast(1.02); }
.portrait figcaption { margin-top: 12px; display: flex; justify-content: space-between; }
.bio p { margin: 0 0 1.2em; max-width: 36em; }
.bio .lede { font-size: 1em; line-height: inherit; color: var(--ink-2); } /* same size as the rest of the bio; only the drop cap marks the start */
.bio .lede::first-letter { /* see .prose .lede: one shared, quieter two-line initial */
  font-family: var(--display); float: left; font-size: 3.05em; line-height: .84; padding: .05em .08em 0 0; color: var(--rubric); font-weight: 500;
}
.bio p:not(.lede) { color: var(--ink-2); }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 460px; }
}

/* projects */
.dark { background: var(--night); color: var(--night-text); }
.dark .label { color: var(--night-muted); }
.dark .rule, .dark hr { border-color: #2e2820; }
.project { padding: clamp(56px, 8vw, 110px) 0; border-top: 1px solid var(--rule); }
.project:first-of-type { border-top: 0; }
.p-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.p-num { font-family: var(--display); font-style: italic; color: var(--rubric); font-size: clamp(22px, 2vw, 28px); }
.project h3 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.2vw, 60px); line-height: .98; letter-spacing: -.02em; margin: 10px 0 22px; }
.project h3 em { font-weight: 400; }
.project p { color: var(--ink-2); max-width: 34em; }
.timeline { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 5.5em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: .95em; line-height: 1.4; }
.timeline .yr { font-family: var(--mono); font-size: 12px; color: var(--rubric); padding-top: 4px; letter-spacing: .06em; }
.timeline small { display: block; color: var(--muted); font-size: .85em; margin-top: 2px; }
@media (max-width: 860px) { .p-grid { grid-template-columns: 1fr; } }

/* Ensemble Marais page: full recording sits wide under the intro */
.full-rec { margin-top: clamp(48px, 6vw, 80px); }
.full-rec > p { margin: 0 0 16px; font-family: var(--display); font-style: italic; font-size: 1.4em; }

/* Maelzel page */
.track { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); }
.track .label b { color: var(--rubric); margin-right: 6px; }
.track p { margin-top: 12px; }
.tempo-mark { aspect-ratio: 4 / 5; text-align: center; }
.tempo-mark span { font-size: clamp(48px, 5.6vw, 88px); line-height: 1.05; }
.tempo-fig figcaption { display: block; margin-top: 12px; line-height: 1.6; }
@media (max-width: 860px) { .tempo-mark { aspect-ratio: 16 / 9; } }

/* publication citation (research page) */
.abstract { margin-top: clamp(32px, 4vw, 48px); }
.abstract p { margin-top: 12px; color: var(--ink-2); }
.pub { margin-top: clamp(40px, 5vw, 64px); padding-top: 20px; border-top: 1px solid var(--ink); }
.pub-cite { font-size: 1.05em; line-height: 1.55; margin: 12px 0 22px; max-width: 34em; }
.pub-cite cite { font-style: italic; }

/* marks copy written by Claude (AI), pending Andrew's review */
.ai-gen { font-family: var(--mono); font-style: normal; font-weight: 500; font-size: max(11px, .42em); letter-spacing: .06em; color: var(--rubric); vertical-align: .15em; white-space: nowrap; }
.prose .lede.no-drop::first-letter { float: none; font: inherit; font-size: inherit; line-height: inherit; padding: 0; color: inherit; }

/* project cards (home) */
/* two wide cards per row on laptops and smaller desktops; one per row on phones */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); align-items: stretch; }
@media (max-width: 700px) { .cards { grid-template-columns: 1fr; } }
/* a card whose "image" is set type: a metronome marking */
.card-type { display: flex; align-items: center; justify-content: center; background: var(--night); color: var(--gilt); }
.card-type span { font-family: var(--display); font-style: italic; font-size: clamp(40px, 4vw, 64px); letter-spacing: -.01em; transition: transform 1.2s var(--ease); }
a.card:hover .card-type span { transform: scale(1.06); }
.card { display: flex; flex-direction: column; background: var(--paper-2); color: inherit; text-decoration: none; overflow: hidden; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--night); }
.card-media > img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transition: transform 1.2s var(--ease); }
a.card:hover .card-media > img { transform: scale(1.04); }
.card-body { padding: clamp(18px, 2vw, 28px) clamp(20px, 2.2vw, 32px) clamp(22px, 2.4vw, 32px); }
.card .p-num { font-size: 1.5em; margin-right: 6px; }
.card h3 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 2.3vw, 36px); line-height: 1.02; letter-spacing: -.01em; margin: 8px 0 12px; transition: color .3s; }
.card h3 em { color: var(--rubric); font-weight: 400; }
a.card:hover h3 { color: var(--rubric); }
.card p { color: var(--ink-2); font-size: .95em; line-height: 1.5; margin: 0 0 1em; }
.card .timeline { margin-top: 8px; }
.card .timeline li { grid-template-columns: 3.2em 1fr; gap: 10px; padding: 10px 0; font-size: .85em; }
.card-sub { display: block; margin-top: 18px; }
.card-people { display: flex; gap: 6px 20px; flex-wrap: wrap; margin: 4px 0 16px; font-family: var(--display); font-size: 1em; line-height: 1.2; }
.card-people .label { display: block; margin-top: 3px; }
.card-more { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--rubric); }
.card-more span { display: inline-block; transition: transform .35s var(--ease); }
a.card:hover .card-more span { transform: translateX(5px); }
/* track list: picks which recording plays in the card */
.tracks { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.tracks button { display: grid; grid-template-columns: 16px 1fr; column-gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 0; font: inherit; font-size: .85em; line-height: 1.35; color: var(--ink-2); cursor: pointer; }
.tracks button::before { content: "▶"; grid-row: span 2; font-size: 10px; color: var(--muted); padding-top: 5px; }
.tracks button > span { grid-column: 2; }
.tracks button strong { font-family: var(--display); font-size: 1.2em; font-weight: 500; color: var(--ink); }
.tracks button:hover strong, .tracks button[aria-pressed="true"] strong { color: var(--rubric); }
.tracks button[aria-pressed="true"]::before { color: var(--rubric); }

/* feature project (dark band) */
.feature { position: relative; overflow: hidden; }
.feature-img { position: absolute; inset: 0; }
.feature-img img { width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; opacity: .55; }
.feature-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--night) 0%, rgba(18,15,12,.92) 38%, rgba(18,15,12,.35) 75%, rgba(18,15,12,.6) 100%); }
.feature .wrap { position: relative; padding-top: clamp(90px, 12vw, 170px); padding-bottom: clamp(90px, 12vw, 170px); }
.feature h1, .feature h3 { font-family: var(--display); font-weight: 500; font-size: clamp(44px, 6.4vw, 100px); line-height: .9; letter-spacing: -.03em; margin: 18px 0 26px; max-width: 9.5em; }
.feature h1 em, .feature h3 em { color: var(--gilt); font-weight: 400; }
.feature p { color: #cfc5b4; max-width: 32em; }
.feature .p-num { color: var(--gilt); }
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  padding: 16px 22px; border: 1px solid currentColor; margin-top: 18px;
  transition: background .3s, color .3s, gap .3s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); gap: 22px; }
.dark .btn:hover { background: var(--night-text); color: var(--night); }
.btn.solid { background: var(--rubric); border-color: var(--rubric); color: #fff; }
.btn.solid:hover { background: var(--rubric-ink); border-color: var(--rubric-ink); color: #fff; }
.feature-people { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 36px; }
.feature-people div { font-family: var(--display); font-size: 1.3em; line-height: 1.2; }
.feature-people .label { display: block; margin-top: 4px; }

/* video facade */
.video { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; cursor: pointer; border: 0; padding: 0; width: 100%; display: block; color: #fff; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .4s, transform 1.2s var(--ease); }
.video:hover img { opacity: 1; transform: scale(1.03); }
.video .play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: rgba(253,252,250,.92); display: grid; place-items: center; transition: transform .4s var(--ease), background .3s;
}
.video .play::before { content: ""; border-left: 18px solid var(--ink); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.video:hover .play { transform: scale(1.1); background: var(--rubric); }
.video:hover .play::before { border-left-color: #fff; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vcap { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0 0; font-size: .92em; line-height: 1.35; }
.vcap strong { font-family: var(--display); font-size: 1.25em; font-weight: 500; }
.vids { display: grid; gap: 36px; }
.vids.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .vids.two { grid-template-columns: 1fr; } }

/* writings */
.post-card { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 96px); align-items: center; text-decoration: none; }
.post-card .ph { overflow: hidden; background: var(--paper-2); isolation: isolate; }
.post-card .ph img { width: 100%; aspect-ratio: 1/1; object-fit: cover; transition: transform 1.4s var(--ease); mix-blend-mode: multiply; }
.post-card:hover .ph img { transform: scale(1.04) rotate(-.5deg); }
.post-card h3 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.2vw, 60px); line-height: .96; letter-spacing: -.02em; margin: 16px 0 20px; }
.post-card:hover h3 { color: var(--rubric); }
.post-card p { color: var(--ink-2); }
.formula {
  font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.4vw, 32px);
  border-left: 2px solid var(--rubric); padding: 4px 0 4px 18px; margin: 24px 0; color: var(--ink);
}
.formula .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .78em; line-height: 1.1; margin: 0 .2em; }
.formula .frac span:first-child { border-bottom: 1px solid currentColor; padding: 0 .2em; }
@media (max-width: 860px) { .post-card { grid-template-columns: 1fr; } }
.all-link { margin-top: clamp(32px, 5vw, 56px); padding-top: 18px; border-top: 1px solid var(--ink); text-align: right; }
.all-link a { color: var(--rubric); text-decoration: none; }
.all-link a span { display: inline-block; transition: transform .35s var(--ease); }
.all-link a:hover span { transform: translateX(5px); }

/* writings list (blog index) */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-row { display: grid; grid-template-columns: 9em 1fr clamp(160px, 18vw, 240px); gap: clamp(16px, 3vw, 48px); align-items: start; padding: clamp(22px, 3vw, 36px) 0; text-decoration: none; }
.pr-date { padding-top: .7em; }
.pr-main { display: flex; flex-direction: column; gap: 10px; }
.pr-title { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3vw, 44px); line-height: 1.02; letter-spacing: -.015em; transition: color .3s; }
.pr-sum { color: var(--ink-2); max-width: 38em; }
.pr-img { overflow: hidden; background: var(--paper-2); aspect-ratio: 1/1; }
.pr-img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform 1.2s var(--ease); }
.post-row:hover .pr-title { color: var(--rubric); }
.post-row:hover .pr-img img { transform: scale(1.05); }
@media (max-width: 700px) {
  .post-row { grid-template-columns: 1fr 96px; }
  .pr-date { grid-column: 1 / -1; padding: 0; }
  .pr-sum { font-size: .92em; }
}

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(10px, 1.6vw, 22px); }
.gallery figure { margin: 0; overflow: hidden; position: relative; background: var(--paper-2); isolation: isolate; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), filter .6s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; left: 14px; bottom: 12px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.5); opacity: 0; transform: translateY(6px); transition: .4s var(--ease); }
.gallery figure:hover figcaption { opacity: 1; transform: none; }
.g1 { grid-column: 1 / span 7; aspect-ratio: 3/2; }
.g2 { grid-column: 8 / span 5; grid-row: span 2; }
.g3 { grid-column: 3 / span 5; aspect-ratio: 1/1; }
.g4 { grid-column: 1 / span 2; align-self: end; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .g1 { grid-column: 1 / -1; }
  .g2 { grid-column: 1; grid-row: auto; aspect-ratio: 3/4; }
  .g3 { grid-column: 2; aspect-ratio: 3/4; }
  .g4 { display: none; }
}

/* contact */
.contact { text-align: left; }
.contact .contact-head { font-size: clamp(40px, 5vw, 76px); line-height: .95; letter-spacing: -.025em; }
.contact .contact-head a { text-decoration: none; display: inline-block; transition: color .3s; }
.contact .contact-head a:hover { color: var(--rubric); }
.contact .contact-head .arrow { display: inline-block; font-family: var(--body); font-size: .42em; vertical-align: .55em; font-weight: 300; font-style: normal; transition: transform .5s var(--ease); color: var(--rubric); }
.contact .contact-head a:hover .arrow { transform: translate(.08em, -.08em); }
.contact-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ink); }
.contact-row p { margin: 0; max-width: 30em; color: var(--ink-2); }
.mail-box { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
/* contact email: the address as plain text (one click selects all of it), with a copy icon beside it */
.mail-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.mail-addr { font-family: var(--display); font-size: clamp(19px, 1.5vw, 22px); font-weight: 500; line-height: 1.2; letter-spacing: .005em; color: var(--ink); user-select: all; }
.copy-btn { background: none; border: 0; padding: 6px; margin: -6px; cursor: pointer; color: var(--muted); line-height: 0; align-self: center; transition: color .2s; }
.copy-btn:hover { color: var(--rubric); }
.copy-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn .ico-done, .copy-btn.copied .ico-copy { display: none; }
.copy-btn.copied .ico-done { display: block; }
.copy-btn.copied { color: var(--rubric); }
@media (max-width: 700px) { .mail-box { align-items: flex-start; } }

footer { padding: 28px 0 36px; border-top: 1px solid var(--rule); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--rubric); }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- inner pages ---------- */
.page-hero { padding: clamp(96px, 9vw, 136px) 0 clamp(36px, 4.5vw, 64px); }
.page-hero h1 { font-size: clamp(44px, 6.4vw, 104px); line-height: .92; letter-spacing: -.025em; }
.page-hero h1 em { color: var(--rubric); font-weight: 400; }
.page-hero .kicker { font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.6vw, 36px); line-height: 1.2; margin: 26px 0 0; color: var(--ink-2); max-width: 24em; }
.back { display: inline-flex; gap: 8px; text-decoration: none; margin-bottom: 20px; }
.back:hover { color: var(--rubric); }

.prose { max-width: 38em; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4vw, 56px); line-height: 1; letter-spacing: -.015em; margin: 2em 0 .6em; }
/* opening paragraph: same size as the rest; a modest red initial two lines deep marks the start */
.prose .lede { font-size: 1em; line-height: inherit; }
.prose .lede::first-letter { font-family: var(--display); float: left; font-size: 3.05em; line-height: .84; padding: .05em .08em 0 0; color: var(--rubric); font-weight: 500; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Roman sessions share the video-list styling (Ensemble Marais): see .vid-row / .vid-text below */

.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 40px); }
.team figure { margin: 0; }
.team img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .6s; }
.team figure:hover img { filter: grayscale(0); }
.team figcaption { margin-top: 14px; }
.team figcaption strong { display: block; font-family: var(--display); font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; line-height: 1.1; }
@media (max-width: 640px) { .team { grid-template-columns: 1fr 1fr; } .team figure:first-child { grid-column: 1 / -1; } .team figure:first-child img { aspect-ratio: 4/3; object-position: 50% 25%; } }

.diagram { isolation: isolate; background: #fff; padding: clamp(16px, 3vw, 40px); border: 1px solid var(--rule); }
.diagram img { mix-blend-mode: multiply; margin: 0 auto; }

.math-photo { margin: 2em 0; }
.math-photo img { width: 100%; }
.math-photo figcaption { margin-top: 10px; }


/* ==========================================================
   Design pass (Nov 2026): shared page parts, media, spacing
   ========================================================== */

/* page heads: back link, small label, title — same order on every inner page */
.page-hero .back, .feature-hero .back { display: flex; width: fit-content; margin-bottom: 18px; }
.eyebrow { display: block; }
.page-hero h1 { margin-top: 14px; }
.page-hero-tall { min-height: 70vh; }
.page-body { padding-bottom: clamp(48px, 6vw, 88px); }

/* Roman: full-screen dark opener */
.feature-hero .wrap { width: 100%; padding-top: clamp(110px, 11vw, 160px); padding-bottom: clamp(56px, 6vw, 96px); } /* natural height: just room for the nav above and some air below */
.prose.intro { margin: 0 auto; } /* Roman intro: one centred column */
/* Roman: the same room above the intro (from the header) as below it (to The Sessions heading) */
.sec.intro-sec { padding: clamp(56px, 6vw, 96px) 0 0; }
.intro-sec .prose > :last-child { margin-bottom: 0; }
.intro-sec + .sec { padding-top: clamp(56px, 6vw, 96px); }
.feature-hero .back:hover { color: var(--gilt); }
.feature-hero h1 { font-size: clamp(56px, 10vw, 168px); max-width: 8em; margin-top: 14px; }
.feature-kicker { font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.2; margin: 0; }
.feature .feature-kicker { color: var(--night-text); }
.feature-kicker em { color: var(--gilt); }

/* shared section variants */
.tint { background: var(--paper-2); }
.sec.flush-top { padding-top: 0; }
.sec.sessions { padding-bottom: clamp(32px, 4.5vw, 64px); }
.sec-head:has(> .label:only-child), .sec-head:has(> h2.label) { margin-bottom: clamp(20px, 2.5vw, 32px); }
.sub-block { margin-top: clamp(48px, 6vw, 80px); }
.split.center { align-items: center; }
.prose .btn { margin-top: 8px; }
.signoff { margin-top: 3em; }
.contact-head { margin-top: 0; }

/* a section label inside prose stays a label (it was picking up the big prose h2 size) */
.prose h2.label { font-family: var(--mono); font-size: 11.5px; font-weight: 400; line-height: 1.6; letter-spacing: .14em; margin: 0; }

/* media beside long text scrolls normally with the page (no sticky) */
figure.media-col { margin: 0; }

/* photos and figures: one treatment everywhere */
.split figure img, .math-photo img { width: 100%; }
.media-col figcaption, .tempo-fig figcaption { margin-top: 12px; }

/* a session whose video has no notes plays wide, as the opening film of the sessions */
.session.solo { grid-template-columns: 1fr; padding-top: 0; border-top: 0; }
.session:last-child { padding-bottom: 0; }

/* video captions line up with the video edge, a touch smaller than body text */
.vcap { color: var(--ink-2); }
.vcap strong { color: var(--ink); }

/* previous / next project, at the foot of every project page */
.pager { border-top: 1px solid var(--rule); }
.pager .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.pager-link { display: flex; flex-direction: column; gap: 10px; padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px) clamp(32px, 4.5vw, 56px) 0; text-decoration: none; }
.pager-link.next { text-align: right; align-items: flex-end; padding-right: 0; padding-left: clamp(16px, 3vw, 40px); border-left: 1px solid var(--rule); }
.pager-title { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.01em; transition: color .3s; }
.pager-title em { color: var(--rubric); font-weight: 400; }
.pager-link:hover .pager-title { color: var(--rubric); }
@media (max-width: 600px) {
  .pager .wrap { grid-template-columns: 1fr; }
  .pager-link.next { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
}

/* short pages (writings list, 404): the footer sits at the bottom of the screen, not mid-page */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body > main { flex: 1 0 auto; }

/* home hero: name and roles, centred; the menu name appears once the page scrolls */
.home .nav .brand { transition: opacity .45s var(--ease), transform .45s var(--ease); }
.home .nav:not(.scrolled):not(.open) .brand { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.hero .hero-body { grid-template-columns: minmax(0, 1fr); justify-items: center; }
/* name and three roles, centered above the violin */
.intro-name { text-align: center; }
.intro-title { font-family: var(--display); font-weight: 400; font-size: clamp(52px, 6.4vw, 104px); line-height: .98; letter-spacing: -.02em; margin: 0; }
.intro-title em { display: block; font-size: .42em; letter-spacing: 0; color: var(--rubric); margin-top: .35em; }
.intro-roles { list-style: none; padding: 0; margin: clamp(22px, 3vh, 36px) 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; }
.intro-roles li { display: inline-flex; align-items: center; }
.intro-roles li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--rubric); margin: 0 16px; }
@media (max-width: 700px) {
  .intro-title { font-size: 46px; }
  .intro-roles { flex-direction: column; align-items: center; gap: 8px; }
  .intro-roles li + li::before { display: none; }
}



/* writing (article) layout: title, then the image large and centred, then the text in one centred column */
.article-head .wrap { max-width: calc(38em + 2 * var(--gutter)); } /* title lines up with the text column below */
.article-head h1 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.08; letter-spacing: -.015em; } /* article titles are long sentences: smaller, with room between lines so descenders don't touch */
.article-figure { margin: 0 auto clamp(40px, 5vw, 72px); max-width: min(100%, 860px); }
.article-figure img { width: 100%; }
.article .prose { margin: 0 auto; }

/* home section headers: a serif heading with some weight, instead of the small mono label */
:is(.home, .framed-heads) main > section > .wrap > .sec-head h2.label {
  font-family: var(--display); font-size: clamp(30px, 2.8vw, 42px); font-weight: 500; line-height: 1;
  letter-spacing: .005em; text-transform: none; color: var(--ink);
  display: flex; align-items: center; gap: clamp(18px, 2vw, 28px);
}
:is(.home, .framed-heads) main > section > .wrap > .sec-head { margin-bottom: clamp(36px, 4.5vw, 64px); justify-items: center; }
/* the rules either side of each heading: a hairline with one small end tick on the outer end,
   like a dimension line on a drawing; a quiet hint, nothing more (the left one is mirrored) */
:is(.home, .framed-heads) main > section > .wrap > .sec-head h2.label::before,
:is(.home, .framed-heads) main > section > .wrap > .sec-head h2.label::after {
  content: ""; flex: none; width: clamp(40px, 5vw, 72px); height: 7px; margin-top: .12em; color: var(--ink); opacity: .32;
  background:
    linear-gradient(currentColor, currentColor) 0 50% / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px 100% no-repeat;
}
:is(.home, .framed-heads) main > section > .wrap > .sec-head h2.label::before { transform: scaleX(-1); }
/* the framed heading already opens the section, so the list needs no top rule; and no closing rule under
   the last post (rules still separate posts once there are several) */
#writings .post-list { border-top: 0; }
#writings .post-list li:last-child { border-bottom: 0; }
/* home contact: just the invitation and the email, straight under the framed heading (no extra rule) */
.home .contact .contact-row { margin-top: 0; padding-top: 0; border-top: 0; }
/* home: sections read as distinct bands — Writings and Contact sit on the soft tint (the project cards' colour),
   alternating with the white ones, and every section gets the same generous room */
.home main > section { padding: clamp(56px, 6vw, 96px) 0; }
.home #writings, .home #contact { background: var(--paper-2); }

/* video list (Ensemble Marais): one recording per row, video left and its description right; stacked on phones */
.vid-list { list-style: none; margin: 0; padding: 0; }
.vid-row, .session { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(32px, 4vw, 56px) 0; border-top: 1px solid var(--rule); }
.vid-row:first-child { border-top: 0; padding-top: 0; }
.vid-text .label { color: var(--rubric); }
.vid-text h2, .session h3 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.1; letter-spacing: -.01em; margin: 10px 0 0; }
.vid-text h2 em, .session h3 em { color: var(--ink-2); font-weight: 400; }
.vid-text p, .session p { margin: 16px 0 0; color: var(--ink-2); max-width: 32em; }
@media (max-width: 760px) { .vid-row, .session { grid-template-columns: 1fr; gap: 18px; } }
.session h3 { margin-top: 0; }
.session .with { font-family: var(--display); font-style: italic; font-size: 1.15em; color: var(--ink); margin-top: 12px; }

/* the players, under a project title: name in the serif, instrument as a small label beneath */
.players { list-style: none; margin: clamp(24px, 3vw, 36px) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px clamp(28px, 4vw, 56px); font-family: var(--display); font-size: clamp(22px, 2vw, 28px); font-weight: 500; line-height: 1.15; }
.players .label { display: block; margin-top: 6px; color: var(--muted); }

/* Maelzel: screenshots of the research charts, full width, one under another */
.charts .wrap { display: grid; gap: clamp(40px, 5vw, 72px); justify-items: start; }
.chart { margin: 0; width: 100%; }
.chart img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); background: #f5f2ec; }
.chart figcaption { margin-top: 14px; color: var(--muted); }

/* text beside a wide chart: the chart gets the larger share so its labels stay readable */
.chart-split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.chart-split .prose .btn { margin-top: 8px; }
@media (max-width: 860px) { .chart-split { grid-template-columns: 1fr; } }

/* a status note such as "Work in progress": italic serif in the rubric red */
.wip { font-family: var(--display); font-style: italic; font-size: 1.2em; line-height: 1.2; color: var(--rubric); }
/* a title with a short note beside it (Maelzel: "Work in progress"), sitting on the title's baseline; wraps under it on narrow screens */
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: clamp(16px, 2vw, 28px); row-gap: 6px; }
.title-row .wip { margin: 0; font-size: clamp(20px, 1.9vw, 28px); }

/* scanned scores (black ink on pure white) sit on a warm paper tone instead of glaring white:
   the white is multiplied into the paper colour, the ink is warmed toward sepia, and a faint
   inner shadow gives the edge of a page. Use: <div class="card-media score"><img …></div> */
/* weathering, all layered under the multiplied scan: a fine paper grain (SVG noise), a few soft
   foxing stains, a warm light falling off toward the corners, and darkened, slightly scorched edges */
.card-media.score {
  background-color: #f1eadb;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 18% 22% at 82% 24%, rgba(150, 105, 50, .16), transparent 70%),
    radial-gradient(ellipse 12% 16% at 14% 78%, rgba(150, 105, 50, .13), transparent 70%),
    radial-gradient(ellipse 30% 26% at 58% 88%, rgba(140, 100, 55, .10), transparent 75%),
    radial-gradient(ellipse 75% 70% at 45% 40%, rgba(255, 252, 244, .7), transparent 75%),
    linear-gradient(160deg, rgba(120, 85, 40, .07), transparent 40%, transparent 65%, rgba(110, 75, 35, .11));
  box-shadow: inset 0 0 26px rgba(95, 65, 30, .22), inset 0 0 90px rgba(120, 90, 50, .12);
}
.card-media.score > img { mix-blend-mode: multiply; filter: sepia(.45) contrast(.9) brightness(1.08); opacity: .94; }
