/* =====================================================================
   numerology2.css — "The Codex of Numbers"
   Maximalist illuminated-manuscript design for /numerology2/.
   Built with Anthropic's Frontend Design skill.
   ===================================================================== */

:root {
  /* Palette */
  --codex-parchment-1:   #FBF6E8;
  --codex-parchment-2:   #F4EAD0;
  --codex-parchment-3:   #E8D9A8;
  --codex-ivory:         #FAF6E9;
  --codex-cream:         #F5EBC8;
  --codex-burgundy:      #6B1F2C;
  --codex-burgundy-deep: #4A1620;
  --codex-burgundy-soft: #8B3A4B;
  --codex-gold-deep:     #8E6E3A;
  --codex-gold-mid:      #B89150;
  --codex-gold-bright:   #D4AC68;
  --codex-gold-foil:     #F4DCA6;
  --codex-midnight-1:    #0E1424;
  --codex-midnight-2:    #161E33;
  --codex-midnight-3:    #1F2B47;
  --codex-emerald:       #1F4937;
  --codex-paper-shadow:  rgba(74, 28, 38, 0.10);
  --codex-paper-shadow-lg: rgba(74, 28, 38, 0.22);

  /* Typography */
  --codex-font-display:  "Cormorant Unicase", "Cormorant Garamond", serif;
  --codex-font-serif:    "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --codex-font-body:     "EB Garamond", Georgia, serif;
  --codex-font-numeral:  "Cinzel Decorative", serif;
  --codex-font-script:   "Italianno", cursive;
}

/* ═══════════════════════════════════════════════════════════
   FOUNDATION
   ═══════════════════════════════════════════════════════════ */
body.codex-body {
  background: var(--codex-parchment-1);
  color: var(--codex-burgundy);
  font-family: var(--codex-font-body);
  overflow-x: hidden;
}

.codex-main { position: relative; z-index: 1; }

/* Site-wide grain overlay */
.codex-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  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.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: multiply;
}

/* ═══════════════════════════════════════════════════════════
   SHARED ROOM PRIMITIVES
   ═══════════════════════════════════════════════════════════ */
.codex-room {
  position: relative;
  padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 4vw, 3rem);
  isolation: isolate;
  /* Full-bleed escape — every room background goes edge-to-edge */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Colophon also breaks out so its parchment bg pins to browser edges */
.codex-colophon {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Section dividers (the ornate fleuron rules between rooms) */
.codex-room-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  max-width: 600px;
  width: 100%;
}
.codex-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--codex-gold-mid), transparent);
}
.codex-divider-mark {
  font-family: var(--codex-font-numeral);
  font-size: 1.5rem;
  color: var(--codex-gold-deep);
  text-shadow: 0 1px 0 rgba(212, 172, 104, 0.4);
}
.codex-room-divider-dark .codex-divider-line {
  background: linear-gradient(90deg, transparent, var(--codex-gold-bright), transparent);
}
.codex-room-divider-dark .codex-divider-mark { color: var(--codex-gold-foil); }

/* Section headers */
.codex-room-head {
  text-align: center;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  max-width: 760px;
}
.codex-room-eyebrow {
  display: inline-block;
  font-family: var(--codex-font-numeral);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--codex-gold-deep);
  margin-bottom: 1.2rem;
}
.codex-room-title {
  font-family: var(--codex-font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--codex-burgundy);
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}
.codex-room-title em {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--codex-gold-deep);
  text-transform: lowercase;
  letter-spacing: 0;
}
.codex-room-script {
  font-family: var(--codex-font-script);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--codex-gold-deep);
  margin: 0.4rem 0 1.4rem;
  -webkit-text-stroke: 0.3px var(--codex-gold-deep);
}
.codex-room-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 1.2rem;
  max-width: 360px;
}
.codex-room-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--codex-gold-mid), transparent);
}
.codex-room-rule-mark {
  font-size: 0.95rem;
  color: var(--codex-gold-bright);
}
.codex-room-deck {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.2rem, 1.85vw, 1.4rem);
  line-height: 1.6;
  color: var(--codex-burgundy-deep);
  max-width: 640px;
  margin: 0 auto;
}
.codex-room-head-dark .codex-room-eyebrow,
.codex-room-head-dark .codex-room-rule-mark { color: var(--codex-gold-foil); }
.codex-room-head-dark .codex-room-title { color: var(--codex-cream); }
.codex-room-head-dark .codex-room-title em { color: var(--codex-gold-bright); }
.codex-room-head-dark .codex-room-script { color: var(--codex-gold-bright); -webkit-text-stroke-color: var(--codex-gold-bright); }
.codex-room-head-dark .codex-room-rule-line { background: linear-gradient(90deg, transparent, var(--codex-gold-bright), transparent); }
.codex-room-head-dark .codex-room-deck { color: rgba(245, 235, 200, 0.85); }

/* Match the hero .page-hero-subtitle style exactly (size + weight + color) */
.codex-room-deck.codex-room-deck-match-hero {
  font-family: 'EB Garamond', serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 580px;
}

/* ═══════════════════════════════════════════════════════════
   ROOM 1 — HERO
   ═══════════════════════════════════════════════════════════ */
.codex-room-hero {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 172, 104, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(107, 31, 44, 0.08), transparent 70%),
    linear-gradient(180deg, var(--codex-parchment-1) 0%, var(--codex-parchment-2) 100%);
  /* Match the standard page-hero rhythm — same height as tarot / numerology v1 */
  padding-top: 0;
  padding-bottom: 0.5rem;
  text-align: center;
  overflow: hidden;
}
/* Tighter divider in the hero room (closer to the next purple section) */
.codex-room-hero .codex-room-divider {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* Ghost numerals scattered behind hero */
.codex-ghost-numerals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.codex-ghost {
  position: absolute;
  font-family: var(--codex-font-numeral);
  font-weight: 900;
  color: var(--codex-gold-mid);
  opacity: 0.05;
  user-select: none;
  animation: codexGhostDrift 30s ease-in-out infinite;
}
.codex-ghost-1 { top:  4%; left:  6%; font-size: clamp(8rem, 18vw, 16rem); animation-delay: -2s; }
.codex-ghost-2 { top: 18%; right: 4%; font-size: clamp(6rem, 14vw, 12rem); animation-delay: -8s; }
.codex-ghost-3 { top: 56%; left:  3%; font-size: clamp(7rem, 16vw, 14rem); animation-delay: -4s; }
.codex-ghost-4 { top: 44%; right: 8%; font-size: clamp(5rem, 12vw, 10rem); animation-delay: -12s; }
.codex-ghost-5 { top: 76%; left: 12%; font-size: clamp(6rem, 14vw, 12rem); animation-delay: -16s; }
.codex-ghost-6 { top: 84%; right: 4%; font-size: clamp(7rem, 15vw, 13rem); animation-delay: -6s; }
.codex-ghost-7 { top: 32%; left: 42%; font-size: clamp(8rem, 20vw, 18rem); animation-delay: -10s; opacity: 0.025; }
.codex-ghost-8 { top: 10%; left: 22%; font-size: clamp(4rem, 9vw, 7rem); animation-delay: -14s; }
.codex-ghost-9 { top: 64%; right: 28%; font-size: clamp(5rem, 11vw, 9rem); animation-delay: -18s; }

@keyframes codexGhostDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(8px, -10px) rotate(0.5deg); }
}

