/* The Black Ledger — ledger law as luxury dark UI
   Aligned: deep dossier (traceability, Ledger tone) + tribunal art brief (ink, ash, seal, triptych) */

:root {
  --bg-void: #040508;
  --bg-deep: #080a0f;
  --bg-raised: #0e1018;
  --bg-panel: #12151e;
  --bg-ash: #d4cfc4;
  --ink: #ebe6dc;
  --ink-soft: #b8b3a8;
  --ink-muted: #8a8578;
  --ink-blue: #5a6d8a;
  --ink-blue-dim: #3d4a5e;
  --violet-deep: #2a2438;
  --ember: #c2542c;
  --ember-glow: rgba(194, 84, 44, 0.45);
  --ember-dim: #7a3319;
  --gold: #c4a035;
  --gold-soft: rgba(196, 160, 53, 0.35);
  --gold-dim: #8a7028;
  --edge: rgba(196, 160, 53, 0.18);
  --edge-strong: rgba(196, 160, 53, 0.35);
  --rib: rgba(235, 230, 220, 0.045);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-manuscript: "Spectral", Georgia, serif;
  --space: clamp(1rem, 4vw, 2rem);
  --max: 72rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg-void);
  font-optical-sizing: auto;
}

/*
 * Default link colour.
 *
 * This stylesheet had none: every link was styled by its component (.nav a,
 * .btn, .logo), so any bare <a> fell through to the browser default — blue,
 * on a near-black page, effectively unreadable. It failed silently, and it
 * had already caught the in-prose link in the "game in the world's own words"
 * section long before the studio credit in the footer joined it.
 *
 * Component rules out-specify this one and are unaffected.
 */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--bg-void);
  font-weight: 600;
  z-index: 200;
}
.skip-link:focus {
  left: 1rem;
}

/* —— Header —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(4, 5, 8, 0.94) 0%, rgba(4, 5, 8, 0.78) 70%, transparent 100%);
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease-out), border-color 0.35s;
}

.site-header.is-scrolled {
  background: rgba(8, 10, 15, 0.88);
  border-bottom-color: var(--edge);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  font-optical-sizing: auto;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gold-soft), inset 0 0 8px rgba(196, 160, 53, 0.15);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
}

.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--gold);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(5.5rem + var(--space)) var(--space) calc(var(--space) * 2);
  overflow: hidden;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-aurora {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 210deg at 70% 40%, transparent 0deg, rgba(90, 109, 138, 0.12) 60deg, transparent 120deg),
    radial-gradient(ellipse 100% 80% at 50% -10%, rgba(74, 92, 114, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(194, 84, 44, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 100% 60%, rgba(196, 160, 53, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #0a0c12 0%, var(--bg-void) 45%, #06070a 100%);
  animation: aurora-shift 28s ease-in-out infinite alternate;
}

@keyframes aurora-shift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-2%, 1%) scale(1.03);
    opacity: 0.92;
  }
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 50% at 50% 50%, transparent 0%, rgba(4, 5, 8, 0.5) 100%);
}

.hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hero-geometry {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--edge);
}

.hero-ring--outer {
  width: min(85vw, 720px);
  height: min(85vw, 720px);
  border-style: dashed;
  border-color: rgba(196, 160, 53, 0.12);
  animation: ring-drift 40s linear infinite;
}

.hero-ring--inner {
  width: min(62vw, 520px);
  height: min(62vw, 520px);
  border-color: rgba(90, 109, 138, 0.2);
}

@keyframes ring-drift {
  to {
    transform: rotate(360deg);
  }
}

.hero-diamond {
  position: absolute;
  width: min(28vw, 200px);
  height: min(28vw, 200px);
  border: 1px solid rgba(196, 160, 53, 0.15);
  transform: rotate(45deg);
  box-shadow: 0 0 60px rgba(90, 109, 138, 0.08);
}

.hero-triptych {
  position: absolute;
  right: clamp(0.5rem, 4vw, 4rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: clamp(0.35rem, 1.5vw, 0.85rem);
  height: min(58vh, 420px);
  opacity: 0.85;
}

.hero-triptych__col {
  width: clamp(3px, 0.45vw, 6px);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, var(--c, #5a6d8a) 15%, var(--c, #5a6d8a) 85%, transparent 100%);
  box-shadow: 0 0 32px var(--glow, rgba(90, 109, 138, 0.35));
  animation: triptych-pulse 6s ease-in-out infinite;
}

.hero-triptych__col--scribe {
  --c: #6b7f96;
  --glow: rgba(107, 127, 150, 0.4);
  animation-delay: 0s;
}

.hero-triptych__col--assessor {
  --c: #c8c4b8;
  --glow: rgba(200, 196, 184, 0.25);
  animation-delay: 0.6s;
}

.hero-triptych__col--executor {
  --c: #c2542c;
  --glow: var(--ember-glow);
  animation-delay: 1.2s;
}

@keyframes triptych-pulse {
  0%,
  100% {
    opacity: 0.65;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.15);
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.hero-copy {
  max-width: min(42rem, 100%);
}

@media (min-width: 1100px) {
  .hero-copy {
    max-width: 36rem;
  }
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-blue);
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.hero-kicker__dot {
  color: var(--gold-dim);
  opacity: 0.7;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(2.75rem, 7.5vw, 4.75rem);
  line-height: 1.02;
  margin: 0 0 1.5rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.hero-title__accent {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold) 0%, var(--ember) 55%, #e8b84a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.hero-dek {
  font-family: var(--font-manuscript);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  max-width: 38ch;
}

.hero-dek q {
  font-style: italic;
  color: var(--gold);
}

.hero-lead {
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 40ch;
  margin: 0 0 2.25rem;
  line-height: 1.7;
}

.hero-lead strong {
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, filter 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(165deg, #d4623a 0%, var(--ember-dim) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(194, 84, 44, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 8px 32px rgba(194, 84, 44, 0.35);
}

.btn-ghost {
  background: rgba(18, 21, 30, 0.6);
  color: var(--gold);
  border-color: var(--edge-strong);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(196, 160, 53, 0.1);
  border-color: var(--gold-dim);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  opacity: 0.65;
}

.hero-scroll__line {
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(180deg, var(--gold-dim), transparent);
  animation: scroll-line 2.5s ease-in-out infinite;
}

@keyframes scroll-line {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.6);
    transform-origin: top;
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
}

@media (max-width: 900px) {
  .hero-triptych {
    right: 1rem;
    opacity: 0.45;
    height: 40vh;
  }
  .hero-geometry {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora,
  .hero-ring--outer,
  .hero-triptych__col,
  .hero-scroll__line {
    animation: none;
  }
  .hero-aurora {
    transform: none;
  }
}

/* —— Intro (lore + premise) —— */
.section--intro {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0a0c12 50%, var(--bg-raised) 100%);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}

