/* =========================================================
   Monkey Cult — Daily Reveal
   Tarot-style ritual reveal. Vanilla CSS, mobile-first.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Color — dark, warm, parchment-led */
  --bg-abyss: #0b0a09;
  --bg-charcoal: #17130f;
  --bg-ink: #0f0c0a;
  --parchment: #e9dcc0;
  --parchment-dim: #bba882;
  --parchment-faint: rgba(233, 220, 192, 0.55);
  --gold-deep: #8a6a30;
  --gold-antique: #b8924b;
  --gold-glow: #d9b26a;
  --gold-bright: #efc97a;
  --indigo-shadow: #1a1c2e;
  --omen-whisper: #a8926a;
  --tier-whisper: #8f7d58;
  --tier-omen: #b8924b;
  --tier-arcana: #e6c37a;

  /* Typography */
  --font-display: 'Cinzel', 'Trajan Pro', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  /* Timing */
  --reveal-activate: 400ms;
  --reveal-charge: 700ms;
  --reveal-flip: 900ms;
  --reveal-settle: 600ms;

  /* Layout */
  --card-width-mobile: 72vw;
  --card-width-tablet: 320px;
  --card-width-desktop: 380px;
  --card-ratio: calc(3 / 2); /* 2:3 portrait */

  /* Easing */
  --ease-ritual: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-settle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
dl { margin: 0; }

/* ---------- Base ---------- */
html {
  background: var(--bg-abyss);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  background:
    radial-gradient(ellipse at center top, #1a1510 0%, #0b0a09 55%, #05040a 100%);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Atmosphere layers ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.atmosphere__vignette {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(5, 4, 8, 0.55) 75%, rgba(0, 0, 0, 0.9) 100%);
  transition: background 600ms var(--ease-settle);
}

.atmosphere__sigil {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120vmin, 900px);
  height: min(120vmin, 900px);
  transform: translate(-50%, -50%);
  color: var(--gold-antique);
  opacity: 0.045;
  animation: sigil-rotate 240s linear infinite;
  transition: opacity 800ms var(--ease-settle);
  will-change: transform;
}

