/* ==========================================================
   location-sound.ch – main stylesheet
   Colours and fonts are defined once here, in :root.
   ========================================================== */

/* ----------------------------------------------------------
   Font: Archivo (SIL Open Font License, see fonts/OFL-license.txt)
   Stored on this website, so no visitor data is sent to Google.
   One variable file covers all weights and widths.
   ---------------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-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: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #D8D9DA;      /* page background: neutral grey */
  --paper-deep: #CACBCD; /* bands */
  --ink: #272C6B;        /* text: dark indigo */
  --muted: #4E5270;      /* secondary text */
  --line: #B1B3B7;       /* rules and borders */
  --button: #2C40C0;     /* buttons: vivid blue */
  --button-dark: #22329A;/* button hover */

  /* Level meter colours (no red: levels never clip) */
  --meter-green: #2E9A4A;
  --meter-yellow: #E3B420;
  --meter-orange: #E8741C;
  --rec: #C23A2E;        /* the red "recording" light, used sparingly */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;      /* comfortable line length for body text */
  --wrap: 72rem;         /* maximum page width */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--rec); outline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---------- Headings: condensed, like end-credit lettering ---------- */
h1, h2, h3 {
  font-stretch: 72%;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  word-spacing: 0.06em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.5rem; font-stretch: 85%; }

p { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--muted); }

/* ---------- Header ---------- */
/* The header with the menu stays at the top while scrolling */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
/* Links to a section stop below the fixed header (height measured by js/site.js) */
html { scroll-padding-top: calc(var(--header-h, 4.5rem) + 0.5rem); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}
.site-name {
  font-weight: 700; font-stretch: 80%; font-size: 1.5rem;
  text-decoration: none;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- Page sections ---------- */
main > section { padding-block: clamp(2.25rem, 5.5vw, 4rem); }
main > section + section { border-top: 1px solid var(--line); }
.band { background: var(--paper-deep); }

/* ---------- Home: hero ---------- */
.slate {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--muted); margin: 0;
}
/* Timecode in the same red as REC, but steady */
.timecode { color: var(--rec); }
/* REC light: dot and letters blink together in red */
.rec {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--rec); font-weight: 700;
  animation: rec-blink 1.6s steps(1) infinite;
}
.rec-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--rec); }
@keyframes rec-blink { 50% { opacity: 0.25; } }

