/* Soundloom presents Itrî & Bach
   Layout: one reading column on phones; on wide screens the overture splits text/photo
   and lists widen into grids. A fixed canvas behind everything draws the two threads (the loom). */
:root {
  --ink: #130e0d;
  --ink-2: #1d1715;
  --ink-3: #2a2220;
  --ivory: #f2ebdf;
  --muted: #b3a798;
  --gold: #e8c766;      /* Bach */
  --crimson: #d0474f;   /* Itrî */
  --rule: rgba(242, 235, 223, .14);
  --display: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(18px, 5vw, 48px);
  --bar-h: 56px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font: 400 17px/1.65 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--gold); color: var(--ink); padding: 8px 12px; }
.skip:focus { top: 12px; }

/* The loom: two threads behind the page */
.loom { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .32; }
main, .foot { position: relative; z-index: 1; }
main { overflow-x: clip; }

/* Top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  background: linear-gradient(var(--ink) 30%, rgba(19, 14, 13, 0));
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); text-decoration: none; font: 400 20px/1 var(--display); letter-spacing: .02em; }
.brand .mark { color: var(--gold); flex: none; }
.lang { display: flex; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; background: rgba(19, 14, 13, .7); backdrop-filter: blur(6px); }
.lang button {
  min-width: 44px; min-height: 36px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 13px/1 var(--body); letter-spacing: .1em; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* Shared section rhythm */
.movement { padding: 88px var(--gutter) 24px; max-width: 1120px; margin: 0 auto; display: grid; gap: 24px; }
.mv { display: flex; align-items: baseline; gap: 12px; font: 600 12px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.mv span:first-child { font: italic 400 26px/1 var(--display); letter-spacing: 0; text-transform: none; color: var(--gold); }
h2 { font-size: clamp(36px, 9vw, 64px); line-height: 1.04; letter-spacing: -.01em; }
h3 { font-size: 24px; line-height: 1.2; }
.prose { display: grid; gap: 16px; max-width: 38em; }

/* I. Overture */
.overture {
  min-height: 100svh; display: grid; align-content: end; gap: 28px;
  padding: calc(var(--bar-h) + 40px) var(--gutter) 40px; max-width: 1120px; margin: 0 auto;
}
.overture-text { display: grid; gap: 14px; }
.script { font: 400 clamp(32px, 9vw, 52px)/1 var(--script); color: var(--gold); }
h1 { font-size: clamp(68px, 21vw, 168px); line-height: .9; letter-spacing: -.02em; }
h1 .amp { font-style: italic; color: var(--crimson); }
.sub { font: italic 400 clamp(20px, 5vw, 26px)/1.3 var(--display); color: var(--ivory); max-width: 22em; }
.lineup { font: 600 12px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .02em;
}
.btn.ghost { background: none; color: var(--ivory); border: 1px solid var(--rule); }
.overture-photo { margin: 0 calc(var(--gutter) * -1); position: relative; }
.overture-photo img { width: 100%; max-height: 72svh; object-fit: cover; object-position: 50% 22%; }
.overture-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--ink), rgba(19, 14, 13, 0) 22%, rgba(19, 14, 13, 0) 70%, var(--ink)); }
@media (min-width: 900px) {
  .overture { grid-template-columns: 1.2fr 1fr; align-items: center; align-content: center; }
  .overture-photo { margin: 0; }
  .overture-photo img { max-height: 82svh; }
  .overture-photo::after { background: linear-gradient(90deg, var(--ink), rgba(19, 14, 13, 0) 25%), linear-gradient(rgba(19, 14, 13, 0) 70%, var(--ink)); }
}

