/* ═══════════════════════════════════════════════════════
   ESPIRAL DE LUZ — base.css
   Alquimia del Alma · 2026
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Jost:wght@300;400;500&display=swap');

:root {
  /* Base — negro cósmico */
  --bg-deep:   #03040a;
  --bg-dark:   #06080f;
  --bg-card:   #0a0c18;
  --bg-hover:  #10121e;
  --bg-modal:  #080a16;

  /* Zona Contractiva (1–8) — brasa fría */
  --z-con:     #8a4a3a;
  --z-con-lt:  #b87060;
  --z-con-dim: rgba(138,74,58,0.14);
  --z-con-bdr: rgba(138,74,58,0.32);

  /* El Umbral / Coraje (9) — ORO */
  --z-umb:     #c9a84c;
  --z-umb-lt:  #e6c96b;
  --z-umb-dim: rgba(201,168,76,0.14);
  --z-umb-bdr: rgba(201,168,76,0.38);

  /* Zona Expansiva (10–17) — turquesa a luminoso */
  --z-exp:     #4a9ab0;
  --z-exp-lt:  #72c0d4;
  --z-exp-dim: rgba(74,154,176,0.14);
  --z-exp-bdr: rgba(74,154,176,0.32);

  /* Texto */
  --cream:     #eef4f8;
  --cream-dim: #8aa4b8;
  --muted:     #3a5060;

  /* Bordes */
  --border:    rgba(74,154,176,0.12);
  --border-hi: rgba(201,168,76,0.32);

  /* Color individual por nivel */
  --c01: #8a3a50;
  --c02: #7a4a3a;
  --c03: #4a4a5a;
  --c04: #8a2a35;
  --c05: #3a5a8a;
  --c06: #8a6a2a;
  --c07: #9a3a1a;
  --c08: #7a6040;
  --c09: #c9a84c;
  --c10: #5a8a5a;
  --c11: #4a6a9a;
  --c12: #3a8a8a;
  --c13: #5a5a9a;
  --c14: #9a5a70;
  --c15: #c9923a;
  --c16: #4a7a9a;
  --c17: #c9c07a;

  /* Tipografía */
  --font-d: 'Cormorant Garamond', Georgia, serif;
  --font-b: 'Jost', sans-serif;
  --ease:   cubic-bezier(0.4,0,0.2,1);
  --r:      3px;

  /* Layout */
  --nav-h: 60px;
  --max-w: 1280px;
  --col-gap: clamp(1rem, 3vw, 2rem);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  background: var(--bg-deep);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* Grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--font-d); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 400; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.7rem); font-weight: 400; }
h4 { font-size: 1.15rem; font-weight: 500; }

p { font-size: clamp(0.9rem, 1.5vw, 1.05rem); color: var(--cream-dim); line-height: 1.85; }
strong { color: var(--cream); font-weight: 500; }

a { color: inherit; text-decoration: none; transition: opacity 0.2s var(--ease); }
a:hover { opacity: 0.75; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(3,4,10,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  z-index: 1000;
  transition: border-color 0.3s;
}

.nav-brand {
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--cream);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-brand .simbolo { color: var(--z-umb); font-size: 1.2rem; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--cream); }
.nav-links a.active { color: var(--cream); }

.nav-chip {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--z-umb-bdr);
  color: var(--z-umb);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ── PAGE WRAPPER ── */
.page-wrap {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── CONTAINERS ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--r);
  font-family: var(--font-b);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.25s var(--ease);
}

.btn-primary {
  background: var(--z-umb);
  color: #03040a;
}
.btn-primary:hover { background: var(--z-umb-lt); opacity: 1; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--z-umb);
}
.btn-outline:hover { background: var(--z-umb-dim); opacity: 1; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cream-dim);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--cream); opacity: 1; }

