/* ---- Theme tokens ---- */
:root {
  --bg: #faf6ef;
  --bg-grad: radial-gradient(ellipse at top, #fdfaf4 0%, #faf6ef 60%);
  --surface: #f3ecdf;
  --ink: #2a2420;
  --muted: #6b5f54;
  --rule: #d9cfbe;
  --accent: #2d4a3e;
  --accent-hover: #1f362c;
  --on-accent: #faf6ef;
  --max: 980px;
  --measure: 38rem;
  --radius: 3px;
  --shadow-md: 0 10px 28px -12px rgba(42,36,32,0.22);
  --font-base: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161310;
    --bg-grad: radial-gradient(ellipse at top, #1d1915 0%, #161310 60%);
    --surface: #211c18;
    --ink: #f0e8db;
    --muted: #a89d8f;
    --rule: #3a322a;
    --accent: #8ab59f;
    --accent-hover: #a9cebc;
    --on-accent: #161310;
  }
}
:root[data-theme="dark"] {
  --bg: #161310;
  --bg-grad: radial-gradient(ellipse at top, #1d1915 0%, #161310 60%);
  --surface: #211c18;
  --ink: #f0e8db;
  --muted: #a89d8f;
  --rule: #3a322a;
  --accent: #8ab59f;
  --accent-hover: #a9cebc;
  --on-accent: #161310;
}

/* Early Music page: warmer, more playful accent */
body.early { --accent: #a0522d; --accent-hover: #7f3f20; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.early { --accent: #e09a6c; --accent-hover: #f0b48a; }
}
:root[data-theme="dark"] body.early { --accent: #e09a6c; --accent-hover: #f0b48a; }

body.reader { --font-base: 20px; --measure: 46rem; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: var(--font-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; position: relative; }

/* ---- Header ---- */
header.site { border-bottom: 1px solid var(--rule); padding: 1.75rem 0 1.25rem; position: relative; z-index: 5; }
.header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.site-title { font-size: 1.75rem; letter-spacing: 0.02em; margin: 0; font-weight: normal; }
.site-title a { color: var(--ink); text-decoration: none; }
.tagline { color: var(--muted); font-style: italic; margin: 0.15rem 0 1.25rem; }
.header-tools { display: flex; gap: 0.5rem; }
.tool-btn {
  background: none; border: 1px solid var(--rule); color: var(--muted);
  width: 36px; height: 36px; cursor: pointer; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tool-btn:hover, .tool-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.tool-btn:hover { background: var(--surface); }
.tool-btn svg { width: 16px; height: 16px; }

nav.primary ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  font-family: system-ui, -apple-system, sans-serif; font-size: 0.95rem;
}
nav.primary a {
  color: var(--muted); text-decoration: none; padding-bottom: 2px;
  border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s;
}
nav.primary a:hover, nav.primary a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Type ---- */
main { padding: 3.5rem 0 5rem; position: relative; z-index: 2; }
h1 { font-size: clamp(2.1rem, 5vw, 2.9rem); font-weight: normal; line-height: 1.15; margin: 0 0 1.25rem; letter-spacing: -0.01em; }
h2 {
  font-size: 1.5rem; font-weight: normal; margin: 2.75rem 0 1rem; color: var(--accent);
  position: relative; display: inline-block;
}
h2::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
h2.in-view::after { width: 2.5rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--accent); transition: color 0.15s; }
a:hover { color: var(--accent-hover); }
.lead { font-size: 1.2rem; color: var(--muted); font-style: italic; }
.placeholder { color: var(--muted); font-style: italic; }

/* ---- Motion ---- */
.reveal-letters .letter {
  display: inline-block; opacity: 0; transform: translateY(0.5em);
  animation: letterRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.reveal-letters .space { display: inline-block; width: 0.28em; }
@keyframes letterRise { to { opacity: 1; transform: none; } }
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---- Home hero ---- */
.hero { position: relative; display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 3rem; align-items: center; padding: 1rem 0 1.5rem; }
.staff-lines {
  position: absolute; left: -10%; right: -10%; top: 50%; height: 120px;
  transform: translateY(-50%); z-index: -1; pointer-events: none;
  color: var(--accent); opacity: 0.12;
}
.staff-lines path { animation: staffDrift 14s ease-in-out infinite alternate; }
.staff-lines path:nth-child(2) { animation-delay: -2s; }
.staff-lines path:nth-child(3) { animation-delay: -4s; }
.staff-lines path:nth-child(4) { animation-delay: -6s; }
.staff-lines path:nth-child(5) { animation-delay: -8s; }
@keyframes staffDrift { from { transform: translateY(-6px); } to { transform: translateY(6px); } }

.hero-portrait-wrap { position: relative; }
.hero-portrait-wrap::before {
  content: ''; position: absolute; inset: -12%; z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 62%);
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.08); opacity: 1; } }
.hero-portrait {
  position: relative; z-index: 1; aspect-ratio: 4/5; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-md);
  border-radius: 999px 999px var(--radius) var(--radius);
}
.hero-portrait img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s; }
.hero-portrait:hover img { transform: scale(1.03); }
.hero-portrait .fallback {
  position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-style: italic; font-size: 0.9rem; text-align: center; padding: 1rem;
}

