/* ==========================================================================
   CÍRCULO URÓBOROS - SCHOLA HERMETICA & SCRIPTORIUM ALCHIMICUM
   Estilo Medieval de Códice Iluminado & Parallax Engine
   100% Responsive para Móviles, Tablets y Desktops con Alto Rendimiento
   ========================================================================== */

:root {
  --parchment-light: #FAF5E8;
  --parchment-sheet: #F3EBD8;
  --parchment-aged: #EADBBD;
  --parchment-dark: #D4BE8D;
  --parchment-vignette: #A68C5E;

  --ink-black: #1A1009;
  --ink-dark: #24160E;
  --ink-sepia: #382417;
  --ink-muted: #5D432D;
  --ink-faded: #8C7053;

  --cinnabar-red: #9E2A2B;
  --cinnabar-light: #BA3637;
  --cinnabar-dark: #6B1A1C;

  --gold-leaf: #C29B38;
  --gold-light: #F7E7A6;
  --gold-shimmer: #DFC270;
  --gold-dark: #7A5812;

  --lapis-lazuli: #1E3A5F;
  --lapis-light: #2D5485;
  --lapis-deep: #101E32;

  --font-gothic: 'Cinzel', 'MedievalSharp', serif;
  --font-manuscript: 'EB Garamond', Georgia, serif;
  --font-illuminated: 'UnifrakturMaguntia', 'MedievalSharp', serif;

  --shadow-ink: 0 4px 12px rgba(36, 22, 14, 0.25);
  --shadow-deep: 0 10px 30px rgba(36, 22, 14, 0.35);
  --shadow-wax: 2px 4px 10px rgba(107, 26, 28, 0.5);
}

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

html {
  font-size: 16px;
  max-width: 100vw;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
}

