/* Aether & Arcana — Celestial Noir Design System */

/* ------ Custom Properties ------ */
:root {
  --void: #020617;
  --void-2: #070d1a;
  --void-3: #0f1629;
  --nebula: #1e1b4b;
  --nebula-2: #2d2a6e;
  --starlight: #f8fafc;
  --starlight-2: #e2e8f0;
  --starlight-dim: #94a3b8;
  --gold: #fbbf24;
  --gold-soft: #f0d78c;
  --gold-dim: rgba(251, 191, 36, 0.25);
  --gold-glow: rgba(251, 191, 36, 0.12);

  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --shadow-gold: 0 0 24px rgba(251, 191, 36, 0.18);
  --shadow-gold-sm: 0 0 12px rgba(251, 191, 36, 0.12);

  --card-aspect: 2 / 3.5;
  --nav-height: 4rem;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------ Reset & Base ------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--void);
  color: var(--starlight);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ------ Starfield ------ */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 20% 10%,
    rgba(30, 27, 75, 0.6) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 80% 90%,
    rgba(251, 191, 36, 0.04) 0%,
    transparent 50%
  );
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--starlight);
}

.star-gold {
  background: var(--gold);
  box-shadow: 0 0 4px var(--gold), 0 0 8px rgba(251, 191, 36, 0.4);
}

/* ------ Navigation ------ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(251, 191, 36, 0.35);
  white-space: nowrap;
  transition: text-decoration-color 0.2s;
}

.nav-logo:hover {
  text-decoration-color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin-left: auto;
}

.nav-link {
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--starlight-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

@media (max-width: 600px) {
  .site-nav {
    padding: 0 1rem;
  }
  .nav-links {
    gap: 1.25rem;
  }
  .nav-link {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
  }
}

/* ------ Page Layout ------ */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.page-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 600px) {
  .page-content {
    padding: 0 1rem;
  }
}

/* ------ Typography ------ */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}

.display-heading {
  font-family: var(--font-display);
  color: var(--starlight);
  line-height: 1.1;
}

/* ------ Hero Section ------ */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-tagline {
  margin-bottom: 1rem;
}

.hero-heading {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--gold) 0%, var(--nebula) 45%, var(--nebula-2) 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroGradientShift 12s ease infinite;
}

@keyframes heroGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--starlight-dim);
  line-height: 1.65;
  max-width: 500px;
}

/* ------ Mode Cards (Home) ------ */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 3rem 0 6rem;
}

@media (max-width: 900px) {
  .mode-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .mode-cards {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  position: relative;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: var(--radius-xl);
  padding: 2rem;
  background: rgba(30, 27, 75, 0.12);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
  min-height: 260px;
}

.mode-card:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(30, 27, 75, 0.28);
  transform: translateY(-2px);
}

.mode-card.featured {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.05);
}

.mode-card.featured:hover {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
}

.mode-card-eyebrow {
  /* inherits .eyebrow */
}

.mode-card-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--starlight);
  letter-spacing: 0.02em;
}

.mode-card.featured .mode-card-title {
  color: var(--gold);
}

.mode-card-desc {
  font-size: 0.9rem;
  color: var(--starlight-dim);
  line-height: 1.65;
  flex: 1;
}

.mode-card-placeholder {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 1.25rem;
  height: 56px;
}

.mini-card {
  width: 28px;
  aspect-ratio: var(--card-aspect);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 4px;
  background: var(--nebula);
  flex-shrink: 0;
}

.mode-card.featured .mini-card {
  border-color: rgba(251, 191, 36, 0.5);
}

/* ------ Card Visual Component ------ */
.card-visual {
  position: relative;
  aspect-ratio: var(--card-aspect);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: var(--shadow-gold-sm);
  overflow: hidden;
  background: transparent;
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  filter: invert(84%) sepia(63%) saturate(1881%) hue-rotate(330deg) brightness(94%) contrast(110%);
  opacity: 0.6;
}

