/* ==================================================================== *
 *  SOUNDS OF SAVING — global styles — "Liner Notes" design system
 *
 *  Warm paper + ink, dusk-violet accent, a serif body and a grotesque
 *  display. Tokens live in tokens.css; fonts in fonts.css; this file only
 *  consumes them. Sections: Reset · Base · Type roles · Layout · Header /
 *  nav · Buttons · Footer · Imagery treatment · Utilities · Responsive.
 * ==================================================================== */

@import "fonts.css";
@import "tokens.css";

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

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

body,
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }

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

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

/* — Base ——————————————————————————————————————————————————— */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  letter-spacing: var(--tracking);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}

h1 { font-size: var(--fs-title); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { max-width: var(--maxw-prose); }

/* Eyebrows / labels / tracklist tags — Space Mono, uppercase, wide tracking.
   Reusable class; inline-styled eyebrows in templates still pick up
   --font-mono via their own rules once they switch to this token. */
.eyebrow,
.label,
.mono {
  font-family: var(--font-mono);
  font-weight: var(--fw-regular);
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }

strong { font-weight: var(--fw-semibold); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--white);
  padding: var(--space-2xs) var(--space-sm);
  z-index: 100;
}
.skip:focus { left: var(--space-sm); }

/* — Layout ——————————————————————————————————————————————————— */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-xl);
}
.section--alt { background: var(--bg-alt); }

main { min-height: 50vh; }

/* — Header / nav ————————————————————————————————————————————— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h);
  padding-block: var(--space-2xs);
}
.site-header__brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.site-header__logo {
  height: 44px;
  width: auto;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: var(--space-2xs);
}

.site-nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}
.site-nav__links,
.site-nav__cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.site-nav a {
  color: var(--text);
  font-weight: var(--fw-medium);
  font-size: var(--fs-small);
}
.site-nav__links a:hover,
.site-nav__links a[aria-current="page"] { color: var(--accent); }
.site-nav__donate { color: var(--text); }
.site-nav__donate:hover { color: var(--accent); }

/* Overlay header (home only): transparent over the hero video, white text,
   logo hidden (it lives in the hero); turns solid white once scrolled. */
.site-header--overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: transparent;
  border-bottom-color: transparent;
}
.site-header--overlay .site-header__brand { display: none; }
.site-header--overlay .site-nav a,
.site-header--overlay .site-nav__donate,
.site-header--overlay .nav-toggle { color: var(--white); }
.site-header--overlay .btn--stroke { border-color: var(--white); color: var(--white); }
.site-header--overlay .btn--stroke:hover { background: var(--white); color: var(--text); }
.site-header--overlay.is-solid {
  background: var(--white);
  border-bottom-color: var(--border);
}
.site-header--overlay.is-solid .site-header__brand { display: inline-flex; }
.site-header--overlay.is-solid .site-nav a,
.site-header--overlay.is-solid .site-nav__donate,
.site-header--overlay.is-solid .nav-toggle { color: var(--text); }
.site-header--overlay.is-solid .btn--stroke { border-color: var(--accent); color: var(--accent); }
.site-header--overlay.is-solid .btn--stroke:hover { background: var(--accent); color: var(--white); }