/* Floating ornament dust */
.codex-orn-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.codex-orn {
  position: absolute;
  color: var(--codex-gold-mid);
  font-size: 1rem;
  opacity: 0.6;
  animation: codexOrnTwinkle 4s ease-in-out infinite;
}
@keyframes codexOrnTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 0.85; transform: scale(1.15); }
}

/* Compare-with-v1 link — small, top-RIGHT corner so it doesn't conflict with .page-hero-back on top-left */
.codex-back {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-family: var(--codex-font-numeral);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--codex-gold-deep);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(184, 145, 80, 0.35);
  border-radius: 999px;
  background: rgba(255, 251, 240, 0.55);
  backdrop-filter: blur(4px);
  z-index: 5;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.codex-back:hover { opacity: 1; color: var(--codex-burgundy); border-color: var(--codex-burgundy); }

/* Hero inner */
.codex-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  width: 100%;
  padding: 0 1rem;
  animation: codexHeroFadeIn 1.4s ease-out;
}
@keyframes codexHeroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.codex-hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.8rem;
}
.codex-hero-eyebrow {
  font-family: var(--codex-font-numeral);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--codex-gold-deep);
}
.codex-hero-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.9rem auto 0;
  width: min(280px, 80%);
}
.codex-hero-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--codex-gold-mid), transparent);
}
.codex-hero-rule-mark {
  font-size: 0.85rem;
  color: var(--codex-gold-bright);
}

/* The big title — kinetic word stack */
.codex-hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1.4rem;
  font-family: var(--codex-font-display);
  font-weight: 500;
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  color: var(--codex-burgundy);
}
.codex-hero-the {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--codex-gold-deep);
  margin-bottom: 0.4rem;
}
.codex-hero-main {
  font-size: clamp(4rem, 11vw, 9rem);
  background: linear-gradient(180deg, var(--codex-burgundy) 0%, var(--codex-burgundy-soft) 50%, var(--codex-burgundy-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(212, 172, 104, 0.3),
    0 4px 24px rgba(74, 28, 38, 0.16);
  display: block;
}
.codex-hero-main-burgundy {
  background: linear-gradient(180deg, var(--codex-gold-deep) 0%, var(--codex-burgundy) 50%, var(--codex-burgundy-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.codex-hero-of {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.4rem);
  text-transform: lowercase;
  color: var(--codex-gold-deep);
  letter-spacing: 0.02em;
  margin: -0.3em 0;
}
.codex-hero-of em { font-style: italic; }

.codex-hero-script {
  font-family: var(--codex-font-script);
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  color: var(--codex-gold-deep);
  -webkit-text-stroke: 0.3px var(--codex-gold-deep);
  margin: 0.5rem 0 0;
  text-shadow: 0 1px 0 rgba(212, 172, 104, 0.25);
}

.codex-hero-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin: 2.4rem auto 0;
  max-width: 640px;
}
.codex-hero-deck {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--codex-burgundy-deep);
  margin: 0;
}
.codex-hero-fleuron {
  font-family: var(--codex-font-numeral);
  font-size: 1.4rem;
  color: var(--codex-gold-deep);
  text-shadow: 0 1px 0 rgba(212, 172, 104, 0.3);
  animation: codexFleuronFloat 4s ease-in-out infinite;
}
@keyframes codexFleuronFloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   AMPLIFIED HERO MEDALLION ANIMATIONS (numerology2 only)
   Override + add to the base animations in numerology-hub.css
   ═══════════════════════════════════════════════════════════ */

/* Subtle whole-medallion breathing (both sides, opposite phase) */
.codex-room-hero .num-medallion-vesica {
  animation: codexHeroMedallionBreathL 6s ease-in-out infinite;
}
.codex-room-hero .num-medallion-sigil {
  animation: codexHeroMedallionBreathR 6s ease-in-out infinite;
}
@keyframes codexHeroMedallionBreathL {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}
@keyframes codexHeroMedallionBreathR {
  0%, 100% { transform: translateY(0) rotate(1deg); }
  50%      { transform: translateY(-6px) rotate(-1deg); }
}

/* VESICA — bigger swing on the two intersecting circles + stroke glow pulse */
.codex-room-hero .num-medallion-vesica .num-vesica-left {
  animation: codexVesicaLeft 4s ease-in-out infinite !important;
}
.codex-room-hero .num-medallion-vesica .num-vesica-right {
  animation: codexVesicaRight 4s ease-in-out infinite !important;
}
@keyframes codexVesicaLeft {
  0%, 100% { transform: translateX(0); stroke-width: 0.7; opacity: 0.85; }
  50%      { transform: translateX(-5px); stroke-width: 1.1; opacity: 1; }
}
@keyframes codexVesicaRight {
  0%, 100% { transform: translateX(0); stroke-width: 0.7; opacity: 0.85; }
  50%      { transform: translateX(5px); stroke-width: 1.1; opacity: 1; }
}

/* VESICA — bigger center pulse + halo */
.codex-room-hero .num-medallion-vesica .num-vesica-center {
  animation: codexVesicaCenterPulse 1.8s ease-in-out infinite !important;
}
@keyframes codexVesicaCenterPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 1px rgba(212,172,104,0.4));
  }
  50% {
    transform: scale(1.7);
    filter: drop-shadow(0 0 8px rgba(212,172,104,1)) drop-shadow(0 0 14px rgba(244,220,166,0.6));
  }
}

/* SIGIL — make the rotating star group spin faster + glow */
.codex-room-hero .num-medallion-sigil .num-sigil-star {
  animation: codexSigilSpin 16s linear infinite !important;
  filter: drop-shadow(0 0 1px rgba(212,172,104,0.4));
  transform-origin: 32px 32px;
}
@keyframes codexSigilSpin {
  0%   { transform: rotate(0deg);   filter: drop-shadow(0 0 1px rgba(212,172,104,0.4)); }
  50%  { filter: drop-shadow(0 0 4px rgba(212,172,104,0.95)); }
  100% { transform: rotate(360deg); filter: drop-shadow(0 0 1px rgba(212,172,104,0.4)); }
}

/* SIGIL — counter-rotate the individual polygons for layered motion */
.codex-room-hero .num-medallion-sigil .num-sigil-star polygon:nth-of-type(1) {
  animation: codexSigilTri1 20s linear infinite;
  transform-origin: 32px 32px;
}
.codex-room-hero .num-medallion-sigil .num-sigil-star polygon:nth-of-type(2) {
  animation: codexSigilTri2 26s linear infinite reverse;
  transform-origin: 32px 32px;
}
.codex-room-hero .num-medallion-sigil .num-sigil-star polygon:nth-of-type(3) {
  animation: codexSigilTri3 22s linear infinite;
  transform-origin: 32px 32px;
}
@keyframes codexSigilTri1 { from { transform: rotate(0deg);   } to { transform: rotate(360deg); } }
@keyframes codexSigilTri2 { from { transform: rotate(40deg);  } to { transform: rotate(400deg); } }
@keyframes codexSigilTri3 { from { transform: rotate(80deg);  } to { transform: rotate(440deg); } }