/* II. Lifelines */
.life { margin: 0; padding: 18px 14px 10px; background: rgba(29, 23, 21, .8); max-width: 640px; }
.life svg { width: 100%; height: auto; display: block; overflow: visible; }
.life .overlap { fill: rgba(232, 199, 102, .1); }
.lifeline { stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.lifeline.itri { stroke: var(--crimson); }
.lifeline.bach { stroke: var(--gold); }
.life .who { font: 400 17px var(--display); fill: var(--ivory); }
.life .yr { font: 500 11px var(--body); fill: var(--muted); }
.life .together { font: 600 12px var(--body); fill: var(--gold); letter-spacing: .06em; }
@media (min-width: 900px) { .century { grid-template-columns: 1fr 1fr; column-gap: 56px; } .century .mv, .century h2 { grid-column: 1 / -1; } }

/* III. Conversation: Bach answers from the left, Itrî from the right */
.voices { display: grid; gap: 18px; }
.voice { font: 400 clamp(20px, 5vw, 28px)/1.35 var(--display); max-width: 24em; padding: 6px 0 6px 18px; border-left: 2px solid; }
.voice b { font-weight: 500; font-style: italic; }
.voice.bach { border-color: var(--gold); }
.voice.bach b { color: var(--gold); }
.voice.itri { border-color: var(--crimson); justify-self: end; text-align: right; border-left: 0; border-right: 2px solid var(--crimson); padding: 6px 18px 6px 0; }
.voice.itri b { color: var(--crimson); }
.pull { margin: 12px 0; font: italic 400 clamp(26px, 7vw, 44px)/1.2 var(--display); color: var(--ivory); max-width: 20em; text-wrap: balance; }
.credit { color: var(--muted); font-size: 15px; }

/* IV. Musicians: swipe on phones, grid on desktop */
.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 340px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scroll-padding-inline: var(--gutter);
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 16px; scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }
.player { scroll-snap-align: start; display: grid; gap: 8px; align-content: start; background: var(--ink-2); padding-bottom: 20px; }
.player picture { aspect-ratio: 4 / 5; overflow: hidden; }
.player picture img { width: 100%; height: 100%; object-fit: cover; }
.player > :not(picture):not(.string) { padding-inline: 18px; }
.player .inst { font: italic 400 30px/1.1 var(--display); }
.player.itri .inst { color: var(--crimson); }
.player.bach .inst { color: var(--gold); }
.player h3 { font: 600 15px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.player p:last-child { color: var(--muted); font-size: 15px; line-height: 1.55; }
.string { width: 100%; height: 10px; display: block; }
.string path { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.player.itri .string path { stroke: var(--crimson); }
.player.bach .string path { stroke: var(--gold); }
@media (min-width: 900px) {
  .cards { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; }
  .cards.feat { grid-template-columns: repeat(2, 1fr); max-width: calc((100% - 32px) * 2 / 3 + 16px); }
}

.feat-h { margin-top: 16px; font: italic 400 30px/1.1 var(--display); color: var(--gold); }

/* V. Program */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule); background: none; cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.filters button[aria-pressed="true"] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.pieces { list-style: none; margin: 0; padding: 0; display: grid; }
.pieces li {
  display: grid; grid-template-columns: 2.4em 1fr auto; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  transition: opacity .35s ease, transform .35s ease;
}
.pieces li > div { min-width: 0; display: grid; gap: 2px; }
.pieces .no { font: italic 400 22px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.pieces b { font: 400 20px/1.25 var(--display); }
.pieces .meta { font-size: 14px; color: var(--muted); }
.pieces li[data-kind="itri"] .no { color: var(--crimson); }
.pieces li[data-kind="bach"] .no { color: var(--gold); }
.pieces li[data-kind="taksim"] b { font-style: italic; }
.pieces li.dim { opacity: .18; }
.play {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold); text-decoration: none; font-size: 12px; padding-left: 2px;
}
@media (min-width: 900px) { .pieces { display: block; columns: 2; column-gap: 48px; } .pieces li { break-inside: avoid; } }

/* VI. Films */
.films { display: grid; gap: 22px; }
@media (min-width: 900px) { .films { grid-template-columns: 1fr 1fr; } }
.film { margin: 0; display: grid; gap: 10px; }
.film figcaption { font-size: 15px; color: var(--muted); }
.film figcaption b { color: var(--ivory); font-weight: 500; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .3s, transform .6s; }
.yt:hover img { opacity: 1; transform: scale(1.02); }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(19, 14, 13, .72); border: 1px solid var(--gold); }
.yt-play::after { content: ""; position: absolute; left: 27px; top: 22px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent var(--gold); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.album { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; text-decoration: none; color: var(--ivory); max-width: 420px; }
.album > span { display: grid; gap: 2px; }
.album b { font: 400 22px/1.2 var(--display); }
.album > span > span { color: var(--muted); font-size: 15px; }

/* VII. Concerts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); }
.facts div { background: var(--ink); padding: 14px 12px; display: grid; gap: 4px; }
.facts dt { font: 600 11px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font: 400 17px/1.25 var(--display); }
.dates { list-style: none; margin: 0; padding: 0; display: grid; }
.dates li { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.dates time, .dates .date-ph { display: grid; justify-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.dates .d { font: 400 34px/1 var(--display); color: var(--gold); }
.dates .m { font: 600 12px/1.4 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.dates .y { font-size: 11px; color: var(--muted); }
.dates li > div { display: grid; gap: 2px; min-width: 0; }
.dates b { font: 400 22px/1.2 var(--display); }
.dates li > div span { font-size: 14px; color: var(--muted); }
.status { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); padding: 7px 9px; border-radius: 999px; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dates.tbc .veil { filter: blur(7px); user-select: none; pointer-events: none; }
.dates.tbc .status { color: var(--muted); border-color: var(--rule); opacity: .6; cursor: not-allowed; }
.past-h { margin-top: 12px; font-size: 22px; }
.past { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); }
.past span:first-child { color: var(--ivory); font-variant-numeric: tabular-nums; margin-right: 8px; }

/* VIII. Gallery: every photo visible as a two- or three-column mosaic; tap to enlarge */
.gallery { columns: 2; column-gap: 10px; }
@media (min-width: 900px) { .gallery { columns: 3; column-gap: 14px; } }
.shot { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: 0; background: var(--ink-2); cursor: zoom-in; break-inside: avoid; overflow: hidden; }
@media (min-width: 900px) { .shot { margin-bottom: 14px; } }
.shot img { width: 100%; height: auto; transition: transform .6s ease, opacity .3s; opacity: .92; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.03); opacity: 1; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; margin: 0; overflow: hidden; }
.lightbox::backdrop { background: rgba(10, 7, 6, .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; touch-action: pan-y; }
.lightbox button {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--rule);
  background: rgba(19, 14, 13, .7); color: var(--ivory); font: 300 30px/1 var(--body); cursor: pointer; display: grid; place-items: center;
}
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.lb-prev, .lb-next { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.lb-prev { left: calc(50% - 60px); }
.lb-next { right: calc(50% - 60px); }
@media (min-width: 900px) { .lb-prev, .lb-next { bottom: auto; top: calc(50% - 24px); } .lb-prev { left: 24px; } .lb-next { right: 24px; } }

/* IX. FAQ */
.qa { display: grid; max-width: 46em; }
.qa details { border-bottom: 1px solid var(--rule); }
.qa summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font: 400 21px/1.3 var(--display); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 300 26px/1 var(--body); color: var(--gold); transition: transform .3s; }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details p { padding: 0 0 20px; color: var(--muted); max-width: 40em; }