.card-visual.reversed img {
  transform: rotate(180deg);
}

.card-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 35%,
    transparent 60%
  );
  border-radius: var(--radius-xl);
  pointer-events: none;
  z-index: 2;
}

.card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  transform: translateX(-150%);
  pointer-events: none;
  border-radius: var(--radius-xl);
  z-index: 3;
}

.card-visual:hover::before {
  animation: card-shine 0.55s ease forwards;
}

@keyframes card-shine {
  to { transform: translateX(250%); }
}

/* Face-down card back */
.card-back {
  position: absolute;
  inset: 0;
  background: var(--nebula);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-pentagram {
  position: absolute;
  width: 62%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  color: rgba(251, 191, 36, 0.65);
}

.card-back-shimmer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 60%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(251, 191, 36, 0.1) 50%,
    transparent 100%
  );
  transform: skewX(-15deg);
  animation: card-shimmer 5s ease-in-out infinite;
}

.card-back-label {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.4rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.38);
}

/* ------ Keyword Badges ------ */
.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
}

.keyword-badge {
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  color: var(--gold);
  white-space: nowrap;
}

.keyword-badge.reversed {
  border-color: rgba(248, 250, 252, 0.28);
  color: var(--starlight-dim);
}

/* ------ Buttons ------ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2.25rem;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: var(--void);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-150%);
  pointer-events: none;
}

.btn-primary:hover::after {
  animation: btn-shine 0.5s ease forwards;
}

@keyframes btn-shine {
  to { transform: translateX(200%); }
}

.btn-primary:hover {
  background: var(--gold);
  box-shadow: 0 0 12px 3px rgba(251, 191, 36, 0.4);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ------ Input Fields ------ */
.question-input {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(248, 250, 252, 0.15);
  color: var(--starlight);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s;
}

.question-input::placeholder {
  color: var(--starlight-dim);
}

.question-input:focus {
  border-color: rgba(251, 191, 36, 0.55);
}

/* ------ Library Page ------ */
.library-header {
  padding: 4rem 0 3rem;
}

.library-header .eyebrow {
  margin-bottom: 0.875rem;
}

.library-header h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.library-header p {
  color: var(--starlight-dim);
  font-size: 1rem;
  max-width: 460px;
  line-height: 1.65;
}

.library-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.library-search {
  max-width: 320px;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(248, 250, 252, 0.18);
  background: transparent;
  color: var(--starlight-dim);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter-btn:hover {
  color: var(--starlight);
  border-color: rgba(248, 250, 252, 0.35);
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--void);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem 1rem;
  padding-bottom: 6rem;
}

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.75rem; }
}

.card-grid-item {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.25s var(--ease-expo);
}

.card-grid-item:hover {
  transform: translateY(-5px);
}

.card-grid-item .card-visual {
  width: 100%;
}

.card-grid-number {
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.5);
  text-align: center;
}

.card-grid-name {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: var(--starlight-2);
  line-height: 1.3;
}

/* ------ Reading Pages ------ */
.reading-page-header {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.reading-page-header .eyebrow {
  margin-bottom: 0.875rem;
}

.reading-page-header h1 {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.reading-page-header p {
  color: var(--starlight-dim);
  font-size: 0.9375rem;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

.reading-input-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.reading-input-section .question-input {
  text-align: center;
}

.reading-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  color: var(--starlight-dim);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.reading-divider::before,
.reading-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(248, 250, 252, 0.12);
}

/* One-card reading */
.one-card-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto 2.5rem;
  max-width: 420px;
  width: min(100%, 420px);
}

.one-card-display .card-visual {
  width: clamp(160px, 30vw, 220px);
}

.card-name-display {
  text-align: center;
}

.card-name-display h2,
.card-name-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  min-height: 1.75rem;
}

.card-orientation {
  font-size: 0.625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--starlight-dim);
  min-height: 1rem;
}