/* SIGIL — bigger center pulse */
.codex-room-hero .num-medallion-sigil .num-sigil-center {
  animation: codexSigilCenterPulse 1.6s ease-in-out infinite !important;
}
@keyframes codexSigilCenterPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 1px rgba(212,172,104,0.4));
  }
  50% {
    transform: scale(1.65);
    filter: drop-shadow(0 0 8px rgba(212,172,104,1)) drop-shadow(0 0 16px rgba(244,220,166,0.6));
  }
}

/* Both medallions — make twinkles AND sparks stronger */
.codex-room-hero .page-hero-medallion .hero-twinkle {
  animation: codexHeroTwinkleBig 2.4s ease-in-out infinite !important;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes codexHeroTwinkleBig {
  0%, 100% { opacity: 0.3; transform: scale(0.7); filter: drop-shadow(0 0 0 rgba(212,172,104,0)); }
  50%      { opacity: 1;   transform: scale(2);   filter: drop-shadow(0 0 5px currentColor); }
}
.codex-room-hero .page-hero-medallion .hero-twinkle-1 { animation-delay: 0s; }
.codex-room-hero .page-hero-medallion .hero-twinkle-2 { animation-delay: 0.6s; }
.codex-room-hero .page-hero-medallion .hero-twinkle-3 { animation-delay: 1.2s; }
.codex-room-hero .page-hero-medallion .hero-twinkle-4 { animation-delay: 1.8s; }

.codex-room-hero .page-hero-medallion .num-spark {
  animation: codexHeroSparkBig 3s ease-in-out infinite !important;
}
@keyframes codexHeroSparkBig {
  0%, 100% { opacity: 0;    transform: scale(0.4); }
  45%, 55% { opacity: 0.95; transform: scale(2.4); filter: drop-shadow(0 0 4px currentColor); }
}

/* Decorative outer rings spin a bit faster on the hero medallions */
.codex-room-hero .page-hero-medallion .num-ring-outer {
  animation: numRingDrift 14s linear infinite !important;
}
.codex-room-hero .page-hero-medallion .num-ring-inner {
  animation: numRingDrift 11s linear infinite reverse !important;
}

@media (prefers-reduced-motion: reduce) {
  .codex-room-hero .page-hero-medallion,
  .codex-room-hero .page-hero-medallion * {
    animation: none !important;
  }
}

/* v1 hero composition needs to sit above the atmospheric background layers */
.codex-hero-classic {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.codex-hero-classic .page-hero-band {
  position: relative;
  z-index: 3;
}

/* Watermark behind hero text */
.codex-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(380px, 50vw, 580px);
  height: clamp(380px, 50vw, 580px);
  transform: translate(-50%, -50%);
  z-index: 0;
  color: var(--codex-gold-mid);
  opacity: 0.18;
  pointer-events: none;
}
.codex-watermark svg { width: 100%; height: 100%; }
.codex-watermark-star {
  transform-origin: center;
  animation: codexWatermarkSpin 60s linear infinite;
}
@keyframes codexWatermarkSpin { to { transform: translate(100px, 100px) rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   ROOM 2 — THE EIGHT DOORWAYS  (wine vault — was constellation)
   ═══════════════════════════════════════════════════════════ */
.codex-room-doorways {
  background:
    radial-gradient(ellipse 70% 45% at 50% 12%, rgba(107, 31, 44, 0.45) 0%, transparent 75%),
    radial-gradient(ellipse 80% 60% at 50% 95%, rgba(212, 172, 104, 0.10) 0%, transparent 75%),
    #2D1428;
  color: var(--codex-cream);
  padding-top: clamp(4.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(5rem, 10vw, 8rem);
  position: relative;
  overflow: hidden;
  /* Full-bleed escape from parent padding */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
/* Pull the section header tighter to the top of the wine box */
.codex-room-doorways .codex-room-head {
  margin-top: 0;
}
/* Wine room noise texture overlay */
.codex-room-doorways::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix type='matrix' values='0 0 0 0 0.85  0 0 0 0 0.65  0 0 0 0 0.30  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/></svg>");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.codex-room-doorways > * { position: relative; z-index: 1; }
.codex-room-doorways .codex-room-eyebrow,
.codex-room-doorways .codex-room-rule-mark { color: var(--codex-gold-foil); }
.codex-room-doorways .codex-room-title { color: var(--codex-cream); }
.codex-room-doorways .codex-room-title em { color: var(--codex-gold-bright); }
.codex-room-doorways .codex-room-script { color: var(--codex-gold-bright); -webkit-text-stroke-color: var(--codex-gold-bright); }
.codex-room-doorways .codex-room-rule-line { background: linear-gradient(90deg, transparent, var(--codex-gold-bright), transparent); }
.codex-room-doorways .codex-room-deck { color: rgba(245, 235, 200, 0.92); }

/* Deck under the t2-room-head (matches tarot's intro paragraph style + readable on wine) */
.codex-room-doorways .codex-room-deck-light {
  margin: 1.4rem auto 0;
  max-width: 640px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.6;
  color: rgba(245, 235, 200, 0.92);
  text-align: center;
}

/* When .codex-room is also .t2-room, suppress codex-room's full-bleed since
   t2-room-ritual already has its own — avoids double-margin glitches */
.codex-room.t2-room {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.codex-doorways-grid,
.codex-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: 1fr;          /* equal-height rows */
  align-items: stretch;
  gap: 1.4rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

@media (min-width: 940px) {
  .codex-doorways-grid,
  .codex-tools-grid { grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
}

/* Card itself fills the grid cell, frame stretches to full height */
.codex-tools-grid .codex-card,
.codex-constellation .codex-card { height: 100%; }
.codex-tools-grid .codex-card-frame,
.codex-constellation .codex-card-frame { height: 100%; }

/* TOOL CARDS — same tarot-card frame as numbers, but with Roman glyph + per-tool ink color accent */
.codex-card-tool .codex-card-banner-top {
  position: relative;
}
.codex-card-tool .codex-card-banner-top::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 18%;
  right: 18%;
  height: 2px;
  background: var(--door-color, var(--codex-burgundy));
  opacity: 0.85;
}
.codex-card-banner-label-tool {
  color: var(--door-color, var(--codex-burgundy)) !important;
  font-size: 0.66rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.28em !important;
  word-spacing: 0.45em;
}

.codex-card-glyph-roman {
  font-family: var(--codex-font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 7vw, 6rem) !important;
  letter-spacing: 0.02em !important;
  background: linear-gradient(180deg,
    var(--door-color, #6B1F2C) 0%,
    #8E6E3A 50%,
    var(--door-color, #6B1F2C) 100%) !important;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.codex-card-tool-desc {
  display: block;
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  color: var(--codex-burgundy-deep);
  line-height: 1.5;
  margin-top: 0.4rem;
  text-align: center;
  padding: 0 0.3rem;
}

/* Tool card art zone: simpler than number card (no extra rays/circles bg) */
.codex-card-art-tool {
  padding: 1.5rem 1.2rem;
  min-height: 170px;
}
.codex-card-art-tool .codex-card-medallion {
  width: 130px;
  height: 130px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.codex-card-art-tool .codex-card-medallion svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(74, 28, 38, 0.18));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1), filter 0.45s ease;
}
.codex-card-tool:hover .codex-card-art-tool .codex-card-medallion svg {
  transform: scale(1.08);
  filter: drop-shadow(0 8px 22px rgba(212, 172, 104, 0.55));
}

/* ─── Challenges medallion: 4 mountain peaks of increasing height ─── */
.num-medallion-peaks .num-ring-outer {
  transform-origin: 32px 32px;
  animation: numRingDrift 24s linear infinite;
}
.num-medallion-peaks .num-ring-inner {
  transform-origin: 32px 32px;
  animation: numRingDrift 18s linear infinite reverse;
}
.num-medallion-peaks .num-peak-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: numPeakGlow 3s ease-in-out infinite;
}
.num-medallion-peaks .num-peak-1 .num-peak-glow { animation-delay: 0s; }
.num-medallion-peaks .num-peak-2 .num-peak-glow { animation-delay: 0.6s; }
.num-medallion-peaks .num-peak-3 .num-peak-glow { animation-delay: 1.2s; }
.num-medallion-peaks .num-peak-4 .num-peak-glow { animation-delay: 1.8s; }
@keyframes numPeakGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.8); filter: drop-shadow(0 0 0 rgba(212,172,104,0)); }
  50%      { opacity: 1;   transform: scale(1.5); filter: drop-shadow(0 0 4px rgba(212,172,104,0.85)); }
}
.num-medallion-peaks .num-peak {
  transform-origin: center bottom;
  animation: numPeakRise 4s ease-in-out infinite;
}
.num-medallion-peaks .num-peak-1 { animation-delay: 0s; }
.num-medallion-peaks .num-peak-2 { animation-delay: 0.5s; }
.num-medallion-peaks .num-peak-3 { animation-delay: 1s; }
.num-medallion-peaks .num-peak-4 { animation-delay: 1.5s; }
@keyframes numPeakRise {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .num-medallion-peaks * { animation: none !important; }
}

/* Each doorway card — a sealed portal */
.codex-doorway {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  background:
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(212, 172, 104, 0.08), transparent 70%),
    linear-gradient(180deg, var(--codex-ivory) 0%, var(--codex-parchment-2) 100%);
  border: 1px solid var(--codex-gold-mid);
  padding: 1.6rem 1.4rem 1.4rem;
  min-height: 320px;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
  box-shadow:
    inset 0 0 0 1px var(--codex-ivory),
    inset 0 0 0 2px var(--codex-gold-bright),
    0 8px 22px var(--codex-paper-shadow);
  animation: codexDoorEnter 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
  animation-delay: calc(var(--door-index) * 0.08s + 0.2s);
}

@keyframes codexDoorEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Decorative corner ornaments */
.codex-doorway-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--codex-gold-deep);
  pointer-events: none;
  transition: width 0.4s, height 0.4s, border-color 0.3s;
}
.codex-doorway-corner-tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.codex-doorway-corner-tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.codex-doorway-corner-bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.codex-doorway-corner-br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.codex-doorway:hover .codex-doorway-corner {
  width: 24px;
  height: 24px;
  border-color: var(--codex-burgundy);
}

