/* =========================================================
   EDVIS LABORATORY · estilos
   ========================================================= */

/* Propiedades registradas: permiten animar el color de acento (modo rojo) */
@property --accent   { syntax: '<color>'; inherits: true;  initial-value: #2d8cff; }
@property --accent-2 { syntax: '<color>'; inherits: true;  initial-value: #62d0ff; }
@property --accent-3 { syntax: '<color>'; inherits: true;  initial-value: #1646ff; }
@property --angle    { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --bg: #03060d;
  --bg-2: #070c18;
  --surface: rgba(12, 20, 38, .55);
  --surface-2: rgba(16, 27, 50, .7);
  --line: rgba(120, 165, 255, .11);
  --line-2: rgba(120, 165, 255, .2);
  --text: #eaf1ff;
  --muted: #8d9dbb;
  --dim: #5b6b8a;
  --red: #ff2d4a;

  --accent: #2d8cff;
  --accent-2: #62d0ff;
  --accent-3: #1646ff;

  --radius: 20px;
  --container: 1200px;
  --nav-h: 76px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font-display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --font-body: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  color-scheme: dark;
  transition: --accent .9s var(--ease), --accent-2 .9s var(--ease), --accent-3 .9s var(--ease);
}

/* Tonos derivados del acento (se recalculan en cada ámbito que redefine el acento) */
:root {
  --a-08: color-mix(in srgb, var(--accent) 8%, transparent);
  --a-15: color-mix(in srgb, var(--accent) 15%, transparent);
  --a-25: color-mix(in srgb, var(--accent) 25%, transparent);
  --a-40: color-mix(in srgb, var(--accent) 40%, transparent);
  --a-60: color-mix(in srgb, var(--accent) 60%, transparent);
  --a2-40: color-mix(in srgb, var(--accent-2) 40%, transparent);
}

/* Modo rojo: el color favorito */
:root[data-accent="red"] {
  --accent: #ff2d4a;
  --accent-2: #ff8a6b;
  --accent-3: #c40d2e;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) - 8px);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { overflow-wrap: break-word; }
strong { font-weight: 600; color: var(--text); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container { width: min(100% - 64px, var(--container)); }
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip-link:focus { transform: none; }

.t-red { color: #ff4d64; }
.t-blue { color: var(--accent-2); }

.grad {
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 60%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pulse-dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-2);
  animation: ping 2s var(--ease) infinite;
}

/* ---------- Capas de ambiente ---------- */
/* Capa fija propia (en vez de background-attachment: fixed) para no repintar al hacer scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 80% -10%, var(--a-15), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 30%, var(--a-08), transparent 60%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 80%);
  opacity: .45;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  z-index: -1;
  width: 560px; height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a-15), transparent 62%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
  will-change: transform;
}
.cursor-glow.is-active { opacity: 1; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #081328, var(--bg) 65%);
  transition: opacity .8s var(--ease), visibility .8s;
}
.js .preloader {
  display: grid;
  /* Red de seguridad: si JS falla, el preloader desaparece solo */
  animation: preloaderFailsafe .6s 6s forwards;
}
.preloader.is-done { opacity: 0; visibility: hidden; }

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(300px, 80vw);
}

.preloader__flask {
  width: 110px;
  height: auto;
  filter: drop-shadow(0 0 18px var(--a-60));
}

.pl-glass {
  fill: none;
  stroke: #e3f1ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pl-stop-1 { stop-color: var(--accent-2); }
.pl-stop-2 { stop-color: var(--accent-3); }
.pl-liquid { transform: translateY(calc(106px - var(--fill, 0) * 64px)); }
.pl-wave { animation: wave 1.3s linear infinite; }
.pl-bubble { fill: rgba(255, 255, 255, .55); animation: bubble 1.8s ease-in infinite; }
.pl-bubble.b2 { animation-delay: .6s; animation-duration: 2.2s; }
.pl-bubble.b3 { animation-delay: 1.1s; animation-duration: 1.6s; }

.preloader__brand {
  margin: 26px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .14em;
  line-height: 1;
  margin-right: -.14em;
}
.preloader__brand span {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: .62em;
  margin-right: -.62em;
  color: var(--muted);
}

.preloader__status {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.preloader__status span:last-child { color: var(--accent-2); }

.preloader__bar {
  width: 100%;
  height: 2px;
  margin-top: 10px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px var(--accent-2);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .4s, border-color .4s, transform .5s var(--ease), backdrop-filter .4s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand__logo {
  width: 36px; height: 36px;
  color: var(--accent-2);
  filter: drop-shadow(0 0 8px var(--a-60));
  transition: transform .5s var(--ease);
}
.brand:hover .brand__logo { transform: rotate(-12deg) scale(1.06); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: .14em;
}
.brand__text small {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: .5em;
  color: var(--muted);
}

.nav__links { display: none; margin-left: auto; gap: 2px; }
.nav__links a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--muted);
  border-radius: 999px;
  transition: color .3s, background .3s;
}
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav__links a.is-active { color: var(--text); }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  transform: translateX(-50%) scale(0);
  transition: transform .35s var(--ease);
}
.nav__links a.is-active::after { transform: translateX(-50%) scale(1); }

.nav .nav__cta { display: none; }

.nav__toggle {
  margin-left: auto;
  width: 46px; height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .02);
  display: grid;
  place-content: center;
  gap: 6px;
}
.nav__toggle span {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .4s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (min-width: 1024px) {
  .nav__links { display: flex; }
  .nav .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}

/* Menú móvil */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: calc(var(--nav-h) + 24px) 24px 40px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s var(--ease), visibility .45s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu__links { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu__links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 600;
  letter-spacing: -.02em;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s;
}
.mobile-menu__links a:hover { color: var(--accent-2); }
.mobile-menu__links span { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--accent-2); }
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: .05s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: .1s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(4) { transition-delay: .15s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(5) { transition-delay: .2s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(6) { transition-delay: .25s; }
.mobile-menu__cta { align-self: flex-start; }
@media (min-width: 1024px) { .mobile-menu { display: none; } }

/* ---------- Botones ---------- */
.btn {
  --bh: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--bh);
  padding: 0 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s, background .35s, border-color .35s, color .35s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--sm { --bh: 42px; padding: 0 18px; font-size: 14px; }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 45%, var(--accent-3));
  box-shadow: 0 12px 34px -12px var(--a-60), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease);
}
.btn--primary:hover { box-shadow: 0 16px 44px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn--primary:hover::before { transform: translateX(120%); }

.btn--ghost {
  border: 1px solid var(--line-2);
  background: rgba(8, 14, 28, .6);
}
.btn--ghost:hover { border-color: var(--a-60); background: var(--a-08); }

.magnetic { transition: transform .4s var(--ease), box-shadow .35s, background .35s, border-color .35s; }

/* ---------- Animaciones de entrada ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--rd, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 40px) 0 110px;
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 10%; right: -10%;
  width: 60vw; height: 60vw;
  max-width: 800px; max-height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a-25), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: 64px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 1.12fr .88fr; gap: 48px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}

.hero__title {
  margin: 30px 0 0;
  font-weight: 400;
  line-height: 1;
}
.hero__edvis {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(58px, 10.5vw, 136px);
  letter-spacing: .04em;
  background: linear-gradient(100deg, #6c7c98 0%, #f4f8ff 20%, #9db1d0 36%, #ffffff 50%, #7a8cab 64%, #e8efff 80%, #7f92b2 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px var(--a-40)) drop-shadow(0 3px 0 rgba(0, 0, 0, .5));
  animation: chrome 8s linear infinite;
}
.hero__edvis::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent-2);
  filter: blur(5px);
  opacity: .55;
  pointer-events: none;
}
.hero__lab {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.55vw, 19px);
  letter-spacing: .62em;
  color: #dce7ff;
}
.hero__lab i {
  flex: 0 0 clamp(24px, 4vw, 48px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2));
  box-shadow: 0 0 10px var(--accent);
}
.hero__lab i:last-child { background: linear-gradient(90deg, var(--accent-2), transparent); margin-left: -.62em; }

.hero__typed {
  margin: 34px 0 0;
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 300;
  color: var(--text);
  min-height: 1.5em;
}
@media (max-width: 560px) { .hero__typed { min-height: 3em; } }
.typed { font-weight: 600; color: var(--accent-2); text-shadow: 0 0 24px var(--a-60); }
.caret {
  display: inline-block;
  width: 3px; height: 1.05em;
  margin-left: 4px;
  vertical-align: -.15em;
  border-radius: 2px;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: caret 1s steps(2) infinite;
}

.hero__lead {
  max-width: 54ch;
  margin: 18px 0 0;
  font-size: clamp(15.5px, 1.3vw, 17.5px);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero__words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero__words li { display: flex; align-items: center; gap: 16px; }
.hero__words li + li::before {
  content: "";
  flex: none;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Retrato */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1200px;
}
.portrait {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  transition: transform .7s var(--ease);
  will-change: transform;
}
.portrait__halo {
  position: absolute;
  inset: 8% -6% -4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a-40), transparent 65%);
  filter: blur(40px);
  transform: translateZ(-60px);
  animation: breathe 6s ease-in-out infinite;
}
.portrait__frame {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #050a14;
  box-shadow: 0 40px 90px -25px rgba(0, 0, 0, .9), 0 0 70px -20px var(--a-60);
}
.portrait__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.04);
}
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 55%, rgba(3, 6, 13, .85)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.portrait__scan {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 2;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--a-25) 85%, var(--accent-2) 100%);
  opacity: .35;
  mix-blend-mode: screen;
  animation: scan 5.5s cubic-bezier(.6, 0, .4, 1) infinite;
}
.portrait__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .16), transparent 45%);
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}
.portrait:hover .portrait__glare { opacity: 1; }

