/* =========================================================
   SERVICIOS CLICK — Rediseño futurista
   Animaciones: CSS Scroll-Driven Animations
   ========================================================= */

@property --n   { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --ang { syntax: "<angle>";   inherits: false; initial-value: 0deg; }

:root {
  /* Colores del sitio original */
  --mint: #0cd5ad;
  --mint-d: #09a586;
  --mint-dd: #07745f;
  --orange: #f58220;
  --gray: #5a5c5b;
  /* Colores del logo */
  --red: #E52421;
  --green: #3FB549;
  --blue: #29A9E1;
  --yellow: #FFD500;

  --bg: #04070a;
  --bg-2: #0a1114;
  --surface: rgba(255, 255, 255, .04);
  --border: rgba(12, 213, 173, .18);
  --text: #eefcf8;
  --muted: #8aa39d;

  --grad: linear-gradient(100deg, var(--mint) 0%, var(--blue) 55%, #7d6bff 100%);
  --grad-warm: linear-gradient(100deg, var(--orange), var(--yellow));
  --glow: 0 0 40px rgba(12, 213, 173, .35);

  --display: "Poppins", system-ui, sans-serif;
  --body: "Open Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; font-family: var(--body); background: var(--bg); color: var(--text);
  line-height: 1.65; overflow-x: clip; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--mint); color: var(--bg); }
h1, h2, h3 { font-family: var(--display); }

.container { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--mint); margin: 0 0 1rem; }
.h-xl  { font-size: clamp(2.1rem, 5vw, 4.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -.035em; margin: 0 0 1.5rem; }
.h-xxl { font-size: clamp(3rem, 11vw, 10rem); line-height: .9; font-weight: 900; letter-spacing: -.05em; margin: 0 0 3rem; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); margin: 0 0 1.6rem; color: #cfe3de; }
.punch { font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; margin: 0 0 2rem; }
.punch em { font-style: normal; background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 1rem 1.7rem; border-radius: 14px; border: 0;
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  transition: transform .3s, box-shadow .3s, background .3s;
}
.btn-primary { background: var(--mint); color: #02130f; box-shadow: var(--glow), inset 0 -3px 0 var(--mint-d); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 60px rgba(12,213,173,.6), inset 0 -3px 0 var(--mint-d); }
.btn-ghost { border: 1.5px solid var(--mint); color: var(--mint); background: rgba(12,213,173,.05); }
.btn-ghost:hover { background: var(--mint); color: #02130f; }

/* ---------- Fondo ---------- */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50vmax 40vmax at 0% 0%, rgba(12,213,173,.12), transparent 70%),
    radial-gradient(45vmax 40vmax at 100% 100%, rgba(41,169,225,.12), transparent 70%),
    radial-gradient(30vmax 30vmax at 90% 10%, rgba(245,130,32,.07), transparent 70%);
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 380px; height: 380px; margin: -190px 0 0 -190px; z-index: 0;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(12,213,173,.1), transparent 60%);
  transform: translate(var(--mx, -999px), var(--my, -999px)); transition: transform .15s linear;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Progreso ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--red), var(--green), var(--blue), var(--yellow));
}

/* =========================================================
   NAV + MARCA
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem var(--gutter); border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark { width: 46px; height: 46px; filter: drop-shadow(0 0 10px rgba(12,213,173,.25)); transition: transform .5s; }
.brand:hover .brand-mark { transform: rotate(90deg); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: .95; letter-spacing: -.02em; display: inline-block; white-space: nowrap; }
.wordmark span { display: block; padding-left: .9em; }
.wordmark b, .big-word b { color: var(--blue); font-weight: inherit; }
.nav-links { display: flex; gap: .3rem; align-items: center; }
.nav-links a { font-family: var(--display); font-weight: 600; font-size: .9rem; padding: .55rem 1rem; border-radius: 10px; color: rgba(238,252,248,.78); transition: all .25s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-links .nav-cta { border: 1.5px solid var(--mint); color: var(--mint); }
.nav-links .nav-cta:hover { background: var(--mint); color: #02130f; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: #fff; transition: transform .3s, top .3s; }
.nav-toggle span:first-child { top: 17px; } .nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }
@media (max-width: 820px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 1rem;
    background: rgba(4,7,10,.96); backdrop-filter: blur(20px);
    clip-path: circle(0 at calc(100% - 40px) 40px); transition: clip-path .6s cubic-bezier(.7,0,.2,1);
  }
  .nav-links.open { clip-path: circle(150% at calc(100% - 40px) 40px); }
  .nav-links a { font-size: 1.6rem; }
  .brand-mark { width: 38px; height: 38px; }
  .wordmark { font-size: 1rem; }
}

/* =========================================================
   HERO — ensamblaje del logo
   ========================================================= */