.codex-doorway:hover {
  transform: translateY(-6px);
  border-color: var(--codex-burgundy);
  box-shadow:
    inset 0 0 0 1px var(--codex-ivory),
    inset 0 0 0 2px var(--codex-gold-foil),
    0 22px 50px rgba(74, 28, 38, 0.25);
}

/* Roman numeral watermark (top-right of each card) */
.codex-doorway-numeral {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--codex-font-numeral);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--codex-gold-mid);
  opacity: 0.55;
  letter-spacing: -0.02em;
  z-index: 0;
  transition: color 0.3s, opacity 0.3s;
}
.codex-doorway:hover .codex-doorway-numeral { color: var(--codex-burgundy); opacity: 0.85; }

.codex-doorway-band-top {
  position: relative;
  z-index: 1;
  margin: 0.2rem 0 0;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(184, 145, 80, 0.45);
}
.codex-doorway-eyebrow {
  font-family: var(--codex-font-numeral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--codex-emerald);
  /* per-card thematic color, set via inline style on .codex-doorway */
  color: var(--door-color, var(--codex-emerald));
  text-shadow: 0 1px 0 rgba(255, 251, 240, 0.55);
}
/* Wider word-gap only on cards that opt in (avoids "naturalgifts" run-together) */
.codex-doorway--eyebrow-wide .codex-doorway-eyebrow {
  word-spacing: 0.55em;
}

.codex-doorway-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 1.4rem 0;
}
.codex-doorway-name {
  font-family: var(--codex-font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--codex-burgundy);
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}
.codex-doorway-script {
  font-family: var(--codex-font-script);
  font-size: 1.45rem;
  color: var(--codex-gold-deep);
  margin: 0 0 0.7rem;
  -webkit-text-stroke: 0.3px var(--codex-gold-deep);
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  justify-content: center;
}
.codex-doorway-desc {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  color: var(--codex-burgundy-deep);
  margin: 0;
}

.codex-doorway-band-top + .codex-doorway-body { padding-top: 1rem; }

.codex-doorway-band-bottom {
  position: relative;
  z-index: 1;
  margin: 0.85rem -1.4rem -1.4rem; /* extend to card edges */
  padding: 0.85rem 1.4rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(107, 31, 44, 0.06) 0%, rgba(107, 31, 44, 0.12) 100%);
  border-top: 1.5px solid var(--codex-burgundy);
  transition: background 0.35s ease;
}
.codex-doorway:hover .codex-doorway-band-bottom {
  background: linear-gradient(180deg, var(--codex-burgundy) 0%, var(--codex-burgundy-deep) 100%);
  border-top-color: var(--codex-gold-foil);
  box-shadow: inset 0 1px 0 rgba(244, 220, 166, 0.25);
}