/* X. Booking */
.booking { padding-bottom: 80px; }
.booking > p { max-width: 32em; color: var(--muted); }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.mail a { display: inline-flex; align-items: center; gap: 12px; color: var(--ivory); text-decoration: none; font: 400 clamp(22px, 6vw, 34px)/1.2 var(--display); border-bottom: 1px solid var(--gold); padding-bottom: 4px; word-break: break-all; }
.mail svg { width: 1em; height: 1em; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; }
.copy { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule); background: none; cursor: pointer; font-size: 14px; }

/* Footer: the loom closes on the mark */
.foot { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px var(--gutter) calc(48px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); background: var(--ink); }
.foot .mark { color: var(--gold); }
.foot .word { font: 400 26px/1 var(--display); letter-spacing: .03em; }
.foot p { max-width: 30em; color: var(--muted); font-size: 15px; }
.foot .small { font-size: 13px; }

/* Scroll-driven motion, only where the browser supports it and the reader allows motion.
   Without support everything simply shows at rest. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes rise { from { opacity: 0; transform: translateY(28px); } }

    .lifeline { animation: draw linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    .lifeline.bach { animation-range: entry 40% cover 55%; }
    @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

    .voice.bach { animation: from-left linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    .voice.itri { animation: from-right linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    @keyframes from-left { from { opacity: 0; transform: translateX(-40px); } }
    @keyframes from-right { from { opacity: 0; transform: translateX(40px); } }

    /* Musicians: the string settles from a wobble to straight, like an instrument coming into tune */
    .string path { animation: tune linear both; animation-timeline: view(); animation-range: entry 10% cover 40%; }
    @keyframes tune { from { d: path("M0 5 Q 25 0 50 5 T 100 5 T 150 5 T 200 5"); } to { d: path("M0 5 Q 25 5 50 5 T 100 5 T 150 5 T 200 5"); } }

  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pieces li, .yt img { transition: none; }
}
