@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #fafaf8;
  --surface: #f0efeb;
  --text: #161616;
  --text-muted: #6b6b67;
  --border: #e3e2dd;
  --accent: #3046c5;

  /* Type scale: fluid modular scale (Utopia method).
     360px viewport: base 16px, ratio 1.2 (minor third)
     1240px viewport: base 17px, ratio 1.25 (major third)
     Sizes interpolate linearly between those widths via clamp(). */
  --step--2: clamp(0.75rem, 0.7372rem + 0.0568vw, 0.7813rem);   /* 12 → 12.5px */
  --step--1: clamp(0.8333rem, 0.8263rem + 0.0307vw, 0.85rem);   /* 13.3 → 13.6px */
  --step-0:  clamp(1rem, 0.9744rem + 0.1136vw, 1.0625rem);      /* 16 → 17px */
  --step-1:  clamp(1.2rem, 1.1476rem + 0.233vw, 1.3281rem);     /* 19.2 → 21.3px */
  --step-2:  clamp(1.44rem, 1.35rem + 0.4vw, 1.66rem);          /* 23 → 26.6px */
  --step-3:  clamp(1.728rem, 1.5862rem + 0.6307vw, 2.075rem);   /* 27.6 → 33.2px */
  --step-4:  clamp(2.0736rem, 1.8612rem + 0.9455vw, 2.5938rem); /* 33.2 → 41.5px */

  /* Type roles: components use these, never raw steps or px values. */
  --text-label: var(--step--2);   /* uppercase section labels */
  --text-meta:  var(--step--1);   /* dates, performers, captions, footer */
  --text-body:  var(--step-0);    /* running text */
  --text-nav:   var(--step-0);    /* header nav: same size as body, never smaller */
  --text-lead:  var(--step-1);    /* intro paragraph */
  --text-title: var(--step-2);    /* page and work titles (h1) */
  --text-brand: var(--step-3);    /* site name in header: largest text on every page */

  --lh-body: 1.7;
  --lh-tight: 1.15;
  --lh-brand: 1.1;
  --tracking-tight: -0.015em;
  --tracking-brand: -0.02em;
  --measure: 65ch;

  /* Space scale: fluid, derived from type step 0 (16→17px between 360 and 1240px), Utopia method.
     Multipliers: 3xs .25 · 2xs .5 · xs .75 · s 1 · m 1.5 · l 2 · xl 3 · 2xl 4 · 3xl 6 · 4xl 8 */
  --space-3xs: clamp(0.25rem, 0.2436rem + 0.0284vw, 0.2656rem);  /* 4 → 4.25px */
  --space-2xs: clamp(0.5rem, 0.4872rem + 0.0568vw, 0.5313rem);   /* 8 → 8.5px */
  --space-xs:  clamp(0.75rem, 0.7308rem + 0.0852vw, 0.7969rem);  /* 12 → 12.75px */
  --space-s:   clamp(1rem, 0.9744rem + 0.1136vw, 1.0625rem);     /* 16 → 17px */
  --space-m:   clamp(1.5rem, 1.4616rem + 0.1705vw, 1.5938rem);   /* 24 → 25.5px */
  --space-l:   clamp(2rem, 1.9489rem + 0.2273vw, 2.125rem);      /* 32 → 34px */
  --space-xl:  clamp(3rem, 2.9233rem + 0.3409vw, 3.1875rem);     /* 48 → 51px */
  --space-2xl: clamp(4rem, 3.8977rem + 0.4545vw, 4.25rem);       /* 64 → 68px */
  --space-3xl: clamp(6rem, 5.8466rem + 0.6818vw, 6.375rem);      /* 96 → 102px */
  --space-4xl: clamp(8rem, 7.7955rem + 0.9091vw, 8.5rem);        /* 128 → 136px */
  /* One-up pairs: grow more strongly with viewport width (for layout-level gaps) */
  --space-s-m:     clamp(1rem, 0.7571rem + 1.0795vw, 1.5938rem); /* 16 → 25.5px */
  --space-m-l:     clamp(1.5rem, 1.2443rem + 1.1364vw, 2.125rem); /* 24 → 34px */
  --space-l-xl:    clamp(2rem, 1.5142rem + 2.1591vw, 3.1875rem); /* 32 → 51px */
  --space-xl-2xl:  clamp(3rem, 2.4886rem + 2.2727vw, 4.25rem);   /* 48 → 68px */
  --space-2xl-3xl: clamp(4rem, 3.0284rem + 4.3182vw, 6.375rem);  /* 64 → 102px */
  --space-3xl-4xl: clamp(6rem, 4.9773rem + 4.5455vw, 8.5rem);    /* 96 → 136px */

  /* Semantic spacing (proximity): related things closer, unrelated further apart.
     Rule: space BEFORE a heading >= 2x the space AFTER it.
     Components use these tokens; use raw steps only for small component internals. */
  --space-related:     var(--space-2xs);     /* lines within one item: title→meta, date→time */
  --space-label:       var(--space-xs);      /* small label → its content */
  --space-stack:       var(--space-s);       /* paragraphs, list items */
  --space-heading:     var(--space-s-m);     /* page/work title → the content it introduces */
  --space-component:   var(--space-l-xl);    /* between blocks inside a section */
  --space-subsection:  var(--space-xl-2xl);  /* before a subheading inside a page */
  --space-columns:     var(--space-xl-2xl);  /* gap between major columns */
  --space-gutter:      var(--space-m-l);     /* grid gutters (work cards) */
  --space-section:     var(--space-2xl-3xl); /* between sections; hero → page title */
  --space-page-top:    var(--space-xl-2xl);  /* header → first content */
  --space-page-bottom: var(--space-3xl-4xl); /* last content → footer */

  --radius: 2px;
  --max-width: 1200px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #1c1c1a;
    --text: #ebebe8;
    --text-muted: #9b9b96;
    --border: #2d2d2a;
    --accent: #9aa8ff;
  }
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; } /* reserve scrollbar space so short pages (Works) do not shift */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3 {
  font-weight: 475;
  line-height: var(--lh-tight);
  margin: 0;
}
h1, h2.h-lg { letter-spacing: var(--tracking-tight); }

