/* ==========================================
   MATHIAS ALVEZ · ESTILOS DEL SITIO
   Paleta tomada del logo: verde #006838 → petróleo #00434f,
   papel, tinta y el lima histórico de la marca como acento.
   ========================================== */

:root {
  --paper: #f4f3ee;
  --paper-2: #e6e4da;
  --ink: #062a2f;
  --ink-2: #0a363c;
  --green: #006838;
  --teal: #00434f;
  --lime: #def080;
  --brand: linear-gradient(100deg, var(--green), var(--teal));
  --hair: rgba(6, 42, 47, 0.16);
  --hair-inv: rgba(244, 243, 238, 0.18);
  --mute: rgba(6, 42, 47, 0.68);
  --mute-inv: rgba(244, 243, 238, 0.7);

  --display: "Archivo", "Arial Narrow", Impact, system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 28px;
  --nav-h: 76px;
}

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

html { scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html.no-motion { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; }
.theme-ink :focus-visible { outline-color: var(--lime); }

.wrap { width: min(1320px, 100% - 32px); margin-inline: auto; }
@media (min-width: 900px) { .wrap { width: min(1320px, 100% - 96px); } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 2000; background: var(--lime); color: var(--ink); padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ====== TIPOGRAFÍA ====== */
.display {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 68%;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.005em;
}
.display--xl { font-size: clamp(4.5rem, 20vw, 19rem); }
.display--l  { font-size: clamp(3rem, 9.5vw, 8.5rem); }
.display--m  { font-size: clamp(2.2rem, 5vw, 4.2rem); }

.label {
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Cada línea recorta a sus letras para que "suban" desde abajo */
.line { display: block; overflow: hidden; padding-top: 0.12em; margin-top: -0.12em; padding-bottom: 0.04em; }
.char, .word { display: inline-block; }
.word { white-space: nowrap; }

.theme-ink   { background: var(--ink);   color: var(--paper); }
.theme-paper { background: var(--paper); color: var(--ink); }
.theme-lime  { background: var(--lime);  color: var(--ink); }

.section-sub { max-width: 52ch; font-size: clamp(1.05rem, 1.6vw, 1.3rem); margin-top: 28px; }
.theme-ink .section-sub { color: var(--mute-inv); }

/* ====== BOTONES ====== */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 1.5px solid transparent;
  transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--lime:hover { background: var(--paper); }
.btn--line { border-color: var(--hair-inv); color: var(--paper); }
.btn--line:hover { border-color: var(--lime); color: var(--lime); }

/* ==========================================
   ENTRADA
   ========================================== */
.intro { display: none; }
.js.motion .intro {
  display: block; position: fixed; inset: 0; z-index: 1500; pointer-events: none;
  --cut-a: 40%; --cut-b: 60%;
}
.js.motion.intro-done .intro { display: none; }

.intro__panel { position: absolute; inset: 0; background: var(--paper); will-change: transform; }
/* El panel A se superpone 3px al B para que no se vea la unión antes del corte */
.intro__panel--a { clip-path: polygon(0 0, calc(var(--cut-a) + 3px) 0, calc(var(--cut-b) + 3px) 100%, 0 100%); z-index: 1; }
.intro__panel--b { clip-path: polygon(var(--cut-a) 0, 100% 0, 100% 100%, var(--cut-b) 100%); }

.intro__slash {
  position: absolute; left: 50%; top: 50%;
  width: 5px; height: 160vmax; margin: -80vmax 0 0 -2.5px;
  background: var(--lime);
  transform: rotate(var(--cut-angle, -12deg)) scaleY(0);
  box-shadow: 0 0 40px 6px rgba(222, 240, 128, 0.55);
}

.intro__mark {
  position: absolute; left: 50%; top: 50%;
  width: clamp(140px, 24vw, 280px); aspect-ratio: 391 / 243;
  transform: translate(-50%, -58%);
}
.intro__piece { position: absolute; inset: 0; overflow: hidden; }
.intro__piece img { width: 100%; height: 100%; transform: translateY(105%); }

.intro__label {
  position: absolute; left: 0; right: 0; top: calc(50% + clamp(70px, 10vw, 120px));
  text-align: center; color: var(--ink);
  font-family: var(--display); font-weight: 800; font-stretch: 75%;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem;
  opacity: 0;
}
.intro__label span { color: var(--green); margin-left: 0.6em; }

/* Visita repetida en la misma sesión: solo la apertura diagonal */
.intro-seen .intro__mark, .intro-seen .intro__label { display: none; }

/* ====== CORTINA ENTRE SECCIONES ====== */
.wipe { position: fixed; inset: 0; z-index: 1400; pointer-events: none; overflow: hidden; visibility: hidden; }
.wipe__inner {
  position: absolute; top: -10%; bottom: -10%; left: -35%; right: -35%;
  background: var(--brand);
  display: grid; place-items: center;
  transform: skewX(-16deg) translateX(-130%);
}
.wipe__inner img { width: clamp(90px, 12vw, 150px); filter: brightness(0) invert(0.96); transform: skewX(16deg); }

/* ==========================================
   NAVEGACIÓN
   ========================================== */
.nav {
  position: fixed; z-index: 1000; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__logo, .nav__links, .nav__toggle {
  background: rgba(244, 243, 238, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hair);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(6, 42, 47, 0.12);
}
.nav__logo { display: block; padding: 10px 18px; }
.nav__logo-full { height: 30px; width: auto; }
.nav__logo-m { display: none; height: 26px; width: auto; }
.nav__links { display: flex; list-style: none; padding: 6px; gap: 2px; }
.nav__links a {
  display: block; padding: 9px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--ink);
  transition: background .25s, color .25s;
}
.nav__links a:hover { background: var(--paper-2); }
.nav__links .nav__cta { background: var(--ink); color: var(--paper); }
.nav__links .nav__cta:hover { background: var(--green); }
.nav__toggle { display: none; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; font-weight: 700; color: var(--ink); }
.nav__toggle-icon, .nav__toggle-icon::before { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .35s var(--ease-out); }
.nav__toggle-icon { position: relative; }
.nav__toggle-icon::before { content: ""; position: absolute; top: 6px; }
.nav__toggle-icon { transform: translateY(-3px); }
.nav.is-open .nav__toggle-icon { transform: rotate(45deg); }
.nav.is-open .nav__toggle-icon::before { transform: translateY(-6px) rotate(-90deg); }

@media (max-width: 960px) {
  .js .nav__toggle { display: inline-flex; }
  .js .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 4px;
    padding: 96px 24px 40px; border-radius: 0; border: 0;
    background: var(--ink);
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: clip-path .7s var(--ease-out);
    visibility: hidden;
  }
  .js .nav.is-open .nav__links { clip-path: polygon(0 0, 130% 0, 100% 100%, 0 100%); visibility: visible; }
  .js .nav__links a {
    color: var(--paper); background: none !important;
    font-family: var(--display); font-weight: 800; font-stretch: 68%;
    text-transform: uppercase; font-size: clamp(2.6rem, 13vw, 4.5rem); line-height: 1;
    padding: 6px 0; border-radius: 0;
  }
  .js .nav__links .nav__cta { color: var(--lime); }
  .no-js .nav { flex-wrap: wrap; }
  .no-js .nav__links { overflow-x: auto; max-width: 100%; }
}
@media (max-width: 520px) {
  .nav__logo { padding: 11px 16px; }
  .nav__logo-full { display: none; }
  .nav__logo-m { display: block; }
}

/* ==========================================
   INICIO
   ========================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(24px, 6vh, 72px)) 0 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(ellipse 55% 55% at 78% 30%, rgba(0, 104, 56, 0.5), transparent 70%),
    radial-gradient(ellipse 50% 45% at 0% 100%, rgba(0, 67, 79, 0.85), transparent 70%),
    var(--ink);
}

/* Grilla de puntos estática que se desvanece hacia los bordes */
.hero__field {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, rgba(244, 243, 238, 0.16) 1px, transparent 1.4px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 70% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 65% at 70% 40%, #000 20%, transparent 75%);
}

/* Esfera de Bloch (qubit): decorativa y estática; solo se dibuja una vez al entrar */
.qubit {
  position: absolute; z-index: -1; pointer-events: none;
  width: clamp(280px, min(38vw, 62vh), 580px); aspect-ratio: 1;
  right: 5vw; top: calc(var(--nav-h) + 1.5vh);
  overflow: visible;
  /* Se desvanece hacia abajo para dejar limpia la zona del texto */
  -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 78%);
          mask-image: linear-gradient(to bottom, #000 42%, transparent 78%);
}
.qubit__line { stroke: var(--paper); stroke-opacity: 0.22; stroke-width: 1; }
.qubit__line--dash { stroke-dasharray: 0.012 0.012; stroke-opacity: 0.16; }
.qubit__arc { stroke: var(--lime); stroke-opacity: 0.6; stroke-width: 1; }
.qubit__vector { stroke: var(--lime); stroke-width: 2; stroke-linecap: round; }
.qubit__state { fill: var(--lime); }
.qubit__glow { fill: var(--lime); opacity: 0.18; filter: blur(6px); }
.qubit__ket { fill: var(--paper); fill-opacity: 0.5; font: 500 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.qubit__ket--psi { fill: var(--lime); fill-opacity: 0.9; }

.hero__grid { display: grid; gap: clamp(20px, 3.5vh, 36px); width: min(1320px, 100% - 32px); }
@media (min-width: 900px) { .hero__grid, .hero__foot { width: min(1320px, 100% - 96px); } }

/* Etiquetas tipo cristal */
.hero__status { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  background: rgba(244, 243, 238, 0.07);
  border: 1px solid var(--hair-inv);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip--ghost { background: none; color: var(--mute-inv); }
.chip__clock { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--paper); }
.chip__pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.motion .chip__pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--lime); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

.hero__title { font-size: clamp(4.4rem, min(22vw, 32vh), 20rem); }
.hero__surname {
  font-size: 0.26em; font-stretch: 90%; letter-spacing: 0.04em;
  color: var(--lime); margin-top: 0.2em; line-height: 1.1;
}
.hero__tagline { font-size: clamp(1.2rem, min(2.1vw, 3.4vh), 1.75rem); font-weight: 600; line-height: 1.3; max-width: 26ch; margin-bottom: 24px; }
.btn span { transition: transform .3s var(--ease-out); }
.btn:hover span { transform: translateX(3px); }
.hero .btn { padding: 13px 18px; font-size: 0.95rem; }

.hero__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin: clamp(28px, 5vh, 56px) auto 0; padding: 16px 0 20px;
  width: min(1320px, 100% - 32px);
  border-top: 1px solid var(--hair-inv);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute-inv);
}
.hero__foot a { text-decoration: none; }
.hero__foot a:hover { color: var(--lime); }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.2fr 1fr; align-items: end; column-gap: 56px; }
  .hero__status { grid-column: 1 / -1; }
  .hero__side { padding-bottom: 0.8rem; }
}
@media (max-width: 899px) {
  .qubit { width: 78vw; right: -22vw; top: calc(var(--nav-h) - 4vh); opacity: 0.6; }
}