.hero { height: 320vh; position: relative; view-timeline: --hero block; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.stage-bg { position: absolute; inset: 0; z-index: -3; }
.stage-bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.28) contrast(1.2); }
.stage-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(12,213,173,.12), var(--bg) 72%), linear-gradient(transparent 60%, var(--bg));
  mix-blend-mode: normal;
}
.stage-dots {
  position: absolute; inset: -20%; z-index: -2; opacity: .35;
  background-image: radial-gradient(rgba(12,213,173,.7) 1px, transparent 1.4px); background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 65%); mask-image: radial-gradient(circle at center, #000 0%, transparent 65%);
}
.stage-radar { position: absolute; inset: 0; display: grid; place-items: center; z-index: -1; pointer-events: none; }
.stage-radar i { grid-area: 1 / 1; border-radius: 50%; border: 1px solid rgba(12,213,173,.18); width: 40vmin; aspect-ratio: 1; animation: radar 6s linear infinite; }
.stage-radar i:nth-child(2) { animation-delay: -2s; } .stage-radar i:nth-child(3) { animation-delay: -4s; }
@keyframes radar { from { transform: scale(.3); opacity: 0; } 30% { opacity: 1; } to { transform: scale(3); opacity: 0; } }

/* Los rombos */
.mark { --s: clamp(70px, 12vmin, 130px); --a: calc((var(--s) / 2 + 5px) * 1.4142); position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 1; }
.dia {
  position: absolute; width: var(--s); height: var(--s); left: calc(var(--s) / -2); top: calc(var(--s) / -2);
  border-radius: 18%; display: grid; place-items: center;
  background: var(--c); box-shadow: 0 0 50px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 0 1px rgba(255,255,255,.25), inset 0 -10px 30px rgba(0,0,0,.25);
  /* posición dispersa inicial */
  transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(var(--fs));
  opacity: .9;
}
.dia span { transform: rotate(-45deg); font: 700 calc(var(--s) * .42) / 1 Arial, sans-serif; color: #111; }
.d-green  { --c: var(--green);  --tx: 0;                    --ty: calc(var(--a) * -1); --fx: -34vw; --fy: -26vh; --fr: 20deg;  --fs: 1.5; }
.d-blue   { --c: var(--blue);   --tx: var(--a);             --ty: 0;                   --fx: 36vw;  --fy: -22vh; --fr: 100deg; --fs: 1.2; }
.d-yellow { --c: var(--yellow); --tx: 0;                    --ty: var(--a);            --fx: 30vw;  --fy: 28vh;  --fr: -30deg; --fs: 1.7; }
.d-red    { --c: var(--red);    --tx: calc(var(--a) * -1);  --ty: 0;                   --fx: -38vw; --fy: 24vh;  --fr: 140deg; --fs: 1.3; }
.pulse { position: absolute; width: calc(var(--s) * 3); aspect-ratio: 1; left: calc(var(--s) * -1.5); top: calc(var(--s) * -1.5); border-radius: 50%; border: 2px solid var(--mint); opacity: 0; pointer-events: none; }

.hero-copy { position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter); display: flex; flex-direction: column; align-items: center; }
.hud {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mint);
  border: 1px solid var(--border); border-radius: 999px; padding: .5rem 1.1rem; background: rgba(4,7,10,.6); backdrop-filter: blur(8px);
  display: inline-flex; gap: .6rem; align-items: center; margin: 0 0 1.8rem; animation: up 1s .2s both;
}
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: blink 1.3s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hero-title {
  font-size: clamp(3rem, 10vw, 9.5rem); font-weight: 900; line-height: .92; letter-spacing: -.055em; margin: 0 0 2.4rem;
  text-shadow: 0 10px 60px rgba(0,0,0,.6); animation: glitchIn 1.2s .35s both;
}
.shine {
  background: linear-gradient(100deg, var(--mint) 20%, #fff 40%, var(--blue) 60%, var(--mint) 80%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }
@keyframes glitchIn {
  0% { opacity: 0; transform: translateY(40px) skewX(-12deg); filter: blur(12px); clip-path: inset(0 0 100% 0); }
  60% { clip-path: inset(0 0 0 0); }
  70% { transform: translateX(4px) skewX(3deg); }
  80% { transform: translateX(-3px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes up { from { opacity: 0; transform: translateY(30px); } }
.hero-copy .btn { animation: up 1s 1s both; }

.hero-brand { position: absolute; left: 0; right: 0; top: calc(50% + clamp(110px, 20vmin, 220px)); text-align: center; padding: 0 var(--gutter); opacity: 0; pointer-events: none; z-index: 2; }
.big-word { font-family: var(--display); font-weight: 900; font-size: clamp(2.2rem, 7vw, 6rem); letter-spacing: -.045em; line-height: 1; margin: 0; }
.hero-tag { font-family: var(--mono); color: var(--muted); letter-spacing: .15em; text-transform: uppercase; font-size: .8rem; margin: 1rem 0 0; }

.scroll-hint { position: absolute; bottom: 1.8rem; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); z-index: 2; }
.scroll-hint i { width: 22px; height: 36px; border: 1.5px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--mint); animation: wheel 1.6s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

/* =========================================================
   IDENTIDAD
   ========================================================= */
.identity { padding: 8rem 0 6rem; }
.id-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.id-visual { position: relative; }
.id-frame { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; border: 1px solid var(--border); position: relative; }
.id-frame img { width: 100%; height: 125%; object-fit: cover; filter: saturate(.8) brightness(.75); }
.id-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, rgba(12,213,173,.25), transparent 45%, rgba(41,169,225,.35)); }
.float-chip {
  position: absolute; z-index: 2; padding: .7rem 1.1rem; border-radius: 14px; font-family: var(--display); font-weight: 600; font-size: .88rem;
  background: rgba(10,17,20,.8); border: 1px solid var(--border); backdrop-filter: blur(12px); display: flex; gap: .55rem; align-items: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.c1 i { color: var(--red); } .c2 i { color: var(--blue); } .c3 i { color: var(--yellow); }
.c1 { top: 10%; left: -8%; } .c2 { top: 45%; right: -6%; } .c3 { bottom: 8%; left: 6%; }
.fill-text { color: inherit; }
@media (max-width: 860px) {
  .id-grid { grid-template-columns: minmax(0, 1fr); }
  .c1 { left: 4%; } .c2 { right: 4%; }
}

/* =========================================================
   SERVICIOS — stacking cards
   ========================================================= */
.services { padding: 6rem 0 4rem; }
.stack {
  list-style: none; padding: 0; margin-block: 0;
  display: grid; grid-template-rows: repeat(var(--numcards), var(--card-h));
  gap: 4vh; padding-bottom: calc(var(--numcards) * 1.5rem);
  --card-h: min(78vh, 560px); --card-top: 1.6rem;
  view-timeline-name: --cards;
}
.stack-item { position: sticky; top: 90px; padding-top: calc(var(--index) * var(--card-top)); }
.scard {
  height: var(--card-h); border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr;
  background: linear-gradient(150deg, #0e1a1d, #070c0f 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 -10px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset;
  transform-origin: 50% 0%; will-change: transform;
}
.scard-body { padding: clamp(1.6rem, 4vw, 3.2rem); display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.scard-n { position: absolute; top: clamp(1.4rem, 3vw, 2.4rem); left: clamp(1.6rem, 4vw, 3.2rem); font-family: var(--mono); color: var(--accent); letter-spacing: .2em; font-size: .85rem; }
.scard-ico {
  font-size: 1.6rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; margin-bottom: auto; margin-top: 3rem;
  background: var(--accent); color: #0a0a0a; transform: rotate(45deg); box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent);
}
.scard-ico::before { display: block; transform: rotate(-45deg); }
.scard h3 { font-size: clamp(2rem, 4.2vw, 3.6rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; margin: 1.5rem 0 1rem; }
.scard p { color: #bcd1cc; margin: 0; max-width: 46ch; }
.scard p strong { color: var(--accent); }
.scard-img { position: relative; overflow: hidden; }
.scard-img img { width: 100%; height: 100%; object-fit: cover; }
.scard-img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #0b1416 0%, transparent 35%), linear-gradient(0deg, color-mix(in srgb, var(--accent) 25%, transparent), transparent 60%); }
@media (max-width: 760px) {
  .stack { --card-h: min(80vh, 620px); }
  .scard { grid-template-columns: 1fr; grid-template-rows: 38% 1fr; }
  .scard-img { order: -1; }
  .scard-img::before { background: linear-gradient(0deg, #0b1416 0%, transparent 60%); }
  .scard-ico { margin-top: 0; width: 52px; height: 52px; font-size: 1.3rem; }
  .scard-n { top: auto; bottom: 1.4rem; right: 1.6rem; left: auto; }
  .stack-item { top: 76px; }
}

/* =========================================================
   TECNOLOGÍAS
   ========================================================= */
.tech { padding: 8rem 0; }
.tech-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.skills { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.4rem; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: .5rem; font-family: var(--display); font-weight: 600; }
.pct { font-family: var(--mono); color: var(--mint); counter-reset: n var(--v); }
.pct::after { content: counter(n) "%"; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 8px; background: rgba(255,255,255,.07); overflow: hidden; display: block; }
.bar i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: inherit; background: var(--grad); box-shadow: 0 0 14px var(--mint); transform-origin: 0 50%; }
.terminal { border-radius: 18px; background: #070d10; border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.5), var(--glow); overflow: hidden; }
.term-bar { display: flex; gap: .45rem; align-items: center; padding: .85rem 1rem; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border); }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: var(--red); } .term-bar i:nth-child(2) { background: var(--yellow); } .term-bar i:nth-child(3) { background: var(--green); }
.term-bar span { margin-left: auto; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.term-code { margin: 0; padding: 1.4rem 1.4rem 1.8rem; font-family: var(--mono); font-size: clamp(.78rem, 1.2vw, .95rem); line-height: 2; overflow-x: auto; white-space: pre; }
.term-code .ln { display: inline-block; }
.term-code em { font-style: normal; color: var(--orange); }
.term-code u { text-decoration: none; color: var(--blue); }
.term-code s { text-decoration: none; color: var(--yellow); }
.term-code b { color: var(--mint); font-weight: 400; }
.term-code i { color: var(--green); font-style: normal; }
@media (max-width: 860px) { .tech-grid { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   NOSOTROS
   ========================================================= */
.about { padding: 8rem 0; position: relative; overflow: hidden; }
.about-ghost { position: absolute; top: 3rem; left: 0; white-space: nowrap; pointer-events: none; z-index: -1; }
.about-ghost span { font-family: var(--display); font-weight: 900; font-size: clamp(5rem, 16vw, 15rem); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px rgba(12,213,173,.16); display: inline-block; }
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about-visual { position: relative; display: grid; place-items: center; }
.about-ring {
  position: absolute; width: 85%; aspect-ratio: 1; border-radius: 50%; bottom: 0;
  background: conic-gradient(from var(--ang), var(--red), var(--green), var(--blue), var(--yellow), var(--red));
  filter: blur(60px); opacity: .4; animation: spin 12s linear infinite;
}
@keyframes spin { to { --ang: 360deg; } }
.about-img { position: relative; width: min(380px, 80%); filter: grayscale(1) contrast(1.1) drop-shadow(0 30px 50px rgba(0,0,0,.7)); -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 6rem; }
.stat { border-radius: 20px; padding: 1.8rem 1.2rem; text-align: center; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.stat:first-child { background: linear-gradient(135deg, var(--mint-dd), var(--mint)); border-color: transparent; }
.stat:first-child b, .stat:first-child span { color: #fff; -webkit-text-fill-color: #fff; }
.stat b { display: block; font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 900; line-height: 1; color: var(--mint); }
.stat span { font-family: var(--mono); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.count { counter-reset: n var(--to); }
.count::after { content: counter(n); }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   TESTIMONIOS + CLIENTES
   ========================================================= */
.clients { padding: 8rem 0 6rem; overflow: hidden; }
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin-top: 3rem; perspective: 1200px; }
.review {
  margin: 0; padding: 2rem; border-radius: var(--radius); position: relative; display: flex; flex-direction: column; gap: 1.5rem;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); border: 1px solid var(--border);
}
.review .q { font-size: 2rem; color: var(--mint); }
.review blockquote { margin: 0; font-size: 1.02rem; color: #d3e6e1; flex: 1; }
.review figcaption { display: flex; align-items: center; gap: .9rem; }
.review figcaption img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; border: 2px solid var(--mint); }
.review figcaption span { display: flex; flex-direction: column; font-family: var(--display); font-weight: 700; }
.review figcaption small { color: var(--yellow); letter-spacing: .15em; }
.review:nth-child(2) { --tilt: 0deg; }
.others { margin-top: 6rem; }
.others h3 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0; }
.others p { color: var(--mint); font-family: var(--display); font-weight: 600; margin: .3rem 0 2.5rem; }
.logo-belt { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.belt { display: flex; gap: clamp(3rem, 7vw, 6rem); width: max-content; align-items: center; padding: 1.5rem 0; animation: belt 30s linear infinite; }
.belt img { height: clamp(26px, 3.5vw, 42px); width: auto; filter: invert(1); opacity: .65; transition: opacity .3s, filter .3s; }
.belt img:hover { opacity: 1; filter: invert(1) drop-shadow(0 0 10px var(--mint)); }
@keyframes belt { to { transform: translateX(-50%); } }
@media (max-width: 860px) { .reviews { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   CONTACTO
   ========================================================= */
.contact { padding: 8rem 0 7rem; }
.contact-title { display: flex; flex-direction: column; font-size: clamp(2.8rem, 10vw, 9rem); line-height: .95; font-weight: 900; letter-spacing: -.05em; margin: 0 0 4rem; }
.contact-title span:last-child { padding-left: 8vw; }
.cform {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: clamp(1.4rem, 3vw, 2.4rem); border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.01)); border: 1px solid var(--border); backdrop-filter: blur(10px);
}
.full { grid-column: 1 / -1; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 1.5rem 1rem .6rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.35);
  color: var(--text); font: inherit; outline: none; transition: border-color .3s, box-shadow .3s; resize: vertical;
}
.field label { position: absolute; left: 1rem; top: 1.05rem; color: var(--muted); pointer-events: none; transition: all .2s; font-size: .95rem; }
.field input:focus, .field textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(12,213,173,.15); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: .45rem; font-size: .7rem; color: var(--mint); font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.check { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .9rem; }
.check input { accent-color: var(--mint); width: 18px; height: 18px; }
.form-msg { margin: 0; min-height: 1.4em; font-family: var(--mono); font-size: .85rem; color: var(--mint); }
.form-msg.err { color: var(--orange); }
@media (max-width: 760px) { .cform { grid-template-columns: minmax(0, 1fr); } }

.footer { border-top: 1px solid var(--border); padding: 2.2rem 0; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--muted); font-size: .85rem; }

/* =========================================================
   SCROLL-DRIVEN ANIMATIONS
   ========================================================= */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    .progress { animation: sda-grow linear both; animation-timeline: scroll(root); }
    @keyframes sda-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

    .nav { animation: sda-nav linear both; animation-timeline: scroll(root); animation-range: 0 240px; }
    @keyframes sda-nav { to { padding-block: .65rem; background: rgba(4,7,10,.75); backdrop-filter: blur(16px) saturate(1.4); border-bottom-color: rgba(12,213,173,.16); } }

    /* --- HERO --- */
    .hero-copy { animation: sda-copy-out linear both; animation-timeline: --hero; animation-range: contain 0% contain 30%; }
    @keyframes sda-copy-out { to { opacity: 0; transform: translateY(-18vh) scale(.85); filter: blur(12px); } }

    .dia { animation: sda-assemble linear both; animation-timeline: --hero; animation-range: contain 5% contain 55%; }
    @keyframes sda-assemble {
      from { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(var(--fs)); opacity: .9; }
      70%  { opacity: 1; }
      to   { transform: translate(var(--tx), var(--ty)) rotate(45deg) scale(1); opacity: 1; }
    }
    .mark { animation: sda-mark linear both; animation-timeline: --hero; animation-range: contain 55% contain 90%; }
    @keyframes sda-mark {
      0%   { transform: translateY(0) scale(1); }
      15%  { transform: translateY(0) scale(1.18); }
      30%  { transform: translateY(0) scale(1); }
      100% { transform: translateY(-10vh) scale(.85); }
    }
    .pulse { animation: sda-pulse linear both; animation-timeline: --hero; animation-range: contain 55% contain 75%; }
    @keyframes sda-pulse { 0% { opacity: 0; transform: scale(.4); } 10% { opacity: 1; } 100% { opacity: 0; transform: scale(2.6); } }
    .hero-brand { animation: sda-brand linear both; animation-timeline: --hero; animation-range: contain 60% contain 85%; }
    @keyframes sda-brand {
      from { opacity: 0; transform: translateY(8vh); filter: blur(14px); letter-spacing: .2em; }
      to   { opacity: 1; transform: translateY(-10vh); filter: none; }
    }
    .stage-dots { animation: sda-dots linear both; animation-timeline: --hero; animation-range: contain 0% contain 100%; }
    @keyframes sda-dots { to { transform: scale(1.8); opacity: .6; } }
    .stage-bg img { animation: sda-bg linear both; animation-timeline: --hero; animation-range: contain 0% contain 100%; }
    @keyframes sda-bg { from { transform: scale(1.05); } to { transform: scale(1.4); filter: grayscale(1) brightness(.12); } }
    .scroll-hint { animation: sda-fade linear both; animation-timeline: --hero; animation-range: contain 0% contain 8%; }
    @keyframes sda-fade { to { opacity: 0; } }

    /* --- Genéricas --- */
    .sd { animation: sda-in linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    @keyframes sda-in { from { opacity: 0; transform: translateY(60px) scale(.95); filter: blur(6px); } }

    .sd-clip { animation: sda-clip linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
    @keyframes sda-clip { from { clip-path: inset(0 100% 0 0); transform: translateX(-30px); } to { clip-path: inset(0 0 -20% 0); } }

    .fill-text {
      background: linear-gradient(90deg, var(--text) 50%, rgba(238,252,248,.15) 50%); background-size: 200% 100%; background-position: 100% 0;
      -webkit-background-clip: text; background-clip: text; color: transparent;
      animation: sda-fill linear both; animation-timeline: view(); animation-range: entry 60% cover 55%;
    }
    @keyframes sda-fill { to { background-position: 0 0; } }

    /* --- Identidad --- */
    .id-frame { animation: sda-unmask linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    @keyframes sda-unmask { from { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); } to { clip-path: polygon(-50% -50%, 150% -50%, 150% 150%, -50% 150%); } }
    .id-frame img { animation: sda-parallax linear both; animation-timeline: view(); }
    @keyframes sda-parallax { from { transform: translateY(-20%); } to { transform: translateY(0); } }

    /* --- Stacking cards --- */
    .scard {
      --start: calc((var(--index) - 1) / var(--numcards) * 100%);
      --end: calc(var(--index) / var(--numcards) * 100%);
      --reverse: calc(var(--numcards) - var(--index));
      animation: sda-stack linear forwards;
      animation-timeline: --cards;
      animation-range: exit-crossing var(--start) exit-crossing var(--end);
    }
    @keyframes sda-stack { to { transform: scale(calc(1.1 - .1 * var(--reverse))); filter: brightness(.55); } }
    .scard-img img { animation: sda-zoom linear both; animation-timeline: view(); animation-range: entry 0% contain 30%; }
    @keyframes sda-zoom { from { transform: scale(1.4); filter: blur(4px) saturate(0); } }

    /* --- Skills --- */
    .bar i { animation: sda-bar linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; }
    @keyframes sda-bar { from { transform: scaleX(0); } }
    .pct { animation: sda-pct linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; counter-reset: n var(--n); }
    @keyframes sda-pct { from { --n: 0; } to { --n: var(--v); } }
    .term-code .ln { animation: sda-type linear both; animation-timeline: view(); }
    .term-code .ln:nth-child(1) { animation-range: entry 100% cover 30%; }
    .term-code .ln:nth-child(2) { animation-range: cover 25% cover 35%; }
    .term-code .ln:nth-child(3) { animation-range: cover 30% cover 40%; }
    .term-code .ln:nth-child(4) { animation-range: cover 35% cover 45%; }
    .term-code .ln:nth-child(5) { animation-range: cover 40% cover 50%; }
    .term-code .ln:nth-child(6) { animation-range: cover 45% cover 55%; }
    @keyframes sda-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

    /* --- Nosotros --- */
    .about-ghost span { animation: sda-ghost linear both; animation-timeline: view(); }
    @keyframes sda-ghost { from { transform: translateX(10%); } to { transform: translateX(-45%); } }
    .about-img { animation: sda-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    @keyframes sda-rise { from { transform: translateY(30%) scale(.9); opacity: 0; filter: grayscale(1) blur(10px); } }
    .count { animation: sda-count linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; counter-reset: n var(--n); }
    @keyframes sda-count { from { --n: 0; } to { --n: var(--to); } }

    /* --- Testimonios: abanico 3D --- */
    .review { animation: sda-review linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    .review:nth-child(1) { --rx: -40%; --rr: -14deg; }
    .review:nth-child(2) { --rx: 0%;   --rr: 0deg; }
    .review:nth-child(3) { --rx: 40%;  --rr: 14deg; }
    @keyframes sda-review { from { opacity: 0; transform: translate(var(--rx), 40%) rotate(var(--rr)) rotateX(30deg) scale(.85); } }
    .others h3 { animation: sda-in linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }

    /* --- Contacto --- */
    .contact-title span { animation: sda-line-l linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    .contact-title span:last-child { animation-name: sda-line-r; }
    @keyframes sda-line-l { from { transform: translateX(-35%); opacity: 0; } }
    @keyframes sda-line-r { from { transform: translateX(35%); opacity: 0; } }
  }
}

/* =========================================================
   FALLBACK
   ========================================================= */
@supports not (animation-timeline: view()) {
  .hero { height: auto; }
  .stage { position: relative; min-height: 100svh; }
  .hero-brand { display: none; }
  .js .sd, .js .sd-clip, .js .review { opacity: 0; transform: translateY(40px); transition: opacity .8s, transform .8s cubic-bezier(.2,.8,.2,1); }
  .js .in { opacity: 1 !important; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero { height: auto; }
  .stage { position: relative; min-height: 100svh; }
  .hero-brand { display: none; }
}