.codex-doorway-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--codex-font-numeral);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--codex-burgundy);
  transition: color 0.3s ease, gap 0.3s ease, transform 0.3s ease;
}
.codex-doorway:hover .codex-doorway-enter {
  color: var(--codex-gold-foil);
  gap: 0.95rem;
}
.codex-doorway-enter-text {
  text-shadow: 0 1px 0 rgba(255, 251, 240, 0.4);
}
.codex-doorway:hover .codex-doorway-enter-text {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.codex-doorway-enter-arrow {
  font-size: 1.3rem;
  display: inline-block;
  transition: transform 0.3s ease;
}
.codex-doorway:hover .codex-doorway-enter-arrow {
  transform: translateX(3px);
}

/* Doorway "No 1" — bigger digit inside the script line */
.codex-doorway-script-mark {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--codex-gold-deep);
  -webkit-text-stroke: 0;
  font-weight: 600;
}
.codex-doorway-script-num {
  font-family: var(--codex-font-numeral);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--codex-burgundy);
  -webkit-text-stroke: 0;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, var(--codex-gold-deep) 0%, var(--codex-burgundy) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 0.1rem;
}
.codex-doorway:hover .codex-doorway-script-num {
  background: linear-gradient(180deg, var(--codex-burgundy) 0%, var(--codex-gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.codex-doorway:hover .codex-doorway-enter-arrow { transform: translateX(2px); }

/* Decorative lock plate (subtle, only on hover) */
.codex-doorway-plate {
  position: absolute;
  bottom: 56px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  color: var(--codex-gold-bright);
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s;
  pointer-events: none;
}
.codex-doorway:hover .codex-doorway-plate {
  opacity: 0.5;
  transform: translateX(-50%) translateY(-2px);
}
.codex-doorway-plate svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════════════
   ROOM 3 — CONSTELLATION OF NUMBERS
   ═══════════════════════════════════════════════════════════ */
/* Anchor scroll target — accounts for any sticky top-nav */
.codex-room-constellation { scroll-margin-top: 80px; }

.codex-room-constellation {
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(212, 172, 104, 0.10), transparent 65%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(31, 73, 55, 0.18), transparent 70%),
    linear-gradient(180deg, var(--codex-midnight-1) 0%, var(--codex-midnight-2) 50%, var(--codex-midnight-1) 100%);
  color: var(--codex-cream);
  padding-top: clamp(5rem, 10vw, 8rem);
  padding-bottom: clamp(5rem, 10vw, 8rem);
  overflow: hidden;
  position: relative;
  /* Full-bleed escape from parent padding */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.codex-room-constellation > * { position: relative; z-index: 1; }

/* Star field */
.codex-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.codex-star {
  position: absolute;
  background: var(--codex-gold-foil);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(244, 220, 166, 0.7);
  animation: codexStarTwinkle 3s ease-in-out infinite;
}
@keyframes codexStarTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50%      { opacity: 1;   transform: scale(1.3); }
}

/* Micro — ultra-fine specks, almost imperceptible individually */
.codex-star-micro {
  background: rgba(244, 220, 166, 0.55);
  box-shadow: 0 0 1.5px rgba(244, 220, 166, 0.25);
  animation-name: codexStarMicro;
}
@keyframes codexStarMicro {
  0%, 100% { opacity: 0.05; transform: scale(0.5); }
  50%      { opacity: 0.55; transform: scale(1); }
}

/* Dust — tiny atmospheric specks, dimmer */
.codex-star-dust {
  background: rgba(244, 220, 166, 0.7);
  box-shadow: 0 0 3px rgba(244, 220, 166, 0.4);
}
@keyframes codexStarDust {
  0%, 100% { opacity: 0.1; transform: scale(0.6); }
  50%      { opacity: 0.7; transform: scale(1.1); }
}
.codex-star-dust { animation-name: codexStarDust; }

/* Mid stars — what the original looked like */
.codex-star-mid {
  background: var(--codex-gold-foil);
  box-shadow: 0 0 7px rgba(244, 220, 166, 0.75);
}

/* Guide stars — big, bright, with a 4-point sparkle cross */
.codex-star-guide {
  background: var(--codex-gold-foil);
  box-shadow:
    0 0 8px rgba(244, 220, 166, 0.95),
    0 0 16px rgba(244, 220, 166, 0.55),
    0 0 26px rgba(212, 172, 104, 0.4);
  animation-name: codexStarGuide;
}
.codex-star-guide::before,
.codex-star-guide::after {
  content: "";
  position: absolute;
  background: rgba(244, 220, 166, 0.85);
  top: 50%;
  left: 50%;
  pointer-events: none;
}
.codex-star-guide::before {
  width: 1px;
  height: 8px;
  transform: translate(-50%, -50%);
}
.codex-star-guide::after {
  width: 8px;
  height: 1px;
  transform: translate(-50%, -50%);
}
@keyframes codexStarGuide {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.4); }
}

/* The constellation grid */
.codex-constellation {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 0.5rem;
  z-index: 1;
}
@media (min-width: 940px) {
  .codex-constellation { grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
}

/* ═══════════════════════════════════════════════════════════
   NUMBER CARDS — cream tarot-card aesthetic on the wine room
   ═══════════════════════════════════════════════════════════ */
.codex-card {
  display: block;
  text-decoration: none;
  isolation: isolate;
  perspective: 1200px;
  animation: codexCardRise 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
  animation-delay: calc(var(--card-index) * 0.06s);
}
.codex-card-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 360px;
  background:
    radial-gradient(ellipse 90% 60% at 50% 30%, #FDFAEE 0%, transparent 70%),
    linear-gradient(160deg, #FAF3E0 0%, #F0E0BD 100%);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(212, 172, 104, 0.4),
    inset 0 0 0 6px #FAF3E0,
    inset 0 0 0 7px #B89150,
    0 18px 40px rgba(20, 8, 24, 0.55),
    0 4px 14px rgba(212, 172, 104, 0.18);
  overflow: hidden;
  transition:
    transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1),
    box-shadow 0.5s ease;
}
.codex-card:hover .codex-card-frame {
  transform: translateY(-10px) rotate(-0.5deg);
  box-shadow:
    inset 0 0 0 1px rgba(212, 172, 104, 0.5),
    inset 0 0 0 6px #FAF3E0,
    inset 0 0 0 7px #6B1F2C,
    0 28px 60px rgba(20, 8, 24, 0.7),
    0 8px 20px rgba(212, 172, 104, 0.35);
}
.codex-card:nth-child(2n):hover .codex-card-frame { transform: translateY(-12px) rotate(0.5deg); }
.codex-card:nth-child(3n):hover .codex-card-frame { transform: translateY(-10px) rotate(-1deg); }

/* Top banner: I · ARCHETYPE №01 · I */
.codex-card-banner-top {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem 0.7rem;
  background: linear-gradient(180deg, #FBF6E4 0%, #F5EBC8 100%);
  border-bottom: 1px solid rgba(184, 145, 80, 0.4);
  z-index: 2;
  margin: 9px 9px 0;
}
.codex-card-roman {
  font-family: var(--codex-font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--codex-burgundy);
}
.codex-card-banner-label {
  font-family: var(--codex-font-numeral);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--codex-burgundy);
  text-align: center;
  white-space: nowrap;
}

/* Hero zone: massive numeral glyph centered on cream */
.codex-card-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 1rem 1.4rem;
  margin: 0 9px;
  background: linear-gradient(180deg, #FAF3E0 0%, #F5EBC8 100%);
  z-index: 1;
  min-height: 180px;
  overflow: hidden;
}
.codex-card-art-bg {
  position: absolute;
  inset: 8%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.codex-card-art-bg svg {
  width: 100%;
  height: 100%;
  max-width: 200px;
  max-height: 200px;
}
.codex-card-art-rays {
  transform-origin: 100px 100px;
  animation: codexCardRaysSpin 80s linear infinite;
}
@keyframes codexCardRaysSpin { to { transform: translate(100px, 100px) rotate(360deg); } }

.codex-card-glyph {
  position: relative;
  z-index: 2;
  font-family: var(--codex-font-numeral);
  font-weight: 900;
  font-size: clamp(5.5rem, 9vw, 7.5rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg,
    #8E6E3A 0%,
    #D4AC68 35%,
    #F4DCA6 50%,
    #B89150 70%,
    #6B1F2C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 0 rgba(212, 172, 104, 0.3);
  filter: drop-shadow(0 4px 14px rgba(74, 28, 38, 0.18));
  transition: transform 0.5s ease, filter 0.4s ease;
}
.codex-card:hover .codex-card-glyph {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 20px rgba(212, 172, 104, 0.55));
}

.codex-card-master-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--codex-font-numeral);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--codex-burgundy-deep);
  background: linear-gradient(180deg, var(--codex-gold-foil) 0%, var(--codex-gold-bright) 100%);
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(74, 28, 38, 0.3);
}