/* ==========================================
   SOBRE MÍ
   ========================================== */
.story { padding: clamp(96px, 14vw, 200px) 0 clamp(64px, 8vw, 120px); }
.story__body { display: grid; gap: 24px; margin-top: clamp(40px, 6vw, 80px); }
.story__body .label { color: var(--green); }
.story__aside { display: grid; gap: 20px; align-content: start; }
.ficha { border-top: 1px solid var(--hair); }
.ficha div { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.ficha dd { margin-top: 2px; font-weight: 600; }
.story__lead { font-weight: 700; }
.story__text { display: grid; gap: 1.1em; font-size: clamp(1.2rem, 2.1vw, 1.75rem); line-height: 1.45; font-weight: 500; max-width: 38em; }
@media (min-width: 900px) { .story__body { grid-template-columns: 1fr 2.6fr; } }

/* ==========================================
   PROYECTOS · tarjetas que se apilan
   ========================================== */
.work { padding-bottom: clamp(64px, 10vw, 140px); }
.work__caption { color: var(--green); margin-bottom: 28px; }
.cases { list-style: none; padding: 0; }
.case { position: sticky; top: calc(var(--nav-h) + 12px); }
.case + .case { margin-top: 6vh; }
.case__inner {
  position: relative; overflow: hidden;
  min-height: min(74vh, 620px);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 56px);
  display: grid; grid-template-rows: auto 1fr; gap: 24px;
  transform-origin: 50% 0;
  will-change: transform;
}
.case__num { font-size: clamp(4rem, 12vw, 10rem); opacity: 0.9; }
.case__body { align-self: end; max-width: 46ch; position: relative; z-index: 1; }
.case__body h3 { margin: 10px 0 14px; }
.case__body > p:not(.label) { font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.case__mark {
  position: absolute; right: -4%; bottom: -8%;
  width: clamp(240px, 42vw, 620px); opacity: 0.14; pointer-events: none;
}
.case--0 .case__inner { background: var(--ink); color: var(--paper); }
.case--1 .case__inner { background: var(--brand); color: var(--paper); }
.case--2 .case__inner { background: var(--lime); color: var(--ink); }
.case--3 .case__inner { background: var(--paper-2); color: var(--ink); }
.case--0 .case__mark, .case--1 .case__mark { filter: brightness(0) invert(1); opacity: 0.08; }
.case--0 .case__num { color: var(--lime); }

.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li { font-size: 0.8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid currentColor; opacity: 0.85; }

/* ==========================================
   NOMBRES · marquesinas
   ========================================== */
.names { padding: clamp(56px, 8vw, 100px) 0; overflow: hidden; }
.names .label { margin-bottom: 28px; }
.marquee { overflow: hidden; }
.marquee + .marquee { margin-top: 8px; }
.marquee__track {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5em;
  font-size: clamp(3rem, 9vw, 7.5rem); line-height: 1.02;
}
.marquee__track li { display: inline-flex; align-items: center; gap: 0.5em; white-space: nowrap; }
/* Separador: un trazo inclinado como los del logo */
.marquee__track li::after {
  content: ""; width: 0.14em; height: 0.62em; border-radius: 0.08em;
  background: currentColor; transform: skewX(-24deg);
}
.marquee__track--outline { font-size: clamp(2.2rem, 6vw, 5rem); color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.marquee__track--outline li::after { background: var(--green); }
.motion .marquee__track { flex-wrap: nowrap; width: max-content; animation: marquee 38s linear infinite; }
.motion .marquee--reverse .marquee__track { animation-direction: reverse; animation-duration: 52s; }
.motion .marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-1 * var(--shift, 50%))); } }