.atmosphere__noise {
  position: absolute;
  inset: 0;
  /* Inline SVG turbulence — no external asset needed. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.78  0 0 0 0 0.55  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.08;
  mix-blend-mode: overlay;
}

.atmosphere__particles {
  position: absolute;
  inset: 0;
}
.atmosphere__particles li {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 178, 106, 0.85) 0%, rgba(217, 178, 106, 0) 70%);
  opacity: 0;
  animation: dust-drift 18s linear infinite;
}

/* Distribute 24 particles across the viewport with varied timings */
.atmosphere__particles li:nth-child(1)  { left:  5%; animation-delay:  -1s; animation-duration: 22s; }
.atmosphere__particles li:nth-child(2)  { left: 11%; animation-delay:  -6s; animation-duration: 26s; }
.atmosphere__particles li:nth-child(3)  { left: 17%; animation-delay: -11s; animation-duration: 19s; }
.atmosphere__particles li:nth-child(4)  { left: 22%; animation-delay:  -3s; animation-duration: 24s; }
.atmosphere__particles li:nth-child(5)  { left: 28%; animation-delay:  -9s; animation-duration: 30s; }
.atmosphere__particles li:nth-child(6)  { left: 33%; animation-delay: -14s; animation-duration: 21s; }
.atmosphere__particles li:nth-child(7)  { left: 39%; animation-delay:  -2s; animation-duration: 27s; }
.atmosphere__particles li:nth-child(8)  { left: 44%; animation-delay:  -7s; animation-duration: 23s; }
.atmosphere__particles li:nth-child(9)  { left: 49%; animation-delay: -13s; animation-duration: 29s; }
.atmosphere__particles li:nth-child(10) { left: 53%; animation-delay:  -4s; animation-duration: 20s; }
.atmosphere__particles li:nth-child(11) { left: 58%; animation-delay:  -8s; animation-duration: 25s; }
.atmosphere__particles li:nth-child(12) { left: 62%; animation-delay: -10s; animation-duration: 18s; }
.atmosphere__particles li:nth-child(13) { left: 66%; animation-delay:  -5s; animation-duration: 28s; }
.atmosphere__particles li:nth-child(14) { left: 71%; animation-delay: -12s; animation-duration: 22s; }
.atmosphere__particles li:nth-child(15) { left: 75%; animation-delay:  -1s; animation-duration: 26s; }
.atmosphere__particles li:nth-child(16) { left: 79%; animation-delay: -15s; animation-duration: 19s; }
.atmosphere__particles li:nth-child(17) { left: 83%; animation-delay:  -6s; animation-duration: 31s; }
.atmosphere__particles li:nth-child(18) { left: 87%; animation-delay:  -2s; animation-duration: 21s; }
.atmosphere__particles li:nth-child(19) { left: 91%; animation-delay: -11s; animation-duration: 24s; }
.atmosphere__particles li:nth-child(20) { left: 95%; animation-delay:  -4s; animation-duration: 27s; }
.atmosphere__particles li:nth-child(21) { left: 15%; animation-delay:  -9s; animation-duration: 23s; width: 2px; height: 2px; }
.atmosphere__particles li:nth-child(22) { left: 36%; animation-delay: -14s; animation-duration: 30s; width: 2px; height: 2px; }
.atmosphere__particles li:nth-child(23) { left: 64%; animation-delay:  -7s; animation-duration: 19s; width: 2px; height: 2px; }
.atmosphere__particles li:nth-child(24) { left: 88%; animation-delay: -13s; animation-duration: 25s; width: 2px; height: 2px; }

@keyframes dust-drift {
  0%   { transform: translate3d(0, 105vh, 0); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.5; }
  100% { transform: translate3d(-30px, -10vh, 0); opacity: 0; }
}

@keyframes sigil-rotate {
  from { transform: translate(-50%, -50%) rotate(0); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---------- Floating chrome: back-home (pill w/ text) + sound toggle (circle) ---------- */

.back-home {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--parchment-dim);
  background: rgba(15, 12, 10, 0.55);
  border: 1px solid rgba(184, 146, 75, 0.3);
  border-radius: 2px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 240ms ease, border-color 240ms ease, background 240ms ease;
}
.back-home:hover {
  color: var(--gold-glow);
  border-color: var(--gold-glow);
  background: rgba(184, 146, 75, 0.08);
}
.back-home:hover .back-home__icon {
  transform: translateX(-2px);
  color: var(--gold-glow);
}
.back-home:focus-visible {
  outline: 1px solid var(--gold-glow);
  outline-offset: 3px;
}

.back-home__icon {
  width: 14px;
  height: 14px;
  color: var(--gold-antique);
  flex-shrink: 0;
  transition: transform 240ms var(--ease-ritual), color 240ms ease;
}
.back-home__label { padding-left: 0.3em; }

/* Mobile: collapse back button to a circular icon-only, mirrors sound toggle */
@media (max-width: 639px) {
  .back-home {
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .back-home__label { display: none; }
  .back-home__icon { width: 18px; height: 18px; }
}

.sound-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  color: var(--parchment-dim);
  border: 1px solid rgba(184, 146, 75, 0.25);
  border-radius: 50%;
  background: rgba(15, 12, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: color 240ms ease, border-color 240ms ease, background 240ms ease, opacity 240ms ease;
}
.sound-toggle:hover {
  color: var(--gold-glow);
  border-color: rgba(217, 178, 106, 0.5);
}
.sound-toggle:focus-visible {
  outline: 1px solid var(--gold-glow);
  outline-offset: 3px;
}
.sound-toggle:hover { color: var(--gold-glow); border-color: rgba(217, 178, 106, 0.5); }
.sound-toggle:focus-visible {
  outline: 1px solid var(--gold-glow);
  outline-offset: 3px;
}
.sound-toggle__icon { width: 20px; height: 20px; display: none; }
.sound-toggle[data-muted="true"]  .sound-toggle__icon--muted { display: block; }
.sound-toggle[data-muted="false"] .sound-toggle__icon--on    { display: block; color: var(--gold-glow); }
.sound-toggle[hidden] { display: none !important; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 20px 40px;
  max-width: 720px;
  margin: 0 auto;
}

/* =========================================================
   Hero banner
   ========================================================= */
.hero-banner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 48px 20px 36px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 75% 45%, rgba(184, 146, 75, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, rgba(26, 20, 14, 0.85) 0%, rgba(11, 10, 9, 0) 100%);
  border-bottom: 1px solid rgba(184, 146, 75, 0.14);
}

.hero-banner__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Mobile: flatten the content wrapper so visual can slot between title and subtitle via flex order */
.hero-banner__content {
  display: contents;
}
.hero-banner__eyebrow  { order: 1; }
.hero-banner__title    { order: 2; }
.hero-banner__visual   { order: 3; }
.hero-banner__subtitle { order: 4; }
.hero-banner__lede     { order: 5; }
.hero-banner__cta      { order: 6; }

/* Visual (monkey) */
.hero-banner__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 12px 0 20px;
}
.hero-banner__image {
  width: 100%;
  max-width: 420px;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 0 38px rgba(217, 178, 106, 0.18));
}