/* Bottom banner: bold name + italic 3-keyword tag inline */
.codex-card-banner-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.05rem 1.2rem 1.15rem;
  background: linear-gradient(180deg, #FBF6E4 0%, #F5EBC8 100%);
  border-top: 1px solid rgba(184, 145, 80, 0.4);
  z-index: 2;
  margin: 0 9px 9px;
  text-align: center;
}
.codex-card-name {
  font-family: var(--codex-font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.8vw, 1.55rem);
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--codex-burgundy);
  line-height: 1.12;
  text-shadow:
    0 1px 0 rgba(255, 251, 232, 0.7),
    0 1px 2px rgba(74, 28, 38, 0.18);
  -webkit-text-stroke: 0.4px var(--codex-burgundy);
}
.codex-card-tag-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  color: var(--codex-burgundy-deep);
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.codex-card-tag-word { white-space: nowrap; }
.codex-card-tag-dot {
  color: var(--codex-gold-deep);
  font-weight: 700;
  font-style: normal;
  opacity: 0.7;
}

/* L-shape decorative corner brackets — visible only at corners of the cream card */
.codex-card-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--codex-burgundy);
  pointer-events: none;
  z-index: 3;
  transition: width 0.4s, height 0.4s, border-color 0.3s;
}
.codex-card-bracket-tl { top: 14px;    left: 14px;  border-right: none; border-bottom: none; }
.codex-card-bracket-tr { top: 14px;    right: 14px; border-left: none;  border-bottom: none; }
.codex-card-bracket-bl { bottom: 14px; left: 14px;  border-right: none; border-top: none; }
.codex-card-bracket-br { bottom: 14px; right: 14px; border-left: none;  border-top: none; }
.codex-card:hover .codex-card-bracket {
  width: 22px;
  height: 22px;
  border-color: var(--codex-gold-deep);
}

/* Master cards — gold-foil top banner, dramatic frame */
.codex-card-master .codex-card-frame {
  background:
    radial-gradient(ellipse 90% 60% at 50% 30%, #FDFAEE 0%, transparent 70%),
    linear-gradient(160deg, #FBF1D6 0%, #EAD49A 100%);
  box-shadow:
    inset 0 0 0 1px var(--codex-gold-bright),
    inset 0 0 0 6px #FAF3E0,
    inset 0 0 0 7px var(--codex-gold-deep),
    0 22px 50px rgba(20, 8, 24, 0.65),
    0 4px 18px rgba(212, 172, 104, 0.3);
}
.codex-card-master .codex-card-banner-top {
  background: linear-gradient(180deg, var(--codex-gold-foil) 0%, var(--codex-gold-bright) 100%);
  border-bottom-color: var(--codex-gold-deep);
}
.codex-card-master .codex-card-banner-top .codex-card-roman,
.codex-card-master .codex-card-banner-top .codex-card-banner-label {
  color: var(--codex-burgundy-deep);
  text-shadow: 0 1px 0 rgba(255, 251, 232, 0.45);
}
.codex-card-master .codex-card-banner-bottom {
  background: linear-gradient(180deg, #FAF3E0 0%, #F0E0BD 100%);
  border-top-color: var(--codex-gold-deep);
}

/* Stagger entrance, used by .codex-card now */
.codex-numeral-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--codex-cream);
  padding: 1.6rem 1.2rem 1.4rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 172, 104, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(20, 28, 50, 0.85) 0%, rgba(10, 16, 32, 0.92) 100%);
  border: 1px solid rgba(184, 145, 80, 0.4);
  text-align: center;
  isolation: isolate;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1),
    border-color 0.3s,
    box-shadow 0.4s;
  box-shadow:
    inset 0 0 0 1px rgba(244, 220, 166, 0.05),
    0 14px 30px rgba(0, 0, 0, 0.4);
  animation: codexCardRise 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
  animation-delay: calc(var(--card-index) * 0.06s);
}
@keyframes codexCardRise {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.codex-numeral-card:hover {
  border-color: var(--codex-gold-bright);
  box-shadow:
    inset 0 0 0 1px rgba(244, 220, 166, 0.15),
    0 24px 56px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(212, 172, 104, 0.4);
}
@media (min-width: 720px) {
  .codex-numeral-card:hover { transform: translateY(-8px); }
  .codex-numeral-card:nth-child(2n):hover { transform: translateY(12px); }
  .codex-numeral-card:nth-child(4n):hover { transform: translateY(-16px); }
  .codex-numeral-card:nth-child(6n+1):hover { transform: translateY(4px); }
}

/* Decorative diamond corners */
.codex-numeral-corner {
  position: absolute;
  font-size: 0.55rem;
  color: var(--codex-gold-mid);
  opacity: 0.7;
  pointer-events: none;
  transition: color 0.3s, transform 0.3s;
}
.codex-numeral-corner-tl { top: 8px;    left: 8px; }
.codex-numeral-corner-tr { top: 8px;    right: 8px; }
.codex-numeral-corner-bl { bottom: 8px; left: 8px; }
.codex-numeral-corner-br { bottom: 8px; right: 8px; }
.codex-numeral-card:hover .codex-numeral-corner { color: var(--codex-gold-foil); transform: scale(1.3); }

.codex-numeral-eyebrow {
  font-family: var(--codex-font-numeral);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--codex-gold-foil);
  margin-bottom: 0.6rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.codex-numeral-glyph {
  font-family: var(--codex-font-numeral);
  font-weight: 900;
  font-size: clamp(4.5rem, 7vw, 5.8rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  background:
    linear-gradient(180deg,
      var(--codex-gold-foil) 0%,
      var(--codex-gold-bright) 35%,
      var(--codex-gold-mid) 60%,
      var(--codex-gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.2rem 0 0.8rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0 4px 14px rgba(212, 172, 104, 0.35));
  transition: filter 0.4s, transform 0.4s;
}
.codex-numeral-card:hover .codex-numeral-glyph {
  filter: drop-shadow(0 6px 22px rgba(212, 172, 104, 0.7));
  transform: scale(1.05);
}

.codex-numeral-title {
  font-family: var(--codex-font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.7vw, 1.5rem);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--codex-cream);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.codex-numeral-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  margin-bottom: 1.1rem;
  padding: 0 0.5rem;
}
.codex-numeral-tag-word {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--codex-gold-bright);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  position: relative;
}
/* Decorative dot ornament between stacked words (except after the last) */
.codex-numeral-tag-word:not(:last-child)::after {
  content: "·";
  display: block;
  margin-top: 0.18rem;
  color: var(--codex-gold-mid);
  font-size: 0.7rem;
  opacity: 0.7;
  line-height: 1;
}

.codex-numeral-cta {
  font-family: var(--codex-font-numeral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--codex-gold-foil);
  margin: auto -1.2rem -1.4rem;        /* auto top pushes CTA to card bottom */
  padding: 0.95rem 1rem;
  width: calc(100% + 2.4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background:
    linear-gradient(180deg, rgba(107, 31, 44, 0.55) 0%, rgba(74, 22, 32, 0.75) 100%);
  border-top: 1.5px solid var(--codex-gold-bright);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  transition: color 0.35s ease, background 0.35s ease, gap 0.3s ease, border-top-color 0.3s ease;
}
.codex-numeral-card:hover .codex-numeral-cta {
  color: var(--codex-burgundy-deep);
  gap: 0.9rem;
  background: linear-gradient(180deg, var(--codex-gold-foil) 0%, var(--codex-gold-bright) 100%);
  border-top-color: var(--codex-gold-foil);
  text-shadow: 0 1px 0 rgba(244, 220, 166, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.codex-numeral-cta-arrow {
  font-size: 1.05rem;
  display: inline-block;
  transition: transform 0.3s ease;
}
.codex-numeral-card:hover .codex-numeral-cta-arrow { transform: translateX(3px); }

/* Master numbers — bigger, with subtle aura */
.codex-numeral-master {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 172, 104, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(40, 26, 50, 0.92) 0%, rgba(20, 12, 28, 0.96) 100%);
  border-color: rgba(212, 172, 104, 0.65);
  box-shadow:
    inset 0 0 0 1px rgba(244, 220, 166, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.5);
}
.codex-numeral-master .codex-numeral-glyph {
  font-size: clamp(5.5rem, 8vw, 7rem);
}

.codex-numeral-master-band {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--codex-font-numeral);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.26em;
  color: var(--codex-burgundy-deep);
  background: linear-gradient(180deg, var(--codex-gold-foil) 0%, var(--codex-gold-bright) 100%);
  padding: 0.4rem 1rem;
  margin: -0.1rem 0 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.codex-numeral-master-mark { font-size: 0.75rem; color: var(--codex-burgundy); }

/* Master halo (very subtle now) */
.codex-numeral-halo {
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}
.codex-numeral-master .codex-numeral-halo {
  opacity: 1;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, rgba(212, 172, 104, 0.10), transparent 60%);
  animation: codexHaloPulse 5s ease-in-out infinite;
}
@keyframes codexHaloPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.7; }
}