/* — Buttons ————————————————————————————————————————————————— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xs) var(--space-md);
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--primary {
  background: var(--accent);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--accent-deep);
  color: var(--paper);
}
.btn--ghost {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--ghost:hover {
  background: var(--accent);
  color: var(--white);
}
.btn--stroke {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn--stroke:hover {
  background: var(--accent);
  color: var(--white);
}
.site-nav .btn--primary { color: var(--white); }

/* — Footer ——————————————————————————————————————————————————— */
.site-footer {
  background: var(--white-smoke);
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl);
  font-size: var(--fs-small);
}
.site-footer__inner {
  display: grid;
  gap: var(--space-lg);
}
.crisis {
  display: grid;
  gap: var(--space-2xs);
  justify-items: center;
  text-align: center;
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.crisis__name {
  font-weight: var(--fw-semibold);
  color: var(--black);
  font-size: var(--fs-base);
}
.crisis__line { color: var(--text-muted); }
.crisis__line a { color: var(--accent); font-weight: var(--fw-semibold); }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.footer-brand img { height: 40px; width: auto; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.socials a {
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}
.socials a:hover { color: var(--accent); }

.footer-fine {
  color: var(--text-faint);
  font-size: var(--fs-tiny);
}
.footer-fine a { color: var(--text-faint); text-decoration: underline; }
.footer-fine a:hover { color: var(--accent); }

/* — Imagery treatment system ("Liner Notes") ————————————————————————— *
 *
 *  Full color is the DEFAULT. Real faces carry the humanity, so good images
 *  stay untouched. The salvage treatment is OPT-IN, for genuinely low-res
 *  assets only — never apply a global tint to all images.
 *
 *  HOW TO USE
 *  ----------
 *  Good image (default — full color, just a frame/aspect helper):
 *    <figure class="media media--full">
 *      <img src="..." alt="...">
 *      <figcaption class="caption">Artist — Song, 2019</figcaption>
 *    </figure>
 *
 *  Low-quality image to rescue (dusk-violet duotone + film grain at rest,
 *  BLOOMS to full color on hover/focus; caption framed like a liner note):
 *    <figure class="media media--salvage">
 *      <img src="grainy-old-photo.jpg" alt="...">
 *      <figcaption class="caption">Salvaged still, c. 2010</figcaption>
 *    </figure>
 *
 *  --salvage-shadow / --salvage-light / --grain-opacity are tokens; the grain
 *  is an inline data-URI SVG (fractal noise), so no extra asset request.
 * ------------------------------------------------------------------------ */
.media {
  display: block;
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-3);
}
.media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Full color — the default for good assets. No tint, ever. */
.media--full img { filter: none; }

/* Salvage — duotone + grain at rest, full color on hover/focus.
   The duotone is a soft multiply of the dusk-violet over the desaturated
   image; the grain overlay sits above via ::after. */
.media--salvage img {
  filter: grayscale(1) contrast(1.05) brightness(1.02);
  transition: filter 320ms ease;
}
.media--salvage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
  background: linear-gradient(
    160deg,
    var(--salvage-light) 0%,
    var(--salvage-shadow) 100%
  );
  opacity: 0.55;
  transition: opacity 320ms ease;
}
/* Film grain — inline SVG fractal noise, low opacity, repeats cheaply. */
.media--salvage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
/* Bloom to full color on hover / keyboard focus within the figure. */
.media--salvage:hover img,
.media--salvage:focus-within img {
  filter: none;
}
.media--salvage:hover::before,
.media--salvage:focus-within::before { opacity: 0; }
.media--salvage:hover::after,
.media--salvage:focus-within::after { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .media--salvage img,
  .media--salvage::before,
  .media--salvage::after { transition: none; }
}

/* Liner-note caption frame — Space Mono, small, muted. */
.caption {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-wide);
  color: var(--ink-muted);
  padding: var(--space-2xs) 0 0;
}
.media .caption {
  padding: var(--space-2xs) var(--space-xs) var(--space-xs);
}

/* — Utilities ————————————————————————————————————————————————— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* — Responsive ————————————————————————————————————————————————— */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2xs);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) var(--gutter);
  }
  .site-nav__links,
  .site-nav__cta {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2xs);
  }
  .site-header { position: relative; }
  /* The mobile dropdown is always a solid white panel, even in overlay mode. */
  .site-header--overlay { position: relative; background: var(--white); }
  .site-header--overlay .site-header__brand { display: inline-flex; }
  .site-header--overlay .site-nav a,
  .site-header--overlay .site-nav__donate,
  .site-header--overlay .nav-toggle { color: var(--text); }
  .site-header--overlay .btn--stroke { border-color: var(--accent); color: var(--accent); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding-block: var(--space-2xs); }
  .site-nav__cta .btn--stroke {
    margin-top: var(--space-2xs);
    align-self: flex-start;
  }

  .footer-meta { flex-direction: column; align-items: flex-start; }
}