.intro-lede {
  font-size: 1.1rem;
  color: var(--ink-muted);
  margin: 0 0 2.25rem;
  line-height: 1.65;
}

.intro-split {
  display: grid;
  gap: 0;
  border: 1px solid var(--edge);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(4, 5, 8, 0.5);
}

@media (min-width: 900px) {
  .intro-split {
    grid-template-columns: 1fr 1fr;
  }
}

.intro-panel {
  padding: clamp(1.35rem, 3vw, 2rem);
  text-align: left;
}

.intro-panel--lore {
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(160deg, rgba(14, 16, 24, 0.9) 0%, rgba(8, 10, 15, 0.95) 100%);
}

.intro-panel--game {
  background: linear-gradient(160deg, rgba(18, 20, 28, 0.95) 0%, rgba(10, 12, 18, 0.98) 100%);
}

@media (min-width: 900px) {
  .intro-panel--lore {
    border-bottom: none;
    border-right: 1px solid var(--edge);
  }
}

.intro-panel p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  color: var(--ink-muted);
  line-height: 1.72;
  max-width: 52ch;
}

.intro-panel p:last-child {
  margin-bottom: 0;
}

.intro-subhead {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.intro-panel--game .intro-subhead {
  color: var(--ember);
}

/* —— Sections —— */
.section {
  padding: calc(var(--space) * 2.75) var(--space);
  position: relative;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.max-prose {
  max-width: 62ch;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.section-lead {
  font-size: 1.08rem;
  color: var(--ink-muted);
  max-width: 65ch;
  margin: 0;
  line-height: 1.68;
}

.section-lead a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(196, 160, 53, 0.35);
  text-underline-offset: 0.2em;
}

.section-lead a:hover {
  color: var(--ink-soft);
  text-decoration-color: var(--gold-dim);
}

.section--dark {
  background: var(--bg-deep);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}

.section--ledger {
  background: linear-gradient(180deg, var(--bg-panel) 0%, #0f1219 100%);
  border-top: 1px solid var(--edge);
}

.ledger-figure {
  margin: 0 auto 2rem;
  max-width: min(40rem, 100%);
  border-radius: clamp(1rem, 4vw, 1.75rem);
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--edge),
    0 32px 64px -28px rgba(0, 0, 0, 0.75);
}

.ledger-figure__art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  /* Feather edges into the section so the crop feels soft, not razor-sharp */
  -webkit-mask-image: radial-gradient(
    ellipse 92% 88% at 50% 50%,
    #000 55%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 92% 88% at 50% 50%,
    #000 55%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.section--contradiction {
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(90, 109, 138, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 30%, rgba(194, 84, 44, 0.08) 0%, transparent 45%),
    var(--bg-raised);
  border-top: 1px solid var(--edge);
}

.section-epithet {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--gold-dim);
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.section--tribunal {
  position: relative;
  background: var(--bg-deep);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  overflow: hidden;
}

.section--tribunal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 5px, var(--rib) 5px, var(--rib) 6px);
  opacity: 0.6;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.section--tribunal .section-inner {
  position: relative;
  z-index: 1;
}

.oath {
  font-family: var(--font-manuscript);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--bg-ash);
  margin: 1.75rem 0 2.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(212, 207, 196, 0.15);
  border-left: 3px solid var(--ember-dim);
  background: linear-gradient(125deg, rgba(22, 24, 32, 0.95) 0%, rgba(12, 14, 20, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px rgba(0, 0, 0, 0.25);
  max-width: 44ch;
}

.section--cta {
  background: radial-gradient(ellipse 80% 90% at 50% 100%, rgba(194, 84, 44, 0.18) 0%, transparent 55%), var(--bg-void);
  border-top: 1px solid var(--edge);
}

.two-col {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.pull-quote {
  font-family: var(--font-manuscript);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--gold);
  border-left: 3px solid var(--ink-blue);
  margin: 1.75rem 0 0;
  padding-left: 1.35rem;
  line-height: 1.45;
}

.pull-quote--hero {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
}

.panel {
  background: rgba(4, 5, 8, 0.65);
  border: 1px solid var(--edge);
  padding: 1.5rem 1.6rem;
  border-radius: 4px;
  margin-top: 2rem;
}

.panel--ledger-foot {
  border-left: 2px solid var(--ink-blue-dim);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-optical-sizing: auto;
}

.panel-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

.panel-text q {
  font-style: italic;
  color: var(--ink-soft);
}

.pillars {
  margin: 1.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-muted);
  max-width: 58ch;
}

.pillars li {
  margin-bottom: 0.75rem;
}

.pillars strong {
  color: var(--ink-soft);
}

.term {
  color: var(--gold);
  font-style: italic;
}

.grid-three {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

@media (min-width: 720px) {
  .grid-three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  --card-accent: var(--gold-dim);
  background: linear-gradient(165deg, rgba(12, 14, 20, 0.98) 0%, rgba(6, 7, 10, 0.99) 100%);
  border: 1px solid rgba(196, 160, 53, 0.12);
  padding: 1.4rem 1.4rem 1.5rem;
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s var(--ease-out), border-color 0.25s;
}

.card:hover {
  transform: translateY(-3px);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--card-accent), transparent);
  opacity: 0.7;
  border-radius: 4px 4px 0 0;
}

