:root {
  --bg: #eceef2;
  --surface: #f7f8fa;
  --ink: #111216;
  --muted: #6b6f7a;
  --line: #d9dce3;
  --dark: #0c0d10;
  --dark-2: #17181d;
  --holo: linear-gradient(115deg, #3d5afe 0%, #8e6cff 30%, #ff5fa2 60%, #ff9a3c 85%, #3d5afe 100%);
  --radius: 22px;
  --pad-x: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Variables registradas para poder animarlas: entrada de las tarjetas (desplazamiento, escala, giro) */
@property --ex { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ey { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --es { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --er { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; }

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.light { font-weight: 300; }

.star {
  display: inline-block;
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Navegación ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--pad-x);
  transition: background-color .3s, backdrop-filter .3s;
}

/* Arriba del todo el menú es transparente; al bajar toma fondo esmerilado (main.js) */
.nav.scrolled {
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
}

.logo-star {
  font-size: 1.25em;
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }

.nav-link { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav-link:hover,
.nav-link[aria-current="page"] { color: var(--ink); }

.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
}

/* ---------- Portada ---------- */

.hero {
  position: relative;
  min-height: clamp(600px, 100svh, 960px);
  padding: 88px max(var(--pad-x), calc((100% - var(--max)) / 2 + var(--pad-x))) 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: clip;
}

.hero-copy { position: relative; z-index: 1; max-width: 980px; }

.hero-title {
  font-size: clamp(2.4rem, min(5.6vw, 9svh), 4.6rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}

/* balance: si una línea no cabe (celular), reparte las palabras parejo en vez de dejar una sola abajo */
.line { position: relative; display: block; text-wrap: balance; }
.line-light { font-weight: 300; }
.line-bold { font-weight: 800; }
.ghost { visibility: hidden; }
.typed { position: absolute; inset: 0; }
.ph { color: #b4b8c4; font-weight: 700; letter-spacing: .04em; }
.hero-title .star { animation: spin 8s linear infinite; }

.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-sub {
  max-width: 60ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.hero-tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 28px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
}

.hero-tags li { display: flex; align-items: center; gap: 8px; }

.hero-tags svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-fade { animation: fade-up .9s var(--ease) 1.7s both; }

/* Tarjetas 3D: las dibuja CSS, no son imágenes.
   --spread, --lift y --twist los anima main.js al hacer scroll */
/* Ocupa el espacio libre entre el menú y el título.
   --area = alto de la portada menos menú y bloque del título (~470px); con eso se miden las tarjetas */
.stack {
  --area: calc(clamp(600px, 100svh, 960px) - 470px);
  --gx: clamp(30px, 5vw, 80px);
  --gy: calc(var(--area) * .035);
  --spread: 1;
  --lift: 0px;
  --twist: 0deg;
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  margin-bottom: 16px;
  /* Son decorativas: que no se puedan seleccionar ni arrastrar sus imágenes */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.stack img,
.fg-wrap img { -webkit-user-drag: none; user-select: none; }

.stack-float { position: absolute; inset: 0; animation: float 7s ease-in-out infinite; }

.stack-inner { position: absolute; left: 55%; top: 50%; }

/* La de adelante arriba a la izquierda; las demás en cascada hacia atrás, abajo a la derecha.
   will-change: se animan todo el tiempo (entrada, turnos, scroll); así el navegador las prepara una vez */
.stack .card3d {
  will-change: transform, opacity;
  /* +58px: pueden subir hasta ~30px del borde (arriba el menú es transparente y sus enlaces van a los lados) */
  width: clamp(170px, min(36vw, var(--area) + 58px), 600px);
  z-index: calc(10 - var(--i));
  translate: -50% -50%;
  transform:
    perspective(1400px)
    translate(
      calc((var(--i) - 2) * var(--gx) * var(--spread) + var(--ex)),
      calc((var(--i) - 2) * var(--gy) * var(--spread) - var(--i) * var(--lift) + var(--ey))
    )
    scale(calc((1 - var(--i) * .04) * var(--es)))
    rotateX(14deg) rotateY(-28deg) rotateZ(calc(-10deg - var(--i) * var(--twist) + var(--er)));
}

.card3d {
  position: absolute;
  width: clamp(200px, 24vw, 360px);
  aspect-ratio: 1.586;
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 40px 60px -30px rgb(40 30 110 / .45);
  /* Entrada: vuelan desde abajo a la derecha; la de adelante llega primero */
  animation: card-in 1.9s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: calc(.15s + var(--i) * .13s);
}

.card3d::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(255 255 255 / .45), transparent 42%, rgb(0 0 0 / .08));
  pointer-events: none;
}

.chip {
  width: 38px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f7ecc2, #c9a64a);
}

.card-meta { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.card-big {
  align-self: flex-end;
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px #c3c8de;
}

.c1 {
  background:
    radial-gradient(80% 120% at 85% 10%, rgb(255 255 255 / .55), transparent 55%),
    conic-gradient(from 210deg at 35% 65%, #3d5afe, #8e6cff, #ff5fa2, #ffb36b, #3d5afe);
}

.c2 { background: linear-gradient(135deg, #ffffff, #e6e9f3); color: var(--ink); }

.c3 { background: radial-gradient(circle at 70% 40%, #ff8ad1 0 9%, #8e6cff 24%, #2433c9 48%, #0b1a7a 80%); }

.c4 { background: repeating-linear-gradient(100deg, #ff4d5e 0 16px, #ff9a3c 16px 32px, #3d5afe 32px 48px, #ffffff 48px 64px); }
.c4 .card-meta { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--ink); }

.c5 { background: linear-gradient(150deg, #d6e3ff, #5b8bff 45%, #1f3bd6); }

/* Captura del proyecto: cubre la tarjeta cuando existe el archivo (main.js agrega .has-shot) */
.card-shot {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.card-name,
.card-file { position: absolute; z-index: 1; display: none; }

.card-name {
  left: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / .92);
  color: var(--ink);
  font-size: .75rem;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgb(17 18 22 / .4);
}

/* Con captura la tarjeta toma la forma de la imagen (más baja), así que puede ser más ancha */
.stack .card3d.has-shot { width: clamp(170px, min(42vw, (var(--area) + 58px) * 1.18), 680px); }

.card3d.has-shot .card-shot,
.card3d.has-shot .card-name { display: block; }
.card3d.has-shot .chip,
.card3d.has-shot .card-meta,
.card3d.has-shot .card-big { display: none; }

/* Solo al abrir la página en tu computador: qué archivo va en cada tarjeta vacía */
.card-file {
  right: 12px;
  bottom: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(0 0 0 / .5);
  color: #fff;
  font: .65rem ui-monospace, "Cascadia Code", Consolas, monospace;
}

.show-hints .card3d:not(.has-shot) .card-file { display: block; }

.fg-wrap {
  position: absolute;
  right: -90px;
  bottom: -40px;
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.card-fg {
  position: relative;
  width: clamp(260px, 30vw, 440px);
  transform: perspective(1200px) rotateX(24deg) rotateY(-30deg) rotateZ(-26deg);
  animation: fg-in 2.2s cubic-bezier(.16, 1, .3, 1) .55s both;
}

/* ---------- Vitrina: PC + celular sobre pared de bloques ---------- */

.showcase {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -30px 60px -30px rgb(17 18 22 / .35);
  color: #fff;
  background-color: #0b0c0e;
  /* Cada bloque: luz arriba/izquierda, sombra abajo/derecha */
  background-image:
    radial-gradient(55% 55% at 50% 45%, rgb(61 90 254 / .18), transparent 70%),
    linear-gradient(180deg, rgb(255 255 255 / .07) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(0deg, rgb(0 0 0 / .6) 2px, transparent 2px),
    linear-gradient(270deg, rgb(0 0 0 / .5) 2px, transparent 2px),
    linear-gradient(135deg, #1d1e23, #0f1013);
  background-size: auto, 84px 84px, 84px 84px, 84px 84px, 84px 84px, 84px 84px;
}

/* Piso de bloques en perspectiva */
.showcase::before {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: 0;
  height: 40%;
  background-color: #15161a;
  background-image:
    linear-gradient(rgb(255 255 255 / .08) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .08) 1px, transparent 1px);
  background-size: 84px 84px;
  transform: perspective(500px) rotateX(58deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 35%, transparent);
}

.showcase-inner {
  position: relative;
  z-index: 1;
  /* Más ancha que el resto de la página: el PC tiene que verse grande para que se lea el proyecto */
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--pad-x);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 3fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}

.showcase-text {
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}

.showcase-text .light { color: rgb(255 255 255 / .7); }
.showcase-right { justify-self: end; text-align: right; }

.arrow {
  width: clamp(90px, 10vw, 140px);
  margin-top: 24px;
  fill: none;
  stroke: rgb(255 255 255 / .55);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.showcase-right .arrow { transform: scaleX(-1); }

.devices { position: relative; padding-bottom: 4%; }

.laptop { width: 86%; }

/* content-box: el 16:10 es de la pantalla sin el borde, igual que el video (1440x900), así no se recorta */
.laptop-screen {
  position: relative;
  box-sizing: content-box;
  aspect-ratio: 16 / 10;
  border: clamp(6px, .9vw, 12px) solid #1b1c21;
  border-bottom-width: clamp(12px, 1.6vw, 20px);
  border-radius: 18px 18px 6px 6px;
  background: #f4f5f8;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 50px 80px -30px rgb(0 0 0 / .8);
}

.laptop-base {
  position: relative;
  width: 112%;
  height: clamp(10px, 1.4vw, 18px);
  margin-left: -6%;
  border-radius: 2px 2px 16px 16px;
  background: linear-gradient(#dfe2e9, #8b8f9a);
}

.laptop-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 40%;
  translate: -50% 0;
  border-radius: 0 0 8px 8px;
  background: #6f737d;
}

.phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26%;
  /* Misma forma que el video del celular (780x1688), sin contar el borde: así no se recorta */
  box-sizing: content-box;
  aspect-ratio: 780 / 1688;
  border: clamp(5px, .7vw, 9px) solid #111214;
  border-radius: clamp(22px, 3vw, 38px);
  background: #0e0f13;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .14), 0 40px 70px -20px rgb(0 0 0 / .9);
}

.island {
  position: absolute;
  z-index: 2;
  top: 2.5%;
  left: 50%;
  width: 32%;
  height: 3.2%;
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
}

/* Video de un proyecto dentro de una pantalla (mismo formato que la pantalla, 16:10) */
.screen-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Enlace invisible encima de cada pantalla: clic en el video abre el proyecto */
.screen-link { position: absolute; inset: 0; z-index: 1; cursor: pointer; }

/* Botón debajo del PC y el celular (fila nueva de la columna central) */
.showcase-cta { grid-column: 2; display: grid; justify-items: center; gap: 10px; margin-top: 8px; }
.showcase-cta .btn { gap: 8px; }
.showcase-cta p { color: rgb(255 255 255 / .6); font-size: .9rem; }

/* ---------- Proyectos (bento grid) ---------- */

.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--pad-x); }

.section-head { margin-bottom: 36px; }

.h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.bento {
  position: relative;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1.3fr 1fr;
  grid-auto-rows: minmax(140px, auto);
  grid-template-areas:
    "num  pill   years"
    "num  feat   years"
    "back feat   stack"
    "back status stack";
}

/* Escritorio: 5 filas para que las columnas de los lados cambien de tamaño al bajar (main.js anima
   --rb, --rc y --rd). Siempre suman lo mismo en el centro (b + c + d), así el proyecto destacado,
   el título y el estado no cambian; a la izquierda crece "5 proyectos" y a la derecha crece "Stack" */
@media (min-width: 901px) {
  .bento {
    --rb: 250px;
    --rc: 20px;
    --rd: 230px;
    grid-template-rows: 140px var(--rb) var(--rc) var(--rd) 110px;
    grid-template-areas:
      "num  pill   years"
      "num  feat   years"
      "num  feat   stack"
      "back feat   stack"
      "back status stack";
  }
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  transition: translate .4s var(--ease), box-shadow .4s var(--ease);
}

/* translate (no transform) para no chocar con las animaciones de main.js */
.tile:hover { translate: 0 -4px; box-shadow: 0 26px 40px -26px rgb(17 18 22 / .4); }

/* Brillo que sigue al mouse (main.js pone --mx/--my en cada tarjeta y .glow en la cuadrícula).
   ::before = luz suave en la tarjeta; ::after = el borde se ilumina cerca del cursor,
   también en las tarjetas vecinas */
.tile {
  --glow: rgb(255 255 255 / .2);
  --glow-borde: rgb(255 255 255 / .7);
}

.tile-stack,
.tile-status {
  --glow: rgb(61 90 254 / .1);
  --glow-borde: rgb(61 90 254 / .4);
}

.tile::before,
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.tile::before {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
}

.tile::after {
  padding: 1.5px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--glow-borde), transparent 70%);
  -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);
}

.bento.glow .tile::after { opacity: 1; }
.bento.glow .tile:hover::before { opacity: 1; }

.big { font-size: clamp(2.8rem, 5vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.tile-text { font-size: .95rem; opacity: .78; }
.tile-h { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.tile-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }

.tile-num {
  grid-area: num;
  color: #fff;
  background: linear-gradient(160deg, #4f6bff, #1c35d9 60%, #0e1f9e);
}

.glass { position: absolute; top: -8%; right: -14%; width: min(78%, 240px); aspect-ratio: 1; }
.tile-num .big, .tile-num .tile-text { position: relative; }

.glass span {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgb(255 255 255 / .35);
  background: linear-gradient(135deg, rgb(255 255 255 / .3), rgb(255 255 255 / .04));
  backdrop-filter: blur(3px);
  transform: rotate(calc(var(--k) * 12deg + 18deg)) translate(calc(var(--k) * -16px), calc(var(--k) * 16px));
}

.glass span:nth-child(1) { --k: 0; }
.glass span:nth-child(2) { --k: 1; }
.glass span:nth-child(3) { --k: 2; }

.tile-pill {
  grid-area: pill;
  justify-content: center;
  align-items: center;
  color: #fff;
  background: var(--holo);
  background-size: 200% 100%;
  animation: holo-shift 10s ease-in-out infinite alternate;
}

.tile-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }

.tile-years { grid-area: years; color: #fff; background: var(--dark-2); }

.code {
  margin-bottom: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgb(255 255 255 / .05);
  color: #a9b4ff;
  font: .8rem/1.6 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre;
  overflow: hidden;
}

.tile-feat { grid-area: feat; justify-content: flex-start; color: #fff; background: var(--dark); }

.mock {
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / .08);
  background: #1b1c22;
  overflow: hidden;
}

.mock-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgb(255 255 255 / .06); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgb(255 255 255 / .2); }
/* Captura completa del proyecto, sin recortes (misma proporción que la imagen) */
.mock-shot { display: block; width: 100%; aspect-ratio: 1400 / 673; object-fit: cover; object-position: top; }

.tile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-light { background: #fff; color: var(--ink); }
.btn-ghost { border: 1px solid rgb(255 255 255 / .25); color: #fff; }

.tile-back { grid-area: back; color: #fff; background: #050506; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-bottom: auto; }

.bars span {
  flex: 1;
  height: var(--h);
  border-radius: 6px;
  background: linear-gradient(to top, #3d5afe, #8e6cff 70%, #ff5fa2);
  transform-origin: bottom;
}

.tile-stack { grid-area: stack; background: linear-gradient(160deg, #f7f8fa, #dde1e9); }

.orb {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgb(255 255 255 / .9), transparent 30%),
    conic-gradient(from 120deg, #3d5afe, #8e6cff, #ff5fa2, #ff9a3c, #3d5afe);
  filter: saturate(1.1);
}

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .85rem;
  font-weight: 500;
}

.chips img { width: 18px; height: 18px; flex: none; }

.tile-status {
  grid-area: status;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  background: linear-gradient(100deg, #e5eaff, #f3e8ff 50%, #ffe8f0);
  font-weight: 600;
}

.btn-dark { gap: 8px; background: var(--ink); color: #fff; }
.tile-status .btn { position: relative; z-index: 3; padding: 10px 16px; font-size: .88rem; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgb(34 197 94 / .6);
  animation: pulse 2s infinite;
}

/* ---------- Sobre mí ---------- */

.about {
  color: #fff;
  background-color: var(--dark);
  background-image:
    radial-gradient(55% 50% at 85% 15%, rgb(61 90 254 / .25), transparent 60%),
    linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
}

.about-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 12vw, 140px) var(--pad-x);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-title {
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.045em;
}

.about-title .light { color: rgb(255 255 255 / .65); }
.about-title .w { display: inline-block; }

.about-card {
  padding: 28px;
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: var(--radius);
  background: rgb(255 255 255 / .04);
  backdrop-filter: blur(6px);
}

/* Foto en círculo con un borde blanco suave */
.avatar {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border: 2px solid rgb(255 255 255 / .2);
  border-radius: 50%;
  object-fit: cover;
}

.about-card p { color: rgb(255 255 255 / .8); font-size: 1.05rem; }
.about-more { gap: 8px; margin-top: 24px; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / .1);
}

.facts dt { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .5); }
.facts dd { margin: 4px 0 0; font-weight: 600; }

/* ---------- Galería (dentro de Sobre mí) ---------- */

.gallery-head {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  margin-top: clamp(16px, 4vw, 40px);
}

.gallery-head .eyebrow { margin: 0; color: rgb(255 255 255 / .55); }
.gallery-note { color: rgb(255 255 255 / .6); }

.gallery {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  /* El espacio grande un poco más ancho, para que entren fotos horizontales de grupo */
  grid-template-columns: 1.8fr 1.8fr 1fr 1.35fr;
  grid-auto-rows: clamp(150px, 17vw, 240px);
  grid-template-areas:
    "a a b c"
    "a a d c";
}

.photo-a { grid-area: a; }
.photo-b { grid-area: b; }
.photo-c { grid-area: c; }
.photo-d { grid-area: d; }

.photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .08);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 80% at 20% 0%, rgb(142 108 255 / .18), transparent 60%),
    rgb(255 255 255 / .03);
}

.photo-open {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.photo-open:focus-visible { outline: 2px solid #fff; outline-offset: -4px; border-radius: inherit; }

/* Un poco más alta que el marco para poder moverla con el scroll (main.js) */
.photo img {
  position: absolute;
  top: -3%;
  left: 0;
  width: 100%;
  height: 106%;
  object-fit: cover;
  /* Encuadre: por defecto un poco más arriba del centro (evita cortar caras).
     Cada foto puede moverlo con style="--focus: X% Y%" en su <figure> */
  object-position: var(--focus, center 35%);
  transition: scale .6s var(--ease);
}

.photo:hover img { scale: 1.04; }

.photo figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 40px 18px 16px;
  background: linear-gradient(to top, rgb(0 0 0 / .7), transparent);
  font-size: .85rem;
  font-weight: 600;
  pointer-events: none;
}

/* Espacio vacío: se muestra cuando falta el archivo de la foto */
.photo-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  color: rgb(255 255 255 / .55);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

.photo-empty svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }

.photo-empty code {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(255 255 255 / .06);
  color: rgb(255 255 255 / .75);
  font: .75rem ui-monospace, "Cascadia Code", Consolas, monospace;
}

.photo.is-empty { border-style: dashed; border-color: rgb(255 255 255 / .2); }
.photo.is-empty .photo-empty { display: grid; }
.photo.is-empty figcaption, .photo.is-empty .photo-open { display: none; }

.lightbox {
  margin: auto;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
  overflow: hidden;
}

.lightbox::backdrop { background: rgb(5 6 8 / .82); backdrop-filter: blur(6px); }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; object-fit: contain; }
.lightbox-caption { padding: 14px 20px; font-weight: 600; }
.lightbox-caption:empty { display: none; }

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / .55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Página: mi historia (historia.html) ---------- */

/* Texto solo para lectores de pantalla (ej. la "o" que reemplaza el ✳ del título) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.story { max-width: 1120px; margin: 0 auto; padding: 120px var(--pad-x) 32px; }

.story-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.story-back:hover { color: var(--ink); }

.story-hero { max-width: 780px; }

.story-title {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.045em;
}

.story-title .star { animation: spin 8s linear infinite; }

.story-lead { max-width: 54ch; margin-top: 20px; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); }

.story-cover { margin: clamp(36px, 6vw, 64px) 0 0; }

.story-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -30px rgb(17 18 22 / .45);
}

.story figcaption { margin-top: 10px; color: var(--muted); font-size: .85rem; text-align: center; }

/* Capítulo: texto y fotos lado a lado; .flip pone las fotos a la izquierda */
.story-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(56px, 9vw, 110px) 0;
  border-top: 1px solid var(--line);
}

.story-cover + .story-chapter { margin-top: clamp(40px, 6vw, 72px); }
.story-chapter.flip .story-media { order: -1; }
.story-chapter > .story-text:only-child { grid-column: 1 / -1; max-width: 720px; }

.story-step {
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.story-text h2 {
  margin: 10px 0 18px;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.story-text p { color: #3c4049; font-size: 1.05rem; line-height: 1.7; }
.story-text p + p, .story-stats + p { margin-top: 14px; }

/* Palabras clave resaltadas con un subrayado grueso del degradado */
.story-text strong {
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(transparent 62%, rgb(142 108 255 / .22) 0);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: translate .3s var(--ease);
}

.pill-link:hover { translate: 0 -2px; }

.story-media { display: grid; gap: 18px; }
.story-media.two { grid-template-columns: 1fr 1fr; }
.story-media figure { margin: 0; }

.story-media img {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 24px 50px -28px rgb(17 18 22 / .45);
}

.story-media.two img { aspect-ratio: 3 / 4; object-fit: cover; }

.story-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
}

.story-facts dt { color: rgb(255 255 255 / .5); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.story-facts dd { margin: 4px 0 0; font-size: 1.1rem; font-weight: 700; }

.story-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }

.stat { padding: 16px; border-radius: 16px; background: var(--dark); color: rgb(255 255 255 / .7); font-size: .85rem; }

.stat b {
  display: block;
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}

.story-end {
  margin-top: clamp(20px, 4vw, 40px);
  padding: clamp(36px, 6vw, 64px);
  border-radius: 32px;
  background-color: var(--dark);
  background-image: radial-gradient(55% 80% at 85% 10%, rgb(61 90 254 / .3), transparent 60%);
  color: #fff;
}

.story-end h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.story-end .light { color: rgb(255 255 255 / .7); }
.story-end .mail { background: #fff; color: var(--ink); }

/* ---------- Página: proyectos (proyectos.html) ---------- */

.proj-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(32px, 5vw, 56px);
  padding: 0;
  list-style: none;
}

.proj-index a { display: block; color: var(--ink); text-decoration: none; }

.proj-index img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 14px;
  box-shadow: 0 18px 36px -24px rgb(17 18 22 / .5);
  transition: translate .3s var(--ease);
}

.proj-index a:hover img { translate: 0 -4px; }
.proj-index span { display: block; margin-top: 10px; font-size: .9rem; font-weight: 700; }

/* Un proyecto: encabezado, video y detalle */
.case { padding: clamp(56px, 9vw, 110px) 0; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.proj-index + .case { margin-top: clamp(48px, 7vw, 88px); }

.case-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px 40px;
  margin-bottom: 28px;
}

.case-head h2 { margin-top: 8px; font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.case-tagline { max-width: 52ch; margin-top: 12px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.15rem); }

.case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding: 0; list-style: none; }

.case-tags li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.case-links .pill-link { margin-top: 0; }

/* Video con barra de navegador; sin archivo, main.js deja la captura del proyecto */
.case-video {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .06);
  border-radius: var(--radius);
  background: #1b1c22;
  box-shadow: 0 40px 70px -40px rgb(17 18 22 / .6);
}

.case-video video,
.case-video-poster { display: block; width: 100%; height: auto; }

.video-hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / .7);
  color: #fff;
  font-size: .8rem;
}

.video-hint code { font: .78rem ui-monospace, "Cascadia Code", Consolas, monospace; }
.show-hints .case-video.is-empty .video-hint { display: block; }

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(28px, 4vw, 44px);
}

.case-text h3 { margin: 28px 0 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.case-text h3:first-child { margin-top: 0; }

.case-list { display: grid; gap: 8px; padding: 0; list-style: none; }

.case-list li { position: relative; padding-left: 24px; color: #3c4049; font-size: 1.02rem; line-height: 1.6; }

.case-list li::before {
  content: "✳";
  position: absolute;
  left: 0;
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tarjeta lateral: se queda a la vista mientras se lee el proyecto */
.case-aside { position: sticky; top: 96px; align-self: start; }
.case-aside .span { grid-column: 1 / -1; }
.case-aside dd { font-size: 1rem; line-height: 1.4; }
.case-aside a { color: #fff; text-underline-offset: 3px; }

/* ---------- Letras gigantes ---------- */

.marquee { overflow: hidden; padding: clamp(40px, 8vw, 96px) 0; }

.marquee-track {
  display: flex;
  align-items: center;
  gap: .25em;
  width: max-content;
  padding-left: var(--pad-x);
  font-size: clamp(5rem, 18vw, 16rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  white-space: nowrap;
  will-change: transform;
}

.marquee .star { font-size: .45em; }

.marquee .grad {
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Contacto ---------- */

.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad-x) clamp(80px, 12vw, 140px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.mail,
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border-radius: 999px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  text-decoration: none;
}

.mail { background: var(--ink); color: #fff; }
.mail span { transition: translate .3s var(--ease); }
.mail:hover span { translate: 5px 0; }

.wa-btn { gap: 10px; background: #25d366; color: #062b14; }
.wa-btn svg { width: 20px; height: 20px; fill: currentColor; }

.wa-float {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 14px 30px -10px rgb(37 211 102 / .7);
  animation: fade-up .6s var(--ease) 2s both;
  transition: transform .3s var(--ease);
}

.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }

.socials { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; margin-top: 24px; font-weight: 600; }
.socials a { text-underline-offset: 4px; }

.contact-art { position: relative; height: clamp(220px, 30vw, 360px); }

.pill {
  position: absolute;
  border-radius: 999px;
  background: var(--holo);
  box-shadow: inset 0 -12px 30px rgb(0 0 0 / .15), 0 30px 50px -25px rgb(61 90 254 / .55);
}

.p1 { top: 16%; left: 8%; width: 84%; height: 26%; rotate: -8deg; }

.p2 {
  bottom: 14%;
  left: 0;
  width: 46%;
  height: 22%;
  background: conic-gradient(from 90deg at 30% 50%, #3d5afe, #8e6cff, #ff5fa2, #3d5afe);
}

.ring {
  position: absolute;
  right: 6%;
  bottom: 4%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 42%, #3d5afe 43%, #ff5fa2 70%, transparent 71%);
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  /* Abajo deja lugar para el botón flotante de WhatsApp */
  padding: 40px var(--pad-x) 96px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.footer a { text-decoration: none; }

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-brand .logo { color: var(--ink); }
.footer-brand p { margin-top: 6px; }

.footer-social { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }

.footer-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  transition: background-color .3s, color .3s, border-color .3s, translate .3s var(--ease);
}

.footer-social a:hover { translate: 0 -2px; border-color: var(--ink); background: var(--ink); color: #fff; }

.footer-social svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.footer-bottom a:hover { color: var(--ink); }

/* ---------- Aparición al hacer scroll (main.js agrega .in) ---------- */

.js .reveal {
  opacity: 0;
  translate: 0 28px;
  transition-property: opacity, translate, transform, box-shadow;
  transition-duration: .8s, .8s, .4s, .4s;
  transition-timing-function: var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms), calc(var(--d, 0) * 80ms), 0s, 0s;
}

.js .reveal.in { opacity: 1; translate: 0 0; }

/* ---------- Animaciones ---------- */

@keyframes card-in {
  from { --ex: 50vw; --ey: 55vh; --es: 1.5; --er: 18deg; opacity: 0; filter: blur(24px); }
  35% { opacity: 1; }
  to { --ex: 0px; --ey: 0px; --es: 1; --er: 0deg; opacity: 1; filter: blur(0); }
}

@keyframes fg-in {
  from { translate: 35vw 45vh; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

@keyframes fade-up {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes spin { to { rotate: 360deg; } }

@keyframes holo-shift { to { background-position: 100% 0; } }

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgb(34 197 94 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); }
}

/* En pantallas grandes la portada se queda fija y la vitrina sube encima como un panel */
@media (min-width: 821px) and (min-height: 640px) {
  .hero { position: sticky; top: 0; }
}

/* ---------- Celular y tablet ---------- */

@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "pill pill"
      "feat feat"
      "num  years"
      "back stack"
      "status status";
  }

  .tile-feat { min-height: 440px; }
  .tile-num, .tile-years, .tile-back, .tile-stack { min-height: 240px; }
}

@media (max-width: 820px) {
  .hero { justify-content: flex-start; padding-top: 90px; }
  .stack { flex: none; height: 300px; margin-bottom: 8px; }
  .stack { --gx: 30px; --gy: 16px; }
  .stack-inner { left: 50%; }
  .card3d, .stack .card3d { width: 180px; padding: 12px 14px; }
  .stack .card3d.has-shot { width: 210px; }
  .fg-wrap { display: none; }
  .card-big { font-size: 2.8rem; }
  .about-inner, .contact { grid-template-columns: 1fr; }
  .showcase-inner { grid-template-columns: 1fr; }

  .gallery {
    grid-template-columns: 1fr 1fr;
    /* Las dos primeras filas (espacio grande) más bajas, para que sea ancho como la foto */
    grid-template-rows: repeat(2, clamp(90px, 27vw, 120px)) repeat(2, 150px);
    grid-template-areas:
      "a a"
      "a a"
      "b c"
      "d c";
  }
  .showcase-right { justify-self: start; text-align: left; }
  .showcase-cta { grid-column: auto; justify-items: start; }
  .arrow { display: none; }
  .story { padding-top: 96px; }
  .story-chapter { grid-template-columns: 1fr; }
  .story-chapter.flip .story-media { order: 0; }
  .proj-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-body { grid-template-columns: 1fr; }
  .case-aside { position: static; }
}

@media (max-width: 560px) {
  .nav-link { display: none; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "pill" "feat" "num" "years" "back" "stack" "status"; }
  .facts { grid-template-columns: 1fr 1fr; }
}

/* ---------- Reducir movimiento: mismo contenido, sin animaciones ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal { opacity: 1; translate: none; }
  .tile:hover { translate: none; }
}
