/* Layout: photo-led pages, one 68rem column; ensembles listed like a score's instrumentation */
:root {
  --bg: #f2f5f5;
  --surface: #ffffff;
  --fg: #16212a;
  --muted: #53626c;
  --line: #d6dde0;
  --accent: #1d5868;   /* Léman blue-green */
  --brass: #9c701c;    /* rosin / brass detail */
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 68rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f161b; --surface: #16212a; --fg: #e6ecee; --muted: #9eabb3;
    --line: #26343d; --accent: #82bccb; --brass: #d4a752; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f161b; --surface: #16212a; --fg: #e6ecee; --muted: #9eabb3;
  --line: #26343d; --accent: #82bccb; --brass: #d4a752; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 1.0625rem/1.65 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--accent); color: var(--bg); }
html { scrollbar-color: var(--muted) var(--bg); accent-color: var(--accent); caret-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brass); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.eyebrow {
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass); font-weight: 600;
}
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section > .wrap { display: grid; gap: 2rem; }
.head { display: grid; gap: .6rem; max-width: 40rem; }
.lead { font-size: 1.2rem; color: var(--muted); }

/* Header, as on the Orchestre Amati site: it slides away while scrolling down and comes back on the first scroll up (build.py) */
.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: var(--bg); transition: translate .3s ease; }
.top.away:not(:has(:focus-visible)) { translate: 0 -100%; } /* back for keyboard focus only: a tapped menu button must not pin it */
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: .9rem; }
.brand { font-family: var(--display); font-size: 1.45rem; color: var(--fg); text-decoration: none; }
.brand em { color: var(--brass); }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; }
.top nav a:not(.btn) { color: var(--fg); text-decoration: none; font-weight: 500; }
.top nav a:not(.btn)[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; }
/* Menu button: below the width where the links no longer fit on the brand's line, they fold behind it (build.py adds .menu). */
.menu-btn { display: none; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1.5px solid var(--fg); border-radius: 999px; background: none; color: var(--fg); cursor: pointer; }
.menu-btn svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-btn path { transition: transform .25s ease, opacity .2s; transform-origin: 12px 12px; }
.menu-btn[aria-expanded="true"] path:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] path:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] path:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 43.9375rem) {
  .top.menu .menu-btn { display: grid; }
  .top.menu nav { display: none; }
  .top.menu.open nav { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; gap: 0; padding-bottom: .5rem; }
  .top.menu.open nav a:not(.btn) { padding: .7rem 0; border-top: 1px solid var(--line); font-size: 1.1rem; }
  .top.menu.open nav .btn { justify-content: center; margin-top: .75rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.3rem;
  border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--bg); font: 600 1rem var(--body); cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.wa { background: #1f7a4a; border-color: #1f7a4a; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Hero: title first, then a wide photo of the ensemble */
.hero .wrap { display: grid; gap: 1.1rem; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3rem); }
.hero h1 { font-size: clamp(2.8rem, 8vw, 5.75rem); max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero img, .hero video { width: 100%; height: clamp(18rem, 58vh, 36rem); object-fit: cover; object-position: center 62%; }

/* Page title band (inner pages) */
.pagehead { padding-block: clamp(2.5rem, 6vw, 4rem) 0; }
.pagehead .wrap { display: grid; gap: .6rem; }
.pagehead h1 { font-size: clamp(2.4rem, 6vw, 3.75rem); }

/* Intro */
.intro { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.intro .text { display: grid; gap: 1.2rem; max-width: 36rem; }
.figures { display: flex; flex-wrap: wrap; gap: 2rem; }
.figures div { display: grid; }
.figures b { font-family: var(--display); font-size: 2.6rem; font-weight: 500; line-height: 1; color: var(--accent); }
.figures span { color: var(--muted); font-size: .95rem; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: "♪"; position: absolute; left: 0; color: var(--brass); }

/* Formules */
.formules { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.formule {
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; gap: 1.5rem;
  align-items: center; padding-block: 1.25rem; border-bottom: 1px solid var(--line);
}
.formule img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 4px; }
.formule .info { display: grid; gap: .3rem; min-width: 0; }
.formule .score { font-family: var(--display); font-style: italic; color: var(--brass); font-size: 1.05rem; }
.formule p { color: var(--muted); }
@media (max-width: 40rem) {
  .formule { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); }
  .formule .btn { grid-column: 1 / -1; justify-self: start; }
}

/* Répertoire */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; background: var(--bg); }
.note { color: var(--muted); font-size: .95rem; }

/* Photo strip / gallery */
.grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.grid figure { margin: 0; display: grid; gap: .35rem; }
.grid button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; overflow: hidden; }
.grid img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform .3s ease; }
.grid button:hover img { transform: scale(1.03); }
.grid figcaption { font-size: .9rem; color: var(--muted); }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 1400px); max-height: 92vh; }
dialog.lightbox::backdrop { background: rgba(5, 10, 14, .9); }
dialog.lightbox img { max-height: 84vh; width: auto; margin-inline: auto; cursor: zoom-out; }
dialog.lightbox p { color: #fff; text-align: center; padding-top: .5rem; }
dialog.lightbox button { background: #fff; color: #16212a; border-color: #fff; position: fixed; top: 1rem; right: 1rem; }

/* Videos */
.videos { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.video { display: grid; gap: .5rem; color: var(--fg); text-decoration: none; }
.video .thumb { position: relative; border-radius: 4px; overflow: hidden; }
.video .thumb img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.video .play { position: absolute; inset: 0; margin: auto; width: 3.5rem; height: 3.5rem; fill: rgba(10, 18, 24, .7); transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.video .play path { fill: #fff; }
.video:hover .play { transform: scale(1.08); }
.video:hover h3 { color: var(--accent); }
.video h3 { font-family: var(--body); font-size: 1.05rem; font-weight: 600; line-height: 1.35; }

/* Contact */
.contact { display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.direct { display: grid; gap: 1.25rem; }
.direct dl { margin: 0; display: grid; gap: .9rem; }
.direct dt { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.direct dd { margin: 0; font-size: 1.2rem; user-select: all; }
form { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2rem); }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
label span { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: 1rem var(--body); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: .7rem .8rem; width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.status { font-weight: 600; }
.status.ok { color: #1f7a4a; }
.status.err { color: #b3261e; }

/* CTA + footer */
.cta-band { background: var(--accent); color: var(--bg); }
.cta-band .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta-band h2 { max-width: 30rem; }
.cta-band .btn { background: var(--bg); color: var(--accent); border-color: var(--bg); }
footer { padding-block: 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer .wrap { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
footer h3 { font-family: var(--body); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--fg); margin-bottom: .5rem; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Groups on Photos / Vidéos pages */
.jump { margin-top: .75rem; }
.jump a { text-decoration: none; color: var(--fg); }
.jump li:hover { border-color: var(--accent); }
.group { display: grid; gap: 1.25rem; scroll-margin-top: 1.5rem; }
.group + .group { padding-top: 2.5rem; border-top: 1px solid var(--line); }
.ghead { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; }
.ghead .score { font-family: var(--display); font-style: italic; color: var(--brass); font-size: 1.1rem; }
.hero img, .hero video { object-position: center 30%; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }

/* KIE AI: hero loop + ambient band */
.hero video { display: block; }
.ambiance { position: relative; isolation: isolate; overflow: hidden; display: grid; min-height: clamp(20rem, 62vh, 34rem); color: #fff; }
.ambiance img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; animation: ambiance-drift 32s ease-in-out infinite alternate; }
.ambiance::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(8, 10, 14, .62), rgba(8, 10, 14, .2) 75%); }
.ambiance .wrap { display: grid; place-content: center; justify-items: center; gap: .8rem; text-align: center; padding-block: 3rem; }
.ambiance .eyebrow { color: #ecc77a; }
.ambiance .say { margin: 0; font-family: var(--display); font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.1; max-width: 18ch; text-shadow: 0 2px 20px rgba(0, 0, 0, .55); }
.ambiance .sub { margin: 0; font-size: 1.1rem; max-width: 34rem; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
@keyframes ambiance-drift { from { transform: scale(1); } to { transform: scale(1.08) translateX(-1.5%); } }
@media (prefers-reduced-motion: reduce) { .ambiance img { animation: none; } }

/* ---------- Motion, adapted from 21st.dev components (js/fx.js runs the typewriter and the open panels) ----------
   Without JavaScript, or with "reduce motion", the page stays still and reads the same. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Typewriter Loop: « Pour vos concerts / mariages / fêtes / soirées » */
.typer { font-family: var(--display); font-style: italic; font-size: clamp(1.5rem, 3.2vw, 2.2rem); line-height: 1.15; min-height: 1.15em; }
.type { color: var(--accent); }
.type::after { content: ""; display: inline-block; width: .06em; height: .85em; margin-left: .08em; vertical-align: -.05em; background: var(--brass); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .type::after { animation: none; } }

/* Services Stack: the five formulas pinned one over the other as you scroll down */
.formules.stack { border-top: 0; display: grid; gap: 1.25rem; }
.formules.stack .formule { position: sticky; top: calc(1rem + var(--k) * 1.25rem); background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem; box-shadow: 0 -14px 36px rgba(22, 33, 42, .12); }
@media (min-width: 48rem) {
  .formules.stack .formule { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr) auto; min-height: 17rem; padding: 1.25rem 1.5rem 1.25rem 1.25rem; }
  .formules.stack .formule h3 { font-size: 2rem; }
}

/* Hover Expand Gallery (the repertoire) and Gallery Modal Accordion (a few events): one panel open at a time */
.hx { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.hx :is(button, .hx-panel) { position: relative; display: grid; width: 100%; padding: 0; border: 0; border-radius: 4px; overflow: hidden; text-align: left; font: inherit;
  background: linear-gradient(200deg, var(--accent), #0d2a33); color: #fff; }
.hx li:nth-child(3n + 2) :is(button, .hx-panel) { background: linear-gradient(200deg, var(--brass), #3a2a0b); }
.hx button { cursor: zoom-in; }
.hx img { width: 100%; height: 12rem; object-fit: cover; }
.hx-label { padding: .7rem 1rem .1rem; font-family: var(--display); font-size: 1.3rem; line-height: 1.15; }
.hx-meta { padding: 0 1rem .8rem; font-family: var(--display); font-style: italic; color: #ecc77a; }
.hx-meta:empty { padding-bottom: .6rem; }
@media (min-width: 48rem) {
  .hx { --rail: 4rem; display: flex; gap: 0; height: clamp(22rem, 58vh, 30rem); }
  .hx li { flex: 0 0 var(--rail); min-width: 0; transition: flex-basis .62s cubic-bezier(.32, .72, 0, 1); }
  .hx li + li { border-left: 1px solid rgba(255, 255, 255, .2); }
  .hx li.on { flex-basis: calc(100% - (var(--n) - 1) * var(--rail)); }
  .hx :is(button, .hx-panel) { display: block; height: 100%; border-radius: 0; }
  .hx li:first-child :is(button, .hx-panel) { border-radius: 4px 0 0 4px; }
  .hx li:last-child :is(button, .hx-panel) { border-radius: 0 4px 4px 0; }
  .hx img { position: absolute; inset: 0 0 0 var(--rail); width: calc(100% - var(--rail)); height: 100%; opacity: 0; transition: opacity .62s ease; }
  .hx li.on img { opacity: 1; }
  .hx-label, .hx-meta { position: absolute; left: 0; width: var(--rail); writing-mode: vertical-rl; rotate: 180deg; white-space: nowrap; padding: 0; display: flex; align-items: center; }
  .hx-label { bottom: 1.25rem; opacity: .7; transition: opacity .4s; }
  .hx-meta { top: 1.25rem; opacity: 0; transition: opacity .4s; }
  .hx li.on :is(.hx-label, .hx-meta) { opacity: 1; }
  /* A style with no photo yet: its name, large, fills the open panel */
  .hx .plain .hx-label { inset: 0 0 0 var(--rail); width: auto; writing-mode: horizontal-tb; rotate: none; align-items: flex-end; padding: 1.5rem; font-size: 1.3rem; }
  .hx li.on .plain .hx-label { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
  .hx li:not(.on) .plain .hx-label { inset: auto 0 1.25rem 0; width: var(--rail); writing-mode: vertical-rl; rotate: 180deg; padding: 0; align-items: center; }
}

/* Hero Carousel: the ensembles as a filmstrip; the one under the mouse unfurls and tints the whole strip */
.film { display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-block: .5rem; margin-top: .5rem; }
.film a { position: relative; flex: 0 0 11rem; scroll-snap-align: start; border-radius: 4px; overflow: hidden; color: #fff; text-decoration: none; }
.film img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.film span { position: absolute; inset: auto 0 0; padding: 1.5rem .7rem .5rem; font-family: var(--display); font-size: 1.05rem; background: linear-gradient(to top, rgba(8, 10, 14, .85), transparent); }
@media (min-width: 48rem) {
  .film { position: relative; isolation: isolate; align-items: flex-start; overflow: hidden; height: clamp(20rem, 46vh, 26rem); padding: 1.25rem; border-radius: 6px; background: #0d1a20; }
  .film::before { content: ""; position: absolute; inset: -2rem; z-index: -1; background: var(--film-bg) center / cover; filter: blur(28px) brightness(.45) saturate(1.2); transition: background-image .6s; }
  .film a { flex: 1 1 0; min-width: 0; height: 50%; transition: flex-grow .62s cubic-bezier(.32, .72, 0, 1), height .62s cubic-bezier(.32, .72, 0, 1); }
  .film a.on { flex-grow: 3.2; height: 100%; }
  .film img { height: 100%; aspect-ratio: auto; }
  .film a:not(.on) span { font-size: .9rem; }
}

/* ---------- Taken from the Orchestre Amati site ---------- */
/* Splitting Text: the hero title enters letter by letter */
.letters .w { display: inline-block; white-space: nowrap; }
.letters .w span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .letters .w span { animation: split-in 1s calc(var(--i) * 45ms + .2s) both cubic-bezier(.2, .7, .2, 1); }
}
@keyframes split-in { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } }
/* Scroll Velocity Text: the styles of the repertoire as a moving line, set like the instrumentation of a score */
.marquee { overflow: hidden; margin-bottom: 2.5rem; border-block: 1px solid var(--line); padding-block: .9rem; }
.marquee .track { display: flex; width: max-content; animation: marquee 90s linear infinite; }
.marquee span { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem, 3vw, 2.1rem); white-space: nowrap; padding-right: .3em; color: var(--brass); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee .track { animation: none; } }
/* 3D Parallax Unfurling Gallery: each ensemble's photo wall unfolds row by row */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .grid.unfurl { overflow-x: clip; } /* the tilted rows would otherwise widen the page on phones */
    .grid.unfurl figure { transform-origin: 50% 0; animation: unfurl linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .grid.unfurl figure:nth-child(2n) { animation-range: entry 10% entry 100%; }
  }
}
@keyframes unfurl { from { transform: perspective(1100px) rotateX(32deg) translateY(2.5rem); opacity: .15; } }

/* Keyboard access and readable service pages, retaining the existing visual identity. */
.skip { position: fixed; top: .5rem; left: 1rem; z-index: 100; padding: .75rem 1rem; background: var(--bg); color: var(--fg); transform: translateY(-180%); }
.skip:focus { transform: none; }
#main:focus { outline: none; }
.formule h3 a { color: inherit; }
.intro > img { width: 100%; border-radius: 6px; }
.direct a { overflow-wrap: anywhere; }
html { scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
  .formules.stack .formule { position: relative; top: auto; }
}
