@font-face {
  font-family: 'Instrument Serif';
  src: url('./assets/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('./assets/fonts/source-sans-3.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --ink: #182321;
  --muted: #52615c;
  --line: #c9cfca;
  --panel: #e9ece6;
  --rust: #762739;
  --rust-dark: #5d1e2c;
  --green: #385745;
  --stage-text: #f6f5ef;
  --stage-muted: #b7c4bb;
  --stage-line: #495950;
  --focus: var(--rust);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans); }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font: 400 1em/1.03 var(--serif); letter-spacing: -.02em; overflow-wrap: anywhere; }
a { color: var(--rust-dark); text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { color: var(--paper); background: var(--rust); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.site-shell { width: min(calc(100% - 5rem), 78rem); margin-inline: auto; }
.skip-link { position: absolute; z-index: 3; inset: .75rem auto auto .75rem; background: var(--paper); padding: .6rem 1rem; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header, .live-section {
  --focus: #e0baae;
  color: var(--stage-text);
  background: var(--ink);
}

.site-header { border-bottom: 1px solid var(--stage-line); }
.header-inner { min-height: 4.65rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; }
.header-tools, .site-nav, .language-switcher { display: flex; align-items: center; }
.header-tools { gap: clamp(1rem, 3vw, 2.6rem); }
.site-nav { gap: clamp(.65rem, 2.3vw, 2rem); }

.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--stage-text); text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  position: relative;
  place-items: center;
  flex: none;
  width: 1.8rem;
  height: 2.1rem;
  border: 1px solid var(--stage-muted);
  border-radius: 1rem 1rem 0 0;
  color: var(--stage-muted);
}
.brand-mark span { width: .72rem; height: .65rem; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: .4rem .4rem .08rem .08rem; }
.brand-mark::after { content: ''; position: absolute; bottom: .44rem; width: .17rem; height: .17rem; border-radius: 50%; background: currentColor; }
.brand-title, .brand-place { display: block; }
.brand-title { font: 400 1.7rem/.92 var(--serif); }
.brand-place { color: var(--stage-muted); font-size: .78rem; overflow-wrap: anywhere; margin-top: .18rem; }

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--stage-muted);
  font-weight: 550;
  white-space: nowrap;
}