.portrait__border {
  position: absolute;
  inset: -1px;
  border-radius: 29px;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), var(--a-25) 0%, var(--accent-2) 12%, var(--a-25) 26%, var(--a-25) 50%, var(--accent) 62%, var(--a-25) 76%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: angle 7s linear infinite;
  pointer-events: none;
}

.hud {
  position: absolute;
  width: 22px; height: 22px;
  border: 0 solid var(--accent-2);
  filter: drop-shadow(0 0 6px var(--accent));
  pointer-events: none;
  z-index: 4;
}
.hud--tl { top: -12px; left: -12px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 6px; }
.hud--tr { top: -12px; right: -12px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 6px; }
.hud--bl { bottom: -12px; left: -12px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 6px; }
.hud--br { bottom: -12px; right: -12px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 6px; }

.float-chip {
  position: absolute;
  z-index: 5;
  transform: translateZ(70px);
}
.float-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg-2) 90%, transparent);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8), 0 0 24px -10px var(--a-60);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
  animation: floatY 5s ease-in-out infinite;
}
.float-chip svg { width: 16px; height: 16px; color: var(--accent-2); }
.float-chip--1 { top: 9%; left: -6px; }
.float-chip--2 { top: 44%; right: -6px; }
.float-chip--2 span { animation-delay: -1.8s; }
.float-chip--3 { bottom: 25%; left: -6px; }
.float-chip--3 span { animation-delay: -3.2s; }