/* ==========================================
   SERVICIOS · filas con barrido
   ========================================== */
.services { padding: clamp(96px, 12vw, 180px) 0; }
.rows { list-style: none; padding: 0; margin-top: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--hair-inv); }
.row {
  position: relative; isolation: isolate;
  display: grid; gap: 8px 32px; align-items: baseline;
  padding: clamp(20px, 3vw, 34px) 8px;
  border-top: 1px solid var(--hair-inv);
  transition: color .45s var(--ease-out);
}
.row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--lime); transform: scaleX(0); transform-origin: left;
  transition: transform .55s var(--ease-out);
}
.row:hover { color: var(--ink); }
.row:hover::before { transform: scaleX(1); }
.row__num { color: var(--lime); transition: color .45s; }
.row:hover .row__num { color: var(--green); }
.row__title { font-size: clamp(2rem, 4.6vw, 3.8rem); }
.row__desc { color: var(--mute-inv); max-width: 44ch; transition: color .45s; }
.row:hover .row__desc { color: var(--ink); }
@media (min-width: 900px) { .row { grid-template-columns: 60px 1.2fr 1fr; } }

/* ==========================================
   PROCESO · barrido secuencial
   ========================================== */
.process-section { padding: clamp(96px, 12vw, 180px) 0; }
.process {
  list-style: none; padding: 0; margin-top: clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px;
}
.process__step {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 230px; padding: 24px; border-radius: 20px;
  border: 1px solid var(--hair);
  color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.process__fill { position: absolute; inset: 0; z-index: -1; background: var(--ink); transform-origin: left; }
.process__step:nth-child(3n + 2) .process__fill { background: var(--brand); }
.process__step .label { color: var(--lime); }
.process__step h3 { font-size: clamp(2rem, 3.6vw, 3rem); }
.process__step p { color: var(--mute-inv); }

/* ==========================================
   TRAYECTORIA
   ========================================== */
.journey { padding: clamp(96px, 12vw, 180px) 0; }
.journey__grid { display: grid; gap: 56px; margin-top: clamp(40px, 6vw, 80px); }
@media (min-width: 900px) { .journey__grid { grid-template-columns: 1.4fr 1fr; gap: 80px; } }
.timeline { list-style: none; padding: 0; }
.timeline li { position: relative; padding: 0 0 32px 28px; border-left: 1px solid var(--hair-inv); }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 4px; width: 9px; height: 16px;
  background: var(--lime); border-radius: 3px; transform: skewX(-20deg);
}
.timeline .label { color: var(--lime); }
.timeline h3 { font-size: 1.2rem; margin: 4px 0; }
.timeline p:last-child { color: var(--mute-inv); }
.accent { color: var(--lime); }
.journey__side .label { color: var(--lime); margin: 0 0 12px; }
.journey__side .label ~ .label { margin-top: 40px; }
.plain { padding-left: 1.1em; color: var(--mute-inv); display: grid; gap: 6px; }
.stack { display: grid; gap: 12px; }
.stack dt { font-weight: 700; }
.stack dd { color: var(--mute-inv); }

