/* ==========================================================================
   Nicolas Emmenegger — reset, elements, layout primitives
   ========================================================================== */

/* ---- Raleway -------------------------------------------------------------
   Self-hosted rather than pulled from Google: one less third party watching
   visitors, and no render-blocking round trip to another origin. Two files,
   both variable across 200–800 — the entire weight range costs less than two
   static cuts would.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/raleway-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/raleway-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  min-height: 100svh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

input, button, textarea, select { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklab, var(--c-accent) 45%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast) var(--ease-out),
              text-decoration-color var(--t-fast) var(--ease-out);
}
a:hover { color: var(--c-accent); text-decoration-color: var(--c-accent); }

ul, ol { list-style: none; padding: 0; }

/* The serif carries a heading by shape, so it runs light and large rather than
   bold. Only the small headings (h3/h4) take a normal weight, where the serif
   would otherwise get thin against the dark ground. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3, h4 { letter-spacing: 0; line-height: var(--lh-snug); }

p { text-wrap: pretty; }

::selection {
  background: var(--c-accent);
  color: var(--c-bg-sink);
}

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

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: var(--c-bg-sink); }
  ::-webkit-scrollbar-thumb {
    background: var(--c-line-str);
    border: 3px solid var(--c-bg-sink);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-accent-deep); }
}

/* ---- Layout primitives -------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: calc(var(--max-w-text) + var(--gutter) * 2); }
.shell--wide { max-width: 1560px; }

.section { padding-block: var(--sp-9); position: relative; }
.section--tight { padding-block: var(--sp-8); }
.section--flush-top { padding-top: 0; }

.stack > * + * { margin-top: var(--flow, var(--sp-4)); }
.stack--lg { --flow: var(--sp-6); }

.prose { max-width: var(--measure); color: var(--c-text-soft); }
.prose > * + * { margin-top: var(--sp-4); }
.prose strong { color: var(--c-text); font-weight: 600; }

/* A hairline that reads as a stave line rather than a border. */
.rule {
  height: 1px;
  border: 0;
  background: var(--c-line);
}

/* ---- Typographic helpers ------------------------------------------------ */

.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.kicker::before {
  content: "";
  width: clamp(18px, 4vw, 44px);
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  flex: none;
}
.kicker--bare::before { display: none; }

.h-display { font-size: var(--fs-3xl); }
.h1 { font-size: var(--fs-2xl); }
.h2 { font-size: var(--fs-xl); }
.h3 { font-size: var(--fs-lg); }
.h4 { font-size: var(--fs-md); }

.lede {
  font-size: var(--fs-md);
  color: var(--c-text-soft);
  max-width: 56ch;
  line-height: 1.6;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.text-mute { color: var(--c-text-mute); }
.text-soft { color: var(--c-text-soft); }
.accent { color: var(--c-accent); }

/* Work titles. Used for repertoire lines and track names. */
.work { font-style: italic; }

/* ---- Accessibility ------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-accent);
  color: var(--c-bg-sink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t-mid) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); color: var(--c-bg-sink); }

[hidden] { display: none !important; }