/* ── DIVIDERS ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.divider-glyph {
  text-align: center;
  position: relative;
  margin: 2.5rem 0;
  color: var(--muted);
  font-family: var(--font-d);
  font-size: 1.2rem;
}
.divider-glyph::before,
.divider-glyph::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 2rem);
  height: 1px;
  background: var(--border);
}
.divider-glyph::before { left: 0; }
.divider-glyph::after  { right: 0; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-contractiva { background: var(--z-con-dim); color: var(--z-con-lt); border: 1px solid var(--z-con-bdr); }
.badge-umbral      { background: var(--z-umb-dim); color: var(--z-umb-lt); border: 1px solid var(--z-umb-bdr); }
.badge-expansiva   { background: var(--z-exp-dim); color: var(--z-exp-lt); border: 1px solid var(--z-exp-bdr); }

/* ── PROGRESS RING SVG ── */
.progress-ring { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--bg-hover); }
.progress-ring-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}

/* ── HZ SCALE BAR ── */
.hz-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right,
    var(--c01) 0%,
    var(--c05) 25%,
    var(--c09) 47%,
    var(--c12) 65%,
    var(--c15) 80%,
    var(--c17) 100%
  );
  border-radius: 2px;
  margin: 1.5rem 0;
  opacity: 0.6;
}

/* ── EYEBROW ── */
.eyebrow {
  font-family: var(--font-b);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 1rem;
}

/* ── CARD BASE ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.card:hover {
  border-color: rgba(201,168,76,0.2);
  transform: translateY(-2px);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cream-dim); }

/* ── SELECTION ── */
::selection { background: var(--z-umb-dim); color: var(--cream); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulsoOro {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

.anim-up  { animation: fadeUp 0.6s var(--ease) both; }
.anim-in  { animation: fadeIn 0.5s var(--ease) both; }
.delay-1  { animation-delay: 0.1s; }
.delay-2  { animation-delay: 0.2s; }
.delay-3  { animation-delay: 0.3s; }
.delay-4  { animation-delay: 0.4s; }
.delay-5  { animation-delay: 0.5s; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 5rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  font-family: var(--font-d);
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.footer-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--cream-dim); }

/* ── ZONE PAGE NAV ── */
.zone-footer-nav {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 4rem;
}
.zone-footer-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.2s;
  padding: 0.5rem 0;
}
.zone-footer-nav a:hover { color: var(--cream); }
.zone-footer-nav .center-stat {
  font-family: var(--font-d);
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
}

/* ── FOCUS ── */
:focus-visible {
  outline: 2px solid var(--z-umb);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── RESPONSIVE UTILS ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* === Pase de legibilidad de lectura - Alquimia 2026-06-13 === */
.modal-content,.modal-body,.leccion-content,.episodio-content,.reader-content{max-width:44rem;margin-left:auto;margin-right:auto}
.modal-content p,.modal-body p,.cap-desarrollo-block p,.cap-apertura-block p,.epilogo-section p,.tab-panel p,.leccion p,.episodio p,.contenido p,.prosa p{font-weight:400;color:#E9E3D4;line-height:1.9;margin-bottom:1.5em}

/* legib-modulos-2026 */
.intro-text,.intro-epigrafe-text,.coraje-concepto-text,.coraje-practica-texto,.coraje-pregunta-text,.modal-concepto,.modal-practica-texto{font-weight:400!important;color:#E9E3D4!important;line-height:1.82!important}
/* === Rediseno legibilidad consistente 2026-06-13c === */
:root{--bg-deep:#100D1A!important;--bg-dark:#16121F!important;--bg-card:#221C32!important;--bg-hover:#2C2545!important;--bg-modal:#1A1622!important;--cream:#F4EFE4!important;--cream-dim:#DAD3C5!important;--muted:#B2AA92!important}
body{font-size:18px}
.modal-content,.modal-body,.panel-body,.main-content{max-width:44rem;margin-left:auto;margin-right:auto}
.modal-content p,.modal-body p,.panel-body p,.main-content p,.cap-desarrollo-block p,.cap-apertura-block p,.tab-panel p,.epilogo-section p,.cap-desarrollo,.cap-texto,.ep-texto,.practica-text,.integracion-text,.ejercicios-content,.ms-desc,.ring-text,.modulo-descripcion,.coraje-concepto-text,.coraje-practica-texto,.coraje-pregunta-text,.intro-text,.modal-concepto,.modal-practica-texto{font-size:1.1rem!important;line-height:1.85!important;color:#ECE6D8!important;font-weight:400!important}