/* Stereo level meter, within the text width */
.meters {
  display: grid; gap: 0.15rem; max-width: 40rem;
  margin-block: 1.25rem clamp(2rem, 5vw, 3.5rem);
}
.meter { display: flex; align-items: center; gap: 0.6rem; }
.meter-label { width: 0.8rem; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.meter-bar { flex: 1; display: flex; gap: 2px; height: 0.45rem; }
.seg { flex: 1; border-radius: 1px; opacity: 0.18; }
.seg.g { background: var(--meter-green); }
.seg.y { background: var(--meter-yellow); }
.seg.o { background: var(--meter-orange); }
.seg.on, .seg.peak { opacity: 1; }
/* End marker: the last orange segment, 1.5 times as long, with a thin black line inside. Never lights up. */
.seg.end {
  flex: 1.5; opacity: 1;
  background: color-mix(in srgb, var(--meter-orange) 22%, var(--paper));
  box-shadow: inset 0 0 0 1px #000;
}

/* When a button is clicked, recording stops: meters freeze, REC light stays on */
.is-stopped .rec { animation: none; opacity: 1; }

.h1-sub { display: block; font-size: 0.55em; font-stretch: 80%; margin-top: 0.3em; color: var(--muted); }
h1 { max-width: none; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block; padding: 0.8rem 1.4rem;
  border: 2px solid var(--button); color: var(--button);
  text-decoration: none; font-weight: 600;
}
.button-primary { background: var(--button); color: #fff; }
.button:hover { background: var(--button); color: #fff; }
.button-primary:hover { background: var(--button-dark); border-color: var(--button-dark); }

/* ---------- Two-column layout: heading left, content right ---------- */
.split { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 2fr; } }

.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.service-list li:first-child { border-top: 0; padding-top: 0; }
.service-list h3 { margin-bottom: 0.3em; }
.service-list p { margin: 0; color: var(--muted); }

/* ---------- Equipment ---------- */
.kit { display: grid; gap: 2.25rem 3rem; }
@media (min-width: 40rem) { .kit { grid-template-columns: repeat(2, 1fr); } .kit-wide { grid-column: 1 / -1; } }
.kit-group h3 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.75rem; }
.kit ul { margin: 0; padding: 0; list-style: none; }
.kit li { padding-block: 0.3rem; }
.kit-sub { display: grid; gap: 1.25rem 3rem; }
@media (min-width: 52rem) { .kit-sub { grid-template-columns: repeat(3, 1fr); } }
.kit-sub h4 { margin: 0 0 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* ---------- Credits table ---------- */
.table-scroll { overflow-x: auto; }
.credits { width: 100%; border-collapse: collapse; }
.credits-full { min-width: 36rem; }
.credits th, .credits td { text-align: left; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits th { font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.credits td:first-child { font-variant-numeric: tabular-nums; color: var(--muted); width: 4rem; }
.credits .title { font-weight: 600; }

/* ---------- Contact ---------- */
.contact-lines { font-size: clamp(1.4rem, 3vw, 2rem); font-stretch: 85%; font-weight: 600; line-height: 1.4; margin-bottom: 2rem; }
.contact-lines a { text-decoration: none; border-bottom: 2px solid var(--line); }
.contact-lines a:hover { border-color: var(--rec); }
.contact-lines .contact-note { font-weight: 400; font-size: 0.6em; display: inline-block; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }

/* ---------- Respect "reduce motion" settings ---------- */
@media (prefers-reduced-motion: reduce) {
  .rec { animation: none; }
}

/* ---------- Legal notice and privacy page ---------- */
.legal h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.5rem; }
.legal address { font-style: normal; margin-bottom: 1em; }

/* ---------- Home: selected work, one fold-out menu per field ---------- */
.genres { border-top: 1px solid var(--line); }
.genre { border-bottom: 1px solid var(--line); }
.genre > summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-block: 1rem; cursor: pointer; list-style: none;
}
.genre > summary::-webkit-details-marker { display: none; }
.genre-name { font-size: 1.5rem; font-weight: 700; font-stretch: 80%; }
.genre-count { color: var(--muted); font-variant-numeric: tabular-nums; }
/* plus / minus sign, drawn in CSS */
.genre > summary::after {
  content: "+"; font-size: 1.6rem; line-height: 1; color: var(--button); margin-left: auto; padding-left: 1rem;
}
.genre[open] > summary::after { content: "–"; }
.genre > summary:hover .genre-name { color: var(--button); }

.credit-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.credit {
  display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.15rem 0.75rem;
  padding-block: 0.7rem; border-top: 1px solid var(--line);
}
.credit-year { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; padding-top: 0.1rem; }
.credit-main .title { font-weight: 600; }
.credit-note { color: var(--muted); font-size: 0.9rem; }
.credit-meta { display: block; color: var(--muted); font-size: 0.9rem; }
.credit-role { grid-column: 2; font-size: 0.9rem; }
@media (min-width: 60rem) {
  .credit { grid-template-columns: 5.5rem 1fr 14rem; }
  .credit-role { grid-column: 3; text-align: right; }
}

/* "Show entire list" button: the full list replaces the top five while it is open */
.full-list { margin-bottom: 1.5rem; }
.full-list > summary { cursor: pointer; list-style: none; font-size: 0.95rem; padding: 0.6rem 1.1rem; }
.full-list > summary::-webkit-details-marker { display: none; }
.full-list .when-open, .full-list[open] .when-closed { display: none; }
.full-list[open] .when-open { display: inline; }
.full-list[open] > summary { margin-bottom: 1rem; }
.genre:has(.full-list[open]) .top-five { display: none; }

/* ---------- Home: productions, one row moving from right to left (above the footer) ---------- */
.productions h2 { margin-bottom: 1.5rem; }
.marquee {
  overflow: hidden;
  /* soft fade at both edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.marquee-track { display: flex; width: max-content; }
.marquee-track.is-looping { animation: marquee 60s linear infinite; }
/* Without JavaScript the row stays still and can be scrolled sideways */
.marquee:not(:has(.is-looping)) { overflow-x: auto; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-set { display: flex; align-items: flex-start; gap: 1rem; padding-right: 1rem; }

.tile { margin: 0; flex: none; }
.tile-poster { width: 4rem; }
.tile-logo { width: 6rem; }
.tile-image {
  display: grid; place-items: center; overflow: hidden;
  background: var(--paper-deep); border: 1px solid var(--line);
}
.tile-poster .tile-image { aspect-ratio: 2 / 3; }
.tile-logo .tile-image { aspect-ratio: 3 / 2; background: #fff; }
.tile-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-logo .tile-image { position: relative; }
.tile-logo .tile-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12%; box-sizing: border-box; }
.tile-placeholder { font-size: 0.55rem; line-height: 1.2; color: var(--muted); text-align: center; padding: 0.25rem; }
.tile figcaption { margin-top: 0.35rem; font-size: 0.68rem; line-height: 1.3; }
.tile figcaption .title {
  font-weight: 600;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; hyphens: auto;
}
.tile-year { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Reduce motion: a still row that can be scrolled sideways by hand */
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; padding-inline: 1.25rem; }
  .marquee-set[aria-hidden="true"] { display: none; }
}

/* ---------- Hero: title, then REC and meters, then tagline ---------- */
.hero h1 { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.hero .meters { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.tagline {
  font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 700; font-stretch: 72%;
  line-height: 1.05; letter-spacing: -0.01em; word-spacing: 0.06em;
  max-width: none; margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

/* Jump links: smooth scroll, and keep the section heading clear of the window edge */
html { scroll-behavior: smooth; }
#work { scroll-margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Biography ---------- */
.bio > * { max-width: 44rem; }
.bio h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 2.25rem 0 0.6rem; }
.bio h2:first-of-type { margin-top: 0; }

/* ---------- Equipment: summary for producers, and highlighted items ---------- */
.kit-summary {
  list-style: none; margin: 2rem 0 0; padding: 0; max-width: 46rem;
  display: grid; gap: 0 2.5rem;
}
@media (min-width: 40rem) { .kit-summary { grid-template-columns: repeat(2, 1fr); } }
.kit-summary li { padding: 0.6rem 0; border-top: 1px solid var(--line); font-weight: 600; }
.kit-highlight { position: relative; padding-left: 0.9rem !important; color: var(--button); font-weight: 600; }
.kit-highlight::before {
  content: ""; position: absolute; left: 0; top: 0.55em; bottom: 0.55em;
  width: 3px; background: var(--button); border-radius: 2px;
}
.kit-summary .kit-highlight::before { top: 0.75rem; bottom: 0.75rem; }

/* ---------- Selected work: links to the SSFV crew directory ---------- */
.other-lang { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); max-width: 20rem; }
.other-lang p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.other-lang ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.other-lang a { color: var(--button); font-weight: 600; font-size: 0.95rem; }

/* ---------- Contact: colleague network ---------- */
.booked { max-width: var(--measure); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.booked h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* Biography: links in the text */
.bio a { color: var(--button); font-weight: 600; }


/* Equipment summary: each point jumps to its section */
.kit-summary a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.kit-summary a:hover { text-decoration-color: currentColor; }
.kit-group { scroll-margin-top: 1rem; }
.kit-accent { color: var(--button); font-weight: 600; }

/* Equipment summary links: blue, like the other links on the site */
.kit-summary a { color: inherit; text-decoration: none; transition: color 0.15s; }
.kit-summary a:hover, .kit-summary a:focus-visible { color: var(--button); text-decoration: none; }

/* "Back to overview": only visible on the section reached from the summary */
.back-link { display: none; margin: 0.9rem 0 0; font-size: 0.9rem; text-align: left; }
.kit-group:target .back-link { display: block; }
.back-link a, .to-top a { color: var(--button); font-weight: 600; text-decoration: none; }
.back-link a:hover, .to-top a:hover { text-decoration: underline; }
#overview { scroll-margin-top: 0; }

/* "Back to top" at the end of every page */
.to-top { text-align: left; font-size: 0.9rem; padding-block: 1.25rem; margin: 0 auto; max-width: none; }

/* ---------- Page photo ---------- */
.page-photo { margin: 2rem 0 0; }
.page-photo img { width: 100%; height: auto; border-radius: 2px; }
@media (min-width: 60rem) {
  .page-intro { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: end; }
  .page-photo { margin: 0; }
}

/* About me photo (home) */
.about-photo { margin: 0; }
.about-photo img, .bio-photo img { width: 100%; height: auto; border-radius: 2px; }
@media (min-width: 52rem) {
  .about > h2 { grid-column: 1; grid-row: 1; }
  .about > div { grid-column: 2; grid-row: 2; align-self: start; }
  .about > div > :first-child { margin-top: 0; }
  .about-photo { grid-column: 1; grid-row: 2; max-width: 16rem; }
}

/* Biography photos: underneath the section text */
.bio > .bio-photo { margin: 1.25rem 0 0; width: min(100%, 26rem); }
.bio > .bio-photo-tall { width: min(100%, 18rem); }
.bio-photo img { width: 100%; height: auto; border-radius: 2px; }

/* Contact: portrait beside the contact details, rest below */
@media (min-width: 60rem) {
  .contact-intro { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: end; }
  .contact-intro .contact-booked { grid-column: 1 / -1; }
  .contact-intro .page-photo { max-width: 15rem; justify-self: end; }
}

/* Equipment: second photo at the bottom */
.kit-photo { margin: 2.5rem 0 0; width: min(100%, 30rem); }
.kit-photo img { width: 100%; height: auto; border-radius: 2px; }

/* Equipment intro: photo top lines up with the top line of the overview list */
@media (min-width: 60rem) {
  .equipment-intro .page-intro-text { display: contents; }
  .equipment-intro > .page-intro-text > h1 { grid-column: 1; grid-row: 1; }
  .equipment-intro > .page-intro-text > .lead { grid-column: 1; grid-row: 2; }
  .equipment-intro > .page-intro-text > .kit-summary { grid-column: 1; grid-row: 3; }
  .equipment-intro > .page-photo { grid-column: 2; grid-row: 3; align-self: start; margin-top: 2rem; }
  .equipment-intro { row-gap: 0; align-items: start; }
}

/* Link from Services to Selected work */
.more-link { margin: 2rem 0 0; }
.more-link a { color: var(--ink); font-weight: 600; text-decoration: none; transition: color 0.15s; }
.more-link a:hover, .more-link a:focus-visible { color: var(--button); }
@media (min-width: 52rem) { .split > .more-link { grid-column: 2; margin-top: 0.5rem; } }