p { margin: 0 0 var(--space-stack); }
ul, ol { margin: 0; padding: 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: .2em;
  transition: color .2s ease, text-decoration-color .2s ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

time, .tnum { font-variant-numeric: tabular-nums; }

.muted { color: var(--text-muted); }

.label {
  font-size: var(--text-label);
  font-weight: 450;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  line-height: var(--lh-body);
}

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

/* Header / nav */
.site-header { padding-block: var(--space-l); }
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-l);
}
.site-name {
  font-size: var(--text-brand);
  font-weight: 500;
  line-height: var(--lh-brand);
  letter-spacing: var(--tracking-brand);
  text-decoration: none;
}
.nav { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); font-size: var(--text-nav); }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.site-header__end { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-m); }

/* Language switcher */
.lang-switch { display: flex; gap: var(--space-2xs); align-items: baseline; font-size: var(--text-meta); color: var(--text-muted); }
.lang-switch a { text-decoration: none; }
.lang-switch [aria-current="true"] { color: var(--text); }
.site-header__end .lang-switch { margin-left: var(--space-m); }

/* Root redirect page and 404 */
.landing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-s); text-align: center; padding: var(--space-xl) var(--gutter); }
.landing__name { font-size: var(--text-brand); font-weight: 500; line-height: var(--lh-brand); letter-spacing: var(--tracking-brand); margin: 0; }
.landing__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); margin: 0; }

/* Main */
.main { flex: 1; padding-top: var(--space-page-top); padding-bottom: var(--space-page-bottom); }
.page-title { font-size: var(--text-title); letter-spacing: var(--tracking-tight); margin-bottom: var(--space-heading); }
.section { margin-top: var(--space-section); }
.section--first { margin-top: 0; }
.section > .label { margin-bottom: var(--space-label); }
.sublabel { font-size: var(--text-meta); font-weight: 450; color: var(--text-muted); margin: var(--space-m) 0 var(--space-xs); }
.more { margin-top: var(--space-component); font-size: var(--text-meta); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl);
  font-size: var(--text-meta);
  color: var(--text-muted);
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-xl); align-items: baseline; }
.site-footer__inner .social { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); }
.site-footer__meta { margin: 0 0 0 auto; display: flex; gap: var(--space-m); }