.hero-banner__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  margin: 0 0 20px;
  padding: 8px 18px;
  border-top: 1px solid rgba(184, 146, 75, 0.35);
  border-bottom: 1px solid rgba(184, 146, 75, 0.35);
}
.hero-banner__eyebrow span { padding-left: 0.42em; }
.hero-banner__banana {
  height: 12px;
  width: calc(12px * var(--banana-ratio, 2.67));
  color: var(--gold-glow);
  flex-shrink: 0;
  display: block;
}
.hero-banner__banana--flip { transform: scaleX(-1); }
.hero-banner__cta .hero-banner__banana {
  height: 10px;
  width: calc(10px * var(--banana-ratio, 2.67));
}

.hero-banner__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.98;
  color: var(--parchment);
  margin: 0 0 18px;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.4),
    0 2px 30px rgba(217, 178, 106, 0.22);
}

.hero-banner__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 500;
  font-style: italic;
  color: var(--gold-glow);
  letter-spacing: 0.02em;
  margin: 0 0 18px;
  text-shadow: 0 0 14px rgba(217, 178, 106, 0.2);
}

.hero-banner__lede {
  font-family: var(--font-body);
  font-size: clamp(0.98rem, 2.2vw, 1.08rem);
  line-height: 1.65;
  color: var(--parchment-faint);
  margin: 0 0 28px;
  max-width: 42ch;
}
.hero-banner__lede b {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
  font-size: 0.88em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 0.12em 0 0.14em;
}
.hero-banner__lede b[data-tier="Whisper"] {
  color: var(--tier-whisper);
}
.hero-banner__lede b[data-tier="Omen"] {
  color: var(--tier-omen);
  text-shadow: 0 0 10px rgba(184, 146, 75, 0.35);
}
.hero-banner__lede b[data-tier="Arcana"] {
  color: var(--tier-arcana);
  text-shadow: 0 0 14px rgba(230, 195, 122, 0.45);
}

.hero-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 30px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg-ink);
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-antique) 100%);
  border: 1px solid var(--gold-bright);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 8px 22px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(217, 178, 106, 0.28);
  transition: transform 200ms var(--ease-ritual), box-shadow 260ms ease, filter 260ms ease;
}
.hero-banner__cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(239, 201, 122, 0.45);
  filter: brightness(1.06);
}
.hero-banner__cta:active { transform: translateY(0); }
.hero-banner__cta:focus-visible { outline: 2px solid var(--gold-glow); outline-offset: 4px; }
.hero-banner__cta .hero-banner__banana { color: var(--bg-ink); }
.hero-banner__cta span { padding-left: 0.32em; }

/* ---------- Ritual section ---------- */
.ritual {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 20px;
  scroll-margin-top: 40px;
}

.ritual__halo,
.ritual__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.ritual__halo {
  width: min(88vw, 460px);
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(184, 146, 75, 0.18);
  box-shadow:
    inset 0 0 60px rgba(184, 146, 75, 0.06),
    0 0 90px rgba(184, 146, 75, 0.08);
  transition: border-color 600ms ease, box-shadow 600ms ease, transform 800ms var(--ease-settle);
}
.ritual__halo::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(184, 146, 75, 0.12);
}
.ritual__glow {
  width: min(90vw, 520px);
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle, rgba(217, 178, 106, 0.18) 0%, rgba(217, 178, 106, 0.07) 38%, transparent 70%);
  animation: glow-breathe 5.5s ease-in-out infinite;
  transition: background 600ms ease, transform 800ms var(--ease-settle);
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -55%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -55%) scale(1.04); }
}

/* ---------- Card ---------- */
.card {
  position: relative;
  z-index: 2;
  width: var(--card-width-mobile);
  max-width: 360px;
  aspect-ratio: 2 / 3;
  perspective: 1400px;
  animation: card-float 6s ease-in-out infinite;
  transition: transform 800ms var(--ease-settle);
  will-change: transform;
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--reveal-flip) var(--ease-ritual);
  will-change: transform;
}

