:root {
  --bg: #05070a;
  --surface: rgba(13, 16, 22, 0.82);
  --surface-solid: #0d1016;
  --surface-hover: rgba(22, 27, 36, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(240, 246, 255, 0.38);
  --text: #f0f4f8;
  --muted: #8290a4;
  --accent: #ffffff;
  --accent-strong: #cbd5e1;
  --silver: #e2e8f0;
  --gold: #ffffff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  --radius: 16px;
}

/* native cross-document view transitions between pages */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: view-fade-out 0.35s ease forwards;
}

::view-transition-new(root) {
  animation: view-fade-in 0.45s ease forwards;
}

@keyframes view-fade-out {
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes view-fade-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--accent-strong) var(--bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--muted));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  cursor: default;
}

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

/* preloader */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-label {
  display: block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.preloader-bar {
  display: block;
  width: 240px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.preloader-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.preloader-percent {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

/* custom cursor */

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transform: translate3d(calc(var(--rx, 50vw) - 50%), calc(var(--ry, 50vh) - 50%), 0);
  transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

.cursor-ring.is-active {
  opacity: 1;
}

.cursor-ring.is-hover {
  width: 46px;
  height: 46px;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.3);
}

@media (pointer: coarse) {
  .cursor-ring {
    display: none;
  }
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -50%);
  animation: trail-fade 0.8s ease-out forwards;
}

@keyframes trail-fade {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

/* ripple */

.ripple {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  opacity: 0.8;
  pointer-events: none;
  animation: ripple-expand 0.9s ease-out forwards;
}

@keyframes ripple-expand {
  to {
    width: 220px;
    height: 220px;
    opacity: 0;
  }
}

/* click-burst particles */

.click-burst {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 50;
  animation: burst-fly 0.6s ease-out forwards;
}

@keyframes burst-fly {
  to {
    transform: translate(var(--bx), var(--by)) scale(0);
    opacity: 0;
  }
}

h1,
h2,
h3,
h4 {
  font-family: "Cinzel", "Space Grotesk", "IBM Plex Sans", serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wrap {
  width: min(1040px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ambient background layers */

#aurora {
  position: fixed;
  inset: 0;
  z-index: -3;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
}

/* fake momentum smooth-scroll */

#scroll-spacer {
  display: none;
}

body.js-smooth-scroll #scroll-spacer {
  display: block;
}

body.js-smooth-scroll #scroll-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  will-change: transform;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%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");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate3d(calc(var(--cx, 50vw) - 50%), calc(var(--cy, 50vh) - 50%), 0);
}

.cursor-glow.is-active {
  opacity: 1;
}

@media (pointer: coarse) {
  .cursor-glow {
    display: none;
  }
}

/* header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 0;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-mark {
  font-family: "Cinzel", "Space Grotesk", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.4);
}

.brand-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-family: "Cinzel", "IBM Plex Sans", serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 140ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* hero + living engine stage */

.hero {
  padding: 48px 0 16px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 56px 40px 44px;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(circle at 88% 0%, rgba(200, 215, 235, 0.05), transparent 40%),
    linear-gradient(165deg, #10141b, #07090c 75%);
  text-align: center;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--rim-angle, 0deg), transparent 0 60%, var(--accent-strong) 75%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rim-spin 7s linear infinite;
  opacity: 0.55;
}

@property --rim-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes rim-spin {
  to {
    --rim-angle: 360deg;
  }
}

.on-air {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.on-air::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px #ffffff;
  animation: pulse-glow 2.4s ease-in-out infinite;
}

.beacon-stage {
  position: relative;
  z-index: 0;
  width: 220px;
  height: 220px;
  margin: 28px auto 12px;
  will-change: transform;
}

.god-rays {
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.god-rays::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 2px,
    transparent 6px
  );
  background-color: rgba(5, 7, 10, 0.5);
}