.card-office {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--card-accent);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.card h3.card-epithet {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  font-weight: 600;
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-optical-sizing: auto;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.card-phase {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.card h3:not(.card-epithet) {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-optical-sizing: auto;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

.card--scribe {
  --card-accent: #7a8fa8;
  border-color: rgba(122, 143, 168, 0.22);
}

.card--assessor {
  --card-accent: #c8c4b8;
  border-color: rgba(200, 196, 184, 0.14);
}

.card--executor {
  --card-accent: var(--ember);
  border-color: rgba(194, 84, 44, 0.25);
}

.muted {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-top: 2.25rem;
  line-height: 1.55;
}

.muted code {
  font-size: 0.78em;
  color: var(--ink-soft);
  word-break: break-all;
}

.cta-inner {
  text-align: center;
}

.cta-inner .hero-actions {
  justify-content: center;
  margin-top: 1.75rem;
}

.cta-inner p {
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--ink-muted);
  line-height: 1.65;
}

.cta-inner code {
  color: var(--ink-soft);
  font-size: 0.88em;
}

.site-footer {
  border-top: 1px solid var(--edge);
  padding: 2.5rem var(--space);
  background: linear-gradient(180deg, var(--bg-void) 0%, #020305 100%);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.footer-small {
  font-size: 0.8rem;
  margin-top: 0.6rem;
  opacity: 0.82;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover,
  .btn-ghost:hover,
  .card:hover {
    transform: none;
  }
}

/* —— Scroll reveal —— */
/*
 * Scroll reveal, gated on JavaScript being alive.
 *
 * These rules used to apply unconditionally, which meant 37 elements sat at
 * opacity 0 waiting for main.js. If the script failed to load — a blocked CDN,
 * a parse error, an extension — the page was not degraded, it was blank, and
 * nothing said so. The `.js` class is added by an inline script in the head, so
 * without JS the content is simply visible and unanimated.
 */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger container: don't move the wrapper, animate children */
[data-reveal="stagger"] {
  transform: none;
}

.js [data-reveal="stagger"] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

[data-reveal="stagger"].is-visible > *:nth-child(1) { transition-delay: 0s; }
[data-reveal="stagger"].is-visible > *:nth-child(2) { transition-delay: 0.13s; }
[data-reveal="stagger"].is-visible > *:nth-child(3) { transition-delay: 0.26s; }

[data-reveal="stagger"].is-visible > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal="stagger"] > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* —— Ambient sound toggle —— */
.sound-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem 0.5rem 0.65rem;
  background: rgba(8, 10, 15, 0.82);
  border: 1px solid var(--edge);
  border-radius: 2rem;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.sound-btn:hover {
  color: var(--gold);
  border-color: var(--edge-strong);
  background: rgba(8, 10, 15, 0.92);
}

.sound-btn.is-playing {
  color: var(--gold);
  border-color: var(--edge-strong);
  box-shadow: 0 0 16px rgba(196, 160, 53, 0.12);
}

.sound-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sound-wave {
  opacity: 0;
  transition: opacity 0.4s;
}

.sound-btn.is-playing .sound-wave {
  opacity: 1;
}