.card__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.card__face--front {
  transform: rotateY(180deg);
}
.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter:
    drop-shadow(0 18px 32px rgba(0, 0, 0, 0.6))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.card__shadow {
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 70%;
  height: 20px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
  filter: blur(6px);
  z-index: 1;
  transition: opacity 600ms ease, transform 800ms var(--ease-settle);
}

@keyframes card-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ---------- Card back (CSS fallback + image overlay) ---------- */
.card-back {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at center, #1f1811 0%, #120e0a 60%, #0a0806 100%);
  color: var(--gold-antique);
  display: grid;
  place-items: center;
  filter:
    drop-shadow(0 18px 32px rgba(0, 0, 0, 0.6))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
/* If the user drops assets/card-back.png, it renders on top of the CSS fallback. */
.card-back::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/card-back.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.card-back__ornament {
  position: relative;
  z-index: 2;
  width: 88%;
  height: 88%;
  opacity: 0.55;
}
.card-back__glyph {
  position: absolute;
  z-index: 3;
  font-size: 22px;
  color: var(--gold-glow);
  text-shadow: 0 0 12px rgba(217, 178, 106, 0.5);
  letter-spacing: 0.3em;
}

/* When user provides assets/card-back.png, hide CSS fallback so their art shows clean. */
body.has-card-back-image .card-back__ornament,
body.has-card-back-image .card-back__glyph { display: none; }
body.has-card-back-image .card-back { background: none; }
/* ---------- Whisper caption ---------- */
.ritual__whisper {
  position: relative;
  z-index: 2;
  margin: 36px 0 26px;
  font-size: 1rem;
  color: var(--parchment-faint);
  text-align: center;
  letter-spacing: 0.02em;
  max-width: 28ch;
  transition: opacity 400ms ease, transform 400ms ease;
}

/* ---------- Card as ritual trigger ---------- */
.card--interactive {
  cursor: pointer;
}
.card--interactive:focus { outline: none; }
.card--interactive:focus-visible {
  outline: 1px solid var(--gold-glow);
  outline-offset: 14px;
  border-radius: 14px;
}
/* Idle hover — intensify back-face glow as the invitation */
.card--interactive:hover .card-back {
  filter:
    drop-shadow(0 22px 40px rgba(0, 0, 0, 0.7))
    drop-shadow(0 0 40px rgba(217, 178, 106, 0.35));
}

/* ---------- Site footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 36px 20px 40px;
  border-top: 1px solid rgba(184, 146, 75, 0.12);
  text-align: center;
  color: var(--parchment-faint);
  font-family: var(--font-body);
  margin-top: 72px;
}
.site-footer__inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__copy {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--parchment-dim);
}
.site-footer__ticker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold-antique);
  padding: 0 0.12em;
}
.site-footer__disclaimer {
  margin: 0;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.55;
  color: rgba(233, 220, 192, 0.4);
  letter-spacing: 0.01em;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .site-footer { padding: 44px 32px 48px; margin-top: 88px; }
  .site-footer__inner { gap: 10px; }
  .site-footer__copy { font-size: 0.9rem; }
  .site-footer__disclaimer { font-size: 0.82rem; }
}

/* ---------- Countdown (next reading) ---------- */
.countdown {
  margin-top: 56px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 700ms ease, transform 700ms var(--ease-settle);
}
.countdown.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.countdown__label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  margin: 0 0 14px;
  padding-left: 0.45em;
}

.countdown__time {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 5.4vw, 2.4rem);
  letter-spacing: 0.08em;
  color: var(--gold-glow);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(217, 178, 106, 0.22);
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
}
.countdown__digits {
  min-width: 1.6em;
  display: inline-block;
  text-align: center;
}
.countdown__sep {
  color: var(--gold-antique);
  opacity: 0.6;
  font-weight: 400;
  transform: translateY(-0.04em);
}

.countdown__units {
  display: flex;
  gap: clamp(28px, 8vw, 64px);
  justify-content: center;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--parchment-faint);
}
.countdown__units span { padding-left: 0.42em; }

/* =========================================================
   Reveal animation states — new flow: summoning → bursting → modal
   ========================================================= */

