/* ═══════════════════════════════════════════════════════════════════════
   site.css — Estilos compartidos de caleaguilar.com
   ───────────────────────────────────────────────────────────────────────
   Contiene SOLO los bloques que se repiten en (casi) todas las páginas.
   Los estilos propios de una página (hero, secciones, sliders) siguen en
   el <style> inline de esa página.

   Valores canónicos = baseline auditado de los artículos de blog (100/100),
   con el set más completo de tokens/componentes de index.html.
   Audit-fixes del Pending ya incorporados:
     · .fade-up 0.85s → 0.5s
     · #amber-fab móvil 30/34px → 40px (target táctil)

   Orden de carga: este archivo se enlaza en <head> ANTES del <style> inline,
   así el inline gana en el cascade (misma especificidad, va después).
   Durante la migración por fases eso garantiza cero cambio visual.
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark; /* controles nativos (scrollbar, date inputs) en oscuro */
  --d-bg:      #110E18;
  --d-surface: #1B1726;
  --d-text:    #F5F0E8;
  --d-muted:   #9B97A8;
  --d-faint:   #4A4458;
  --d-border:  rgba(201,168,76,0.18);

  --l-bg:      #F9F5EF;
  --l-surface: #FFFFFF;
  --l-text:    #2C1B4A;
  --l-muted:   #6E6080;
  --l-faint:   #B0A4BE;
  --l-border:  rgba(44,27,74,0.10);
  --l-border-gold: rgba(201,168,76,0.22);

  --gold:        #C9A84C;
  --gold-soft:   #E0C273;
  --gold-pale:   rgba(201,168,76,0.08);
  --purple:      #8B7BA8;
  --purple-rich: #7B4FB8;
  --purple-deep: #4A2882;
  --deep-navy:   #0C1038;
  --warm-linen:  #EDE8E0;

  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart:  cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'Inter', sans-serif; font-size: 17px; line-height: 1.75; overflow-x: clip;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Accesibilidad ── */
.skip-link {
  position: absolute; top: -100px; left: 24px;
  background: var(--gold); color: var(--d-bg);
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  text-decoration: none; z-index: 999;
  transition: top 200ms var(--ease-out);
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ── Eyebrow / rule ── */
.eyebrow {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}
/* gold falla WCAG en fondos claros (2.03:1) → purple-rich (5.38:1) ✅ */
.light .eyebrow { color: var(--purple-rich); }
.rule-gold { width: 40px; height: 1px; background: var(--gold); border: none; margin: 28px 0; }

/* ── Layout base ── */
.center { text-align: center; }
.center p { margin-inline: auto; }
section { padding: 96px 24px; } /* 8pt grid: 96 = 12×8 */
.container { max-width: 1140px; margin-inline: auto; }
.container--narrow { max-width: 760px; margin-inline: auto; }

/* ══════════════════ BOTONES ══════════════════ */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none; cursor: pointer;
  border-radius: 2px; border: none;
  transition: transform 160ms var(--ease-out), background 180ms var(--ease-out),
              box-shadow 180ms var(--ease-out), color 180ms var(--ease-out),
              border-color 180ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-gold { background: var(--gold); color: var(--d-bg); padding: 12px 28px; box-shadow: 0 4px 20px rgba(201,168,76,0.22); }
@media (hover:hover) and (pointer:fine) { .btn-gold:hover { background: var(--gold-soft); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(201,168,76,0.32); } }

.btn-ghost-dark { background: transparent; color: var(--d-text); padding: 12px 24px; border: 1px solid rgba(245,240,232,0.2); }
@media (hover:hover) and (pointer:fine) { .btn-ghost-dark:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); } }

