/* ==========================================================================
   Motion: preloader, aviso +18, transiciones, cursor y estados iniciales.
   Los estados ocultos solo aplican con html.js-motion (si falla JS, todo se ve).
   ========================================================================== */

/* ---------- Preloader ---------- */
.preloader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; color: var(--on-dark); pointer-events: all; }
.preloader__panel { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--forest); overflow: hidden; }
.preloader__panel::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .1; mix-blend-mode: overlay; }
.preloader__panel--top { top: 0; }
.preloader__panel--bottom { bottom: 0; }
.preloader__inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: 26px; text-align: center; padding: 0 24px; }
.preloader__logo { position: relative; width: clamp(150px, 30vw, 210px); aspect-ratio: 1; display: grid; place-items: center; }
.preloader__logo img { width: 74%; background: #fff; border-radius: 50%; padding: 5px; clip-path: circle(0% at 50% 50%); }
.preloader__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.preloader__ring circle { fill: none; stroke-width: 2; }
.preloader__ring .track { stroke: rgba(183,182,106,.15); }
.preloader__ring .bar { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.preloader__count { font-family: var(--font-head); font-weight: 700; font-size: clamp(3.4rem, 12vw, 6rem); line-height: 1; letter-spacing: -.05em; color: #fff; font-variant-numeric: tabular-nums; display: flex; align-items: flex-start; }
.preloader__count sup { font-size: .32em; color: var(--lichen); margin: .3em 0 0 .1em; }
.preloader__tag { display: flex; gap: .32em; flex-wrap: wrap; justify-content: center; overflow: hidden; font-family: var(--font-body); font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--lichen); }
.preloader__tag span { display: inline-block; transform: translateY(110%); }
.preloader__mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; color: rgba(183,182,106,.12); }
.page-curtain { position: fixed; inset: 0; z-index: 999; background: var(--forest); transform: translateY(100%); pointer-events: none; visibility: hidden; }
.page-curtain::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .1; mix-blend-mode: overlay; }
.page-curtain img { position: absolute; left: 50%; top: 50%; width: 84px; margin: -42px 0 0 -42px; background: #fff; border-radius: 50%; padding: 3px; }
html.is-loading, html.is-loading body { overflow: hidden; }

/* ---------- Aviso +18 ---------- */
.age-gate { position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; padding: 16px; visibility: hidden; }
.age-gate.is-open { visibility: visible; }
.age-gate__backdrop { position: absolute; inset: 0; background: rgba(5,26,20,.6); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); opacity: 0; }
.age-gate__card { position: relative; width: min(100%, 520px); background: var(--paper); border-radius: var(--radius-lg); padding: clamp(28px, 6vw, 48px); text-align: center; box-shadow: 0 40px 120px -30px rgba(0,0,0,.6); overflow: hidden; isolation: isolate; opacity: 0; }
.age-gate__card::before { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; top: -200px; left: 50%; margin-left: -160px; background: rgba(195,151,69,.35); filter: blur(60px); z-index: -1; }
.age-gate__logo { width: 96px; margin: 0 auto 18px; }
.age-gate__badge { display: inline-grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: var(--forest); color: var(--gold); font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; margin: -56px auto 16px; position: relative; left: 40px; box-shadow: 0 0 0 6px var(--paper); }
.age-gate h2 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin-bottom: .4em; }
.age-gate p { color: var(--ink-soft); font-size: 1.02rem; }
.age-gate__legal { font-size: .84rem !important; margin: 18px 0 0; }
.age-gate__actions { display: grid; gap: 10px; margin-top: 24px; }
@media (min-width: 480px) { .age-gate__actions { grid-template-columns: 1.3fr 1fr; } }
.age-gate__denied { display: none; }
.age-gate.is-denied .age-gate__ask { display: none; }
.age-gate.is-denied .age-gate__denied { display: block; }

/* ---------- Cursor personalizado (solo puntero fino) ---------- */
.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js-motion .cursor, html.js-motion .cursor-dot { opacity: 0; }
  html.js-motion .cursor { display: grid; place-items: center; position: fixed; left: 0; top: 0; z-index: 998; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 1.5px solid rgba(195,151,69,.9); border-radius: 50%; pointer-events: none; transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), background-color .4s, border-color .4s; mix-blend-mode: difference; }
  html.js-motion .cursor-dot { display: block; position: fixed; left: 0; top: 0; z-index: 998; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold); pointer-events: none; }
  html.js-motion .cursor.is-hover { width: 74px; height: 74px; margin: -37px 0 0 -37px; background: rgba(195,151,69,.9); border-color: transparent; }
  html.js-motion .cursor.is-media { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--gold); border-color: transparent; mix-blend-mode: normal; }
  html.js-motion .cursor span { font-family: var(--font-head); font-weight: 700; font-size: .72rem; letter-spacing: .1em; color: var(--forest); opacity: 0; transition: opacity .3s; }
  html.js-motion .cursor.is-media span { opacity: 1; }
}

/* ---------- Estados iniciales (animados por motion.js) ---------- */
html.js-motion [data-reveal] { opacity: 0; transform: translateY(40px); }
html.js-motion [data-img-reveal] { clip-path: inset(100% 0 0 0 round var(--radius-lg)); }
html.js-motion [data-img-reveal] > img, html.js-motion [data-img-reveal] > video { transform: scale(1.3); }
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word > span { display: inline-block; will-change: transform; }
html.js-motion [data-split] .split-word > span { transform: translateY(110%) rotate(4deg); }

@media (prefers-reduced-motion: reduce) {
  .preloader, .cursor, .cursor-dot, .page-curtain { display: none !important; }
  html.js-motion [data-reveal], html.js-motion [data-img-reveal], html.js-motion [data-split] .split-word > span { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  html.js-motion [data-img-reveal] > img, html.js-motion [data-img-reveal] > video { transform: none !important; }
  .rotating-badge .ring, .hero__scroll i::after, .wa-float::before { animation: none; }
  .mobile-nav { transition: none; }
}

/* Visibilidad de preloader / cortina según el tipo de entrada */
.preloader { display: none; }
html.is-loading .preloader { display: grid; }
html.is-entering .page-curtain { transform: none; visibility: visible; }