@media (min-width: 640px) {
  .float-chip--1 { left: -12%; }
  .float-chip--2 { right: -12%; }
  .float-chip--3 { left: -9%; }
}

.portrait__badge {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transform: translateX(-50%) translateZ(40px);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  color: var(--dim);
  transition: color .3s;
}
.scroll-cue:hover { color: var(--accent-2); }
.scroll-cue__mouse {
  width: 24px; height: 38px;
  border: 1.5px solid currentColor;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.scroll-cue__mouse span {
  width: 3px; height: 8px;
  border-radius: 2px;
  background: var(--accent-2);
  animation: wheel 1.8s var(--ease) infinite;
}
.scroll-cue__text { font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; }
@media (min-width: 1024px) and (min-height: 760px) { .scroll-cue { display: flex; } }

/* ---------- MARQUEE ---------- */
.marquee {
  position: relative;
  z-index: 2;
  width: 110%;
  margin-left: -5%;
  padding: 22px 0;
  border-block: 1px solid var(--line-2);
  background: linear-gradient(90deg, var(--bg), #081229 50%, var(--bg));
  transform: rotate(-2deg);
  overflow: hidden;
  box-shadow: 0 0 60px -20px var(--a-40);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group span:nth-of-type(odd) { color: transparent; -webkit-text-stroke: 1px var(--accent-2); }
.marquee__group svg { width: 28px; height: 28px; color: var(--accent); flex: none; }

/* ---------- Secciones ---------- */
.section {
  position: relative;
  padding: clamp(96px, 12vw, 160px) 0;
}
.section__head {
  max-width: 780px;
  margin-bottom: clamp(48px, 6vw, 76px);
}
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .section__eyebrow { justify-content: center; }
.section__head--center .section__sub { margin-inline: auto; }

.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.section__eyebrow::before {
  content: "";
  width: 30px; height: 1px;
  flex: none;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}
.section__title {
  margin: 0;
  font-size: clamp(32px, 4.7vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.section__sub {
  max-width: 62ch;
  margin: 20px 0 0;
  font-size: clamp(15.5px, 1.35vw, 18px);
  color: var(--muted);
}

/* Efecto foco que sigue al ratón (tarjetas) */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before,
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}
.spotlight::before {
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--a-15), transparent 45%);
}
.spotlight::after {
  z-index: 2;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--accent-2), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.spotlight:hover::before,
.spotlight:hover::after { opacity: 1; }

/* ---------- SOBRE MÍ ---------- */
.about__grid { display: grid; gap: 56px; }
@media (min-width: 1024px) {
  .about__grid { grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
  .about__media { position: sticky; top: calc(var(--nav-h) + 24px); }
}

.about__media { perspective: 1200px; }
.about__photo {
  position: relative;
  margin: 0;
  aspect-ratio: 1374 / 1145;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), 0 0 60px -30px var(--a-60);
  transition: transform .7s var(--ease);
  transform-style: preserve-3d;
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 60%, rgba(3, 6, 13, .8)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.about__photo figcaption {
  position: absolute;
  left: 18px; bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: #cfe0ff;
}
.about__photo .hud--tl { top: 14px; left: 14px; }
.about__photo .hud--br { bottom: 14px; right: 14px; }
.rec {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff3b55;
  box-shadow: 0 0 10px #ff3b55;
  animation: blink 1.4s steps(2) infinite;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  color: var(--text);
  text-shadow: 0 0 22px var(--a-60);
}
.stat__label { font-size: 12.5px; color: var(--muted); }

.about__text .lead {
  margin: 0 0 22px;
  font-size: clamp(19px, 1.75vw, 23px);
  line-height: 1.5;
  color: var(--text);
}
.about__text > p { margin: 0 0 18px; color: var(--muted); }

.color-card {
  position: relative;
  margin-top: 34px;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 45, 74, .12), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(45, 140, 255, .14), transparent 55%),
    var(--surface);
  overflow: hidden;
}
.color-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff2d4a, #b04dff 50%, #2d8cff);
}
.color-card__file { margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.color-card__text { margin: 0; color: var(--muted); }
.color-card__text em { display: block; margin-top: 12px; font-style: normal; font-weight: 500; color: var(--text); }

.swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  text-align: left;
  transition: border-color .35s, background .35s, transform .35s var(--ease);
}
.swatch:hover { transform: translateY(-2px); }
.swatch__color { flex: none; width: 42px; height: 42px; border-radius: 12px; transition: box-shadow .35s; }
.swatch--red .swatch__color { background: radial-gradient(circle at 30% 25%, #ff8a98, #ff2d4a 50%, #7a0014); box-shadow: 0 0 18px rgba(255, 45, 74, .45); }
.swatch--blue .swatch__color { background: radial-gradient(circle at 30% 25%, #a8e6ff, #2d8cff 50%, #0a237a); box-shadow: 0 0 18px rgba(45, 140, 255, .45); }
.swatch__label { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.swatch__label strong { font-size: 15px; }
.swatch__label small { font-size: 12px; color: var(--muted); }
.swatch--red[aria-pressed="true"] { border-color: rgba(255, 45, 74, .7); background: rgba(255, 45, 74, .08); }
.swatch--red[aria-pressed="true"] .swatch__color { box-shadow: 0 0 28px rgba(255, 45, 74, .8); }
.swatch--blue[aria-pressed="true"] { border-color: rgba(45, 140, 255, .7); background: rgba(45, 140, 255, .08); }
.swatch--blue[aria-pressed="true"] .swatch__color { box-shadow: 0 0 28px rgba(45, 140, 255, .8); }
.color-card__hint { margin: 14px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }

.spec {
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.spec > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.spec dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
.spec dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}
.spec__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.spec__swatch--red { background: #ff2d4a; box-shadow: 0 0 8px #ff2d4a; }
.spec__swatch--blue { background: #2d8cff; box-shadow: 0 0 8px #2d8cff; }

/* ---------- PROYECTOS ---------- */
.projects__grid { display: grid; gap: 20px; }
@media (min-width: 768px) {
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
}

.project {
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  overflow: hidden;
  transition: border-color .45s, translate .6s var(--ease), box-shadow .45s;
}
.project:hover {
  translate: 0 -6px;
  border-color: var(--a-40);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 50px -25px var(--a-60);
}

.project__visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 250px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 60%, var(--a-15), transparent 65%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    #040913;
}

.project__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
}
.project__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tag {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--a-40);
  background: var(--a-08);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: blink 1.8s ease-in-out infinite;
}
.project h3 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.project p { margin: 0; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding: 6px 0 0; list-style: none; }
.tags li {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.project__index {
  position: absolute;
  top: 16px; right: 18px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

/* Web y apps */
.vis-web { perspective: 900px; }
.vis-web > * { grid-area: 1 / 1; }
.mock-browser {
  width: 76%;
  max-width: 280px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #060c18;
  overflow: hidden;
  transform: rotateY(-14deg) rotateX(8deg);
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .8), 0 0 40px -12px var(--a-60);
  transition: transform .7s var(--ease);
}
.project:hover .mock-browser { transform: rotateY(-4deg) rotateX(2deg); }
.mock-browser__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.mock-browser__bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.mock-browser__bar span {
  flex: 1;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dim);
}
.mock-browser__body { display: grid; gap: 10px; padding: 12px; }
.mock-hero {
  position: relative;
  height: 46px;
  border-radius: 6px;
  background: linear-gradient(110deg, var(--a-60), var(--a-15));
  overflow: hidden;
}
.mock-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}
.mock-lines { display: grid; gap: 6px; }
.mock-lines span {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  transform-origin: left;
  animation: lineGrow 4s var(--ease) infinite;
}
.mock-lines span:nth-child(1) { width: 92%; }
.mock-lines span:nth-child(2) { width: 74%; animation-delay: .2s; }
.mock-lines span:nth-child(3) { width: 52%; animation-delay: .4s; }
.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mock-cards span { height: 32px; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.mock-cards span:nth-child(2) { border-color: var(--a-40); background: var(--a-08); }
.mock-phone {
  justify-self: end;
  align-self: end;
  width: 66px; height: 120px;
  margin: 0 10% 18px 0;
  padding: 14px 7px 7px;
  display: grid;
  gap: 5px;
  align-content: start;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: #050a14;
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, .8), 0 0 24px -8px var(--a-60);
  animation: floatY 5s ease-in-out infinite;
}
.mock-phone span { height: 13px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
.mock-phone span:first-child { height: 30px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.mock-code {
  justify-self: start;
  align-self: start;
  margin: 22px 0 0 10%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--a-40);
  background: var(--a-15);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-2);
  animation: floatY 6s ease-in-out -2s infinite;
}

/* Placa electrónica */
.vis-pcb { width: 86%; max-width: 300px; height: auto; transition: transform .6s var(--ease); }
.project:hover .vis-pcb { transform: scale(1.05); }
.pcb-board { fill: #081427; stroke: var(--a-60); stroke-width: 1; }
.pcb-usb { fill: #1a2740; stroke: rgba(255, 255, 255, .2); }
.pcb-pins rect { fill: #0c1930; stroke: var(--a-40); }
.pcb-traces path { fill: none; stroke: var(--a-25); stroke-width: 2; stroke-linejoin: round; }
.pcb-pulses path {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 10 140;
  animation: dash 2.8s linear infinite;
}
.pcb-pulses path:nth-child(2) { animation-delay: -.5s; }
.pcb-pulses path:nth-child(3) { animation-delay: -1.1s; }
.pcb-pulses path:nth-child(4) { animation-delay: -1.7s; }
.pcb-pulses path:nth-child(5) { animation-delay: -2.2s; }
.pcb-pulses path:nth-child(6) { animation-delay: -.9s; }
.pcb-chip { fill: #03070f; stroke: var(--a-40); }
.pcb-chip-pins path { stroke: #9fb3d1; stroke-width: 1.5; }
.pcb-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 1.5px; fill: var(--accent-2); }
.pcb-led { fill: var(--accent-2); animation: blink 1.6s steps(2) infinite; }
.pcb-led--2 { fill: #ff4d64; animation-delay: .8s; }
.pcb-hole { fill: #03070f; stroke: rgba(255, 255, 255, .15); }

/* ---------- SERVICIOS ---------- */
.services__grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .services__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services__grid { grid-template-columns: repeat(3, 1fr); } }

.service {
  padding: 32px 28px 30px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .45s, translate .6s var(--ease);
}
.service:hover { translate: 0 -5px; border-color: var(--a-40); }
.service__num {
  position: absolute;
  top: 26px; right: 26px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--dim);
}
.service__icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 24px;
  border-radius: 16px;
  border: 1px solid var(--a-25);
  background: linear-gradient(145deg, var(--a-25), var(--a-08));
  color: var(--accent-2);
  box-shadow: 0 0 30px -10px var(--a-60);
  transition: transform .5s var(--ease), box-shadow .5s;
}
.service__icon svg { width: 25px; height: 25px; }
.service:hover .service__icon { transform: translateY(-3px) rotate(-6deg); box-shadow: 0 0 40px -6px var(--accent); }
.service h3 { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.service p { margin: 0; font-size: 15px; color: var(--muted); }

.stack { margin-top: 80px; }
.stack__label {
  margin: 0 0 22px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.stack__row {
  overflow: hidden;
  padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.stack__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.stack__row--reverse .stack__track { animation-direction: reverse; }
.stack__row:hover .stack__track { animation-play-state: paused; }
.stack__list { display: flex; gap: 12px; margin: 0; padding: 0 12px 0 0; list-style: none; }
.stack__list li {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .3s, border-color .3s, background .3s;
}
.stack__list li:hover { color: var(--text); border-color: var(--accent); background: var(--a-15); }

/* ---------- MÉTODO ---------- */
.process__wrap { position: relative; }
.process__line {
  position: absolute;
  z-index: 0;
  border-radius: 2px;
  background: var(--line-2);
}
.process__line span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 14px var(--accent);
  transform-origin: left top;
  transform: scale(0, 1);
}
.process__line[data-orient="v"] span { background: linear-gradient(180deg, var(--accent-2), var(--accent)); transform: scale(1, 0); }

.process__steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 44px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) { .process__steps { grid-template-columns: repeat(4, 1fr); gap: 28px; } }

.step { position: relative; min-height: 72px; padding-left: 96px; }
@media (min-width: 900px) { .step { padding: 104px 0 0; } }
.step__node {
  position: absolute;
  top: 0; left: 0;
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--muted);
  transition: color .6s, border-color .6s, box-shadow .6s, background .6s;
}
.step__node::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed var(--a-60);
  opacity: 0;
  transition: opacity .6s;
  animation: spin 14s linear infinite;
}
.step.is-active .step__node {
  color: #fff;
  border-color: var(--accent);
  background: radial-gradient(circle at 50% 30%, var(--a-40), var(--bg-2) 72%);
  box-shadow: 0 0 34px var(--a-40);
}
.step.is-active .step__node::after { opacity: 1; }
.step__word {
  margin: 16px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: color .6s, text-shadow .6s;
}
@media (min-width: 900px) { .step__word { margin-top: 0; } }
.step.is-active .step__word { color: var(--accent-2); text-shadow: 0 0 20px var(--a-60); }
.step p { max-width: 34ch; margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- TERMINAL ---------- */
.terminal {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: rgba(3, 7, 15, .94);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .95), 0 0 80px -40px var(--a-60);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
  transition: border-color .4s, box-shadow .4s;
}
.terminal:focus-within { border-color: var(--a-60); box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .95), 0 0 90px -30px var(--accent); }
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}
.terminal__dots { display: flex; gap: 7px; }
.terminal__dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.terminal__dots i:nth-child(2) { background: #febc2e; }
.terminal__dots i:nth-child(3) { background: #28c840; }
.terminal__title { flex: 1; text-align: center; font-size: 12.5px; color: var(--dim); }
.terminal__tag {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}
.terminal__body {
  height: 380px;
  padding: 18px 20px 20px;
  overflow-y: auto;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
@media (max-width: 600px) { .terminal__body { height: 340px; padding: 14px; } .terminal { font-size: 12.5px; } }

.term-line { margin: 0; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: #c9d6ee; }
.term-line--cmd { margin-top: 10px; color: var(--text); }
.term-line--cmd .t-prompt { color: var(--accent-2); }
.t-dim { color: var(--dim); }
.t-accent { color: var(--accent-2); }
.t-ok { color: #4de8a8; }
.t-err { color: #ff6b81; }
.t-warn { color: #ffc861; }
.t-link { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.t-link:hover { color: #fff; }

.terminal__line { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.terminal__prompt { flex: none; color: var(--accent-2); white-space: nowrap; }
@media (max-width: 480px) { .prompt-long { display: none; } }
.terminal__line input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: max(16px, 1em); /* evita el zoom automático en iOS */
  caret-color: var(--accent-2);
}
@media (min-width: 601px) { .terminal__line input { font-size: inherit; } }
.terminal__line input:focus-visible { outline: none; }

.terminal__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 920px;
  margin: 22px auto 0;
}
.chip-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .02);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.chip-btn:hover { color: var(--text); border-color: var(--accent); background: var(--a-15); transform: translateY(-2px); }
.chip-btn--red:hover { border-color: #ff2d4a; background: rgba(255, 45, 74, .15); }

/* ---------- CONTACTO ---------- */
.contact__card {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 5.5vw, 72px);
  border-radius: 34px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse at 0% 0%, var(--a-25), transparent 50%),
    radial-gradient(ellipse at 100% 100%, var(--a-15), transparent 50%),
    linear-gradient(180deg, rgba(12, 20, 38, .85), rgba(4, 8, 17, .95));
  overflow: hidden;
}
.contact__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 50%, #000, transparent 70%);
}
.contact__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), transparent 0%, var(--accent-2) 10%, transparent 22%, transparent 50%, var(--accent) 60%, transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: angle 9s linear infinite;
  pointer-events: none;
}

.contact__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) { .contact__grid { grid-template-columns: 1.3fr .7fr; gap: 56px; } }

.ig-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  margin-top: 34px;
  padding: 12px 24px 12px 12px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, var(--accent-3));
  color: #fff;
  box-shadow: 0 22px 50px -18px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.ig-cta:hover { box-shadow: 0 26px 60px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.ig-cta__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px; height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .22);
}
.ig-cta__icon svg { width: 26px; height: 26px; }
.ig-cta__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ig-cta__text small { font-size: 12.5px; opacity: .85; }
.ig-cta__text strong { color: #fff; font-family: var(--font-display); font-size: clamp(17px, 2vw, 21px); font-weight: 400; letter-spacing: .04em; }
.ig-cta__arrow { width: 22px; height: 22px; flex: none; margin-left: 6px; transition: transform .35s var(--ease); }
.ig-cta:hover .ig-cta__arrow { transform: translateX(5px); }

.contact__points { display: grid; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--muted); }
.contact__points li { display: flex; align-items: center; gap: 10px; }
.contact__points svg { width: 18px; height: 18px; flex: none; color: var(--accent-2); }

/* Móvil con chat de Instagram */
.contact__visual { display: flex; justify-content: center; perspective: 1000px; }
.phone {
  width: min(100%, 270px);
  aspect-ratio: 9 / 18.5;
  padding: 10px;
  border-radius: 46px;
  border: 1px solid var(--line-2);
  background: linear-gradient(145deg, #1b2438, #070b14);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .95), 0 0 70px -20px var(--a-60), inset 0 0 0 1px rgba(255, 255, 255, .04);
  transform: rotateY(-10deg) rotateX(4deg);
  transition: transform .8s var(--ease);
}
.phone:hover { transform: none; }
.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 37px;
  background: #050912;
  overflow: hidden;
}
.phone__notch {
  position: absolute;
  top: 10px; left: 50%;
  width: 84px; height: 24px;
  border-radius: 20px;
  background: #000;
  transform: translateX(-50%);
}
.phone__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 46px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.phone__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
}
.phone__avatar svg { width: 100%; height: 100%; padding: 5px; border-radius: 50%; background: #050912; color: var(--accent-2); }
.phone__user { display: flex; flex-direction: column; line-height: 1.2; }
.phone__user strong { font-size: 13.5px; }
.phone__user small { font-size: 11px; color: #4de8a8; }
.phone__chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 12px;
  overflow: hidden;
}
.msg {
  max-width: 82%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 12.5px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px) scale(.94);
}
.msg--in { align-self: flex-start; border-bottom-left-radius: 6px; background: #182134; }
.msg--out { align-self: flex-end; border-bottom-right-radius: 6px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 11px 14px;
  border-radius: 18px;
  background: #182134;
  opacity: 0;
}
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.phone.is-playing .msg,
.phone.is-playing .typing { animation: msgIn .6s var(--ease) forwards; }
.phone.is-playing .m1 { animation-delay: .3s; }
.phone.is-playing .m2 { animation-delay: 1.5s; }
.phone.is-playing .m3 { animation-delay: 2.8s; }
.phone.is-playing .m4 { animation-delay: 4.1s; }
.phone.is-playing .m5 { animation-delay: 5.4s; }
.phone__input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px 16px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--dim);
}
.phone__input svg { width: 16px; height: 16px; color: var(--accent-2); }

/* ---------- FOOTER ---------- */
.footer {
  position: relative;
  padding: 64px 0 28px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.footer__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 32px; }
.footer__brand p { margin: 14px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--dim); letter-spacing: .06em; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; color: var(--muted); }
.footer__nav a { transition: color .3s; }
.footer__nav a:hover { color: var(--accent-2); }
.footer__social {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  transition: border-color .3s, background .3s, color .3s, transform .35s var(--ease);
}
.footer__social svg { width: 22px; height: 22px; }
.footer__social:hover { color: var(--accent-2); border-color: var(--accent); background: var(--a-15); transform: translateY(-3px); }

