/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { background: #050505; }

::selection { background: #d4af37; color: #050505; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #3a3120; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #d4af37; }

.gold-text {
  background: linear-gradient(120deg, #eeda94, #d4af37 45%, #8f701f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* vertical padding doesn't affect inline layout, but it enlarges the
     background painting area so descenders (g, y, j, p, q) aren't clipped */
  padding-top: 0.08em;
  padding-bottom: 0.2em;
}

/* ===== Grain overlay ===== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ===== Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-scale .pan-l, .preloader-scale .pan-r { animation: sway 1.8s ease-in-out infinite; transform-origin: 22px 20px; }
.preloader-scale .pan-r { transform-origin: 78px 20px; animation-delay: .15s; }
@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(6deg); }
}

/* ===== Custom cursor (desktop only) ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 90;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #d4af37;
  display: none;
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(212,175,55,.5);
  transition: width .25s ease, height .25s ease, border-color .25s ease, background-color .25s ease;
  display: none;
}
.cursor-ring.is-active {
  width: 56px; height: 56px;
  background: rgba(212,175,55,.08);
  border-color: rgba(212,175,55,.8);
}
.has-custom-cursor .cursor-dot, .has-custom-cursor .cursor-ring { display: block; }
.has-custom-cursor * { cursor: none !important; }

/* ===== Header scrolled state ===== */
.site-header.is-scrolled {
  background: rgba(5,5,5,.75);
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(212,175,55,.15);
}

/* ===== Mobile nav ===== */
.mobile-nav {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .45s ease, transform .45s ease, visibility .45s ease;
}
.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== Hero ===== */
.hero-glow {
  background: radial-gradient(circle, rgba(212,175,55,.16) 0%, rgba(212,175,55,0) 65%);
  filter: blur(10px);
}
#heroCanvas { opacity: .55; }
.mouse-wheel { animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { opacity: 0; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* ===== Hero rotating word ===== */
.hero-rotator {
  transition: width .4s cubic-bezier(.65,0,.35,1);
  will-change: width;
}
.rotator-word {
  transition: opacity .35s ease, transform .35s ease;
}
.pulse-ping {
  animation: pulsering 2s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes pulsering {
  0% { transform: scale(1); opacity: .7; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-ping { animation: none; }
}

/* ===== Marquee ===== */
.marquee-track {
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-band:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== CTA glow ===== */
.cta-band { background: #0c0c0b; }
.cta-glow {
  background:
    radial-gradient(circle at 20% 20%, rgba(212,175,55,.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(212,175,55,.1), transparent 40%);
}

/* ===== Reveal animation base state (GSAP overrides via inline styles once JS runs) ===== */
.reveal-up, .reveal-scale, .reveal-line > span {
  opacity: 0;
}
.no-js .reveal-up, .no-js .reveal-scale, .no-js .reveal-line > span { opacity: 1; }

/* ===== WhatsApp FAB ===== */
.fab-ping {
  animation: fabping 2.4s cubic-bezier(0,0,.2,1) infinite;
  background: rgba(212,175,55,.55);
}
@keyframes fabping {
  0% { transform: scale(1); opacity: .6; }
  75%, 100% { transform: scale(1.9); opacity: 0; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .mouse-wheel, .fab-ping, .preloader-scale .pan-l, .preloader-scale .pan-r {
    animation: none !important;
  }
  .reveal-up, .reveal-scale, .reveal-line > span { opacity: 1 !important; transform: none !important; }
}

/* ===== Páginas legales ===== */
.legal { color: rgba(245,241,230,.72); font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.legal p, .legal ul, .legal ol, .legal .legal-table { margin-bottom: 1.25rem; }
.legal h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: #f5f1e6;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212,175,55,.15);
  scroll-margin-top: 6rem;
}
.legal h3 {
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #ddb949;
  margin: 2rem 0 .75rem;
}
.legal strong { color: #f5f1e6; font-weight: 500; }
.legal a { color: #e6c968; text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: #eeda94; }
.legal ul { list-style: none; padding-left: 0; }
.legal ul li { position: relative; padding-left: 1.4rem; margin-bottom: .5rem; }
.legal ul li::before { content: "\2726"; position: absolute; left: 0; top: 0; font-size: .7rem; color: #d4af37; }
.legal ol { padding-left: 1.5rem; list-style: decimal; }
.legal ol[type="a"] { list-style: lower-alpha; }
.legal ol li { margin-bottom: .5rem; padding-left: .25rem; }
.legal ol li::marker { color: #d4af37; }

.legal-toc {
  margin: 2.5rem 0;
  padding: 1.5rem 1.75rem;
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 1rem;
  background: #0c0c0b;
}
.legal-toc-title { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: #ddb949; margin-bottom: .75rem !important; }
.legal-toc ol { margin: 0; font-size: .95rem; }
.legal-toc a { text-decoration: none; color: rgba(245,241,230,.75); }
.legal-toc a:hover { color: #e6c968; }

.legal-table { overflow-x: auto; border: 1px solid rgba(255,255,255,.1); border-radius: .75rem; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th { text-align: left; font-weight: 500; color: #ddb949; background: #0c0c0b; padding: .85rem 1rem; }
.legal-table td { padding: .85rem 1rem; border-top: 1px solid rgba(255,255,255,.08); vertical-align: top; }
.legal-table td:first-child { color: #f5f1e6; min-width: 11rem; }


/* ===== Íconos SVG ===== */
.icon { display: inline-block; fill: currentColor; vertical-align: -0.125em; flex-shrink: 0; overflow: visible; }

/* ===== Entrada del hero (CSS, para que se pinte sin esperar a los scripts) ===== */
.hero .reveal-up, .hero .reveal-line > span {
  animation: heroIn .9s cubic-bezier(.22,.8,.3,1) both;
  animation-delay: var(--hd, .1s);
}
@keyframes heroIn {
  from { opacity: 0; translate: 0 30px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .reveal-up, .hero .reveal-line > span { animation: none; }
}
