/* ==========================================================================
   L2 Faction — Angels vs Demons · base compartida (intro index.html + web completa)
   Lo exclusivo de la web completa vive en site.css.
   ========================================================================== */

:root {
  /* Obsidiana y hierro */
  --night: #0b0907;
  --night-2: #120e0a;
  --night-3: #1b1510;
  --iron: #241c15;
  --iron-2: #31271d;
  --night-text: #f1e6cf;
  --night-muted: rgba(241, 230, 207, .7);
  --night-line: rgba(232, 196, 112, .24);
  --night-line-strong: rgba(232, 196, 112, .55);

  /* Oro y fuego */
  --gold: #d6a243;
  --gold-hi: #ffe7a6;
  --gold-light: #ecc777;
  --gold-dark: #8a5d1a;
  --gold-deep: #5c3b0c;
  --ember: #ff8a2a;
  --fire: #ff5a12;

  /* Pergamino */
  --parch: #eadcbd;
  --parch-2: #dccaa3;
  --parch-3: #c9b183;
  --ink: #2c1f10;
  --ink-2: #4a3820;
  --ink-muted: #6e5a3d;
  --parch-line: rgba(122, 82, 26, .35);

  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-sans: 'Inter', Arial, sans-serif;

  --gold-gradient: linear-gradient(180deg, #fff4cf 0%, #f2cf7c 28%, #c88d2c 52%, #f6dd94 70%, #8a5d1a 100%);
  --gold-metal: linear-gradient(180deg, #fff1bf 0%, #f0c96c 22%, #c98e2b 50%, #a26c1c 74%, #e9bd62 100%);
  --silver-metal: linear-gradient(180deg, #ffffff 0%, #e3e6ea 24%, #a9b0b8 52%, #7c848d 74%, #d9dde2 100%);
  --iron-metal: linear-gradient(180deg, #3d3226 0%, #241c15 46%, #17120d 100%);
  --header-h: 76px;

  /* Textura generada: grano */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --cursor-default: url('../img/cursor-default.png') 1 1, auto;
  --cursor-hover: url('../img/cursor-hover.png') 1 1, pointer;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--night-text);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

/* ---------- Cursor de Lineage II (flecha clásica y guantelete en lo clickeable) ---------- */
html, body { cursor: var(--cursor-default); }
a, button, [role="button"], [role="tab"], [data-nav], [data-set-lang], label, select, summary,
input[type="button"], input[type="submit"], input[type="reset"], input[type="checkbox"], input[type="radio"] {
  cursor: var(--cursor-hover);
}
button:disabled, [disabled], .is-pending { cursor: var(--cursor-default); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea { cursor: text; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto; z-index: 1000;
  padding: 10px 16px; background: var(--night-3); border: 1px solid var(--gold); color: var(--gold-hi);
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  padding: .95rem 1.9rem;
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase;
  border-radius: 4px;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
  isolation: isolate;
  white-space: nowrap;
  overflow: visible;
}
.btn svg { width: 17px; height: 17px; flex: none; }
/* Marco interior biselado */
.btn::after {
  content: ''; position: absolute; inset: 3px; border-radius: 2px; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
/* Brillo que recorre el botón */
.btn > span, .btn > svg { position: relative; z-index: 1; }
.btn--gold, .btn--ivory { overflow: hidden; }
.btn--gold::before, .btn--ivory::before {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: skewX(-20deg); animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

.btn--gold {
  color: #3a2205;
  background: var(--gold-metal);
  border: 1px solid #6e4a12;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
  box-shadow: inset 0 2px 0 rgba(255, 250, 220, .7), inset 0 -3px 0 rgba(90, 55, 10, .45), 0 10px 24px -10px rgba(255, 150, 40, .65), 0 0 0 1px rgba(0, 0, 0, .5);
}
.btn--gold:hover { transform: translateY(-2px); filter: brightness(1.08) saturate(1.1); box-shadow: inset 0 2px 0 rgba(255, 250, 220, .8), inset 0 -3px 0 rgba(90, 55, 10, .45), 0 16px 34px -10px rgba(255, 140, 30, .85), 0 0 0 1px rgba(0, 0, 0, .5); }
.btn--ivory {
  color: #1f242a;
  background: var(--silver-metal);
  border: 1px solid #4b525a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -3px 0 rgba(40, 45, 52, .35), 0 10px 24px -12px rgba(160, 190, 230, .5), 0 0 0 1px rgba(0, 0, 0, .5);
}
.btn--ivory:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .95), inset 0 -3px 0 rgba(40, 45, 52, .35), 0 16px 32px -12px rgba(170, 200, 240, .75), 0 0 0 1px rgba(0, 0, 0, .5); }
.btn--sm { padding: .6rem 1.15rem; font-size: .7rem; }
.btn--lg { padding: 1.1rem 2.3rem; }
.btn--xl { padding: 1.25rem 2.9rem; font-size: 1rem; letter-spacing: .14em; min-width: 250px; }

/* Botón con fuego: halo de llamas animado detrás */
.btn--fire { overflow: visible; isolation: auto; }
.btn--fire > .btn__flames, .btn--fire::before { pointer-events: none; }
.btn--fire {
  background-image: var(--gold-metal);
  animation: fireGlow 1.8s ease-in-out infinite;
}
@keyframes fireGlow {
  0%, 100% { box-shadow: inset 0 2px 0 rgba(255, 250, 220, .7), inset 0 -3px 0 rgba(90, 55, 10, .45), 0 0 18px 2px rgba(255, 120, 20, .55), 0 0 42px 8px rgba(255, 70, 0, .28), 0 0 0 1px rgba(0, 0, 0, .5); }
  50% { box-shadow: inset 0 2px 0 rgba(255, 250, 220, .8), inset 0 -3px 0 rgba(90, 55, 10, .45), 0 0 26px 5px rgba(255, 150, 30, .75), 0 0 64px 14px rgba(255, 80, 0, .38), 0 0 0 1px rgba(0, 0, 0, .5); }
}
.btn--fire::before {
  /* reemplaza el brillo por una lengua de fuego que sube desde abajo */
  left: 6%; right: 6%; width: auto; top: auto; bottom: 0; height: 120%; transform: none; z-index: -1;
  background:
    radial-gradient(ellipse 18% 60% at 20% 100%, rgba(255, 200, 80, .95), transparent 70%),
    radial-gradient(ellipse 16% 70% at 45% 100%, rgba(255, 140, 30, .95), transparent 70%),
    radial-gradient(ellipse 18% 55% at 70% 100%, rgba(255, 190, 70, .9), transparent 70%),
    radial-gradient(ellipse 14% 65% at 88% 100%, rgba(255, 110, 20, .9), transparent 70%);
  filter: blur(6px);
  animation: flames 1.1s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}
@keyframes flames {
  0% { transform: translateY(18%) scaleY(.9); opacity: .75; }
  50% { transform: translateY(4%) scaleY(1.1) skewX(3deg); opacity: 1; }
  100% { transform: translateY(12%) scaleY(1) skewX(-3deg); opacity: .85; }
}

/* ---------- Selector de idioma (intro y menú móvil) ---------- */
.mobile-lang__btn { padding: 6px 12px; font-family: var(--font-sans); font-size: .8rem; font-weight: 600; color: var(--night-muted); border: 1px solid var(--night-line); border-radius: 3px; }
.mobile-lang__btn.is-active { color: var(--gold-hi); border-color: var(--gold); background: rgba(232, 196, 112, .1); }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 999; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #2a1c0e 0%, var(--night) 65%);
  transition: opacity .7s ease, visibility .7s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.preloader__logo { width: min(340px, 70vw); height: auto; animation: breathe 2.2s ease-in-out infinite; }
.preloader__bar { width: 200px; height: 2px; background: rgba(232, 196, 112, .2); overflow: hidden; border-radius: 2px; }
.preloader__bar span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); animation: bar 1.3s ease-in-out infinite; }
@keyframes bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes breathe { 50% { filter: drop-shadow(0 0 22px rgba(255, 190, 80, .75)); transform: scale(1.03); } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 30px) 0 0;
  text-align: center;
  background: var(--night);
}
.hero__sky { position: absolute; inset: 0; z-index: 0; }
.hero__art {
  position: absolute; inset: 0;
  /* Versión liviana (1280 px) para teléfonos; desde 700 px de ancho se usa la de 2560 px,
     así el fondo ya no se estira sobre pantallas grandes ni queda pixelado */
  background: url('../img/hero-world-1280.webp') center 35% / cover no-repeat;
  /* arte Ángeles (azul, izquierda) vs Demonios (rojo, derecha): sin sepia para no apagar los dos bandos */
  filter: saturate(1.15) contrast(1.08) brightness(.82);
  /* acercamiento suave; el arte ya viene en 2560x1440 para que el zoom no lo pixele */
  animation: heroZoom 40s ease-in-out infinite alternate;
}
@media (min-width: 700px) {
  .hero__art { background-image: url('../img/hero-world.webp'); }
}
/* velo negro sobre el arte del fondo: da más impacto al logo y al contenido (no tapa brasas ni resplandor) */
.hero__art::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
@keyframes heroZoom { to { transform: scale(1.03); } }
@keyframes slowZoom { to { transform: scale(1.07); } }
/* Viñeta y calor */
.hero__sky::after {
  content: ''; position: absolute; inset: 0;
  background:
    /* velo suave detrás del texto: el arte nuevo tiene más contraste en el centro */
    radial-gradient(ellipse 58% 36% at 50% 50%, rgba(8, 6, 4, .42) 0%, rgba(8, 6, 4, .16) 55%, transparent 80%),
    radial-gradient(ellipse 75% 60% at 50% 42%, transparent 30%, rgba(8, 6, 4, .78) 100%),
    linear-gradient(180deg, rgba(8, 6, 4, .55) 0%, transparent 22%);
}
.hero__glow {
  position: absolute; left: 50%; top: 38%; width: min(1100px, 120vw); height: 560px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 170, 60, .4) 0%, rgba(255, 110, 20, .16) 35%, transparent 68%);
  mix-blend-mode: screen; animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow { 50% { opacity: .65; transform: translate(-50%, -50%) scale(1.06); } }
.hero__fog {
  position: absolute; left: -20%; width: 140%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(210, 180, 140, .22) 0%, rgba(160, 130, 100, .1) 40%, transparent 70%);
  filter: blur(18px); animation: fogDrift 38s ease-in-out infinite alternate;
}
.hero__fog--1 { height: 45%; bottom: 8%; }
.hero__fog--2 { height: 35%; bottom: -4%; animation-duration: 52s; animation-direction: alternate-reverse; opacity: .8; }
@keyframes fogDrift { to { transform: translateX(12%); } }
/* Destellos de magia */
.hero__flash { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: 0; animation: flash 7s ease-in-out infinite; }
.hero__flash--1 { left: 12%; top: 30%; width: 260px; height: 260px; background: radial-gradient(circle, rgba(120, 180, 255, .55), transparent 65%); }
.hero__flash--2 { right: 10%; top: 22%; width: 320px; height: 320px; background: radial-gradient(circle, rgba(255, 190, 90, .55), transparent 65%); animation-delay: 2.3s; }
.hero__flash--3 { left: 58%; top: 60%; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255, 90, 40, .5), transparent 65%); animation-delay: 4.6s; }
@keyframes flash { 0%, 100% { opacity: 0; transform: scale(.7); } 12% { opacity: 1; transform: scale(1); } 30% { opacity: 0; transform: scale(1.25); } }
.hero__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: linear-gradient(180deg, transparent, var(--night) 92%); }