.cta {
  display: inline-block; margin-top: 0.75rem; padding: 0.8rem 1.6rem;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font-family: system-ui, sans-serif; font-size: 0.95rem; letter-spacing: 0.03em;
  border-radius: var(--radius); position: relative; overflow: hidden;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cta:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cta::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg); transition: left 0.6s;
}
.cta:hover::after { left: 120%; }

/* ---- Cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card {
  background: var(--surface); border: 1px solid var(--rule); padding: 1.5rem; border-radius: var(--radius);
  position: relative; overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.25s;
}
.card::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.card:hover::before { transform: scaleX(1); }
.card p { margin-bottom: 0; }
.card .tag {
  font-family: system-ui, sans-serif; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.4rem;
}

/* ---- Rates ---- */
.rate-table { width: 100%; border-collapse: collapse; margin: 1rem 0 0.5rem; }
.rate-table th, .rate-table td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); }
.rate-table th {
  font-family: system-ui, sans-serif; font-size: 0.8rem; color: var(--muted);
  font-weight: normal; letter-spacing: 0.08em; text-transform: uppercase;
}
.rate-table tbody tr { transition: background 0.15s; }
.rate-table tbody tr:hover { background: var(--surface); }
.rate-table td:nth-child(2) { font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }

/* ---- Media ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.media-slot {
  aspect-ratio: 16/9; background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 0.4rem; align-items: center; justify-content: center;
  color: var(--muted); font-style: italic; font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.25s;
}
.media-slot svg { width: 28px; height: 28px; opacity: 0.55; transition: opacity 0.2s, transform 0.25s; }
.media-slot:hover { border-color: var(--accent); transform: translateY(-2px); }
.media-slot:hover svg { opacity: 1; transform: scale(1.1); color: var(--accent); }
.media-grid.audio .media-slot { aspect-ratio: 4/1; flex-direction: row; }
.media-grid.photos .media-slot { aspect-ratio: 1; }

/* ---- Filter chips ---- */
.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 1.25rem; font-family: system-ui, sans-serif; }
.chip {
  padding: 0.45rem 1rem; background: var(--surface); border: 1px solid var(--rule); color: var(--muted);
  font-size: 0.85rem; cursor: pointer; border-radius: 999px; transition: all 0.15s;
}
.chip:hover, .chip[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* ---- Collapsibles (policy) ---- */
details.collapsible {
  border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius);
  margin: 0 0 0.75rem; transition: border-color 0.2s;
}
details.collapsible[open] { border-color: var(--accent); }
details.collapsible > summary {
  cursor: pointer; padding: 1rem 1.25rem; list-style: none; user-select: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-size: 1.1rem;
}
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform 0.25s; }
details.collapsible[open] > summary::after { transform: rotate(45deg); }
details.collapsible > .content { padding: 0 1.25rem 1.1rem; }
.policy-tools { display: flex; gap: 1rem; margin: 0 0 1rem; font-family: system-ui, sans-serif; font-size: 0.85rem; }
.text-btn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.88rem; font-family: system-ui, sans-serif; position: relative; z-index: 2; }
footer p { margin: 0.2rem 0; max-width: none; }

/* ---- Accessibility ---- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal, .reveal-letters .letter { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  body { font-size: calc(var(--font-base) - 1px); }
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-portrait-wrap { order: -1; max-width: 260px; margin: 0 auto; }
  main { padding: 2.25rem 0 3.5rem; }
  .rate-table th, .rate-table td { padding: 0.7rem 0.5rem; }
}

/* ---- v3 additions ---- */
.card-link { margin-top: 0.9rem !important; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.card-link a { text-decoration: none; border-bottom: 1px solid currentColor; }
.rate-note { margin-top: 2rem; color: var(--muted); font-size: 0.95rem; }
.card-grid .card h3 + p { color: var(--ink); }
.rate-table td:first-child { white-space: nowrap; }

/* ---- v4: contact ---- */
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-top: 0.75rem; }
.hero-actions .cta { margin-top: 0; }
.text-link { font-family: system-ui, sans-serif; font-size: 0.95rem; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.contact-band {
  margin-top: 3.5rem; padding: 0.25rem 2rem 2rem; background: var(--surface);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.contact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.contact-actions .cta { margin-top: 0; }
.contact-address { font-family: system-ui, sans-serif; font-size: 0.95rem; color: var(--ink); }
.text-btn.copied { text-decoration: none; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
@media (max-width: 760px) { .contact-band { padding: 0.25rem 1.25rem 1.5rem; } }
.staff-lines { width: 120%; }
main { overflow-x: clip; }
.contact-actions .text-btn { font-family: system-ui, sans-serif; font-size: 0.9rem; }
