/* =========================================================
   Materia Lab — sistema visual
   Paleta heredada del sitio anterior. Motivo: el chaflán
   del isotipo (--cut) y la línea de capa (hairlines).
   ========================================================= */

:root {
  /* color · primitivos */
  --ink:   #161c32;
  --navy:  #242e48;
  --slate: #333d55;
  --pearl: #dcdee2;
  --red:   #9b1722;

  /* color · semánticos */
  --bg:        var(--ink);
  --surface:   #1c2340;
  --surface-2: var(--navy);
  --text:      var(--pearl);
  --text-2:    rgba(220, 222, 226, .68);
  --text-3:    rgba(220, 222, 226, .42);
  --hair:      rgba(220, 222, 226, .12);
  --hair-str:  rgba(220, 222, 226, .24);
  --accent:    var(--red);
  --accent-hi: #d6404c;        /* rojo legible sobre fondo oscuro, sólo texto pequeño */
  --hot:       #ff8a3d;        /* filamento caliente: sólo en la capa activa */

  /* tipografía */
  --f-disp: 'Archivo', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --fs-display: clamp(2.6rem, 6.4vw, 6.2rem);
  --fs-h2:      clamp(2rem, 4.2vw, 3.6rem);
  --fs-h3:      clamp(1.2rem, 1.6vw, 1.45rem);
  --fs-lead:    clamp(1.05rem, 1.35vw, 1.25rem);
  --fs-body:    1rem;
  --fs-mono:    .82rem;

  /* espacio */
  --gutter: clamp(16px, 4vw, 56px);
  --max:    1320px;
  --sec:    clamp(80px, 10vw, 150px);

  /* forma */
  --cut: 14px;

  /* movimiento: 3 duraciones, 2 curvas. Todo el sitio usa sólo estas. */
  --t-fast: .25s;
  --t-med:  .6s;
  --t-slow: 1.1s;
  --ease-out:   cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--red); color: var(--pearl); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

.mono { font-family: var(--f-mono); font-size: var(--fs-mono); letter-spacing: .01em; }
.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

.display {
  font-family: var(--f-disp);
  font-size: var(--fs-display);
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--f-disp);
  font-size: var(--fs-h2);
  font-weight: 750;
  font-variation-settings: 'wdth' 108;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.h3 {
  font-family: var(--f-disp);
  font-size: var(--fs-h3);
  font-weight: 650;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -.005em;
}
.kicker { font-weight: 500; color: var(--text-2); margin-bottom: 1.2rem; }
.lead { font-size: var(--fs-lead); color: var(--text-2); max-width: 34ch; margin-top: 1.4rem; }

.section { padding: var(--sec) var(--gutter); max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; }
.section__intro { color: var(--text-2); font-size: var(--fs-lead); margin-top: 1.4rem; max-width: 52ch; }

/* chaflán del isotipo */
.cut, .wa-card, .social, .social__icon, .map {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

/* ---------- botones ---------- */
.btn {
  --cut: 10px;
  display: inline-flex; align-items: center; gap: .65em;
  padding: 15px 26px;
  font: 600 .95rem/1 var(--f-body);
  background: var(--red); color: var(--pearl);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background var(--t-fast) var(--ease-out);
  position: relative;
}
.btn:hover { background: #b51c29; }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--hair-str); }
.btn--ghost:hover { background: rgba(220,222,226,.06); }
.btn--sm { padding: 11px 18px; font-size: .85rem; --cut: 8px; }
.btn--lg { padding: 20px 32px; font-size: 1.05rem; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  height: 64px; padding: 0 var(--gutter);
  background: rgba(22, 28, 50, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--hair);
}
.nav__logo { height: 22px; width: auto; color: var(--pearl); }
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: .9rem; color: var(--text-2); }
.nav__links a { position: relative; padding: 6px 0; transition: color var(--t-fast); }
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.nav__links a:hover, .nav__links a.is-current { color: var(--pearl); }
.nav__links a.is-current::after { transform: scaleX(1); }
.nav__z { color: var(--text-3); min-width: 9.5em; text-align: right; }
.nav__z span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; }
.nav__progress span { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(0); }