/* ═══════════════════════════════════════════════════════════
   ROOM 4 — EDITORIAL
   ═══════════════════════════════════════════════════════════ */
.codex-room-editorial {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(212, 172, 104, 0.08), transparent 60%),
    linear-gradient(180deg, var(--codex-ivory) 0%, var(--codex-cream) 100%);
}

/* Editorial — adopts the same typography rhythm as /tarot/'s editorial section */
.codex-editorial {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.codex-editorial h2 {
  font-family: 'EB Garamond', serif;
  font-weight: 600;
  font-style: italic;
  font-size: clamp(2.2rem, 4.4vw, 3rem);
  color: #6B1F2C;
  margin: 0 0 1.2rem;
  line-height: 1.1;
  text-align: left;
}
.codex-editorial h3,
.codex-editorial-h3 {
  font-family: 'EB Garamond', serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  color: #3A1F38;
  margin: 2.6rem 0 0.9rem;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}
.codex-editorial p {
  font-family: 'EB Garamond', serif;
  font-size: 1.12rem;
  line-height: 1.78;
  color: #3a2826;
  margin: 0 0 1.3rem;
}
.codex-editorial p em     { color: #6B1F2C; font-style: italic; }
.codex-editorial p strong { color: #6B1F2C; font-weight: 700; }
.codex-editorial a {
  color: #6B1F2C;
  text-decoration: underline;
  text-decoration-color: rgba(184, 145, 80, 0.55);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.codex-editorial a:hover { color: #D4AC68; text-decoration-color: #D4AC68; }

.codex-editorial-lede { font-size: clamp(1.15rem, 1.7vw, 1.25rem); }

/* Drop-cap on the FIRST letter of the FIRST paragraph (the "W" in "What Is Numerology?") */
.codex-editorial-dropcap {
  font-family: 'EB Garamond', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 5.2rem;
  line-height: 0.85;
  float: left;
  padding: 0.55rem 0.7rem 0 0;
  color: #6B1F2C;
  text-shadow: 0 2px 0 rgba(212, 172, 104, 0.25);
}

.codex-pullquote {
  position: relative;
  margin: 2.6rem auto;
  padding: 1.8rem 2rem 1.8rem 3rem;
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.8), rgba(247, 235, 210, 0.5));
  border-left: 3px solid var(--codex-gold-bright);
  border-radius: 0 4px 4px 0;
}
.codex-pullquote-mark {
  position: absolute;
  top: 8px;
  left: 14px;
  font-family: var(--codex-font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--codex-gold-bright);
  font-weight: 700;
}
.codex-pullquote p {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--codex-burgundy);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   ROOM 5 — FAQ
   ═══════════════════════════════════════════════════════════ */
.codex-room-faq {
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(212, 172, 104, 0.08), transparent 65%),
    linear-gradient(180deg, var(--codex-cream) 0%, var(--codex-parchment-2) 100%);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);    /* tighter — closer to editorial above */
}
/* Editorial section: trim bottom padding so FAQ sits closer */
.codex-room-editorial { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.codex-faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.codex-faq-item {
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.9) 0%, rgba(247, 235, 210, 0.85) 100%);
  border: 1px solid rgba(184, 145, 80, 0.35);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.codex-faq-item[open] {
  border-color: var(--codex-burgundy);
  box-shadow: 0 6px 16px rgba(74, 28, 38, 0.08);
}
.codex-faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  font-family: var(--codex-font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  letter-spacing: 0;
  color: var(--codex-burgundy);
  transition: color 0.3s;
  text-transform: uppercase;
}
.codex-faq-item summary::-webkit-details-marker { display: none; }
.codex-faq-item:hover summary { color: var(--codex-gold-deep); }
.codex-faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--codex-gold-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--codex-font-numeral);
  font-weight: 700;
  font-size: 1rem;
  color: var(--codex-gold-deep);
  transition: transform 0.3s, background 0.3s, color 0.3s;
}
.codex-faq-item[open] .codex-faq-icon {
  background: var(--codex-burgundy);
  border-color: var(--codex-burgundy);
  color: var(--codex-gold-foil);
  transform: rotate(45deg);
}
.codex-faq-body {
  padding: 0.4rem 1.4rem 1.4rem;
  border-top: 1px dashed rgba(184, 145, 80, 0.35);
}
.codex-faq-body p {
  font-family: var(--codex-font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--codex-burgundy-deep);
  margin: 0.6rem 0 0;
}

/* ═══════════════════════════════════════════════════════════
   COLOPHON
   ═══════════════════════════════════════════════════════════ */