/* === State: summoning (buildup, ~3500ms) === */
body.state-summoning .card {
  animation: card-shake 3500ms ease-in-out forwards;
}
body.state-summoning .card-back {
  animation: back-glow-rise 3500ms ease-in-out forwards;
}
body.state-summoning .ritual__halo {
  animation: halo-pulse-intense 3500ms ease-in-out forwards;
}
body.state-summoning .ritual__glow {
  animation: glow-intensify 3500ms ease-in-out forwards;
}
body.state-summoning .atmosphere__sigil {
  animation: sigil-brighten 3500ms ease-in-out forwards;
}
body.state-summoning .atmosphere__vignette {
  animation: vignette-darken 3500ms ease-in-out forwards;
}
body.state-summoning .ritual__whisper,
body.state-bursting .ritual__whisper {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 400ms ease, transform 400ms ease;
}

@keyframes card-shake {
  0%   { transform: translate3d(0, 0, 0) rotate(0); }
  5%   { transform: translate3d(-0.5px, 0, 0) rotate(-0.1deg); }
  10%  { transform: translate3d(1px, -0.5px, 0) rotate(0.15deg); }
  15%  { transform: translate3d(-1px, 0.5px, 0) rotate(-0.2deg); }
  25%  { transform: translate3d(1.5px, -1px, 0) rotate(0.3deg); }
  35%  { transform: translate3d(-2px, 1px, 0) rotate(-0.4deg); }
  45%  { transform: translate3d(2.5px, -1.5px, 0) rotate(0.5deg); }
  55%  { transform: translate3d(-3px, 2px, 0) rotate(-0.6deg); }
  65%  { transform: translate3d(3.5px, -2.5px, 0) rotate(0.75deg); }
  75%  { transform: translate3d(-4px, 3px, 0) rotate(-0.9deg); }
  85%  { transform: translate3d(4.5px, -3.5px, 0) rotate(1.1deg); }
  92%  { transform: translate3d(-5px, 4px, 0) rotate(-1.3deg); }
  100% { transform: translate3d(0, -14px, 0) scale(1.03); }
}

@keyframes back-glow-rise {
  0% {
    filter:
      drop-shadow(0 18px 32px rgba(0, 0, 0, 0.6))
      drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  }
  100% {
    filter:
      drop-shadow(0 26px 48px rgba(0, 0, 0, 0.72))
      drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6))
      drop-shadow(0 0 50px rgba(239, 201, 122, 0.6));
  }
}

@keyframes halo-pulse-intense {
  0% {
    border-color: rgba(184, 146, 75, 0.18);
    box-shadow: inset 0 0 60px rgba(184, 146, 75, 0.06), 0 0 90px rgba(184, 146, 75, 0.08);
    transform: translate(-50%, -55%) scale(1);
  }
  50% {
    border-color: rgba(217, 178, 106, 0.55);
    box-shadow: inset 0 0 120px rgba(217, 178, 106, 0.22), 0 0 170px rgba(217, 178, 106, 0.3);
    transform: translate(-50%, -55%) scale(1.05);
  }
  100% {
    border-color: rgba(239, 201, 122, 0.85);
    box-shadow: inset 0 0 180px rgba(239, 201, 122, 0.4), 0 0 240px rgba(239, 201, 122, 0.55);
    transform: translate(-50%, -55%) scale(1.12);
  }
}

@keyframes glow-intensify {
  0%   { background: radial-gradient(circle, rgba(217, 178, 106, 0.18) 0%, rgba(217, 178, 106, 0.07) 38%, transparent 70%); }
  100% { background: radial-gradient(circle, rgba(239, 201, 122, 0.7) 0%, rgba(217, 178, 106, 0.3) 45%, transparent 78%); }
}

@keyframes sigil-brighten {
  0%   { opacity: 0.045; }
  100% { opacity: 0.15; }
}

@keyframes vignette-darken {
  0%   { background: radial-gradient(ellipse at center, transparent 35%, rgba(5, 4, 8, 0.55) 75%, rgba(0, 0, 0, 0.9) 100%); }
  100% { background: radial-gradient(ellipse at center, transparent 22%, rgba(5, 4, 8, 0.88) 62%, rgba(0, 0, 0, 0.98) 100%); }
}

/* === State: bursting (flash transition, ~800ms) === */
body.state-bursting .burst-flash {
  animation: burst-flash 800ms ease-out forwards;
}
body.state-bursting .card {
  animation: card-vanish 500ms ease-in forwards;
}
body.state-bursting .card__inner {
  transform: rotateY(180deg);
  transition: none;
}

@keyframes burst-flash {
  0%   { opacity: 0; transform: scale(0.4); }
  20%  { opacity: 0.95; transform: scale(1); }
  55%  { opacity: 0.7; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.6); }
}

