/* ==========================================================================
   Termos Épicos — Base: reset, tipografía, layout primitives, atmósfera
   ========================================================================== */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Atmósfera de fondo: canvas de partículas + grano + glow --- */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
body::before {                 /* glow orbs radiales */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 12% -5%, rgba(201, 168, 76, .10), transparent 60%),
    radial-gradient(55vw 55vw at 100% 20%, rgba(201, 168, 76, .07), transparent 55%),
    radial-gradient(70vw 60vw at 50% 115%, rgba(122, 99, 40, .08), transparent 60%);
}
body::after {                  /* grano fino */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Todo el contenido por encima de la atmósfera */
.site-header, main, .site-footer, .wa-float, .mobile-nav {
  position: relative;
  z-index: 2;
}
main { flex: 1 0 auto; }

/* --- Tipografía --- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.12; letter-spacing: .01em; }
h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
p  { color: var(--muted-hi); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.display { font-family: var(--font-display); }
.serif   { font-family: var(--font-serif); }

/* Texto dorado con brillo metálico */
.gold {
  background: var(--grad-gold);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gold-shimmer { animation: metalShine 5s linear infinite; }

/* --- Layout helpers --- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 120px); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-serif);
  font-size: .78rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.lead { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--muted-hi); max-width: 62ch; }
.muted { color: var(--muted); }
.hr { height: 1px; background: var(--line); border: 0; margin-block: 28px; }

/* Divisor dorado decorativo */
.rule {
  display: inline-flex; align-items: center; gap: 14px; justify-content: center;
  color: var(--gold); width: 100%;
}
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; max-width: 90px; background: linear-gradient(90deg, transparent, var(--gold-lo)); }
.rule::after { background: linear-gradient(90deg, var(--gold-lo), transparent); }

/* --- Reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* --- Focus visible accesible --- */
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 3px; }

/* --- Utilidades --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hide-mobile { }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }

/* --- Keyframes --- */
@keyframes metalShine { to { background-position: 200% center; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes pulseGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes waPulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5);} 70%{ box-shadow: 0 0 0 18px rgba(37,211,102,0);} 100%{ box-shadow: 0 0 0 0 rgba(37,211,102,0);} }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px);} to { opacity: 1; transform: none; } }
@keyframes tickerMove { to { transform: translateX(-50%); } }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hide-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
