/* =====================================================
   Ile Ona Ire — Templo Nocturno · Hero preview
   ===================================================== */

:root{
  /* Noche */
  --noche:        #0b0603;
  --noche-2:      #140a05;
  --tabaco:       #1f120a;
  --sombra:       rgba(0,0,0,.72);

  /* Tinta y papel envejecido */
  --crema:        #f2e6d0;
  --crema-soft:   rgba(242,230,208,.78);
  --crema-mute:   rgba(242,230,208,.52);
  --crema-faint:  rgba(242,230,208,.26);

  /* Luz */
  --vela:         #f4a94a;
  --vela-core:    #ffd37a;
  --oro:          #c8a263;
  --oro-deep:     #8b6b2e;

  /* Fuego Eleggua */
  --eleggua:      #8b1e1e;
  --eleggua-hot:  #c6421f;

  /* Tipografía */
  --display: "Cinzel", "Times New Roman", serif;
  --body:    "EB Garamond", Georgia, serif;
  --script:  "Tangerine", "Snell Roundhand", cursive;

  --max: 1240px;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--noche);
  color: var(--crema);
  font-family: var(--body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==== GRANO (fijo, mix-blend) ==== */
.grain{
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.90  0 0 0 0 0.80  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ==== HUMO (canvas detrás del contenido del hero) ==== */
.smoke{
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 2;
  opacity: .55;
  mix-blend-mode: screen;
}

/* ==== NAV ==== */
.nav{
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 18px clamp(20px, 4vw, 44px);
  color: var(--crema);
  mix-blend-mode: difference;
  transition: background .4s ease, mix-blend-mode .4s ease;
}
.nav.scrolled{
  background: linear-gradient(to bottom, rgba(11,6,3,.85), rgba(11,6,3,0));
  mix-blend-mode: normal;
  backdrop-filter: blur(6px);
}
.nav__brand{
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--crema);
  text-decoration: none;
}
.nav__mark{
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--crema-mute);
  border-radius: 50%;
  color: var(--oro);
}
.nav__text{ display: flex; flex-direction: column; line-height: 1; }
.nav__text strong{
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav__text small{
  font-family: var(--display);
  font-size: 9.5px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--crema-mute);
  margin-top: 4px;
}
.nav__links{
  display: flex; gap: 32px;
  justify-content: center;
}
.nav__links a{
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--crema-soft);
  text-decoration: none;
  position: relative;
  padding: 6px 0;
  transition: color .3s;
}
.nav__links a::after{
  content:"";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--oro);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s cubic-bezier(.77,0,.18,1);
}
.nav__links a:hover{ color: var(--crema); }
.nav__links a:hover::after{ transform: scaleX(1); transform-origin: left; }

.audio-toggle{
  background: none; border: 1px solid var(--crema-faint);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--crema-soft);
  cursor: pointer;
  transition: border-color .3s, color .3s, background .3s;
}
.audio-toggle:hover{
  color: var(--vela-core);
  border-color: var(--vela);
  box-shadow: 0 0 14px rgba(244,169,74,.35);
}
.audio-toggle.is-on{
  color: var(--vela-core);
  border-color: var(--vela);
  animation: audioPulse 1.6s ease-in-out infinite;
}
@keyframes audioPulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(244,169,74,.35); }
  50%    { box-shadow: 0 0 0 10px rgba(244,169,74,0); }
}

/* ==== HERO ==== */
.hero{
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__media{
  position: absolute; inset: 0;
  z-index: 0;
}
.hero__media video{
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.05) brightness(.62);
  transform: scale(1.04);
}
.hero__veil{
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(0,0,0,.25), rgba(0,0,0,.78) 80%),
    linear-gradient(to bottom, rgba(11,6,3,.55) 0%, rgba(11,6,3,.25) 40%, rgba(11,6,3,.85) 100%);
}
.hero__vignette{
  position: absolute; inset: 0;
  box-shadow:
    inset 0 0 160px 40px rgba(0,0,0,.65),
    inset 0 -60px 160px rgba(11,6,3,.9);
}

/* Cowrie decorativo */
.deco--cowrie{
  position: absolute;
  top: 14vh; left: clamp(20px, 5vw, 60px);
  color: var(--oro);
  opacity: .55;
  z-index: 4;
  animation: driftSlow 9s ease-in-out infinite alternate;
}
@keyframes driftSlow {
  from { transform: translateY(0) rotate(-6deg); }
  to   { transform: translateY(-10px) rotate(0deg); }
}