/* Brasas que suben (hero y banda del dragón) */
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: radial-gradient(circle, #fff3c0 0%, #ffb340 35%, rgba(255, 90, 10, .7) 60%, transparent 72%);
  box-shadow: 0 0 6px 1px rgba(255, 140, 30, .6);
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(var(--sway, 30px), -48vh) scale(.85); }
  100% { transform: translate(calc(var(--sway, 30px) * -.6), -100vh) scale(.4); opacity: 0; }
}

.hero__content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.hero__title { display: flex; flex-direction: column; align-items: center; }
.hero__logo {
  position: relative; display: block; width: auto; max-width: min(680px, 86vw); max-height: min(46vh, 420px);
  /* filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .85)) drop-shadow(0 0 28px rgba(255, 170, 60, .55)) drop-shadow(0 0 70px rgba(255, 110, 20, .3)); */
}
/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal--delay-1 { transition-delay: .1s; }
.reveal--delay-2 { transition-delay: .2s; }
.reveal--delay-3 { transition-delay: .3s; }
.reveal--delay-4 { transition-delay: .4s; }

/* ---------- Responsive (compartido) ---------- */
@media (max-width: 820px) {
  .hero__flash--1, .hero__flash--3 { display: none; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .embers, .hero__flash { display: none; }
}
