/* ==========================================================================
   alberionlive.com
   One page, one gradient. See docs/website-design-doc.md.
   ========================================================================== */

:root {
  /* Palette sampled directly from the banner artwork (deploy/sample-palette.py).
     The design doc's §3.1 values were flagged there as approximations; these
     are the measured ones and run noticeably more saturated. --dusk is the one
     exception: the artwork's low sky reads periwinkle, but the doc explicitly
     calls for a warm mauve band, so the doc's value is kept. To revert the whole
     system to the doc's numbers, only this block changes. */
  --sky:      #3FA9FC;
  --sky-mid:  #8DC7FE;
  --lavender: #BDC2EF;
  --dusk:     #D5BCCB;
  --ridge:    #CEB9A6;
  --basin:    #1A1B22;
  --white:    #FFFFFF;

  --ink:      var(--basin);
  --ink-soft: rgba(26, 27, 34, 0.72);

  /* 1.25 type scale off a 1rem base. */
  --t--1: 0.8rem;
  --t-0:  1rem;
  --t-1:  1.25rem;
  --t-2:  1.5625rem;
  --t-3:  1.9531rem;
  --t-4:  2.4414rem;

  --display: 'Jost', system-ui, sans-serif;
  --body:    'Karla', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --measure: 62ch;
}

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

html {
  scroll-behavior: smooth;
  /* The nav is sticky, so anchored sections must not slide under it. */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--basin);
  color: var(--ink);
  font: 400 var(--t-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, picture, svg { max-width: 100%; }

a { color: inherit; }

:where(a, button):focus-visible {
  outline: 2px solid var(--basin);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 46rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--basin);
  color: var(--white);
  padding: 0.75rem 1rem;
  font: 400 var(--t--1)/1 var(--mono);
}
.skip-link:focus { left: 0; }

/* --- Nav ----------------------------------------------------------------- */
/* Always a light translucent plate, never transparent-to-content: the page
   descends into near-black, and a plate is what keeps one ink colour legible
   from top to bottom. */

.nav {
  /* Fixed, not sticky: sticky leaves the nav sitting on the body background
     above the hero, which turns the translucent plate into a grey bar. Fixed
     puts it over the artwork, which is what "translucent over the gradient"
     means. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(26, 27, 34, 0.08);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  max-width: 68rem;
  margin-inline: auto;
  padding: 0.9rem var(--gutter);
}

.nav__mark {
  font: 300 var(--t-0)/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}

.nav__links,
.nav__social,
.footer__links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links { gap: clamp(0.9rem, 3vw, 2rem); }

.nav__links a {
  font-size: var(--t--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 220ms ease, opacity 220ms ease;
}
.nav__links a:hover { border-bottom-color: var(--basin); }

.nav__social { gap: 0.85rem; margin-left: 0.5rem; }

.nav__social a {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  transition: background-color 220ms ease;
}
/* The orbs from the banner sky, reused as the hover glow. Sparingly. */
.nav__social a:hover { background: rgba(255, 255, 255, 0.85); }

.nav__social svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: var(--basin);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.nav__social svg .fill { fill: var(--basin); stroke: none; }

/* --- Hero ---------------------------------------------------------------- */
/* The art is placed at its natural aspect rather than cropped to the viewport:
   the composition already solves the hero problem, and letting it keep its
   own proportions means zero layout shift and no lost ridgeline. */

.hero { position: relative; background: var(--sky); }

/* The photograph ends on a dark treeline and the page resumes in lavender,
   which meets as a hard horizontal cut. Dissolving the last sliver into the
   descent reads as haze settling in the valley and keeps the ridgeline --
   the actual anchor -- completely intact. */
.hero::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 10%;
  background: linear-gradient(to bottom,
    rgba(189, 194, 239, 0) 0%,
    rgba(189, 194, 239, 0.35) 58%,
    var(--lavender) 100%);
  pointer-events: none;
}

.hero__art {
  display: block;
  width: 100%;
  height: auto;
}

/* 62% is measured, not eyeballed: deploy/measure-hero.py finds the clear sky
   between the wordmark's baseline and the ridgeline in each crop. The wide
   banner's gap runs 45.0%-81.1% (centre 63.1%) and the square lockup's runs
   50.2%-72.5% (centre 61.4%), so one centred value clears both. */
.hero__copy {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  width: min(90%, 44rem);
  text-align: center;
}

/* The wordmark lives in the artwork. The <h1> is here for machines only --
   rendering it again would double the brand. */
