/* Concepto: lienzo de diseño (reglas, caja de selección) + 
   tapete con figura que hace tumbling y deja su estela. Una columna; bloques de color alternos. */
:root {
  --fondo: #eef0f6;
  --fondo-2: #ffffff;
  --marca: #2f45ff;
  --marca-2: #6b7bff;
  --marca-prof: #10165c;
  --acento: #ff4fa0;
  --acento-tinta: #c4186a;
  --tinta: #11131a;
  --tinta-suave: #5a6075;
  --sobre-marca: #dfe3ff;
  --linea: #d3d8e6;
  --guia: #ff4fa0;
  --ok: #10804b;
  --wip: #a35f00;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-io: cubic-bezier(.77,0,.175,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #0b0d16; --fondo-2: #141828; --marca: #5b6cff; --marca-2: #8d99ff; --marca-prof: #0a0f45;
    --acento: #ff6fb3; --acento-tinta: #ff8cc2; --tinta: #e9ebf5; --tinta-suave: #a0a6bd;
    --sobre-marca: #e3e6ff; --linea: #262c42; --guia: #ff6fb3; --ok: #4fd18f; --wip: #f0b44c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #0b0d16; --fondo-2: #141828; --marca: #5b6cff; --marca-2: #8d99ff; --marca-prof: #0a0f45;
  --acento: #ff6fb3; --acento-tinta: #ff8cc2; --tinta: #e9ebf5; --tinta-suave: #a0a6bd;
  --sobre-marca: #e3e6ff; --linea: #262c42; --guia: #ff6fb3; --ok: #4fd18f; --wip: #f0b44c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--fondo); color: var(--tinta);
  font: 16px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 32px;
  overflow-x: hidden;
}
a, button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 44px; position: relative; }

/* Luz que sigue el cursor */
.luz {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 20%), color-mix(in srgb, var(--marca) 14%, transparent), transparent 70%);
}
.wrap > * { position: relative; z-index: 1; }

/* ============ LIENZO (hero) ============ */
.lienzo {
  margin-top: max(20px, env(safe-area-inset-top, 0px));
  border: 1px solid var(--linea); border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(circle, var(--linea) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--fondo-2);
  position: relative;
}
.barra {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--linea); background: var(--fondo-2);
  font: 500 11.5px/1 var(--mono); color: var(--tinta-suave);
}
.puntos { display: flex; gap: 6px; }
.puntos i { width: 10px; height: 10px; border-radius: 50%; background: var(--linea); }
.puntos i:first-child { background: var(--acento); }
.barra .zoom { margin-left: auto; font-variant-numeric: tabular-nums; }
.regla {
  height: 18px; border-bottom: 1px solid var(--linea);
  background: repeating-linear-gradient(90deg, var(--linea) 0 1px, transparent 1px 10px) bottom / 100% 6px no-repeat,
              repeating-linear-gradient(90deg, var(--tinta-suave) 0 1px, transparent 1px 50px) bottom / 100% 12px no-repeat;
  opacity: .8;
}
.tapete {
  border-bottom: 1px solid var(--linea);
  background: linear-gradient(transparent 70%, color-mix(in srgb, var(--marca) 8%, transparent));
}
.tapete svg { display: block; width: 100%; height: auto; max-height: 190px; }
.tapete .piso { stroke: var(--marca); stroke-width: 2; }
.tapete .tick { stroke: var(--tinta-suave); stroke-width: 1; opacity: .6; }
.tapete .num { font: 500 9px var(--mono); fill: var(--tinta-suave); }
.tapete .fig { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5.5; }
.tapete .fig circle { stroke: none; }
.tapete .fantasma { stroke: var(--marca-2); opacity: .22; }
.tapete .fantasma circle { fill: var(--marca-2); }
.tapete .viva { stroke: var(--marca); }
.tapete .viva circle { fill: var(--acento); }
.tapete .sombra { fill: var(--tinta); opacity: .12; }
.escena { position: relative; padding: 28px 22px 26px; display: flex; flex-direction: column; gap: 18px; }


.cabeza { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  background: linear-gradient(135deg, var(--marca), var(--marca-2)); color: #fff;
  display: grid; place-items: center; overflow: hidden;
  font: 800 28px/1 var(--display); font-variation-settings: "wdth" 80;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--marca) 70%, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ubic { display: flex; flex-direction: column; gap: 6px; font: 500 12px/1 var(--mono); color: var(--tinta-suave); letter-spacing: .05em; text-transform: uppercase; }