@keyframes card-vanish {
  0%   { opacity: 1; transform: translate3d(0, -14px, 0) scale(1.03); }
  60%  { opacity: 0.4; transform: translate3d(0, -14px, 0) scale(1.12); }
  100% { opacity: 0; transform: translate3d(0, -14px, 0) scale(1.2); }
}

/* === State: revealed (modal closed or restored on load) === */
body.state-revealed .card__inner {
  transform: rotateY(180deg);
  transition: transform 600ms var(--ease-ritual), opacity 400ms ease;
}
body.state-revealed .card {
  opacity: 1;
  animation: card-float 6s ease-in-out infinite;
}
body.state-revealed .ritual__whisper {
  display: none;
}
body.state-revealed .ritual__halo {
  border-color: rgba(184, 146, 75, 0.32);
  box-shadow: inset 0 0 80px rgba(184, 146, 75, 0.12), 0 0 120px rgba(184, 146, 75, 0.15);
}

/* =========================================================
   Burst flash overlay (fullscreen)
   ========================================================= */
.burst-flash {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(252, 228, 160, 0.98) 0%,
    rgba(239, 201, 122, 0.88) 22%,
    rgba(184, 146, 75, 0.5) 45%,
    transparent 75%
  );
  mix-blend-mode: screen;
}

/* =========================================================
   Modal
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}
.modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 8, 0.82);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 52px 28px 36px;
  background:
    linear-gradient(180deg, rgba(26, 20, 14, 0.96) 0%, rgba(11, 10, 9, 0.98) 100%);
  border: 1px solid rgba(184, 146, 75, 0.3);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(217, 178, 106, 0.08) inset,
    0 30px 80px rgba(0, 0, 0, 0.8),
    0 0 140px rgba(217, 178, 106, 0.15);
  text-align: center;
  transform: scale(0.94) translateY(14px);
  opacity: 0;
  transition: transform 500ms var(--ease-ritual), opacity 500ms ease;
}
.modal[aria-hidden="false"] .modal__dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--parchment-dim);
  border: 1px solid rgba(184, 146, 75, 0.25);
  border-radius: 50%;
  background: rgba(15, 12, 10, 0.55);
  z-index: 3;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 300ms var(--ease-ritual);
}
.modal__close:hover {
  color: var(--gold-glow);
  border-color: var(--gold-glow);
  background: rgba(184, 146, 75, 0.1);
  transform: rotate(90deg);
}
.modal__close:focus-visible {
  outline: 1px solid var(--gold-glow);
  outline-offset: 3px;
}
.modal__close svg { width: 16px; height: 16px; }

.modal__aura {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, 92%);
  aspect-ratio: 1;
  background: radial-gradient(
    circle,
    rgba(217, 178, 106, 0.3) 0%,
    rgba(217, 178, 106, 0.12) 40%,
    transparent 75%
  );
  pointer-events: none;
  z-index: 0;
  animation: aura-breathe 4s ease-in-out infinite;
}

@keyframes aura-breathe {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.modal__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(72vw, 260px);
  aspect-ratio: 2 / 3;
  margin: 0 auto 24px;
}
.modal__card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter:
    drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 30px rgba(217, 178, 106, 0.22));
}

/* Tier-colored aura */
.modal__dialog[data-tier="Whisper"] .modal__aura {
  background: radial-gradient(circle, rgba(184, 146, 75, 0.25) 0%, rgba(184, 146, 75, 0.1) 40%, transparent 75%);
}
.modal__dialog[data-tier="Omen"] .modal__aura {
  background: radial-gradient(circle, rgba(217, 178, 106, 0.38) 0%, rgba(217, 178, 106, 0.15) 40%, transparent 75%);
}
.modal__dialog[data-tier="Arcana"] .modal__aura {
  background: radial-gradient(circle, rgba(239, 201, 122, 0.58) 0%, rgba(239, 201, 122, 0.22) 42%, transparent 78%);
  animation: aura-pulse-arcana 2.6s ease-in-out infinite;
}

@keyframes aura-pulse-arcana {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  50%      { transform: translateX(-50%) scale(1.14); opacity: 1; }
}