@media (max-width: 900px) {
  .nav { gap: 16px; height: 56px; }
  .nav__links, .nav__z { display: none; }
  .nav .btn { margin-left: auto; }
}

/* =========================================================
   ESCENAS QUE SE IMPRIMEN CON EL SCROLL (hero y llavero)
   ========================================================= */
.print { position: relative; }
.print--hero { height: 420vh; }
.print--kc { height: 400vh; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background:
    radial-gradient(80% 60% at 70% 55%, rgba(51, 61, 85, .55), transparent 70%),
    var(--bg);
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage::after { /* velo para legibilidad del texto sobre la escena */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(22,28,50,.92) 0%, rgba(22,28,50,.6) 30%, transparent 52%);
}
.stage__copy, .hud, .stage__scroll { z-index: 1; }
.stage__fallback {
  position: absolute; right: 8%; top: 50%; width: min(46vw, 620px); transform: translateY(-40%);
  opacity: 0; pointer-events: none;
}
.no-webgl .stage__fallback { opacity: 1; }
.no-webgl .stage__canvas { display: none; }

.stage__copy {
  position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%);
  width: min(560px, 46vw);
  display: grid;
}
.stage__phase { grid-area: 1 / 1; opacity: 0; visibility: hidden; }
.stage__phase.is-active { opacity: 1; visibility: visible; }
.stage__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.2rem; }

.hud {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px;
  display: flex; flex-wrap: wrap; gap: 8px 36px; align-items: end;
  color: var(--text-3);
}
.hud div { display: flex; gap: .7em; }
.hud dd { color: var(--pearl); font-variant-numeric: tabular-nums; }
.hud .hud__bar { flex: 1 1 200px; height: 2px; background: var(--hair); align-self: center; min-width: 120px; }
.hud__bar span { display: block; width: 100%; height: 100%; background: var(--hot); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 12px var(--hot); }

.stage__scroll {
  position: absolute; right: var(--gutter); top: 50%; color: var(--text-3);
  writing-mode: vertical-rl; display: flex; align-items: center; gap: 12px;
}
.stage__scroll span { width: 1px; height: 56px; background: linear-gradient(var(--pearl), transparent); animation: drip 1.8s var(--ease-inout) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

@media (max-width: 900px) {
  .print--hero { height: 340vh; }
  .print--kc { height: 340vh; }
  .stage::after { background: linear-gradient(180deg, rgba(22,28,50,.95) 0%, rgba(22,28,50,.7) 38%, transparent 60%); }
  .stage__copy { width: auto; right: var(--gutter); top: 88px; transform: none; }
  .stage__phase .lead { max-width: none; }
  .stage__scroll { display: none; }
  .hud { gap: 6px 18px; bottom: 20px; }
  .hud .hud__bar { flex-basis: 100%; order: -1; }
  .stage__fallback { right: auto; left: 50%; top: auto; bottom: 18%; width: 80vw; transform: translateX(-50%); }
}

/* =========================================================
   MANIFIESTO (palabras se iluminan con el scroll)
   ========================================================= */
.manifesto { padding-top: clamp(40px, 6vw, 96px); }
.manifesto__text {
  font-family: var(--f-disp);
  font-size: clamp(1.7rem, 3.6vw, 3.2rem);
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  line-height: 1.18;
  letter-spacing: -.015em;
  max-width: 24ch;
}
.manifesto__text .w { color: rgba(220, 222, 226, .16); transition: color .2s linear; }
.manifesto__text .w.on { color: var(--pearl); }

/* =========================================================
   PEDIDOS: WhatsApp al frente, redes detrás
   ========================================================= */
.wa-card {
  --cut: 28px;
  display: grid; grid-template-columns: 1fr auto; gap: 40px 64px; align-items: end;
  padding: clamp(32px, 6vw, 80px);
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(220,222,226,.03) 7px 8px),
    linear-gradient(135deg, var(--navy), var(--surface));
}
.wa-card .btn { grid-column: 1 / -1; justify-self: start; }
/* el número va "impreso": relleno con líneas de capa */
.wa-card__number {
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--f-disp); font-weight: 800; font-variation-settings: 'wdth' 120;
  line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.wa-card__prefix { font-size: clamp(1.2rem, 2vw, 1.8rem); color: var(--accent-hi); letter-spacing: 0; }