/* ==========================================
   PREGUNTAS
   ========================================== */
.faq-section { padding: clamp(96px, 12vw, 180px) 0; }
.faq-grid { display: grid; gap: 48px; }
@media (min-width: 1000px) { .faq-grid { grid-template-columns: 1fr 1.4fr; } .faq-grid h2 { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; } }
.faq details { border-bottom: 1px solid var(--hair); }
.faq details:first-child { border-top: 1px solid var(--hair); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 0;
  display: flex; justify-content: space-between; gap: 24px;
  font-weight: 700; font-size: clamp(1.05rem, 1.6vw, 1.3rem);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px; margin-top: 6px;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
              linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  transition: transform .4s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(135deg); color: var(--green); }
.faq details p { padding: 0 0 24px; color: var(--mute); max-width: 62ch; }

/* ==========================================
   CONTACTO
   ========================================== */
.contact { padding: clamp(96px, 12vw, 180px) 0 clamp(64px, 8vw, 120px); background: var(--brand); }
.contact h2 { color: var(--lime); }
.contact .section-sub { color: var(--paper); }
.contact__rows { list-style: none; padding: 0; margin-top: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--hair-inv); }
.contact__row {
  display: grid; grid-template-columns: minmax(84px, 140px) minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--hair-inv);
}
.contact__row .label { color: var(--lime); }
.contact__row a {
  font-size: clamp(1.05rem, 1.9vw, 1.6rem); font-weight: 700; text-decoration: none;
  overflow-wrap: break-word; min-width: 0; transition: color .25s;
}
.contact__row a:hover { color: var(--lime); }
.copy {
  border: 1px solid var(--hair-inv); background: none; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-weight: 700; font-size: 0.85rem;
}
.copy:hover { border-color: var(--lime); color: var(--lime); }