.disponible { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); }
.disponible::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: latido 2s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Caja de selección alrededor del nombre */
.seleccion { position: relative; align-self: flex-start; padding: 2px 10px 6px; max-width: 100%; }
.seleccion::before {
  content: ""; position: absolute; inset: 0; border: 1.5px solid var(--guia);
  clip-path: inset(0 100% 100% 0); animation: marco .9s .35s var(--ease-io) forwards;
}
.seleccion .t { position: absolute; width: 9px; height: 9px; background: var(--fondo-2); border: 1.5px solid var(--guia); scale: 0; animation: tir .3s var(--ease-out) forwards; }
.t.a { top: -5px; left: -5px; animation-delay: .4s; } .t.b { top: -5px; right: -5px; animation-delay: .6s; }
.t.c { bottom: -5px; right: -5px; animation-delay: .8s; } .t.d { bottom: -5px; left: -5px; animation-delay: 1s; }
.medida {
  position: absolute; left: 50%; bottom: -26px; translate: -50% 0;
  font: 500 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 4px;
  background: var(--guia); color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
  opacity: 0; animation: aparece .3s 1.1s forwards;
}
@keyframes marco { to { clip-path: inset(0 0 0 0); } }
@keyframes tir { to { scale: 1; } }
@keyframes aparece { to { opacity: 1; } }

h1 {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: clamp(48px, 15vw, 84px); line-height: .92; letter-spacing: -.04em;
  font-variation-settings: "wdth" 76, "opsz" 96;
  transition: font-variation-settings .6s var(--ease-out);
}
h1 .palabra { white-space: nowrap; display: inline-block; }
h1:hover { font-variation-settings: "wdth" 100, "opsz" 96; }
h1 .letra { display: inline-block; animation: sube .7s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes sube { from { translate: 0 .5em; filter: blur(6px); } }


.lema { margin: 0; font-size: 18px; line-height: 1.45; color: var(--tinta-suave); max-width: 38ch; }
.rota { display: grid; justify-items: start; margin-bottom: 2px; color: var(--marca); font: 800 26px/1.1 var(--display); letter-spacing: -.02em; font-variation-settings: "wdth" 85; }
.rota b { grid-area: 1 / 1; font-weight: 800; transition: translate .5s var(--ease-out), opacity .4s, filter .4s; }
.rota b:not(.activa) { opacity: 0; translate: 0 .6em; filter: blur(4px); }
.rota b.sale { opacity: 0; translate: 0 -.6em; filter: blur(4px); }
.lema .gesto {
  color: var(--tinta); font-weight: 600;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--acento) 40%, transparent) 62%);
  background-size: 0% 100%; background-repeat: no-repeat; animation: resalta .8s 1.3s var(--ease-out) forwards;
}
@keyframes resalta { to { background-size: 100% 100%; } }

.redes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  font: 500 13px/1 var(--mono); color: var(--tinta); text-decoration: none;
  padding: 0 13px; border: 1px solid var(--linea); border-radius: 999px; background: var(--fondo-2);
  transition: border-color .2s, color .2s, translate .25s var(--ease-out);
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { border-color: var(--marca); color: var(--marca); translate: 0 -2px; }

/* ============ LINKS ============ */
.seccion { display: flex; flex-direction: column; gap: 12px; }
.etiqueta { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tinta-suave); display: flex; align-items: center; gap: 10px; }
.etiqueta::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--linea) 0 6px, transparent 6px 10px); }
.etiqueta em { font-style: normal; color: var(--acento-tinta); font-variant-numeric: tabular-nums; order: 2; }