.wa-card__digits {
  font-size: clamp(3rem, 8.5vw, 8rem);
  white-space: nowrap;
  background: repeating-linear-gradient(180deg, var(--pearl) 0 4px, rgba(220,222,226,.62) 4px 5px);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wa-card__number:hover .wa-card__digits {
  background-image: repeating-linear-gradient(180deg, #e2525d 0 4px, var(--red) 4px 5px);
}

.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.social {
  --cut: 18px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 20px 24px;
  padding: 28px 32px 28px 28px;
  background: var(--surface);
  transition: background var(--t-med) var(--ease-out);
}
.social__icon {
  --cut: 10px;
  width: 64px; height: 64px; display: grid; place-items: center;
  background: var(--navy); color: var(--pearl);
  transition: background var(--t-med) var(--ease-out);
}
.social__icon svg { width: 28px; height: 28px; fill: currentColor; }
.social__body { display: grid; gap: 4px; align-content: start; }
.social__handle { color: var(--accent-hi); }
.social__text { color: var(--text-2); margin-top: 8px; max-width: 40ch; }
.social__go {
  grid-column: 2; justify-self: start; font-weight: 600; font-size: .92rem;
  padding-bottom: 4px; border-bottom: 2px solid var(--red);
}
.social:hover { background: var(--navy); }
.social:hover .social__icon { background: var(--red); }

@media (max-width: 900px) {
  .wa-card { grid-template-columns: 1fr; }
  .wa-card__number { align-items: flex-start; }
  .socials { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .social { grid-template-columns: 1fr; padding: 24px; }
  .social__go { grid-column: 1; }
}

/* =========================================================
   UBICACIÓN
   ========================================================= */
.location__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.location__copy .btn { margin-top: 32px; }
.speclist { margin-top: 36px; border-top: 1px solid var(--hair); }
.speclist li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.speclist span { color: var(--text-3); }
.speclist a:hover { color: var(--accent-hi); }
.map {
  --cut: 22px;
  position: relative; aspect-ratio: 4 / 3; background: var(--surface);
}
.map iframe {
  width: 100%; height: 100%; border: 0;
  /* mapa en la paleta del sitio: invertido y devuelto al tono original */
  filter: invert(.9) hue-rotate(180deg) saturate(.7) contrast(.92) brightness(.95);
}
@media (max-width: 900px) {
  .location__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   FOOTER + WHATSAPP FLOTANTE
   ========================================================= */
.footer {
  padding: 72px var(--gutter) 48px;
  max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: start;
  border-top: 1px solid var(--hair);
}
.footer__logo { width: 120px; height: auto; color: var(--pearl); opacity: .9; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; color: var(--text-3); }
.footer__cols li { padding: 4px 0; }
.footer__cols a:hover { color: var(--pearl); }
@media (max-width: 760px) {
  .footer { grid-template-columns: 1fr; padding-bottom: 104px; }
  .footer__cols { grid-template-columns: 1fr; }
}

.wa-float {
  --cut: 10px;
  position: fixed; right: var(--gutter); bottom: 24px; z-index: 40;
  display: inline-flex; align-items: center; gap: .6em;
  padding: 16px 22px;
  font: 600 .95rem/1 var(--f-body);
  background: var(--red); color: var(--pearl);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), background var(--t-fast);
}
.wa-float .icon { width: 1.35em; height: 1.35em; }
.wa-float.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wa-float:hover { background: #b51c29; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .print--hero, .print--kc { height: auto; }
  .stage { position: relative; }
  .stage__scroll { display: none; }
}