.nav-link:hover, .nav-link[aria-current="page"] { color: var(--stage-text); text-decoration: underline; text-underline-offset: .45em; }
.language-switcher { border-inline-start: 1px solid var(--stage-line); padding-inline-start: .6rem; }
.language-switcher button { min-width: 2.75rem; min-height: 2.75rem; padding: .4rem; border: 0; background: transparent; color: var(--stage-muted); font-size: .85rem; font-weight: 650; }
.language-switcher button:hover, .language-switcher button[aria-pressed="true"] { color: var(--stage-text); text-decoration: underline; text-underline-offset: .35em; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  color: var(--muted);
  font-size: .87rem;
  font-weight: 650;
  line-height: 1.3;
}
.status-badge::before { content: ''; flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-badge[data-status="live"] { color: var(--green); }
.status-badge[data-status="interrupted"] { color: #84521e; }
.live-section .status-badge { color: var(--stage-muted); }
.live-section .status-badge[data-status="live"] { color: #bad8ad; }
.live-section .status-badge[data-status="interrupted"] { color: #f0c689; }

.live-section { padding-block: clamp(1.9rem, 4.6vw, 4.2rem) clamp(1.75rem, 3.4vw, 2.7rem); }
.venue-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem 2rem; margin-bottom: clamp(1.45rem, 3vw, 2.5rem); }
.venue-heading h1 { font-size: clamp(3.3rem, 7vw, 6rem); line-height: .95; }
.venue-heading p { color: var(--stage-muted); font-size: clamp(1rem, 1.5vw, 1.125rem); }

.performance {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
  grid-template-areas: 'stream details';
  gap: clamp(1.5rem, 3.8vw, 3.5rem);
}
.performance-details { grid-area: details; display: flex; flex-direction: column; align-self: stretch; border-top: 1px solid var(--stage-line); padding-top: 1.1rem; }
.current-piece { flex: 1; padding-block: clamp(1.25rem, 2.4vw, 2rem); overflow-wrap: anywhere; }
.current-piece h2 { font-size: clamp(2.4rem, 4.2vw, 4.15rem); line-height: .97; text-wrap: balance; }
#piece-notes { color: var(--stage-muted); margin-top: .8rem; max-width: 39ch; white-space: pre-line; }
.detail-label { color: var(--stage-muted); font-size: .88rem; font-weight: 600; }
.current-piece .detail-label { margin-bottom: .45rem; }
.piece-credit { margin-top: .55rem; color: var(--stage-text); font-size: .97rem; }
.performer { border-top: 1px solid var(--stage-line); padding-top: .8rem; overflow-wrap: anywhere; }
.performer dd { margin-top: .14rem; font: 400 1.85rem/1.13 var(--serif); }

.stream { grid-area: stream; min-width: 0; }
.stream-frame { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 9; background: #29312d; }
.stream-frame img { display: block; width: 100%; height: 100%; color: var(--stage-text); object-fit: cover; object-position: center; }
.stream-frame[data-status="interrupted"] img { filter: brightness(.58) saturate(.4); }
.stream-label { position: absolute; inset: .8rem auto auto .8rem; padding: .29rem .6rem; color: var(--stage-text); background: var(--ink); font-size: .83rem; font-weight: 650; }
.stream-frame[data-status="live"] .stream-label { background: #9c2f32; color: #fff; }
.stream-frame[data-status="interrupted"] .stream-label { background: #503516; color: #ffe0a5; }

.public-body { padding-block: clamp(2.75rem, 5.5vw, 5.25rem) 5rem; }
.programme-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: clamp(1.75rem, 5vw, 5rem); }
.public-body h2 { font-size: clamp(2.55rem, 4.2vw, 4rem); }
.archive-empty { color: var(--muted); margin-top: .45rem; }
.programme-list { margin: 1.1rem 0 0; padding: 0; list-style: none; counter-reset: programme; border-top: 1px solid var(--line); }
.programme-list li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) minmax(0, auto);
  gap: .28rem .6rem;
  padding: .8rem .4rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  counter-increment: programme;
  overflow-wrap: anywhere;
}
.programme-list li::before { content: counter(programme); color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.programme-list li[aria-current="true"] { background: var(--panel); }
.programme-piece { font: 400 1.52rem/1.22 var(--serif); }
.programme-credit { color: var(--muted); font-size: .95rem; text-align: end; }

.sponsor-frame {
  --focus: #f4d3c8;
  border: 1px solid var(--muted);
  padding: .1875rem;
  color: #f7eee9;
}
.sponsor-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; }
.sponsor-copy { padding: clamp(1.2rem, 2.7vw, 2rem); background: #502a33; }
.sponsor-brand { display: flex; align-items: center; gap: .75rem; }
.sponsor-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid #d2aca5;
  border-radius: 50%;
  color: #f1d3c8;
  font: 400 1.52rem/1 var(--serif);
  letter-spacing: -.06em;
}
.sponsor-name { font-size: .98rem; font-weight: 650; line-height: 1.25; }
.sponsor-disclosure { margin-top: .25rem; color: var(--muted); font-size: .625rem; text-align: end; }
.sponsor h2 { margin-block: 1rem .5rem; font-size: clamp(2.15rem, 3.35vw, 3.2rem); }
.sponsor-copy > p { max-width: 37ch; }
.sponsor a { display: inline-block; margin-top: .5rem; color: inherit; }

.archive { margin-top: clamp(3rem, 6vw, 5.5rem); border-top: 1px solid var(--line); padding-top: clamp(2rem, 4vw, 3rem); scroll-margin-top: 1.5rem; }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); align-items: start; gap: clamp(1.5rem, 4.5vw, 4.5rem); margin-top: 1.45rem; }
.replay-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.replay-choice { display: flex; align-items: center; justify-content: space-between; gap: .4rem .9rem; width: 100%; min-height: 4.75rem; padding: .8rem .7rem; text-align: start; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); }
.replay-choice:hover, .replay-choice[aria-current="true"] { background: var(--panel); }
.replay-choice time, .replay-choice time + span { display: block; }
.replay-choice time { font: 400 1.54rem/1.2 var(--serif); }
.replay-choice time + span { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.replay-watch { flex: 0 0 auto; max-width: 42%; color: var(--rust-dark); font-size: .9rem; font-weight: 650; text-align: end; text-decoration: underline; text-underline-offset: .2em; }
.replay-viewer { min-width: 0; }
.replay-viewer video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); scroll-margin-top: 1rem; }
.replay-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .55rem .75rem; border-bottom: 1px solid var(--line); padding-block: .45rem; }
.replay-controls button { min-height: 2.75rem; padding: .28rem .65rem; border: 1px solid transparent; font-weight: 600; }
.replay-play { background: var(--rust); color: #fffaf8; }
.replay-play:hover { background: var(--rust-dark); }
.replay-mute { background: transparent; color: var(--ink); }
.replay-mute:hover { background: var(--panel); }
.replay-controls input { width: 100%; margin: 0; accent-color: var(--rust); }
.replay-time { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.replay-error { margin-top: .6rem; font-size: .91rem; }
.replay-error { color: var(--rust-dark); }
.replay-programme { margin-top: 1.4rem; }
.replay-programme h3 { font-size: 1.72rem; }
.replay-programme ol { margin: .45rem 0 0; padding-inline-start: 1.4rem; }

@media (max-width: 950px) {
  .site-shell { width: calc(100% - 3rem); }
  .performance { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}

@media (max-width: 730px) {
  .site-shell { width: calc(100% - 2.25rem); }
  .header-inner { min-height: 4rem; }
  .header-tools { gap: .65rem; }
  .site-nav { gap: .8rem; }
  .performance { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'details' 'stream'; }
  .current-piece { padding-block: 1.15rem; }
  .programme-layout, .archive-layout { grid-template-columns: minmax(0, 1fr); }
  .programme-list li { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .programme-credit { grid-column: 2; text-align: start; }
}

@media (max-width: 530px) {
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding-top: .55rem; }
  .header-tools { display: contents; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; gap: 1.4rem; }
  .language-switcher { grid-row: 1; grid-column: 2; border: 0; padding: 0; }
  .venue-heading { flex-direction: column; align-items: start; }
  .brand-title { font-size: 1.5rem; }
  .replay-controls { grid-template-columns: auto minmax(0, 1fr) auto; }
  .replay-controls input { grid-column: 1 / -1; grid-row: 2; }
}