.links { display: flex; flex-direction: column; gap: 10px; }
.link {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px 18px 14px 14px; border-radius: 18px; text-decoration: none; color: var(--tinta);
  background: var(--fondo-2); border: 1px solid var(--linea);
  overflow: hidden; isolation: isolate;
  transition: color .3s, border-color .3s, translate .35s var(--ease-out), box-shadow .35s;
  animation: entra .8s var(--ease-out) both; animation-delay: calc(.5s + var(--i) * 80ms);
}
@keyframes entra { from { translate: 0 18px; filter: blur(6px); } }
.link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, var(--marca), var(--marca-2));
  clip-path: inset(0 100% 0 0); transition: clip-path .5s var(--ease-io);
}
.link .ico {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--marca) 10%, var(--fondo-2)); color: var(--marca);
  transition: background .3s, color .3s, rotate .5s var(--ease-out);
}
.link .ico svg { width: 22px; height: 22px; }
.link .txt { min-width: 0; }
.link .t { display: block; font: 700 20px/1.15 var(--display); letter-spacing: -.01em; font-variation-settings: "wdth" 88; }
.link .d { display: block; font: 400 12.5px/1.3 var(--mono); color: var(--tinta-suave); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .3s; }
.link .flecha { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--linea); transition: rotate .4s var(--ease-out), border-color .3s, background .3s; }
.link .flecha svg { width: 16px; height: 16px; }
.link:hover, .link:focus-visible { color: #fff; border-color: transparent; box-shadow: 0 16px 30px -18px var(--marca); }
.link:hover::before, .link:focus-visible::before { clip-path: inset(0 0 0 0); }
.link:hover .ico, .link:focus-visible .ico { background: rgba(255,255,255,.16); color: #fff; rotate: -8deg; }
.link:hover .d, .link:focus-visible .d { color: var(--sobre-marca); }
.link:hover .flecha, .link:focus-visible .flecha { rotate: -45deg; border-color: rgba(255,255,255,.5); }
.link:active { scale: .985; }

.link.destacado { background: var(--marca-prof); color: #fff; border-color: var(--marca-prof); min-height: 84px; }
.link.destacado .ico { background: var(--acento); color: #fff; }
.link.destacado .d { color: var(--sobre-marca); }
.link.destacado .flecha { border-color: rgba(255,255,255,.3); }
.link.destacado::before { background: linear-gradient(110deg, var(--acento-tinta), var(--acento)); }
.link.destacado .brillo {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%) -150% 0 / 60% 100% no-repeat;
  animation: brillo 4.5s 2s var(--ease-io) infinite;
}
@keyframes brillo { 0%, 60% { background-position: -150% 0; } 100% { background-position: 250% 0; } }

/* ============ PROYECTOS ============ */
.proyectos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proyecto:only-child { grid-column: 1 / -1; }
.proyecto:only-child .boceto { aspect-ratio: 16 / 7; }
@media (max-width: 340px) { .proyectos { grid-template-columns: minmax(0, 1fr); } }
.proyecto {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px;
  border: 1px solid var(--linea); background: var(--fondo-2);
  text-decoration: none; color: var(--tinta); min-width: 0;
  transition: border-color .3s, translate .35s var(--ease-out);
}
a.proyecto:hover { border-color: var(--marca); translate: 0 -3px; }
.boceto {
  aspect-ratio: 16 / 10; max-width: 100%; border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--marca) 7%, var(--fondo));
  border: 1px dashed var(--linea);
}
.boceto svg { width: 100%; height: 100%; display: block; }
.boceto .l { fill: none; stroke: var(--marca); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.boceto .b { fill: color-mix(in srgb, var(--marca) 22%, transparent); }
.boceto .x { fill: var(--acento); }
.proyecto.trazar .boceto .l { animation: traza 1.4s var(--ease-out) backwards; animation-delay: calc(var(--k, 0) * 120ms); }
@keyframes traza { from { stroke-dashoffset: 1; } }
.proyecto .n { overflow-wrap: anywhere; font: 700 16.5px/1.2 var(--display); font-variation-settings: "wdth" 90; padding-inline: 4px; }
.proyecto .p { font-size: 14px; color: var(--tinta-suave); margin: 0; padding-inline: 4px; }
.estado { white-space: nowrap; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado.publicado { color: var(--ok); }
.estado.construccion { color: var(--wip); }
.estado.construccion::before { animation: pulso 1.6s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .25; } }

/* ============ CONTACTO + PIE (bloque de marca) ============ */
.cierre {
  border-radius: 24px; padding: 26px 22px 22px; color: #fff; overflow: hidden; position: relative;
  background: radial-gradient(120% 90% at 100% 0%, var(--marca-2), var(--marca) 45%, var(--marca-prof));
  display: flex; flex-direction: column; gap: 16px;
}
.cierre h2 { margin: 0; font: 800 clamp(30px, 8vw, 40px)/1 var(--display); letter-spacing: -.03em; font-variation-settings: "wdth" 82; text-wrap: balance; }
.cierre h2 em { font-style: normal; color: var(--acento); }
:root .cierre h2 em { color: #ffb3d6; }
.cierre p { margin: 0; color: var(--sobre-marca); max-width: 36ch; }
.correo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); }
.correo > span { flex: 1 1 100%; min-width: 0; white-space: nowrap; padding-top: 4px; font: 500 15px/1.3 var(--mono); user-select: all; overflow-wrap: anywhere; }
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font: 600 14px/1 var(--body); padding: 0 16px; border-radius: 11px; border: 0;
  background: #fff; color: var(--marca-prof);
  transition: translate .2s var(--ease-out);
}
.btn svg { width: 16px; height: 16px; }
.monograma {
  position: absolute; right: -12px; bottom: -34px; pointer-events: none;
  font: 800 180px/1 var(--display); letter-spacing: -.06em; font-variation-settings: "wdth" 75;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.28);
  transition: color .6s var(--ease-out);
}
.cierre:hover .monograma { color: rgba(255,255,255,.1); }
.cierre > *:not(.monograma) { position: relative; }

footer { font: 400 12px/1.6 var(--mono); color: var(--tinta-suave); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .seleccion::before { clip-path: none; } .seleccion .t { scale: 1; } .medida { opacity: 1; }
  .lema .gesto { background-size: 100% 100%; }
}
.pagina-404 { padding-block: 20vh; }