/* Vela */
.candle{
  position: absolute;
  right: clamp(24px, 5vw, 64px);
  bottom: 12vh;
  width: 28px;
  z-index: 4;
  pointer-events: none;
}
.candle__body{
  width: 10px; height: 44px;
  background: linear-gradient(to bottom, #e8d9b8, #b89b6e);
  margin: 0 auto;
  border-radius: 2px 2px 0 0;
  box-shadow: inset -2px 0 2px rgba(0,0,0,.3);
}
.candle__flame{
  position: absolute;
  top: -22px; left: 50%;
  width: 10px; height: 20px;
  background: radial-gradient(ellipse at 50% 80%,
    #ffffff 0%, var(--vela-core) 25%, var(--vela) 55%, rgba(244,169,74,0) 85%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: flicker 2.3s ease-in-out infinite;
  filter: blur(.3px);
}
.candle__glow{
  position: absolute;
  top: -70px; left: 50%;
  width: 180px; height: 180px;
  margin-left: -90px;
  background: radial-gradient(circle, rgba(244,169,74,.35) 0%, rgba(244,169,74,0) 65%);
  border-radius: 50%;
  animation: glow 2.3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes flicker {
  0%,100% { transform: translateX(-50%) scaleY(1)   scaleX(1); opacity: 1; }
  25%     { transform: translateX(-52%) scaleY(1.1) scaleX(.94); opacity: .92; }
  50%     { transform: translateX(-48%) scaleY(.9)  scaleX(1.05); opacity: .98; }
  75%     { transform: translateX(-51%) scaleY(1.05) scaleX(.97); opacity: .9; }
}
@keyframes glow {
  0%,100% { opacity: .9; transform: scale(1); }
  50%     { opacity: 1;  transform: scale(1.08); }
}

/* Contenido */
.hero__inner{
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 0 clamp(20px, 5vw, 48px);
  max-width: 980px;
  margin: 0 auto;
}

.hero__kicker{
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--oro);
  margin: 0 0 42px;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp .9s ease .25s forwards;
}
.hero__kicker .line{
  width: 36px; height: 1px;
  background: var(--oro);
  display: inline-block;
}

.hero__title{
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(60px, 13vw, 180px);
  line-height: .95;
  letter-spacing: .01em;
  margin: 0 0 24px;
  color: var(--crema);
  text-shadow:
    0 0 30px rgba(0,0,0,.6),
    0 2px 0 rgba(0,0,0,.3);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 .3em;
}
.hero__title .word{
  display: inline-flex;
}
.hero__title .char{
  display: inline-block;
  opacity: 0;
  transform: translateY(70%) rotateX(-40deg);
  filter: blur(14px);
  transform-origin: 50% 100%;
  will-change: opacity, transform, filter;
}
.hero__title .char.in{
  animation: charReveal 1.1s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes charReveal {
  0%   { opacity: 0; transform: translateY(70%) rotateX(-40deg); filter: blur(14px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) rotateX(0); filter: blur(0); }
}

/* Script decorativo */
.hero__script{
  font-family: var(--script);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  color: var(--vela);
  margin: -8px 0 24px;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 1.1s ease 1.5s forwards;
  text-shadow: 0 0 22px rgba(244,169,74,.25);
}

.hero__lede{
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.7;
  color: var(--crema-soft);
  max-width: 560px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp .9s ease 1.8s forwards;
}
.hero__lede em{
  font-style: italic;
  color: var(--vela-core);
  font-weight: 500;
}

.hero__actions{
  display: inline-flex; gap: 16px; flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp .9s ease 2.1s forwards;
}

.btn-primary, .btn-ghost{
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 30px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--oro);
  color: var(--crema);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color .4s, border-color .4s, transform .4s;
}
.btn-primary{
  color: var(--noche);
  background: var(--vela);
  border-color: var(--vela);
  box-shadow: 0 0 0 0 rgba(244,169,74,.5);
}
.btn-primary::before{
  content:""; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), var(--vela-core), var(--vela) 60%);
  opacity: 0;
  transition: opacity .4s;
}
.btn-primary span, .btn-primary svg{ position: relative; z-index: 1; }
.btn-primary:hover{
  box-shadow: 0 0 40px -4px rgba(244,169,74,.65);
  transform: translateY(-2px);
}
.btn-primary:hover::before{ opacity: 1; }

.btn-ghost:hover{
  color: var(--vela-core);
  border-color: var(--vela-core);
  transform: translateY(-2px);
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator */
.hero__scroll{
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0;
  animation: fadeIn 1s ease 2.6s forwards;
}
.hero__scroll span{
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--crema-mute);
}
.hero__scroll-line{
  width: 1px; height: 54px;
  background: linear-gradient(to bottom, var(--oro), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after{
  content:""; position: absolute; top: 0; left: 0; right: 0;
  height: 14px;
  background: var(--vela-core);
  animation: scrollDot 2.4s ease-in-out infinite;
  box-shadow: 0 0 8px var(--vela);
}
@keyframes scrollDot {
  0%   { transform: translateY(-14px); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(54px); opacity: 0; }
}
@keyframes fadeIn { to { opacity: 1; } }

/* ==== PEEK siguiente sección ==== */
.next-peek{
  background: var(--noche);
  padding: 140px 0 160px;
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(200,162,99,.12);
}
.next-peek__inner{
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.kicker-mono{
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--oro);
  margin: 0 0 40px;
}
.kicker-mono span{
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--oro-deep);
  margin-right: 10px;
  font-size: 10px;
}
.next-peek__text{
  font-family: var(--body);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.55;
  color: var(--crema-soft);
  font-style: italic;
  margin: 0 0 48px;
}
.next-peek__verdict{
  font-family: var(--display);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--vela-core);
  text-transform: none;
  margin: 0;
}

/* ==== Responsive ==== */
@media (max-width: 760px){
  .nav__links{ display: none; }
  .nav{ grid-template-columns: auto 1fr auto; }
  .candle{ right: 18px; bottom: 100px; transform: scale(.85); }
  .deco--cowrie{ top: 10vh; }
  .hero__kicker{ font-size: 9.5px; letter-spacing: .3em; margin-bottom: 30px; }
  .hero__title{ font-size: clamp(54px, 18vw, 90px); }
  .hero__lede{ font-size: 15px; }
  .btn-primary, .btn-ghost{ padding: 14px 22px; font-size: 11px; letter-spacing: .22em; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .hero__media video{ display: none; }
  .hero__media{ background: url("images/media/hero-poster.webp") center/cover no-repeat; }
}