body {
  background-color: var(--parchment-aged);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(250, 245, 232, 0.9) 0%, rgba(234, 219, 189, 0.8) 50%, rgba(166, 140, 94, 0.9) 100%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%237A5D33' fill-opacity='0.04'%3E%3Cpath d='M0 0h80v80H0V0zm10 10h60v60H10V10z'/%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3Ccircle cx='60' cy='40' r='1'/%3E%3Ccircle cx='40' cy='70' r='1'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink-dark);
  font-family: var(--font-manuscript);
  line-height: 1.65;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  text-rendering: optimizeLegibility;
  transition: filter 0.4s ease, background-color 0.4s ease;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

/* Modo Lux Candelæ (Luz de Velas / Modo Noche Cálido) */
body.lux-candelae {
  background-color: #24170E;
  color: #F8EFE0;
  filter: sepia(0.18) contrast(1.04);
}

body.lux-candelae .manuscript-folio {
  background: linear-gradient(135deg, #FAF0D8 0%, #E2CCA0 50%, #C4A568 100%);
  box-shadow: 0 0 50px rgba(223, 194, 112, 0.2), 0 20px 40px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   TOP TICKER / BARRA DEL COPISTA (100% RESPONSIVE)
   ========================================================================== */
.scribe-ticker-bar {
  background: linear-gradient(90deg, #150D07 0%, #24160D 50%, #150D07 100%);
  border-bottom: 2px solid var(--gold-leaf);
  color: var(--gold-shimmer);
  font-family: var(--font-gothic);
  font-size: clamp(0.68rem, 1.8vw, 0.8rem);
  letter-spacing: 0.08em;
  padding: 8px 16px;
  position: relative;
  width: 100%;
  z-index: 110;
}

.scribe-ticker-content {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
}

.ticker-text {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.ticker-text span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-dot {
  animation: pulse-glow 2s infinite ease-in-out;
  background-color: var(--cinnabar-light);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cinnabar-light);
  display: inline-block;
  flex-shrink: 0;
  height: 8px;
  width: 8px;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.ticker-controls {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.candle-btn {
  background: transparent;
  border: 1px solid var(--gold-leaf);
  border-radius: 4px;
  color: var(--gold-light);
  cursor: pointer;
  font-family: var(--font-gothic);
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  letter-spacing: 0.05em;
  padding: 4px 10px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.candle-btn:hover {
  background: var(--gold-dark);
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(247, 231, 166, 0.4);
}

/* ==========================================================================
   HEADER BANNER DE SOFÍA RVM (PARALLAX STAGE & WEBP)
   ========================================================================== */
.sofia-banner-stage {
  background-color: #080605;
  border-bottom: 3px solid var(--gold-leaf);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  width: 100%;
  z-index: 100;
}

.sofia-banner-wrapper {
  margin: 0 auto;
  max-width: 1440px;
  padding: clamp(8px, 2vw, 16px) clamp(8px, 2vw, 20px);
  position: relative;
  text-align: center;
  transform-origin: center top;
  width: 100%;
  will-change: transform, opacity;
}

.banner-filigree-top,
.banner-filigree-bottom {
  align-items: center;
  color: var(--gold-shimmer);
  display: flex;
  font-family: var(--font-gothic);
  font-size: clamp(0.6rem, 1.4vw, 0.75rem);
  gap: 8px;
  justify-content: center;
  letter-spacing: clamp(0.06em, 1.5vw, 0.25em);
  margin: 3px 0;
  opacity: 0.85;
  overflow: hidden;
  width: 100%;
}

.banner-filigree-top span:nth-child(2),
.banner-filigree-bottom span:nth-child(2) {
  font-size: clamp(0.55rem, 1.8vw, 0.75rem);
  letter-spacing: clamp(0.04em, 1.2vw, 0.2em);
  text-align: center;
  white-space: normal;
}

.banner-line {
  background: linear-gradient(90deg, transparent, var(--gold-leaf), transparent);
  flex: 1;
  height: 1px;
  min-width: 15px;
}

.banner-image-frame {
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(194, 155, 56, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.8);
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.banner-img {
  display: block;
  height: auto;
  max-height: clamp(100px, 20vw, 220px);
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  width: auto;
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN MEDIEVAL (CON DRAWER MÓVIL)
   ========================================================================== */
.manuscript-navbar {
  background: linear-gradient(180deg, rgba(234, 219, 189, 0.98) 0%, rgba(220, 203, 168, 0.98) 100%);
  border-bottom: 2px solid var(--cinnabar-red);
  box-shadow: 0 6px 16px rgba(36, 22, 14, 0.18);
  padding: 8px 16px;
  position: sticky;
  top: 0;
  transition: all 0.3s ease;
  width: 100%;
  z-index: 95;
}

.navbar-container {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1360px;
  position: relative;
  width: 100%;
}

.nav-brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.nav-uroboros-seal {
  cursor: pointer;
  flex-shrink: 0;
  height: clamp(34px, 5.5vw, 46px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: clamp(34px, 5.5vw, 46px);
}

.nav-brand:hover .nav-uroboros-seal {
  transform: rotate(180deg) scale(1.08);
}

.brand-titles {
  min-width: 0;
  overflow: hidden;
}

.brand-titles h1 {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-titles .brand-subtitle {
  color: var(--cinnabar-red);
  display: block;
  font-family: var(--font-manuscript);
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  font-style: italic;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chapters {
  align-items: center;
  display: flex;
  gap: clamp(10px, 1.8vw, 20px);
  list-style: none;
}

.nav-link {
  color: var(--ink-sepia);
  font-family: var(--font-gothic);
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 6px;
  position: relative;
  text-decoration: none;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-link::after {
  background: var(--cinnabar-red);
  bottom: -2px;
  content: '';
  height: 2px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.25s ease;
  width: 80%;
}

.nav-link:hover {
  color: var(--cinnabar-red);
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-cta-btn {
  background: linear-gradient(135deg, var(--cinnabar-light) 0%, var(--cinnabar-red) 50%, var(--cinnabar-dark) 100%);
  border: 1px solid var(--gold-leaf);
  border-radius: 3px;
  box-shadow: var(--shadow-wax);
  color: var(--parchment-light);
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  font-family: var(--font-gothic);
  font-size: clamp(0.72rem, 1.3vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-cta-btn:hover {
  box-shadow: 0 4px 14px rgba(158, 42, 43, 0.7);
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.nav-chapters .mobile-cta-item {
  display: none;
}

/* Botón Hamburguesa Medieval (Móvil) */
.mobile-menu-toggle {
  background: var(--parchment-aged);
  border: 1.5px solid var(--cinnabar-red);
  border-radius: 4px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  gap: 5px;
  height: 38px;
  justify-content: center;
  padding: 8px;
  width: 40px;
}

.mobile-menu-toggle .menu-bar {
  background-color: var(--cinnabar-red);
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: all 0.3s ease;
  width: 100%;
}

.mobile-menu-toggle.active .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   FOLIO PRINCIPAL DEL MANUSCRITO (VIEWPORT CONTAINER)
   ========================================================================== */
.manuscript-viewport {
  margin: clamp(14px, 3vw, 30px) auto;
  max-width: 1400px;
  overflow-x: hidden;
  padding: 0 clamp(8px, 2vw, 20px);
  position: relative;
  width: 100%;
}

.manuscript-folio {
  background: linear-gradient(135deg, var(--parchment-light) 0%, #F5ECDA 35%, var(--parchment-aged) 70%, #DFCBA2 100%);
  border: 3px solid #7A5D33;
  border-radius: 4px;
  box-shadow: 
    0 10px 30px rgba(36, 22, 14, 0.25),
    inset 0 0 clamp(20px, 5vw, 60px) rgba(166, 140, 94, 0.3);
  overflow-x: hidden;
  padding: clamp(18px, 4vw, 55px);
  position: relative;
  width: 100%;
}

/* Bordes interiores decorativos */
.folio-inner-border {
  border: 1.5px dashed var(--cinnabar-red);
  inset: clamp(6px, 1.2vw, 12px);
  pointer-events: none;
  position: absolute;
}

.folio-third-border {
  border: 1px solid #7A5D33;
  inset: clamp(10px, 1.8vw, 18px);
  pointer-events: none;
  position: absolute;
}

.corner-filigree {
  height: clamp(24px, 4vw, 48px);
  pointer-events: none;
  position: absolute;
  width: clamp(24px, 4vw, 48px);
  z-index: 10;
}

.corner-top-left { left: clamp(8px, 1.8vw, 18px); top: clamp(8px, 1.8vw, 18px); }
.corner-top-right { right: clamp(8px, 1.8vw, 18px); top: clamp(8px, 1.8vw, 18px); transform: scaleX(-1); }
.corner-bottom-left { bottom: clamp(8px, 1.8vw, 18px); left: clamp(8px, 1.8vw, 18px); transform: scaleY(-1); }
.corner-bottom-right { bottom: clamp(8px, 1.8vw, 18px); right: clamp(8px, 1.8vw, 18px); transform: scale(-1, -1); }

/* ==========================================================================
   SÍMBOLOS FLOTANTES EN MÁRGENES (SOLO PANTALLAS GRANDES >= 1200px)
   ========================================================================== */
.parallax-marginalia {
  height: 100%;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 80;
}

@media (max-width: 1200px) {
  .parallax-marginalia {
    display: none !important;
  }
}

.margin-symbol {
  opacity: 0.22;
  pointer-events: auto;
  position: absolute;
  transition: opacity 0.3s ease, filter 0.3s ease;
  will-change: transform;
}

.margin-symbol:hover {
  filter: drop-shadow(0 0 12px var(--gold-leaf));
  opacity: 0.85;
}

.symbol-sun-left {
  height: 120px;
  left: 15px;
  top: 250px;
  width: 120px;
}

.symbol-moon-right {
  height: 115px;
  right: 15px;
  top: 450px;
  width: 115px;
}

.symbol-uro-mid-left {
  height: 110px;
  left: 15px;
  top: 1100px;
  width: 110px;
}

.symbol-sun-vignette-right {
  border: 2px solid var(--gold-dark);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  height: 105px;
  overflow: hidden;
  right: 15px;
  top: 1350px;
  width: 105px;
}

.symbol-sun-vignette-right img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* ==========================================================================
   HERO SECTION: EL FRONTISPICIO DEL CÓDICE (RESPONSIVE)
   ========================================================================== */
.manuscript-hero {
  align-items: flex-start;
  display: grid;
  gap: clamp(24px, 4vw, 50px);
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: clamp(35px, 5vw, 70px);
  min-width: 0;
  position: relative;
  width: 100%;
}

.hero-text-column {
  min-width: 0;
  width: 100%;
}

.hero-rubric-top {
  border-bottom: 1.5px solid var(--cinnabar-red);
  color: var(--cinnabar-red);
  font-family: var(--font-gothic);
  font-size: clamp(0.68rem, 1.8vw, 0.85rem);
  font-weight: 700;
  letter-spacing: clamp(0.08em, 1.5vw, 0.22em);
  margin-bottom: clamp(14px, 2.5vw, 24px);
  padding-bottom: 6px;
  padding-right: clamp(20px, 3vw, 35px);
  text-transform: uppercase;
  word-break: break-word;
}

/* Letra Capitular Iluminada ("E") */
.hero-title-group {
  align-items: flex-start;
  display: flex;
  gap: clamp(10px, 2vw, 20px);
  margin-bottom: clamp(14px, 2.5vw, 24px);
  min-width: 0;
  width: 100%;
}

.illuminated-dropcap-container {
  align-items: center;
  background: linear-gradient(135deg, var(--lapis-deep) 0%, var(--lapis-lazuli) 100%);
  border: clamp(2px, 0.4vw, 3px) solid var(--gold-leaf);
  border-radius: 3px;
  box-shadow: var(--shadow-ink);
  display: flex;
  flex-shrink: 0;
  height: clamp(62px, 12vw, 96px);
  justify-content: center;
  position: relative;
  text-align: center;
  width: clamp(56px, 11vw, 88px);
}

.illuminated-dropcap-container::after {
  border: 1px dashed var(--gold-light);
  inset: 4px;
  content: '';
  pointer-events: none;
  position: absolute;
}

.illuminated-letter {
  color: var(--gold-light);
  font-family: var(--font-illuminated);
  font-size: clamp(3rem, 7.5vw, 5rem);
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.hero-heading .title-line-1 {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1.2rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.15;
  word-break: break-word;
}

.hero-heading .title-line-2 {
  color: var(--cinnabar-red);
  font-family: var(--font-gothic);
  font-size: clamp(1.1rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.hero-quote {
  border-left: 3px solid var(--gold-leaf);
  color: var(--gold-dark);
  font-family: var(--font-manuscript);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-style: italic;
  line-height: 1.5;
  margin: clamp(12px, 2vw, 20px) 0;
  padding-left: clamp(10px, 1.8vw, 18px);
}

.hero-prose {
  color: var(--ink-sepia);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  margin-bottom: clamp(18px, 3vw, 30px);
  text-align: justify;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 20px);
  margin-bottom: clamp(20px, 3.5vw, 35px);
  width: 100%;
}

.btn-medieval-gold,
.btn-medieval-parchment {
  align-items: center;
  border-radius: 3px;
  box-shadow: var(--shadow-ink);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-gothic);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  letter-spacing: 0.06em;
  padding: clamp(9px, 1.8vw, 13px) clamp(14px, 2.8vw, 26px);
  position: relative;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-medieval-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-shimmer) 40%, var(--gold-leaf) 75%, var(--gold-dark) 100%);
  border: 2px solid var(--gold-dark);
  color: var(--ink-black);
}

.btn-medieval-gold::after {
  border: 1px dashed var(--ink-sepia);
  inset: 3px;
  content: '';
  pointer-events: none;
  position: absolute;
}

.btn-medieval-gold:hover {
  box-shadow: 0 6px 18px rgba(122, 88, 18, 0.4);
  transform: translateY(-2px);
}

.btn-medieval-parchment {
  background: var(--parchment-aged);
  border: 2px solid var(--cinnabar-red);
  color: var(--cinnabar-red);
}

.btn-medieval-parchment:hover {
  background: var(--cinnabar-red);
  color: var(--parchment-light);
  transform: translateY(-2px);
}

.hero-stats-record {
  border-top: 1px solid var(--parchment-dark);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 25px);
  padding-top: clamp(12px, 1.8vw, 20px);
}

.stat-item {
  color: var(--ink-sepia);
  font-size: clamp(0.82rem, 1.6vw, 0.95rem);
}

.stat-item strong {
  color: var(--cinnabar-red);
  font-family: var(--font-gothic);
  font-weight: 700;
}

/* ==========================================================================
   EL GRAN ASTROLABIO HERMÉTICO (STICKY & ROTATING FLUID)
   ========================================================================== */
.hero-astrolabe-column {
  min-width: 0;
  position: relative;
  width: 100%;
}

.astrolabe-sticky-wrapper {
  position: sticky;
  top: 80px;
  width: 100%;
}

.astrolabe-plate-card {
  background: radial-gradient(circle, #FAF5E8 0%, #F0E6D0 60%, #DFC99E 100%);
  border: 3px solid #382417;
  border-radius: 4px;
  box-shadow: var(--shadow-deep), inset 0 0 25px rgba(122, 93, 51, 0.25);
  margin: 0 auto;
  max-width: 440px;
  padding: clamp(10px, 2vw, 24px);
  position: relative;
  text-align: center;
  width: 100%;
}

.astrolabe-inner-frame {
  border: 1px solid var(--cinnabar-red);
  border-radius: 2px;
  padding: clamp(6px, 1.2vw, 15px);
  position: relative;
}

.astrolabe-mechanism {
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  max-width: 360px;
  position: relative;
  width: 100%;
}

/* Capas concéntricas de rotación paralaje (hardware-accelerated) */
.astrolabe-ring-outer {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  transform: translateZ(0);
  width: 100%;
  will-change: transform;
}

.astrolabe-ring-uroboros {
  height: 80%;
  left: 10%;
  position: absolute;
  top: 10%;
  transform: translateZ(0);
  width: 80%;
  will-change: transform;
}

.astrolabe-ring-uroboros img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.astrolabe-center-sol {
  cursor: grab;
  height: 55%;
  left: 22.5%;
  position: absolute;
  top: 22.5%;
  transform: translateZ(0);
  width: 55%;
  will-change: transform;
}

.astrolabe-center-sol img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.astrolabe-orbit-luna {
  bottom: 6px;
  height: clamp(55px, 22%, 95px);
  position: absolute;
  right: 6px;
  transform: translateZ(0);
  width: clamp(55px, 22%, 95px);
  will-change: transform;
}

.astrolabe-orbit-luna img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.astrolabe-caption {
  color: var(--ink-sepia);
  font-family: var(--font-manuscript);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-style: italic;
  margin-top: 12px;
}

.astrolabe-caption span {
  color: var(--cinnabar-red);
  font-weight: 700;
}

/* ==========================================================================
   SECCIÓN DE CAPÍTULOS (OPTIMIZACIÓN CONTENT-VISIBILITY)
   ========================================================================== */
.manuscript-section {
  content-visibility: auto;
  contain-intrinsic-size: 800px;
  margin-top: clamp(35px, 5vw, 60px);
  min-width: 0;
  padding-top: clamp(24px, 4vw, 50px);
  position: relative;
  width: 100%;
}

.chapter-header {
  margin-bottom: clamp(20px, 3.5vw, 40px);
  position: relative;
  text-align: center;
}

.chapter-rubric {
  color: var(--cinnabar-red);
  display: block;
  font-family: var(--font-gothic);
  font-size: clamp(0.68rem, 1.6vw, 0.85rem);
  font-weight: 700;
  letter-spacing: clamp(0.1em, 1.8vw, 0.25em);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.chapter-title {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  word-break: break-word;
}

.chapter-divider {
  align-items: center;
  color: var(--gold-leaf);
  display: flex;
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  gap: 12px;
  justify-content: center;
  margin: 0 auto;
  max-width: min(380px, 100%);
  width: 100%;
}

.chapter-divider::before,
.chapter-divider::after {
  background: var(--gold-dark);
  content: '';
  flex: 1;
  height: 1.5px;
}

/* ==========================================================================
   CAPITULUM I: CURSOS (RESPONSIVE GRID)
   ========================================================================== */
.courses-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 30px);
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: clamp(25px, 4vw, 50px);
  width: 100%;
}

.course-card {
  background: linear-gradient(180deg, #FAF4E6 0%, var(--parchment-aged) 100%);
  border: 2px solid #7A5D33;
  border-radius: 4px;
  box-shadow: var(--shadow-ink);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(16px, 2.2vw, 24px);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.course-card::after {
  border: 1px dashed var(--cinnabar-red);
  inset: 6px;
  content: '';
  opacity: 0.6;
  pointer-events: none;
  position: absolute;
}

.course-card:hover {
  box-shadow: var(--shadow-deep);
  transform: translateY(-4px);
}

.course-emblem-wrapper {
  align-items: center;
  background: #ECE0C6;
  border: 1px solid #7A5D33;
  border-radius: 3px;
  display: flex;
  height: clamp(100px, 15vw, 140px);
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.course-emblem-wrapper svg,
.course-emblem-wrapper img {
  height: clamp(70px, 11vw, 100px);
  transition: transform 0.4s ease;
  width: clamp(70px, 11vw, 100px);
}

.course-card:hover .course-emblem-wrapper svg,
.course-card:hover .course-emblem-wrapper img {
  transform: rotate(12deg) scale(1.06);
}

.course-tag {
  color: var(--cinnabar-red);
  display: inline-block;
  font-family: var(--font-gothic);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.course-title {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  margin-bottom: 8px;
  word-break: break-word;
}

.course-subtitle {
  color: var(--gold-dark);
  font-family: var(--font-manuscript);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 10px;
}

.course-description {
  color: var(--ink-sepia);
  flex-grow: 1;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.course-specs {
  border-top: 1px dashed #7A5D33;
  color: var(--ink-muted);
  font-size: 0.82rem;
  margin-bottom: 14px;
  padding-top: 10px;
}

.course-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.course-price {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 800;
}

.course-price small {
  font-size: 0.8rem;
  font-weight: 600;
}

.course-btn {
  background: linear-gradient(135deg, var(--cinnabar-light) 0%, var(--cinnabar-red) 100%);
  border: 1px solid var(--gold-leaf);
  border-radius: 3px;
  box-shadow: var(--shadow-wax);
  color: var(--parchment-light);
  cursor: pointer;
  font-family: var(--font-gothic);
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.course-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

/* ==========================================================================
   CAPITULUM II: SCRIPTORIUM (LIBROS Y GRIMORIOS EN PIEL)
   ========================================================================== */
.grimoire-showcase-box {
  background: linear-gradient(135deg, #F5ECDA 0%, #E6D4AF 100%);
  border: 3px solid #7A5D33;
  border-radius: 4px;
  box-shadow: var(--shadow-deep);
  display: grid;
  gap: clamp(20px, 3.5vw, 40px);
  grid-template-columns: 0.8fr 1.2fr;
  margin-bottom: clamp(30px, 5vw, 60px);
  padding: clamp(16px, 3vw, 40px);
  position: relative;
  width: 100%;
}

.grimoire-showcase-box::after {
  border: 1px solid var(--cinnabar-red);
  inset: 10px;
  content: '';
  pointer-events: none;
  position: absolute;
}

.grimoire-mockup-wrapper {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
}

.grimoire-leather-book {
  background: linear-gradient(135deg, #421D12 0%, #24110A 50%, #150905 100%);
  border: 3px solid var(--gold-leaf);
  border-radius: 6px 14px 14px 6px;
  box-shadow: 
    10px 15px 30px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.8);
  height: clamp(280px, 38vw, 380px);
  max-width: 270px;
  padding: clamp(18px, 2.5vw, 30px) clamp(14px, 2vw, 24px);
  position: relative;
  text-align: center;
  width: 100%;
}

.book-spine-line {
  background: linear-gradient(180deg, var(--gold-leaf), var(--gold-dark));
  bottom: 0;
  left: clamp(12px, 1.8vw, 20px);
  position: absolute;
  top: 0;
  width: 3px;
}

.book-corners {
  border-color: var(--gold-leaf);
  border-style: solid;
  height: 20px;
  position: absolute;
  width: 20px;
}

.corner-tr { right: 8px; top: 8px; border-width: 2px 2px 0 0; }
.corner-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.book-emblem-sol {
  cursor: pointer;
  height: clamp(75px, 13vw, 110px);
  margin: clamp(18px, 2.5vw, 35px) auto clamp(10px, 1.8vw, 20px) auto;
  transition: transform 0.5s ease;
  width: clamp(75px, 13vw, 110px);
}

.book-emblem-sol:hover {
  transform: rotate(90deg) scale(1.08);
}

.book-title-foil {
  color: var(--gold-light);
  font-family: var(--font-gothic);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.book-author-foil {
  color: var(--gold-shimmer);
  font-family: var(--font-manuscript);
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-style: italic;
}

.grimoire-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.grimoire-rubric {
  color: var(--cinnabar-red);
  font-family: var(--font-gothic);
  font-size: clamp(0.68rem, 1.5vw, 0.8rem);
  font-weight: 700;
  letter-spacing: clamp(0.08em, 1.5vw, 0.2em);
  margin-bottom: 8px;
}

.grimoire-title {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: clamp(10px, 2vw, 16px);
  word-break: break-word;
}

.grimoire-prose {
  color: var(--ink-sepia);
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  line-height: 1.6;
  margin-bottom: clamp(14px, 2.5vw, 24px);
}

.grimoire-features {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.8vw, 20px);
  margin-bottom: clamp(16px, 2.5vw, 28px);
}

.grimoire-badge {
  background: var(--parchment-light);
  border: 1px solid #7A5D33;
  border-radius: 3px;
  color: var(--ink-sepia);
  font-family: var(--font-gothic);
  font-size: clamp(0.68rem, 1.3vw, 0.8rem);
  font-weight: 600;
  padding: 5px 10px;
}

/* ==========================================================================
   CAPITULUM III: ORÁCULO DE TAROT INTERACTIVO (MOBILE SWIPEABLE)
   ========================================================================== */
.tarot-spread-table {
  max-width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle, #24140F 0%, #150906 100%);
  border: 3px solid var(--gold-leaf);
  border-radius: 4px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9), var(--shadow-deep);
  margin-bottom: clamp(30px, 4.5vw, 60px);
  padding: clamp(20px, 3.5vw, 40px) clamp(12px, 2.5vw, 30px);
  position: relative;
  text-align: center;
  width: 100%;
}

.tarot-instructions {
  color: var(--gold-light);
  font-family: var(--font-manuscript);
  font-size: clamp(0.92rem, 1.8vw, 1.1rem);
  font-style: italic;
  margin-bottom: clamp(16px, 3vw, 30px);
}

.tarot-cards-container {
  display: flex;
  gap: clamp(14px, 2.5vw, 30px);
  justify-content: center;
  perspective: 1000px;
  width: 100%;
}

.tarot-card-flipper {
  cursor: pointer;
  flex-shrink: 0;
  height: clamp(250px, 32vw, 330px);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: clamp(150px, 20vw, 200px);
  -webkit-tap-highlight-color: transparent;
}

.tarot-card-flipper.revealed {
  transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2px solid var(--gold-leaf);
  border-radius: 8px;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

/* Reverso de la carta */
.tarot-card-back {
  background: linear-gradient(135deg, #1C0F17 0%, #2D1822 50%, #0F080D 100%);
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.tarot-card-back::after {
  border: 1px dashed var(--gold-leaf);
  inset: 6px;
  content: '';
  pointer-events: none;
  position: absolute;
}

.back-seal-img {
  height: clamp(50px, 9vw, 80px);
  opacity: 0.8;
  width: clamp(50px, 9vw, 80px);
}

.tarot-back-text {
  color: var(--gold-shimmer);
  font-family: var(--font-gothic);
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  letter-spacing: 0.12em;
  margin-top: 10px;
}

/* Anverso de la carta (Revelada) */
.tarot-card-front {
  background: var(--parchment-light);
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  padding: clamp(10px, 1.8vw, 16px);
  text-align: center;
  transform: rotateY(180deg);
}

.card-numeral {
  color: var(--cinnabar-red);
  font-family: var(--font-gothic);
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  font-weight: 700;
}

.card-illustration-box {
  align-items: center;
  background: var(--parchment-aged);
  border: 1px solid #7A5D33;
  display: flex;
  flex-grow: 1;
  justify-content: center;
  margin: 6px 0;
}

.card-illustration-box img,
.card-illustration-box svg {
  height: clamp(70px, 10vw, 110px);
  width: clamp(70px, 10vw, 110px);
}

.card-name {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card-archetype {
  color: var(--gold-dark);
  font-family: var(--font-manuscript);
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  font-style: italic;
}

/* ==========================================================================
   CAPITULUM IV: AULA MAGNA YOUTUBE & COMUNIDAD
   ========================================================================== */
.community-guild-box {
  background: linear-gradient(180deg, #FAF5E8 0%, #EADBBD 100%);
  border: 2px solid #7A5D33;
  border-radius: 4px;
  box-shadow: var(--shadow-ink);
  display: grid;
  gap: clamp(18px, 3vw, 30px);
  grid-template-columns: 1fr 1fr;
  padding: clamp(18px, 3vw, 35px);
  width: 100%;
}

.guild-col-left h3 {
  color: var(--ink-black);
  font-family: var(--font-gothic);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 10px;
}

.guild-col-left p {
  color: var(--ink-sepia);
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  margin-bottom: 18px;
}

.guild-col-right {
  background: #FAF5E8;
  border: 1px solid #7A5D33;
  border-radius: 3px;
  padding: clamp(14px, 2.2vw, 24px);
}

.guild-perks-list {
  list-style: none;
}

.guild-perks-list li {
  align-items: center;
  color: var(--ink-dark);
  display: flex;
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  gap: 10px;
  margin-bottom: 10px;
}

.guild-perks-list li::before {
  color: var(--cinnabar-red);
  content: '✦';
  font-weight: bold;
}

/* ==========================================================================
   FOOTER: COLOFÓN DEL CÓDICE
   ========================================================================== */
.manuscript-footer {
  border-top: 3px solid #7A5D33;
  color: var(--ink-muted);
  margin-top: clamp(35px, 5vw, 70px);
  padding-top: clamp(20px, 3.5vw, 35px);
  position: relative;
  text-align: center;
  width: 100%;
}

.colophon-latin {
  color: var(--gold-dark);
  font-family: var(--font-gothic);
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.colophon-sub {
  color: var(--cinnabar-red);
  font-family: var(--font-manuscript);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  font-style: italic;
  margin-bottom: 16px;
}

.footer-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 25px);
  justify-content: center;
  margin-bottom: 16px;
}

.footer-nav-links a {
  color: var(--ink-sepia);
  font-family: var(--font-gothic);
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-nav-links a:hover {
  color: var(--cinnabar-red);
}

.footer-credits {
  font-size: clamp(0.72rem, 1.3vw, 0.85rem);
  opacity: 0.75;
}

/* ==========================================================================
   TABLET ADAPTATIONS (769px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .manuscript-hero {
    grid-template-columns: 1fr;
  }
  .hero-astrolabe-column {
    margin: 20px auto;
  }
  .astrolabe-sticky-wrapper {
    position: relative;
    top: 0;
  }
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grimoire-showcase-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .grimoire-details {
    align-items: center;
  }
  .grimoire-prose {
    text-align: justify;
  }
}

/* ==========================================================================
   MOBILE ADAPTATIONS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Navbar Mobile Hamburger & Drawer */
  .manuscript-navbar {
    padding: 8px 12px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-chapters {
    background: linear-gradient(180deg, rgba(234, 219, 189, 0.99) 0%, rgba(220, 203, 168, 0.99) 100%);
    border-bottom: 3px solid var(--cinnabar-red);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    gap: 6px;
    left: 0;
    padding: 16px 20px;
    position: absolute;
    right: 0;
    top: 100%;
    width: 100%;
    z-index: 99;
  }

  .nav-chapters.active {
    display: flex;
  }

  .nav-link {
    border-bottom: 1px dashed rgba(122, 93, 51, 0.3);
    font-size: 0.92rem;
    padding: 9px 0;
    width: 100%;
  }

  .navbar-container > .nav-cta-btn {
    display: none;
  }

  .nav-chapters .mobile-cta-item {
    display: block;
    margin-top: 8px;
    text-align: center;
    width: 100%;
  }

  .nav-chapters .mobile-cta-item .nav-cta-btn {
    display: inline-block;
    width: 100%;
  }

  /* Folio & Margins */
  .manuscript-viewport {
    padding: 0 6px;
    margin: 10px auto;
  }

  .manuscript-folio {
    padding: 16px 12px;
    border-width: 2px;
  }

  .folio-inner-border {
    inset: 5px;
  }

  .folio-third-border {
    inset: 9px;
  }

  .corner-filigree {
    width: 22px;
    height: 22px;
  }

  .corner-top-left { left: 8px; top: 8px; }
  .corner-top-right { right: 8px; top: 8px; }
  .corner-bottom-left { bottom: 8px; left: 8px; }
  .corner-bottom-right { bottom: 8px; right: 8px; }

  /* Rubric */
  .hero-rubric-top {
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    padding-right: 25px;
    line-height: 1.3;
  }

  /* Astrolabe */
  .hero-astrolabe-column {
    margin: 10px auto;
  }

  .astrolabe-plate-card {
    padding: 10px;
  }

  .astrolabe-inner-frame {
    padding: 6px;
  }

  .astrolabe-mechanism {
    max-width: 280px;
    width: 100%;
  }

  /* Single Column Layouts */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .course-card {
    padding: 16px;
  }

  .grimoire-showcase-box {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }

  .grimoire-leather-book {
    max-width: 220px;
    height: 300px;
    padding: 18px 12px;
  }

  .community-guild-box {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-medieval-gold,
  .btn-medieval-parchment {
    width: 100%;
  }

  /* Tarot Horizontal Swipe on Mobile */
  .tarot-cards-container {
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 8px 4px 16px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .tarot-card-flipper {
    flex: 0 0 170px;
    height: 270px;
    scroll-snap-align: center;
  }

  .tarot-spread-table::after {
    color: var(--gold-shimmer);
    content: '← Desliza para ver más arcanos →';
    display: block;
    font-family: var(--font-gothic);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    margin-top: 10px;
  }
}

/* Micro-screen adjustments (<= 380px) */
@media (max-width: 380px) {
  .brand-titles .brand-subtitle {
    display: none;
  }
  .stat-item {
    width: 100%;
  }
  .astrolabe-mechanism {
    max-width: 240px;
  }
}
