/* ==========================================================================
   Base: reset, document, typography roles, focus, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-primary);
  scrollbar-color: var(--velvet-4) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A faint warm light leak and a cool shadow give the page depth without
   competing with artwork. Fixed, so it never repaints on scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 8% -6%, rgb(var(--brass-rgb) / 0.07), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 100%, rgb(96 64 140 / 0.08), transparent 70%);
}

img, svg, video { display: block; max-width: 100%; }
img { border: 0; }

h1, h2, h3, h4, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::selection { background: rgb(var(--brass-rgb) / 0.35); color: var(--ivory); }

[hidden] { display: none !important; }

/* ---- Typography roles -------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

.heading {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.012em;
  line-height: var(--leading-snug);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: var(--reading-max);
}

.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- Focus --------------------------------------------------------------
   Visible on keyboard, remote and controller input; never on mouse clicks. */

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Utilities ---------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-splash);
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ivory);
  color: var(--text-on-light);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* Locks page scroll under the details panel and the player. */
html.is-locked,
html.is-locked body { overflow: hidden; }
html.is-locked body { padding-right: var(--scrollbar-comp, 0px); }

/* ---- Splash -------------------------------------------------------------
   Only visible for the moment between first paint and the session check. */
.splash {
  position: fixed;
  inset: 0;
  z-index: var(--z-splash);
  display: grid;
  place-items: center;
  background: var(--bg-primary);
  transition: opacity var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
}
.splash.is-gone { opacity: 0; visibility: hidden; }
.splash__mark {
  width: 3.5rem;
  color: var(--accent);
  animation: splash-breathe 1.6s var(--ease-in-out) infinite alternate;
}
@keyframes splash-breathe {
  from { opacity: 0.45; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Reduced motion ----------------------------------------------------
   Keep state changes (fades) but drop movement, loops and parallax. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