/* Desktop-split variants: aura positioned on the left column (transform: translate(-50%, -50%)) */
@keyframes aura-breathe-split {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
  50%      { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}
@keyframes aura-pulse-arcana-split {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50%      { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
}

.modal__reading {
  position: relative;
  z-index: 1;
}

.modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4.2vw, 1.8rem);
  letter-spacing: 0.14em;
  color: var(--parchment);
  margin: 0 0 18px;
  text-transform: uppercase;
  text-shadow: 0 1px 20px rgba(217, 178, 106, 0.22);
}

.modal__meaning {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--parchment);
  max-width: 44ch;
  margin: 0 auto 24px;
}

.modal__omen {
  font-family: var(--font-body);
  font-size: 1.08rem;
  color: var(--gold-glow);
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin: 20px auto 18px;
  max-width: 38ch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-shadow: 0 0 16px rgba(217, 178, 106, 0.2);
}
.modal__omen em { font-style: italic; font-weight: 500; }
.modal__omen-mark {
  color: var(--gold-antique);
  font-size: 14px;
  opacity: 0.75;
}

.modal__tier {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--tier-whisper);
  margin: -6px 0 22px;
  padding-left: 0.5em;
  display: inline-block;
  position: relative;
}
.modal__tier::before,
.modal__tier::after {
  content: '\2022';
  color: inherit;
  margin: 0 10px;
  opacity: 0.6;
  letter-spacing: 0;
}
.modal__dialog[data-tier="Whisper"] .modal__tier { color: var(--tier-whisper); }
.modal__dialog[data-tier="Omen"]    .modal__tier { color: var(--tier-omen); }
.modal__dialog[data-tier="Arcana"]  .modal__tier { color: var(--tier-arcana); text-shadow: 0 0 14px rgba(230, 195, 122, 0.45); }

/* Share action footer */
.modal__actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(184, 146, 75, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.modal__share {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--parchment);
  background:
    linear-gradient(180deg, rgba(38, 28, 16, 0.55) 0%, rgba(16, 12, 10, 0.75) 100%);
  border: 1px solid rgba(184, 146, 75, 0.5);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(217, 178, 106, 0.08) inset,
    0 4px 18px rgba(0, 0, 0, 0.35);
  transition:
    color 240ms ease,
    border-color 240ms ease,
    background 240ms ease,
    box-shadow 260ms ease,
    transform 180ms var(--ease-ritual);
}
.modal__share:hover {
  color: var(--gold-bright);
  border-color: var(--gold-glow);
  box-shadow:
    0 0 0 1px rgba(217, 178, 106, 0.18) inset,
    0 6px 24px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(217, 178, 106, 0.22);
}
.modal__share:hover .modal__share-icon { color: var(--gold-glow); }
.modal__share:active { transform: translateY(1px); }
.modal__share:focus-visible { outline: 1px solid var(--gold-glow); outline-offset: 3px; }
.modal__share[disabled] { opacity: 0.65; cursor: wait; }
.modal__share.is-loading .modal__share-icon {
  animation: share-spin 1200ms linear infinite;
}

.modal__share-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-antique);
  flex-shrink: 0;
  transition: color 240ms ease;
}
.modal__share-label { padding-left: 0.32em; }

@keyframes share-spin {
  to { transform: rotate(360deg); }
}

/* Staggered cascade (animated open only) */
.modal__title,
.modal__tier,
.modal__meaning,
.modal__omen {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease, transform 500ms var(--ease-settle);
}
body.modal-open.modal-animating .modal__title   { opacity: 1; transform: none; transition-delay: 400ms; }
body.modal-open.modal-animating .modal__tier    { opacity: 1; transform: none; transition-delay: 700ms; }
body.modal-open.modal-animating .modal__meaning { opacity: 1; transform: none; transition-delay: 1100ms; }
body.modal-open.modal-animating .modal__omen    { opacity: 1; transform: none; transition-delay: 1600ms; }

/* Instant open (no cascade) — re-open from face-up card */
body.modal-open:not(.modal-animating) .modal__title,
body.modal-open:not(.modal-animating) .modal__tier,
body.modal-open:not(.modal-animating) .modal__meaning,
body.modal-open:not(.modal-animating) .modal__omen {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease;
}

/* Scroll lock when modal open */
body.modal-open { overflow: hidden; }

/* Mobile modal tweaks */
@media (max-width: 479px) {
  .modal { padding: 16px; }
  .modal__dialog { padding: 46px 20px 28px; }
  .modal__close { top: 10px; right: 10px; width: 32px; height: 32px; }
  .modal__close svg { width: 14px; height: 14px; }
  .modal__card { width: min(68vw, 220px); margin-bottom: 20px; }
}

