/* =============================================================
   BASE · colores, tipografías, botones, cabecera, carga
   ============================================================= */
:root {
  --navy: #0b1530;
  --navy-2: #13204a;
  --navy-3: #1b2c62;
  --purple: #2a1460;
  --purple-2: #4b2bb3;
  --violet: #7b4cff;
  --yellow: #ffc21a;
  --yellow-2: #ffe27a;
  --orange: #ff7a00;
  --turq: #1fc8c8;
  --sand: #f4d9a0;
  --white: #ffffff;
  --muted: #b8c4e0;
  --radius: 22px;
  --f-title: 'Lilita One', 'Rubik', sans-serif;
  --f-body: 'Rubik', system-ui, sans-serif;
  --f-px: 'Press Start 2P', monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--white);
  background: var(--navy);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* textura de grano tramado sobre todo el fondo */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: url(../assets/tex/grain.png) repeat;
  background-size: 384px;
  image-rendering: pixelated;
  opacity: .9;
}
img { max-width: 100%; display: block; }
a { color: var(--yellow); }
a:hover { color: var(--yellow-2); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.px { font-family: var(--f-px); font-size: 11px; letter-spacing: .06em; line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.title {
  margin: 0;
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: .98;
  text-shadow: 0 4px 0 var(--purple);
}
.kicker { margin: 0 0 12px; color: var(--turq); }
.lead { font-size: 19px; line-height: 1.6; color: #dce5f7; margin: 0; }

/* ----------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  border-radius: 14px; border: 0;
  font: 800 15px/1 var(--f-body);
  text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-big { min-height: 56px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn-sub { background: var(--orange); color: var(--white); box-shadow: 0 4px 0 #9b3f00; }
.btn-sub:hover { color: var(--white); transform: translateY(-2px); box-shadow: 0 6px 0 #9b3f00; }
.btn-yellow {
  background: linear-gradient(180deg, var(--yellow-2), var(--yellow) 40%, var(--orange));
  color: var(--purple); box-shadow: 0 6px 0 var(--purple), 0 14px 30px rgba(255, 122, 0, .35);
}
.btn-yellow:hover { color: var(--purple); transform: translateY(-3px); box-shadow: 0 9px 0 var(--purple), 0 18px 40px rgba(255, 122, 0, .45); }
.btn-yellow:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple); }
.btn-ghost { background: rgba(11, 21, 48, .55); color: var(--white); border: 2px solid var(--white); backdrop-filter: blur(6px); }
.btn-ghost:hover { color: var(--navy); background: var(--white); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 22px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
  color: var(--yellow); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ico-on { display: none; }
.icon-btn[aria-pressed="true"] .ico-on { display: block; }
.icon-btn[aria-pressed="true"] .ico-off { display: none; }

/* ----------------------------------------------------- cabecera */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(11, 21, 48, .82); backdrop-filter: blur(12px); border-color: rgba(255, 255, 255, .08); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.nav-logo img { height: 40px; width: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); transition: transform .25s var(--ease); }
.nav-logo:hover img { transform: rotate(-4deg) scale(1.06); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--white); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 10px 14px; border-radius: 12px; transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255, 194, 26, .14); color: var(--yellow); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; }
.scroll-progress span {
  display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
  background: repeating-linear-gradient(90deg, var(--yellow) 0 8px, var(--orange) 8px 16px);
}

/* ----------------------------------------------------- pantalla de carga */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--navy) url(../assets/tex/grain.png);
  background-size: 384px; image-rendering: pixelated;
  transition: opacity .6s, visibility .6s;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader-logo { width: min(340px, 70vw); animation: bob 1.6s ease-in-out infinite; image-rendering: auto; }
#loader p { margin: 0; color: var(--yellow); }
.loader-bar { width: min(320px, 70vw); height: 18px; border: 3px solid var(--yellow); padding: 3px; }
.loader-bar span {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 10px, transparent 10px 14px);
  animation: load 1.8s steps(14) forwards;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .btn-sub { padding: 0 14px; }
  .nav-logo img { height: 32px; }
}
