/* ════════════════════════════════════════════════════════════
   VASTLY · CORE — sistema de diseño
   Negro absoluto · Rojo señal · Tipografía extendida
   ════════════════════════════════════════════════════════════ */

:root {
  /* superficie */
  --void:   #06050E;
  --carbon: #0B0916;
  --smoke:  #14101F;
  --line:   rgba(242, 239, 234, .09);
  --line-red: rgba(124, 92, 255, .28);

  /* señal */
  --red:      #7C5CFF;
  --red-hot:  #9D85FF;
  --red-deep: #5B2EEA;
  --ember:    #22D3EE;

  /* texto */
  --bone: #F2F0FA;
  --ash:  #9C94B8;
  --coal: #575070;

  /* tipografía */
  --f-disp: "Archivo", sans-serif;
  --f-body: "Archivo", sans-serif;
  --f-mono: "Chivo Mono", monospace;

  /* ritmo */
  --beat: 0;                      /* 0→1, lo escribe el motor de audio */
  --gutter: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.7, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--void); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ── grano de película ─────────────────────────────────────── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 2000;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 900ms steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ── tipografía utilitaria ─────────────────────────────────── */
.mono {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.sec-label {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 14px;
}
.sec-label::before { content: ""; width: 34px; height: 1px; background: var(--red); }
.sec-label .idx { color: var(--ash); }

.h-giant {
  font-family: var(--f-disp);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.01em;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
}
.h-giant .thin { font-weight: 200; font-stretch: 100%; letter-spacing: .02em; }
.h-giant .red { color: var(--red); }
.h-giant .stroke {
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 239, 234, .55);
}

.h-med {
  font-family: var(--f-disp);
  font-stretch: 120%;
  font-weight: 750;
  text-transform: uppercase;
  line-height: 1;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.lede { color: var(--ash); max-width: 56ch; font-size: clamp(.95rem, 1.15vw, 1.08rem); }
.lede strong, .lede b { color: var(--bone); font-weight: 600; }

/* ── botones ───────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--red);
  --btn-fg: #0A0616;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--f-mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform .3s var(--ease-out), background .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); background: var(--red-hot); }
.btn:active { transform: translateY(0); }

.btn.ghost {
  --btn-bg: transparent;
  --btn-fg: var(--bone);
  box-shadow: inset 0 0 0 1px var(--line-red);
}
.btn.ghost:hover { --btn-fg: var(--red-hot); background: rgba(124, 92, 255, .06); }

.btn.dark {
  --btn-bg: var(--smoke);
  --btn-fg: var(--bone);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn.dark:hover { background: #1D1930; }

.btn .arrow { font-family: var(--f-body); font-size: 1rem; line-height: 0; transition: transform .3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* link subrayado técnico */
.tlink {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color .25s, border-color .25s;
}
.tlink:hover { color: var(--red-hot); border-color: var(--red); }

/* ── marco viewfinder ──────────────────────────────────────── */
.corner { position: relative; }
.corner::before, .corner::after,
.corner > .c3::before, .corner > .c3::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  border-color: var(--line-red);
  border-style: solid;
  transition: border-color .3s;
}
.corner::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner::after  { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.corner > .c3::before { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.corner > .c3::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.corner:hover::before, .corner:hover::after,
.corner:hover > .c3::before, .corner:hover > .c3::after { border-color: var(--red); }

/* ── nav ───────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  height: 74px;
  transition: background .4s, border-color .4s, height .4s;
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: rgba(6, 5, 14, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  height: 62px;
}

.nav-logo { display: flex; align-items: center; gap: 13px; }
.nav-logo .mark { width: 24px; height: auto; }
.nav-logo .word { height: 20px; width: auto; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); list-style: none; }
.nav-links a {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color .25s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--bone); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1px; background: var(--red);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .btn { padding: 11px 20px; font-size: .66rem; }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 22px; height: 1.5px; background: var(--bone); transition: transform .3s, opacity .3s; }

@media (max-width: 900px) {
  .nav-links, .nav-cta .tlink { display: none; }
  .nav-burger { display: flex; }
  .nav.menu-open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.menu-open .nav-burger span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* menú mobile */
.mobile-menu {
  position: fixed; inset: 0;
  z-index: 850;
  background: rgba(6, 5, 14, .97);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
  gap: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--f-disp);
  font-stretch: 120%;
  font-weight: 750;
  font-size: clamp(1.8rem, 8vw, 3rem);
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.mobile-menu a .mono { color: var(--red); }

/* ── reveals on scroll ─────────────────────────────────────── */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.rv.in { opacity: 1; transform: none; }
.rv[data-d="1"] { transition-delay: .08s; }
.rv[data-d="2"] { transition-delay: .16s; }
.rv[data-d="3"] { transition-delay: .24s; }
.rv[data-d="4"] { transition-delay: .32s; }
.rv[data-d="5"] { transition-delay: .4s; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
}

/* ── cursor custom (desktop) ───────────────────────────────── */
.cursor {
  position: fixed; z-index: 3000;
  width: 34px; height: 34px;
  border: 1px solid rgba(124, 92, 255, .7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, background .25s, border-color .25s;
  mix-blend-mode: difference;
}
.cursor::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--red);
}
.cursor.hot { width: 56px; height: 56px; background: rgba(124, 92, 255, .12); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ── whatsapp flotante ─────────────────────────────────────── */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 950;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--red);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .3s var(--ease-out), background .3s;
  animation: wa-pulse 3s infinite;
}
.wa-float:hover { transform: translateY(-4px) scale(1.05); background: var(--red-hot); }
.wa-float svg { width: 26px; height: 26px; fill: #0A0616; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, .45); }
  50% { box-shadow: 0 0 0 14px rgba(124, 92, 255, 0); }
}

/* ── footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 70px var(--gutter) 40px;
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 60px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer h5 {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer ul a { color: var(--ash); font-size: .92rem; transition: color .25s; }
.footer ul a:hover { color: var(--bone); }

.footer-brand p { color: var(--ash); font-size: .9rem; max-width: 34ch; margin-top: 14px; }
.footer-logo { display: flex; align-items: center; gap: 13px; }
.footer-logo .mark { width: 26px; height: auto; }
.footer-logo .word { height: 22px; width: auto; }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--coal);
  font-family: var(--f-mono);
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.footer-word {
  position: absolute;
  left: 50%; bottom: -1vw;
  transform: translateX(-50%);
  width: min(96vw, 1400px);
  height: auto;
  opacity: .06;
  pointer-events: none;
  user-select: none;
}

/* ── barras visualizador (decorativas) ─────────────────────── */
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq i { width: 3px; background: var(--red); animation: eq-b 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 90%; animation-delay: .15s; }
.eq i:nth-child(3) { height: 60%; animation-delay: .3s; }
.eq i:nth-child(4) { height: 100%; animation-delay: .45s; }
.eq i:nth-child(5) { height: 50%; animation-delay: .6s; }
@keyframes eq-b { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.eq.off i { animation-play-state: paused; transform: scaleY(.25); }

/* ── chips / tags ──────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  font-family: var(--f-mono);
  font-size: .64rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
  border: 1px solid var(--line);
  transition: border-color .25s, color .25s;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.chip.live { color: var(--red-hot); border-color: var(--line-red); }
.chip.live .dot { animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

/* helpers */
.hide { display: none !important; }

/* ── mobile: títulos gigantes sin desbordar ─────────────────── */
@media (max-width: 520px) {
  .h-giant { font-size: clamp(1.85rem, 8.8vw, 2.5rem); }
  body { overflow-x: clip; }
}
