/* dancealive-links — single-page stylesheet.
   Theme tokens are custom properties switched on prefers-color-scheme.
   Measured WCAG 2.x contrast (see README palette table). Both themes use LIGHT
   button text, so both buttons are a deep blue; ratios below are worst-case
   against the glass card composited over the background photo's extremes:
     light: text 11.77:1 · button-vs-card 3.34:1 · label 5.23:1 · desc 4.76:1
     dark:  text 14.35:1 · button-vs-card 3.38:1 · label 4.75:1 · desc 4.75:1
   The brand blue #29b9f2 is NOT used on this page: it is 2.25:1 under white and
   fails AA outright. Light mode uses #0973a6, dark mode #0e7ba9. */

@font-face {
  font-family: "Cinzel";
  src: url("/fonts/cinzel-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans-latin-var.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* light theme (default) */
  --bg: #f7fafc;
  --text: #141414;
  --accent: #0973a6;
  --accent-hover: #085e88;
  --button-text: #ffffff;
  /* 4.76:1 on --accent, 6.44:1 on --accent-hover — both clear AA. */
  --button-text-muted: #eaf6fd;
  /* Frosted glass. The alpha is NOT a free parameter: every ratio below was
     re-measured against the composite of this card over the darkest AND
     brightest pixels of the background photo, unblurred — so it holds even
     where backdrop-filter is unsupported and no blur softens the backdrop.
     Worst case at 0.82: body text 11.77:1, button-vs-card 3.34:1. Do not
     lower it without re-running that math. */
  --surface: rgba(247, 250, 252, 0.82);
  --card-border: rgba(255, 255, 255, 0.55);
  --card-shadow: 0 18px 50px rgba(6, 22, 33, 0.34);
  --scrim: rgba(8, 26, 38, 0.42);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --text: #f2f2f2;
    /* Dark mode uses LIGHT button text, which forces a darker button than the
       brand blue: #29b9f2 under white is 2.25:1 and fails outright. #0e7ba9 is
       the one value that satisfies both constraints at once — white text 4.75:1
       AND 3.38:1 against the glass card. Brighter fails the text, darker fails
       the card boundary. There is very little room here; re-measure both if it
       is ever changed.
       #29b9f2 therefore no longer appears on this page at all. */
    --accent: #0e7ba9;
    /* Hover goes DARKER, not lighter — inverted from the light theme, because
       the text on it is light. Brightening would cut contrast. */
    --accent-hover: #0c6f99;
    --button-text: #ffffff;
    /* Full white, same as the label. #0e7ba9 leaves no headroom for a dimmed
       tone (white itself is only 4.75:1), so the description is set apart by
       size and weight alone — never colour. */
    --button-text-muted: #ffffff;
    /* Dark glass. Worst case at 0.82: body text 14.35:1, button-vs-card 3.38:1. */
    --surface: rgba(20, 20, 20, 0.82);
    --card-border: rgba(255, 255, 255, 0.14);
    --card-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    /* Heavier in dark mode: the card is near-black, so the photo needs to sit
       further back for the card edge to stay legible. */
    --scrim: rgba(4, 14, 20, 0.62);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* --bg is the solid fallback: it paints before the image decodes, and is what
     shows if the WebP fails. The image is decorative, hence CSS not <img>. */
  background-color: var(--bg);
  /* Scrim over the photo: darkens and de-saturates the liquid so the card reads
     as the foreground and the wave art doesn't compete with the button stack.
     Layered in the same property rather than a pseudo-element so there is no
     extra box to keep in sync. */
  background-image:
    linear-gradient(var(--scrim), var(--scrim)),
    url("/images/cosmic-liquid-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Covers the viewport without background-attachment: fixed, which repaints
     badly on iOS Safari during momentum scroll. */
  background-attachment: scroll;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

main {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.25rem;
  text-align: center;
  background: var(--surface);
  /* Frosted in light, dark glass in dark — the tint comes from --surface. */
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  /* A hairline edge so the card still reads as a distinct plane where the
     backdrop happens to match its tint. */
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  box-shadow: var(--card-shadow);
}

/* Brand lockup — logo left, wordmark right, centred as a group. */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

/* Sized to the wordmark's line box rather than standing taller than it — a
   matched band reads as one lockup instead of a logo with text beside it. */
.logo {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
}

.title {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0;
}

/* Full card width, below the lockup — three clauses need the room. */
.tagline {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 auto 0.75rem;
  max-width: 22rem;
}

.subtext {
  font-size: 0.9375rem;
  margin: 0 auto 1.75rem;
  max-width: 24rem;
}

/* Very narrow screens: stack the lockup so the wordmark never wraps mid-word. */
@media (max-width: 359px) {
  .brand {
    flex-direction: column;
    gap: 0.5rem;
  }

  .title {
    font-size: 1.5rem;
  }
}

.links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-item + .link-item {
  margin-top: 0.875rem;
}

.link {
  display: flex;
  /* Column so the optional Phase-2 .link-desc stacks under the label instead of
     sitting beside it. With a label alone the gap collapses and this renders
     identically to a plain centred button. */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--button-text);
  border-radius: 0.75rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
}

.link-label {
  display: block;
}

/* The optional per-link description — also the ADR-001 Phase-2 `description`
   slot, so generated markup needs no CSS change (HANDOFF §5). In use on two
   buttons today. Secondary emphasis is size and weight, never opacity: a
   translucent white drops under 4.5:1 on --accent. In dark mode this token is
   full white for exactly that reason — #0e7ba9 leaves no room to dim it. */
.link-desc {
  display: block;
  color: var(--button-text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
}

.link:hover {
  background: var(--accent-hover);
}

.link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .link {
    transition: background-color 120ms ease-out, transform 80ms ease-out;
  }

  .link:active {
    transform: scale(0.985);
  }
}