.codex-colophon {
  text-align: center;
  padding: 4rem 2rem 5rem;
  background: linear-gradient(180deg, var(--codex-parchment-2) 0%, var(--codex-parchment-1) 100%);
}
.codex-colophon-fleuron {
  font-family: var(--codex-font-numeral);
  font-size: 1.8rem;
  color: var(--codex-gold-deep);
  margin-bottom: 0.8rem;
}
.codex-colophon-mark {
  font-family: var(--codex-font-script);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--codex-burgundy);
  display: block;
  margin-bottom: 0.6rem;
  -webkit-text-stroke: 0.3px var(--codex-burgundy);
}
.codex-colophon-meta {
  font-family: var(--codex-font-numeral);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--codex-gold-deep);
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .codex-ghost,
  .codex-orn,
  .codex-star,
  .codex-watermark-star,
  .codex-numeral-halo,
  .codex-doorway,
  .codex-numeral-card,
  .codex-fleuron-mark,
  .codex-hero-fleuron {
    animation: none !important;
  }
  .codex-numeral-card { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   ROOM 1.5 — TODAY'S ENERGY  (2026-05-15)
   Universal Day / Month / Year triptych. Three illuminated vellum cards
   on the cream room background, hydrated by /api/energy.php at load.
   Center "TODAY" card is slightly emphasized (raised + brighter border).
   ═══════════════════════════════════════════════════════════════════ */

/* Matches the hero room's atmospheric warm-gold + burgundy radial glows so
   the two rooms read as ONE continuous illuminated parchment, not a hard
   band-cut between them. Less top padding for tighter rhythm. */
.codex-room-today {
  position: relative;
  padding: 1.6rem 1.5rem 3.5rem;
  background:
    radial-gradient(ellipse 70% 50% at 14% 8%, rgba(217, 150, 143, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 40% at 88% 22%, rgba(184, 145, 80, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 55% at 50% 110%, rgba(107, 31, 44, 0.06), transparent 60%),
    linear-gradient(180deg, var(--cc-vellum-warm, #F0DFC8) 0%, var(--cc-vellum, #FAF1E1) 100%);
  isolation: isolate;
}

/* Eyebrow above the "Today's Energy" title — small-caps gold, sets the editorial tone */
.codex-room-today .codex-room-eyebrow {
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.32em;
  color: var(--cc-gold-deep, #8E6E3A);
  text-align: center;
  margin-bottom: 0.9rem;
  padding-left: 0.32em;
}

/* 3-card triptych: equal width on desktop, stack on mobile */
.codex-today-grid {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;     /* center slightly wider */
  gap: 1.5rem;
  max-width: 1080px;
  margin: 2.4rem auto 2.8rem;
  align-items: stretch;
}

/* Each card — illuminated vellum tablet with gold border + corner brackets */
.codex-today-card {
  position: relative;
  padding: 2rem 1.5rem 1.6rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 172, 104, 0.16), transparent 65%),
    linear-gradient(180deg, #FBF3DC 0%, #F4E7C7 100%);
  border: 1px solid var(--cc-gold, #B89150);
  border-radius: 3px;
  box-shadow:
    0 18px 44px rgba(74, 22, 32, 0.10),
    0 4px 10px rgba(74, 22, 32, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 0 0 7px transparent,
    inset 0 0 0 8px rgba(184, 145, 80, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Center "TODAY" card raised + brighter to emphasize NOW */
.codex-today-card--day {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(240, 216, 154, 0.32), transparent 65%),
    linear-gradient(180deg, #FBF3DC 0%, #F0DFC8 100%);
  border-color: var(--cc-gold-bright, #D4AC68);
  box-shadow:
    0 24px 54px rgba(74, 22, 32, 0.16),
    0 6px 14px rgba(74, 22, 32, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 0 0 0 7px transparent,
    inset 0 0 0 8px rgba(212, 172, 104, 0.28);
  transform: translateY(-8px);
}

.codex-today-card:hover {
  transform: translateY(-4px);
}
.codex-today-card--day:hover {
  transform: translateY(-12px);
}

/* Corner brackets — gold L-shapes echoing the form-panel ornament */
.codex-today-corners {
  position: absolute; inset: 0;
  pointer-events: none;
}
.codex-today-corners .ctc {
  position: absolute;
  width: 18px; height: 18px;
  border: 1.4px solid var(--cc-gold-deep, #8E6E3A);
  opacity: 0.55;
}
.codex-today-corners .tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.codex-today-corners .tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.codex-today-corners .bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.codex-today-corners .br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* Eyebrow inside each card — bumped 2026-05-15 to match v1 SEO labels:
   "TODAY'S ENERGY" / "MONTHLY COSMIC ENERGY" / "THE YEAR'S UNIVERSAL VIBRATION" */
.codex-today-eyebrow {
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-weight: 900;                       /* heavier */
  font-size: 1.08rem;                     /* bigger */
  letter-spacing: 0.22em;
  color: var(--cc-burgundy-deep, #4A1620); /* darker burgundy for stronger presence */
  margin-bottom: 1.1rem;
  padding-left: 0.22em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  text-align: center;
  line-height: 1.15;
}
.codex-today-eyebrow .cte-mark {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.95rem;                     /* bumped to match the larger eyebrow */
  color: var(--cc-gold-bright, #D4AC68);
  opacity: 0.95;
  font-style: italic;
  flex-shrink: 0;
}

/* HUGE engraved number — the visual centerpiece.
   2026-05-15: deeper gold gradient with strong burgundy bottom for readable
   contrast against the cream card. Previous gradient was too pale at the top. */
.codex-today-number {
  font-family: 'Cinzel Decorative', 'EB Garamond', serif;
  font-weight: 900;
  font-size: clamp(4.5rem, 9vw, 7rem);
  line-height: 0.95;
  margin: 0.2rem 0 0.6rem;
  white-space: nowrap;
  letter-spacing: -0.02em;
  /* Deeper gold-foil gradient — bright shimmer top, deep gold middle, burgundy bottom */
  background:
    linear-gradient(180deg,
      #D4AC68 0%,       /* gold-bright top (was #F0D89A — too pale) */
      #B89150 25%,
      #8E6E3A 50%,
      #6B3F1A 78%,
      #4A1620 100%);    /* burgundy-deep bottom for grounding contrast */
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5))
          drop-shadow(0 6px 20px rgba(184, 145, 80, 0.5))
          drop-shadow(0 2px 4px rgba(74, 22, 32, 0.25));
}

/* Italianno script title — the meaning name */
.codex-today-title {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.45rem, 2.4vw, 1.75rem);
  color: var(--cc-burgundy, #6B1F2C);
  line-height: 1.15;
  margin: 0.2rem 0 0.85rem;
  min-height: 1.3em;
}

/* Body description */
.codex-today-text {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--cc-ink-soft, #4A3B52);
  margin: 0 0 1.2rem;
  max-width: 28ch;
}

/* Bottom date stamp — bigger, bolder, darker. 2026-05-15 */
.codex-today-date {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(184, 145, 80, 0.45);
  width: 80%;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--cc-burgundy, #6B1F2C);
  letter-spacing: 0.02em;
  min-height: 1.2em;
}

/* Mobile: stack to single column */
@media (max-width: 780px) {
  .codex-room-today { padding: 3rem 0.8rem 2.5rem; }
  .codex-today-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    max-width: 100%;
  }
  .codex-today-card { padding: 1.6rem 1.2rem 1.3rem; }
  .codex-today-card--day { transform: none; }       /* don't raise on mobile — flush stack feels cleaner */
  .codex-today-card--day:hover { transform: none; }
  .codex-today-number { font-size: clamp(4.2rem, 22vw, 6rem); }
  .codex-today-text { max-width: 100%; }
}