.god-rays::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 25deg,
    rgba(255, 255, 255, calc(0.04 + var(--level, 0) * 0.12)) 60deg,
    rgba(220, 230, 245, calc(0.22 + var(--level, 0) * 0.45)) 85deg,
    rgba(255, 255, 255, calc(0.04 + var(--level, 0) * 0.12)) 110deg,
    transparent 145deg,
    transparent 210deg,
    rgba(200, 215, 230, calc(0.1 + var(--level, 0) * 0.25)) 245deg,
    transparent 280deg,
    transparent 360deg
  );
  mix-blend-mode: screen;
  animation: rays-spin 16s linear infinite;
}

@keyframes rays-spin {
  to {
    transform: rotate(360deg);
  }
}

#visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.beacon-orb {
  position: absolute;
  inset: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #8290a4 45%, #080a0e 100%);
  box-shadow:
    0 0 30px rgba(255, 255, 255, calc(0.25 + var(--level, 0) * 0.6)),
    0 0 80px rgba(180, 200, 230, calc(0.15 + var(--level, 0) * 0.5));
  animation: orb-breathe 6s ease-in-out infinite;
}

.orb-logo-backdrop {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 7, 10, 0.92) 0%, rgba(5, 7, 10, 0.65) 55%, transparent 78%);
}

.orb-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62%;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.65));
  user-select: none;
}

.orb-sigil {
  position: absolute;
  inset: 0;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 2.2rem;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.85);
  user-select: none;
}

@keyframes orb-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* glitch burst on track change */

.hero-card.is-tuning {
  animation: tuning-glitch 0.4s steps(2, end);
}

@keyframes tuning-glitch {
  0% {
    filter: none;
  }
  20% {
    filter: invert(0.2) contrast(1.4);
    transform: translate3d(-2px, 0, 0);
  }
  40% {
    filter: invert(0.1) brightness(1.3);
    transform: translate3d(2px, 0, 0);
  }
  60% {
    filter: contrast(1.2);
    transform: translate3d(-1px, 0, 0);
  }
  100% {
    filter: none;
    transform: none;
  }
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 18px 0 8px;
}

.hero-card h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  line-height: 1.1;
  background: linear-gradient(125deg, #ffffff, #cbd5e1, #8290a4, #ffffff);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 10s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 300% center;
  }
}

.hero-quote {
  position: relative;
  z-index: 1;
  margin: 14px auto 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
}

/* transport */

.transport {
  margin: 32px auto 0;
  max-width: 540px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(10px);
}

.transport-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.transport-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), border-color 150ms ease, box-shadow 150ms ease;
}

.transport-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#tp-play {
  width: 56px;
  height: 56px;
  font-size: 1.15rem;
  background: #ffffff;
  color: #05070a;
  border-color: transparent;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.45);
}

#tp-play:hover {
  background: #e2e8f0;
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.65);
}

.transport-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.transport-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff var(--progress, 0%),
    rgba(255, 255, 255, 0.14) var(--progress, 0%)
  );
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.ticker {
  margin-top: 18px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-left: 100%;
  animation: ticker-scroll 18s linear infinite;
}

@keyframes ticker-scroll {
  to {
    transform: translateX(-100%);
  }
}

/* scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.delay-1 {
  transition-delay: 0.12s;
}

.delay-2 {
  transition-delay: 0.24s;
}

/* sections & headings */

.section {
  padding: 64px 0;
}

.section-head {
  margin-bottom: 34px;
}

.section-head.center {
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--accent-strong);
  margin: 0 0 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: 0.05em;
}

.lead-copy {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.05rem;
}

/* theology cards & machinery grid */

.theology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.theology-card {
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.3s ease;
}

.theology-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.theology-card h3 {
  font-size: 1.15rem;
  margin: 0 0 10px;
  color: #ffffff;
}