/* Logo 3D en "Hablemos" */
.contact__grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1000px) { .contact__grid { grid-template-columns: 1.15fr 1fr; gap: 56px; } }
.stage { position: relative; aspect-ratio: 1 / 0.8; width: 100%; max-width: 620px; justify-self: center; }
.stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.stage__fallback { position: absolute; left: 50%; top: 50%; width: 62%; transform: translate(-50%, -50%); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.35)); transition: opacity .4s; }
.stage.is-3d .stage__fallback { opacity: 0; }
@media (max-width: 999px) { .stage { max-width: 420px; order: -1; margin-top: -8px; } }

/* Footer con código que cae y se apila */
.footer {
  position: relative; overflow: hidden;
  min-height: clamp(300px, 42vh, 440px);
  padding: 40px 0 0; background: var(--ink); color: var(--mute-inv); font-size: 0.9rem;
}
.footer__inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.code-pile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.footer img { height: 44px; width: auto; }

/* ==========================================
   ASISTENTE MÁX
   ========================================== */
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 900;
  background: var(--ink); color: var(--lime); border: 1.5px solid var(--lime); border-radius: 999px;
  padding: 12px 20px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 30px rgba(6, 42, 47, 0.35);
  transition: background .25s, color .25s;
}
.fab:hover { background: var(--lime); color: var(--ink); }

.chat {
  width: min(420px, 100% - 32px); max-height: min(620px, 100dvh - 32px);
  padding: 0; border: 1px solid var(--hair); border-radius: 22px;
  background: var(--paper); color: var(--ink);
  margin: auto 16px 16px auto; flex-direction: column;
  box-shadow: 0 30px 80px rgba(6, 42, 47, 0.35);
}
.chat[open] { display: flex; }
.chat::backdrop { background: rgba(6, 42, 47, 0.5); }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--brand); color: var(--paper); }
.chat-head h2 { font-size: 1rem; }
.chat-close { background: none; border: 0; color: inherit; font-size: 1.7rem; cursor: pointer; line-height: 1; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.msg p { display: inline-block; padding: 10px 14px; border-radius: 16px; max-width: 90%; font-size: 0.95rem; }
.msg.bot p { background: var(--paper-2); }
.msg.user { text-align: right; }
.msg.user p { background: var(--ink); color: var(--paper); }
.msg.error p { background: #f7d9d9; color: #6b1b1b; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--hair); }
.chat-form input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--hair); background: #fff; color: var(--ink); font: inherit; }
.chat-form button { padding: 10px 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--lime); font-weight: 700; cursor: pointer; }
.chat-form button:disabled { opacity: 0.6; cursor: wait; }