.card-orientation.reversed {
  color: rgba(251, 191, 36, 0.65);
}

/* Three-card spread */
.three-card-spread {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

@media (max-width: 600px) {
  .three-card-spread {
    grid-template-columns: 1fr;
    max-width: 200px;
  }
}

.spread-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

.spread-card .card-visual {
  width: 100%;
  max-width: 160px;
}

.spread-position {
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.spread-card-name {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  color: var(--starlight-2);
  min-height: 1.1rem;
}

.spread-card-orientation {
  font-size: 0.5625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--starlight-dim);
  text-align: center;
  min-height: 0.875rem;
}

.spread-card-orientation.reversed {
  color: rgba(251, 191, 36, 0.65);
}

.spread-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  list-style: none;
  min-height: 1.5rem;
}

.spread-keywords .keyword-badge {
  font-size: 0.5rem;
  padding: 0.125rem 0.5rem;
}

/* ------ Interpretation / Analysis Box ------ */
.interpretation-box {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 3rem 2.25rem 2rem;
  background: var(--nebula);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-xl);
  position: relative;
}

.interpretation-box.synthesis {
  border-color: rgba(251, 191, 36, 0.35);
}

.copy-btn-top-right {
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin: 0;
  z-index: 1;
}

.interpretation-label {
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.interpretation-question {
  font-size: 0.875rem;
  color: var(--starlight-dim);
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.1);
  font-style: italic;
}

.interpretation-text {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--starlight-2);
  white-space: pre-wrap;
  min-height: 1.5rem;
}

.interpretation-text p + p {
  margin-top: 1em;
}

.streaming-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 1.4s ease-in-out infinite;
  margin-top: 0.75rem;
  vertical-align: middle;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  margin-top: 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(248, 250, 252, 0.18);
  background: transparent;
  color: var(--starlight-dim);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.copy-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ------ Card Detail Page ------ */
.card-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  padding: 4rem 0 6rem;
  align-items: start;
}

@media (max-width: 768px) {
  .card-detail-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2.5rem 0 5rem;
  }
}

.card-detail-art .card-visual {
  width: 100%;
  max-width: 260px;
}

@media (max-width: 768px) {
  .card-detail-art .card-visual {
    max-width: 200px;
    margin: 0 auto;
  }
}

.card-detail-meta {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.card-meta-pill {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--starlight-dim);
  font-weight: 300;
}

.card-detail-number {
  font-size: 0.625rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.625rem;
}

.card-detail-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.card-detail-section {
  margin-bottom: 2rem;
}

.card-detail-section h3 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--starlight-dim);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.card-nav {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(248, 250, 252, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-nav-link {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--starlight-dim);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* ------ Back Link ------ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--starlight-dim);
  text-decoration: none;
  margin-bottom: 2rem;
  margin-top: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--gold);
}

/* ------ Animations ------ */
@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-shimmer {
  0% { left: -80%; }
  100% { left: 160%; }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-card-rise {
  animation: card-rise 0.8s var(--ease-expo) both;
}

.animate-fade-in {
  animation: fade-in 0.5s ease both;
}

/* ------ Accessibility ------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--gold);
  color: var(--void);
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  top: 0;
}

/* ------ Error pages ------ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 4rem 0;
}

.error-heading {
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin-bottom: 1rem;
}

.error-desc {
  color: var(--starlight-dim);
  font-size: 1rem;
  max-width: 400px;
  line-height: 1.65;
}

/* ------ Footer ------ */
.site-footer {
  text-align: center;
  padding: 4rem 0 2.5rem;
  color: var(--starlight-dim);
  font-size: 0.6875rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

/* ------ Result section transition ------ */
#resultSection[hidden] {
  display: none;
}

#resultSection {
  animation: fade-in 0.4s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .animate-card-rise,
  .animate-fade-in,
  .card-back-shimmer,
  .streaming-dot,
  .star {
    animation: none !important;
  }
}