.btn-purple { background: var(--purple-rich); color: #fff; padding: 10px 24px; box-shadow: 0 2px 14px rgba(123,79,184,0.18); }
@media (hover:hover) and (pointer:fine) { .btn-purple:hover { background: var(--purple-deep); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(123,79,184,0.28); } }

.btn-ghost-light { background: transparent; color: var(--l-text); padding: 9px 22px; border: 1px solid var(--l-border); }
@media (hover:hover) and (pointer:fine) { .btn-ghost-light:hover { border-color: var(--purple-rich); color: var(--purple-rich); transform: translateY(-2px); } }

/* Shimmer — barrido de luz en btn-gold (disparado por site.js) */
@keyframes shimmer-sweep {
  0%   { left: -110%; opacity: 1; }
  100% { left: 170%;  opacity: 1; }
}
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::after {
  content: '';
  position: absolute; top: -5%; left: -110%;
  width: 55%; height: 110%;
  background: linear-gradient(108deg, transparent 10%, rgba(255,255,255,0.08) 28%,
              rgba(255,255,255,0.75) 50%, rgba(255,255,255,0.08) 72%, transparent 90%);
  transform: skewX(-20deg);
  pointer-events: none; opacity: 0;
}
.btn-gold.shimmer-run::after { animation: shimmer-sweep 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@media (prefers-reduced-motion: reduce) { .btn-gold::after { display: none !important; } }

/* ── Link-arrow — conector limpio sin caja ── */
.link-arrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: currentColor;
  transition: gap 200ms var(--ease-expo), opacity 200ms;
}
.link-arrow::before {
  content: ''; display: block; flex-shrink: 0;
  width: 28px; height: 1px; background: currentColor;
  transition: width 200ms var(--ease-expo);
}
@media (hover:hover) and (pointer:fine) {
  .link-arrow:hover { gap: 22px; opacity: 0.9; }
  .link-arrow:hover::before { width: 44px; }
}
.link-arrow.on-dark  { color: var(--d-muted); }
.link-arrow.on-light { color: var(--l-muted); }
.link-arrow.gold     { color: var(--gold); }

/* ══════════════════ SCROLL PROGRESS ══════════════════ */
.scroll-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: linear-gradient(to right, var(--gold), var(--gold-soft));
  transition: width 60ms linear;
  pointer-events: none;
}

/* ══════════════════ NAV (barra superior) ══════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(17,14,24,0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--d-border);
  transition: padding 240ms var(--ease-expo), background 240ms var(--ease-expo);
}
nav.scrolled { padding-top: 10px; padding-bottom: 10px; box-shadow: 0 4px 32px rgba(0,0,0,0.3); }
.nav-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-logo img { height: 38px; width: auto; display: block; }
.nav-logo-text { display: none; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 16px; color: var(--d-text); letter-spacing: 0.02em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 12px; font-weight: 500; letter-spacing: 0.06em; white-space: nowrap;
  color: var(--d-muted); text-decoration: none;
  transition: color 160ms var(--ease-out);
}
@media (hover:hover) and (pointer:fine) { .nav-links a:hover { color: var(--d-text); } }
/* Estado activo con señal no-cromática (subrayado) para daltónicos */
.nav-links a[aria-current="page"] { color: var(--gold); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.nav-cta { padding: 8px 18px; font-size: 12px; flex-shrink: 0; }
.lang-switch { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--d-muted); padding: 4px 8px; border: 1px solid var(--d-faint); border-radius: 2px; transition: color 180ms, border-color 180ms; }
@media (hover:hover) and (pointer:fine) { .lang-switch:hover { color: var(--gold); border-color: var(--gold); } }
.mobile-blog-link { display: none; }

@media (max-width: 1024px) { nav { padding: 16px 24px; } .nav-links { gap: 16px; } }
@media (max-width: 860px)  { .nav-links { gap: 12px; } .nav-cta { padding: 8px 12px; font-size: 11px; } }
@media (max-width: 640px) {
  nav { padding: 10px 20px; min-height: 52px; }
  .nav-links { display: none; }
  .nav-cta  { display: none; }
  .nav-logo img { display: none; }
  .nav-logo-text { display: inline; }
  .mobile-blog-link { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--d-muted); text-decoration: none; }
  .lang-switch, .mobile-blog-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ══════════════════ FOOTER ══════════════════ */