.footer__big {
  margin: 48px 0 0;
  font-family: var(--font-display);
  font-size: clamp(64px, 19vw, 260px);
  line-height: .9;
  letter-spacing: .06em;
  text-align: center;
  user-select: none;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  background: radial-gradient(260px circle at var(--fx, 50%) var(--fy, 50%), var(--accent-2), transparent 70%);
  -webkit-background-clip: text;
  background-clip: text;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}
.footer__bottom p { margin: 0; }

/* ---------- Volver arriba ---------- */
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .4s, visibility .4s, transform .4s var(--ease), color .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent-2); }
.to-top__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top__track { fill: none; stroke: var(--line-2); stroke-width: 2; }
.to-top__fill {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
}
.to-top__icon { width: 18px; height: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  z-index: 70;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid var(--a-40);
  background: rgba(8, 13, 26, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px -12px var(--a-60);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { padding: 0; border: 0; }

/* ---------- Keyframes ---------- */
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes chrome { to { background-position: -220% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes angle { to { --angle: 360deg; } }
@keyframes scan { 0% { transform: translateY(-130px); } 100% { transform: translateY(640px); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { opacity: .7; transform: translateZ(-60px) scale(1); } 50% { opacity: 1; transform: translateZ(-60px) scale(1.06); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes wave { to { transform: translateX(-50px); } }
@keyframes bubble { 0% { transform: translateY(40px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(12px); opacity: 0; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes lineGrow { 0% { transform: scaleX(0); } 30%, 80% { transform: scaleX(1); } 100% { transform: scaleX(0); opacity: 0; } }
@keyframes dash { from { stroke-dashoffset: 150; } to { stroke-dashoffset: 0; } }
@keyframes msgIn { to { opacity: 1; transform: none; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes preloaderFailsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { transform: none; }
  .marquee__track, .stack__track { animation: none; }
  .portrait__scan { display: none; }
}