/* Reduced motion: compress ceremony */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 100ms !important;
  }
  .atmosphere__particles { display: none; }
  .atmosphere__sigil { animation: none; }
  .card { animation: none; }
  .ritual__glow { animation: none; }
  .modal__aura { animation: none !important; }

  body.state-summoning .card,
  body.state-summoning .card__face--back,
  body.state-summoning .ritual__halo,
  body.state-summoning .ritual__glow,
  body.state-summoning .atmosphere__sigil,
  body.state-summoning .atmosphere__vignette { animation-duration: 200ms !important; }
  body.state-bursting .burst-flash { animation-duration: 200ms !important; }
  body.state-bursting .card { animation-duration: 100ms !important; }

  .modal, .modal__dialog { transition-duration: 150ms !important; }
  body.modal-open.modal-animating .modal__title,
  body.modal-open.modal-animating .modal__tier,
  body.modal-open.modal-animating .modal__meaning,
  body.modal-open.modal-animating .modal__omen {
    transition-delay: 0ms !important;
  }
}

/* =========================================================
   Responsive
   ========================================================= */

/* Tablet */
@media (min-width: 640px) {
  body { font-size: 18px; }
  .stage { padding: 40px 28px 48px; max-width: 760px; }
  .card { width: var(--card-width-tablet); max-width: none; }
  .ritual__halo { width: min(72vw, 480px); }
  .ritual__glow { width: min(78vw, 560px); }

  .hero-banner { padding: 64px 32px 48px; }
  .hero-banner__image { max-height: 340px; max-width: 500px; }
  .hero-banner__lede { max-width: 48ch; }
}

/* Desktop — 2-column hero, more cinematic ritual stage */
@media (min-width: 1024px) {
  .stage { padding: 56px 32px 64px; max-width: 860px; }
  .card { width: var(--card-width-desktop); }
  .ritual { padding: 48px 0 32px; }
  .ritual__halo { width: 520px; }
  .ritual__glow { width: 620px; }

  /* Modal: split card (left) + reading (right) */
  .modal__dialog {
    max-width: 860px;
    padding: 52px 48px 44px;
  }
  .modal__body {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
  }
  .modal__card {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .modal__reading { text-align: left; }
  .modal__title { margin-top: 4px; }
  .modal__meaning { font-size: 1.06rem; margin: 0 0 24px; max-width: none; }
  .modal__omen {
    justify-content: flex-start;
    margin: 22px 0 18px;
    max-width: none;
    font-size: 1.15rem;
  }
  .modal__tier { margin-top: 18px; }
  .modal__actions { align-items: flex-start; }

  /* Reposition aura behind the left card column */
  .modal__aura {
    top: 50%;
    left: clamp(130px, 22%, 210px);
    width: 460px;
    animation-name: aura-breathe-split;
  }
  .modal__dialog[data-tier="Arcana"] .modal__aura {
    animation-name: aura-pulse-arcana-split;
  }

  .back-home {
    top: 28px;
    left: 28px;
    height: 44px;
    padding: 0 20px;
    font-size: 10.5px;
  }
  .back-home__icon { width: 15px; height: 15px; }
  .sound-toggle { top: 28px; right: 28px; width: 44px; height: 44px; }

  .hero-banner { padding: 80px 48px 64px; }
  .hero-banner__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
    align-items: center;
    text-align: left;
  }
  /* Restore content wrapper as its own flex column; visual stays in col 2 */
  .hero-banner__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  /* Reset mobile ordering — grid auto-placement handles desktop layout */
  .hero-banner__eyebrow,
  .hero-banner__title,
  .hero-banner__visual,
  .hero-banner__subtitle,
  .hero-banner__lede,
  .hero-banner__cta {
    order: 0;
  }
  .hero-banner__visual {
    justify-content: flex-end;
    margin: 0;
  }
  .hero-banner__image { max-height: none; max-width: 560px; }
  .hero-banner__lede { margin-left: 0; max-width: 44ch; }
  .hero-banner__title { letter-spacing: 0.06em; }
}

/* Wide desktop */
@media (min-width: 1440px) {
  .stage { max-width: 960px; }
  .card { width: 420px; }
  .ritual__halo { width: 580px; }
  .ritual__glow { width: 680px; }

  .hero-banner { padding: 100px 64px 80px; }
  .hero-banner__inner { max-width: 1280px; column-gap: 64px; }
  .hero-banner__image { max-width: 620px; }
}