footer {
  background: var(--d-bg); border-top: 1px solid var(--d-border);
  padding: 36px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-brand { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.1rem; color: var(--gold); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 12px; color: var(--d-muted); text-decoration: none; transition: color 160ms var(--ease-out); }
@media (hover:hover) and (pointer:fine) { .footer-links a:hover { color: var(--d-text); } }
footer .footer-copy { font-size: 12px; color: var(--d-muted); max-width: none; }
.footer-social { display: flex; gap: 18px; align-items: center; }
.footer-social a { display: flex; align-items: center; color: var(--d-muted); text-decoration: none; transition: color 200ms var(--ease-out); }
.footer-social a svg { width: 18px; height: 18px; }
@media (hover:hover) and (pointer:fine) { .footer-social a:hover { color: var(--gold); } }

/* ══════════════════ MOBILE BOTTOM NAV (MBN) ══════════════════ */
.mobile-bottom-nav {
  display: none;
  position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 180;
  background: rgba(17,14,24,1);
  border-top: 1px solid rgba(201,168,76,0.22);
  padding-bottom: env(safe-area-inset-bottom);
  height: 62px;
}
@media (max-width: 640px) {
  .mobile-bottom-nav { display: flex; align-items: stretch; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}
.mbn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--d-muted);
  font-family: 'Inter', sans-serif; font-size: 10px;
  font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.2s; position: relative;
}
.mbn-item svg { width: 22px; height: 22px; }
.mbn-icon { position: relative; width: 22px; height: 22px; }
.mbn-item.mbn-active { color: var(--gold); }
.mbn-item.mbn-active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; background: var(--gold);
  border-radius: 0 0 2px 2px; opacity: 0.85;
}
.mbn-limelight {
  position: absolute; top: 0; left: 0;
  width: 42px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 30px rgba(201,168,76,0.5);
  transition: left 380ms cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}
.mbn-limelight::after {
  content: ''; position: absolute; left: -45%; top: 3px;
  width: 190%; height: 50px;
  clip-path: polygon(10% 100%, 28% 0, 72% 0, 90% 100%);
  background: linear-gradient(to bottom, rgba(201,168,76,0.22), transparent);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .mbn-limelight { transition: none; } }

/* ══════════════════ AMBER FILTER (protección de vista) ══════════════════ */
#amber-overlay {
  position: fixed; inset: 0;
  background: rgba(255, 140, 20, 0.17);
  pointer-events: none; opacity: 0;
  transition: opacity 700ms var(--ease-out);
  z-index: 9000;
}
#amber-overlay.on { opacity: 1; }
#amber-fab {
  position: fixed; bottom: 32px; right: 32px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--d-surface); border: 1px solid var(--d-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 9100;
  box-shadow: 0 3px 14px rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 600ms var(--ease-out), background 220ms var(--ease-out),
              border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
#amber-fab.visible { opacity: 1; }
#amber-fab.on { background: rgba(201,168,76,0.12); border-color: rgba(201,168,76,0.7); box-shadow: 0 3px 18px rgba(201,168,76,0.22); }
#amber-fab svg { transition: stroke 220ms var(--ease-out); stroke: var(--d-faint); }
#amber-fab.on svg { stroke: var(--gold); }
@media (hover:hover) and (pointer:fine) {
  #amber-fab:not(.on):hover { border-color: var(--d-muted); }
  #amber-fab:not(.on):hover svg { stroke: var(--d-muted); }
}
/* target táctil ≥44px en móvil (audit-fix: era 30px) */
@media (max-width: 640px) { #amber-fab { bottom: 74px; right: 14px; width: 40px; height: 40px; } }

/* ══════════════════ WORD REVEAL (h1 hero + h2 al scroll) ══════════════════ */
/* site.js envuelve las palabras en .word-reveal / .word-reveal--scroll, así
   que su CSS vive aquí para mantener el par JS/CSS consistente. */
@keyframes word-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.word-reveal { display: inline-block; opacity: 0; animation: word-up 0.72s var(--ease-expo) forwards; }
@media (prefers-reduced-motion: reduce) { .word-reveal { opacity: 1; animation: none; } }
.word-reveal--scroll { animation-play-state: paused; }
.h2-revealed .word-reveal--scroll { animation-play-state: running; }

.reveal-line { overflow: hidden; display: block; }
.reveal-line span { display: block; transform: translateY(100%); transition: transform 0.9s var(--ease-expo); }
.reveal-line.visible span { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal-line span { transform: none; } }

/* ══════════════════ FADE-UP (entrada al hacer scroll) ══════════════════ */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s var(--ease-expo), transform 0.5s var(--ease-expo);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .fade-up { transform: none; transition: opacity 0.2s ease; } }