.theology-card .card-term {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.theology-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* constellation playlist map */

.constellation {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 36px;
  perspective: 1400px;
}

.constellation-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.constellation-lines line {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.35;
  transition: stroke 300ms ease, stroke-dashoffset 1.1s ease;
  pointer-events: none;
}

.constellation-lines line.is-active {
  stroke: #ffffff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.95));
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  background: none;
  border: none;
  padding: 16px;
  cursor: pointer;
  color: var(--text);
  opacity: 0;
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
  transform: translate(-50%, -50%) translateZ(var(--z, 0px)) scale(0.3);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.star.is-in {
  opacity: 1;
  transform: translate(-50%, -50%) translateZ(var(--z, 0px)) scale(1);
}

.star-core {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.75);
  animation: twinkle 3.4s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.star-label {
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.star:hover .star-label,
.star:focus-visible .star-label {
  opacity: 1;
}

.star:hover .star-core,
.star:focus-visible .star-core {
  transform: scale(1.35);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.95);
}

.star.is-active .star-core {
  background: #ffffff;
  box-shadow: 0 0 24px rgba(255, 255, 255, 1);
  transform: scale(1.35);
}

.star-vega .star-core {
  width: 20px;
  height: 20px;
  background: #ffffff;
  box-shadow: 0 0 28px rgba(255, 255, 255, calc(0.6 + var(--level, 0) * 0.4));
  animation: none;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* legend rows */

.legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: grid;
  grid-template-columns: 28px 64px 1fr auto 26px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform;
  transition: background-color 140ms ease, border-color 140ms ease, transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.legend-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.legend-wave {
  width: 64px;
  height: 30px;
  opacity: 0.6;
  transition: opacity 200ms ease;
}

.legend-item.is-playing .legend-wave {
  opacity: 1;
}

.legend-item.is-playing {
  border-color: var(--accent-strong);
  background: var(--surface-hover);
}

.legend-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend-info h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.legend-tag {
  margin: 3px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--muted);
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.eq span {
  width: 3px;
  height: 4px;
  background: var(--muted);
  border-radius: 2px;
}

.legend-item.is-playing .eq span {
  background: #ffffff;
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.legend-item.is-playing .eq span:nth-child(2) {
  animation-delay: 0.15s;
}

.legend-item.is-playing .eq span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes eq-bounce {
  0%, 100% {
    height: 4px;
  }
  50% {
    height: 16px;
  }
}

.queue-note {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 22px;
  text-align: center;
}

/* codex vaults */

.vaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.vault-card {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.vault-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.vault-number {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent-strong);
  margin-bottom: 10px;
  display: block;
}

.vault-card h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.vault-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.vault-card li {
  margin-bottom: 10px;
}

.vault-card li strong {
  color: var(--text);
}

/* horarium table */

.horarium-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-top: 32px;
}

.horarium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.horarium-table th,
.horarium-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.horarium-table th {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.horarium-table td {
  color: var(--muted);
  line-height: 1.5;
}

.horarium-table td strong {
  color: var(--text);
}

.horarium-table tr:last-child td {
  border-bottom: none;
}

.hour-badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* rites & degrees */

.rites-grid,
.degrees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.rite-card,
.degree-card {
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
}

.rite-card h3,
.degree-card h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.rite-card .rite-timing,
.degree-card .degree-rank {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  display: block;
}

.rite-card p,
.degree-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 12px;
}

.rite-card blockquote {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* liturgical formula banner */

.liturgy-banner {
  margin-top: 48px;
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 85%), #0c0f15;
  text-align: center;
}

.liturgy-banner .latin-formula {
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  color: #ffffff;
  margin: 0 0 8px;
}

.liturgy-banner .formula-trans {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  position: relative;
  z-index: 1;
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--accent);
}

/* legal card */

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  line-height: 1.75;
}

.legal-card h1 {
  margin-top: 0;
  font-size: 2rem;
}

.legal-card h2 {
  font-size: 1.3rem;
  margin-top: 32px;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .star {
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
  }
}

@media (max-width: 768px) {
  .hero-card {
    padding: 38px 20px;
  }

  .legend-item {
    grid-template-columns: 22px 1fr auto;
  }

  .legend-wave {
    display: none;
  }

  .eq {
    display: none;
  }

  .site-nav {
    display: none;
  }

  .horarium-table th,
  .horarium-table td {
    padding: 12px 14px;
  }
}