.hero__title {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Dark ink, not white: at this height the sky is a pale periwinkle, where
   white lands around 1.6:1 and near-black clears 12:1. */
.hero__tagline {
  margin: 0;
  color: var(--ink);
  font-size: clamp(var(--t-0), 2.2vw, var(--t-2));
  letter-spacing: 0.01em;
  text-wrap: balance;
}

/* --- The descent --------------------------------------------------------- */
/* One gradient across every section below the hero. Sections are transparent
   bands within it; they have no backgrounds of their own. The dark tail is
   empty padding so body copy never sits on a low-contrast band, and it hands
   off to the footer at exactly --basin. */

.descent {
  background: linear-gradient(
    to bottom,
    var(--lavender)   0%,
    #C7C4E8          38%,
    var(--dusk)      68%,
    #A08D96          86%,
    var(--basin)    100%
  );
  padding-bottom: clamp(6rem, 14vw, 11rem);
}

.section { padding-block: clamp(3.5rem, 9vw, 6rem); }

.section__title {
  margin: 0 0 1.25rem;
  font: 300 clamp(var(--t-2), 4vw, var(--t-4))/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.32em;
}

.section__lede {
  margin: 0 0 2.25rem;
  max-width: var(--measure);
  font-size: var(--t-1);
  color: var(--ink-soft);
}

.section__aside {
  margin: 1.75rem 0 0;
  font-size: var(--t--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.section__aside a {
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 27, 34, 0.35);
  padding-bottom: 2px;
  transition: border-color 220ms ease;
}
.section__aside a:hover { border-bottom-color: var(--basin); }

/* --- Contour dividers ---------------------------------------------------- */

.contour {
  height: 96px;
  background: url('../assets/contour.svg') repeat-x center / 1200px 96px;
  /* Shifted by main.js on scroll. Declared here so the value exists even
     before the first scroll event. */
  background-position-x: 0px;
  opacity: 0.7;
  pointer-events: none;
}

/* --- Music --------------------------------------------------------------- */

/* Reserve the embed's final height up front so swapping the card for the
   iframe shifts nothing. 352px is what Spotify's own oEmbed returns for an
   album -- the compact 152px variant hides the tracklist. */
.player { min-height: 352px; }

/* Music runs without a lede -- the player already names the record -- so the
   player inherits the breathing room the lede used to provide. */
.section__title + .player { margin-top: 2.25rem; }

.player__card {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
  padding: 1rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  max-width: 34rem;
  transition: background-color 240ms ease, transform 240ms ease;
}
.player__card:hover {
  background: rgba(255, 255, 255, 0.48);
  transform: translateY(-2px);
}
.player__card img { display: block; width: 120px; height: 120px; border-radius: 2px; }

.player__meta { display: grid; gap: 0.3rem; }
.player__label {
  font: 400 var(--t--1)/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.player__name { font-size: var(--t-1); font-weight: 500; }
.player__cta {
  font-size: var(--t--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.player iframe {
  display: block;
  width: 100%;
  max-width: 34rem;
  height: 352px;
  border: 0;
  border-radius: 12px;
}

/* --- Games --------------------------------------------------------------- */
/* The one place the doc permits a darker, grittier treatment. Kept to a single
   card so it reads as an accent inside the system, not a second system. */

.lab {
  max-width: 40rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(rgba(26, 27, 34, 0.92), rgba(26, 27, 34, 0.92)),
    url('../assets/contour.svg') repeat center / 600px 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lab__status { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.1rem; }

.tag {
  font: 400 var(--t--1)/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  color: var(--ridge);
}

.lab__body { margin: 0 0 1.5rem; max-width: var(--measure); }

.lab__link { margin: 0; }
.lab__link a {
  font-size: var(--t--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 3px;
  transition: border-color 220ms ease;
}
.lab__link a:hover { border-bottom-color: var(--white); }
.lab :focus-visible { outline-color: var(--white); }

/* --- About --------------------------------------------------------------- */

.about__body {
  margin: 0 0 1.15rem;
  max-width: var(--measure);
  font-size: var(--t-1);
}

/* --- Footer -------------------------------------------------------------- */

.footer {
  background: var(--basin);
  color: rgba(255, 255, 255, 0.82);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer__links { flex-wrap: wrap; gap: clamp(1rem, 3vw, 2rem); }
.footer__links a {
  font-size: var(--t--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: border-color 220ms ease;
}
.footer__links a:hover { border-bottom-color: rgba(255, 255, 255, 0.7); }
.footer :focus-visible { outline-color: var(--white); }

.footer__legal {
  margin: 0;
  font: 400 var(--t--1)/1 var(--mono);
  color: rgba(255, 255, 255, 0.55);
}

/* --- Motion -------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms ease;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 700px) {
  /* The square lockup's sky gap is narrower, so keep the tagline to two tidy
     lines rather than letting it run the full width. */
  .hero__copy { width: min(92%, 21rem); }
  .nav__mark { letter-spacing: 0.22em; font-size: var(--t--1); }
  .nav__links a { letter-spacing: 0.04em; }
  .player__card { flex-direction: column; align-items: flex-start; }
  .player__card img { width: 100%; height: auto; aspect-ratio: 1; }
  .footer__inner { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .nav__social { display: none; }
}

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