/* Prose */
.prose { max-width: var(--measure); }
.prose h2 {
  font-size: var(--text-label);
  font-weight: 450;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: var(--space-subsection) 0 var(--space-label);
}
.prose > :first-child { margin-top: 0; }
.info .prose > p:first-of-type { font-size: var(--text-lead); line-height: 1.6; }
.prose ul { padding-left: 1.2em; margin-bottom: var(--space-stack); }

/* Hero */
.hero { margin: 0 0 var(--space-section); }
.hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 55%;
  background: var(--surface);
  border-radius: var(--radius);
}
@media (min-width: 760px) { .hero img { aspect-ratio: 16 / 9; } }
.hero__caption { margin-top: var(--space-xs); font-size: var(--text-meta); color: var(--text-muted); }

/* Info */
.info { display: grid; gap: var(--space-columns); }
.info__portrait {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius);
}
@media (min-width: 900px) {
  .info { grid-template-columns: minmax(0, 1fr) 240px; align-items: start; }
  .info__portrait { grid-column: 2; grid-row: 1; margin-top: calc(var(--text-lead) * 0.45); } /* align with lead text, not its line box */
  .info__text { grid-column: 1; grid-row: 1; }
}

/* Works grid */
.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  column-gap: var(--space-gutter);
  row-gap: var(--space-component);
}
.card { display: block; text-decoration: none; }
.card__img {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
}
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card:hover .card__img img { transform: scale(1.03); }
.card__title { display: block; margin-top: var(--space-xs); font-size: var(--text-body); font-weight: 500; }
.card__meta { display: block; font-size: var(--text-meta); color: var(--text-muted); }

/* Work list */
.worklist { list-style: none; max-width: var(--measure); }
.worklist li { margin-bottom: var(--space-stack); font-size: var(--text-body); }
.worklist a { font-weight: 500; }

/* Work detail */
.work__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius);
}
.work__title { font-size: var(--text-title); letter-spacing: var(--tracking-tight); margin-top: var(--space-section); }
.work__body {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr;
  gap: var(--space-columns);
  margin-top: var(--space-heading);
}
.meta { margin: 0; display: grid; gap: var(--space-s); align-content: start; }
.meta dd { margin: 0; font-size: var(--text-meta); }
.work__content > * + * { margin-top: var(--space-component); }
.work__content .prose p:last-child { margin-bottom: 0; }
.credit { font-style: italic; color: var(--text-muted); font-size: var(--text-meta); margin-bottom: 0; }
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.embed--audio { aspect-ratio: auto; height: 166px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player { width: 100%; }
video.player { background: var(--surface); border-radius: var(--radius); }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-s);
  margin-top: var(--space-section);
}
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius);
}

/* Events */
.events { list-style: none; }
.event {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 14rem) 6rem;
  gap: var(--space-m);
  padding-block: var(--space-m);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-body);
}
.event:first-child { border-top: 1px solid var(--border); }
.event__date { font-size: var(--text-meta); font-weight: 500; font-variant-numeric: tabular-nums; }
.event__time { display: block; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.event__works { font-weight: 500; }
.event__note { font-weight: 400; font-style: italic; color: var(--text-muted); }
.event__performers, .event__city { font-size: var(--text-meta); color: var(--text-muted); }
.event__link { font-size: var(--text-meta); text-align: right; }
.event__link:empty { display: none; }
@media (max-width: 759px) {
  .event { grid-template-columns: 1fr; gap: var(--space-3xs); }
  .event__link { text-align: left; }
  .work__body { grid-template-columns: 1fr; gap: var(--space-l); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Click-to-load embed facade */
.facade { border: 1px solid var(--border); }
.facade--image::before {
  content: ""; position: absolute; inset: 0;
  background: var(--embed-bg) center / cover; opacity: .25;
}
.facade__inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2xs); padding: var(--space-s); text-align: center;
}
.facade__play {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.facade__play:hover { color: var(--accent); border-color: var(--accent); }
.facade__note { margin: 0; font-size: var(--text-label); color: var(--text-muted); line-height: 1.5; }
.embed--audio .facade__inner { gap: var(--space-3xs); }
