/* VORA Studios · página construida por un enjambre
 * Dos capas: la página (paleta y tipografía de VORA) y el enjambre (cursores,
 * cajas, guías, glitch y HUD), que es la única con colores saturados.
 */

:root {
  --void: #000000;
  --page: #0A0A0B;
  --ink: #F4F0E9;
  --ink-2: #B3ABA0;
  --ink-3: #857E75;
  --bloom: #D8B4A8;
  --hair: rgba(244, 240, 233, .12);
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1240px;

  /* capa del enjambre (decisión 2026-11-19: neón permitido, solo aquí) */
  --sw-sel: #2f6bff;
  --sw-red: #ff2b2b;
  --sw-blue: #2f6bff;
  --sw-hud: #111111;
  --sw-hud-line: #2a2a2a;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1rem/1.6 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--bloom); outline-offset: 3px; }

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 100;
  background: var(--ink); color: var(--page); padding: 8px 14px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ── Barra superior ─────────────────────────────── */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
}
.mark__logo { height: 30px; width: auto; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); font-size: .875rem; }
.nav a { color: var(--ink-2); text-decoration: none; transition: color .3s; }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav a:not([href="#contacto"]) { display: none; } }

/* ── Tipografía ─────────────────────────────────── */
.title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 360;
  font-variation-settings: 'SOFT' 45, 'WONK' 1, 'opsz' 144;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.title--xl { font-size: clamp(2.6rem, 6.6vw, 6rem); line-height: .98; }
.title__dim { display: block; color: var(--ink-3); }
.eyebrow {
  margin: 0 0 22px;
  font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.lede { margin: 28px 0 0; max-width: 46ch; font-size: 1.125rem; color: var(--ink-2); }

/* ── Secciones ──────────────────────────────────── */
.sec {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(96px, 15vh, 180px) var(--gutter);
}
.sec__head { margin-bottom: clamp(40px, 7vh, 72px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 2px;
  font: 500 .9375rem/1 'Instrument Sans', sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color .3s, color .3s, border-color .3s;
}
.btn--solid { background: var(--ink); color: var(--page); }
.btn--solid:hover { background: var(--bloom); }
.btn--ghost { border-color: rgba(244, 240, 233, .28); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Inicio: retícula 54/46 */
.hero {
  display: grid; grid-template-columns: 54fr 46fr; align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: 100svh; padding-top: 120px; padding-bottom: 72px;
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 56px 0 0; border-top: 1px solid var(--hair);
}
.stat { padding: 18px 16px 0 0; }
.stat dt { font-size: .75rem; color: var(--ink-3); letter-spacing: .04em; }
.stat dd {
  margin: 6px 0 0;
  font-family: 'Fraunces', serif; font-weight: 360;
  font-variation-settings: 'SOFT' 50, 'WONK' 1, 'opsz' 72;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero__object { position: relative; margin: 0; aspect-ratio: 1; }
.hero__still, .hero__object canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.hero__object canvas { display: block; }
.hero__object.has-3d .hero__still { opacity: 0; }
.hero__caption {
  position: absolute; left: 0; bottom: 0;
  font-size: .75rem; color: var(--ink-3); letter-spacing: .04em;
}
.hero__caption::before {
  content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px;
  border-radius: 50%; background: var(--bloom); vertical-align: middle;
}

/* Servicios */
.rule { height: 1px; margin: 0; border: 0; background: var(--hair); transform-origin: 0 50%; }
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px; align-items: baseline;
  padding: 30px 0; border-bottom: 1px solid var(--hair);
}
.row__n, .step__n { font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row__name, .step__name, .case__name {
  margin: 0;
  font-family: 'Fraunces', serif; font-weight: 380;
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 60;
  font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.15;
}
.row__desc, .step__desc { margin: 0; color: var(--ink-2); max-width: 52ch; }

/* Proceso */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.step { border-top: 1px solid var(--hair); padding-top: 22px; }
.step__name { margin: 26px 0 12px; }

/* Trabajo */
.work {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(28px, 3vw, 44px) clamp(20px, 2.4vw, 36px);
}
.case { grid-column: span 2; }
.case--wide { grid-column: span 3; }
.case__name a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s; }
.case__name a:hover { background-size: 100% 1px; }
.case__name a::after { content: ' ↗'; font-size: .6em; color: var(--ink-3); vertical-align: .35em; }
.case__media { position: relative; margin: 0 0 18px; aspect-ratio: 11 / 9; overflow: hidden; background: #121213; }
.case__media--void { background: var(--void); }
.case__media img { width: 100%; height: 100%; object-fit: cover; }
.case__kind { margin: 8px 0 0; font-size: .875rem; color: var(--ink-3); }
.ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  border: 1px dashed rgba(244, 240, 233, .16);
}
.ph span { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.note { margin: 40px 0 0; font-size: .875rem; color: var(--ink-3); }

/* Manifiesto */
.manifesto__body {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(40px, 7vh, 72px); color: var(--ink-2); font-size: 1.0625rem;
}
.manifesto__body p { margin: 0; max-width: 48ch; }
.beliefs { list-style: none; margin: clamp(48px, 8vh, 88px) 0 0; padding: 0; }
.beliefs li {
  padding: 20px 0; border-top: 1px solid var(--hair);
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 340;
  font-variation-settings: 'SOFT' 50, 'WONK' 1, 'opsz' 40;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem); color: var(--ink);
}

/* Contacto: retícula 46/54 */
.contact__grid { display: grid; grid-template-columns: 46fr 54fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.contact__side .lede { margin: 0 0 32px; }
.contact__side .btn { margin-right: 16px; }
.mail { display: inline-block; margin-top: 18px; color: var(--ink-2); font-size: .9375rem; text-underline-offset: 4px; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.field { position: relative; margin: 0 0 26px; }
.field__label { display: block; font-size: .75rem; letter-spacing: .06em; color: var(--ink-3); }
.field__opt { margin-left: 6px; opacity: .7; }
.field__input {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: 1rem;
}
.field__input::placeholder { color: var(--ink-3); opacity: .55; }
.field__input:focus { outline: none; border-bottom-color: var(--bloom); }
select.field__input:invalid { color: var(--ink-3); }
select.field__input option { background: #141413; color: var(--ink); }
textarea.field__input { resize: vertical; min-height: 4.5rem; }
.field[data-bad] .field__input { border-bottom-color: var(--bloom); }
.field__err { display: block; margin-top: 6px; font-size: .8125rem; color: var(--bloom); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.form__note { margin: 0; font-size: .8125rem; color: var(--ink-3); }
.form__msg { margin: 20px 0 0; color: var(--ink-2); }
.form__msg a { color: var(--bloom); }

/* Pie */
.foot {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  padding: 48px var(--gutter) 56px; border-top: 1px solid var(--hair);
}
.foot__logo { height: 34px; width: auto; }
.foot__legal { margin: 0; font-size: .8125rem; color: var(--ink-3); }
.foot__replay {
  margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font: inherit; font-size: .8125rem; text-decoration: underline; text-underline-offset: 4px;
}
.foot__replay:hover { color: var(--ink); }

@media (max-width: 900px) {
  .hero, .contact__grid, .manifesto__body { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 104px; }
  .hero__object { order: -1; max-width: 420px; width: 100%; justify-self: center; }
  .steps { grid-template-columns: 1fr 1fr; }
  .work { grid-template-columns: 1fr; }
  .case, .case--wide { grid-column: auto; }
  .row { grid-template-columns: 44px 1fr; }
  .row__desc { grid-column: 2; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .steps, .form__grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════
   Capa del enjambre
   ══════════════════════════════════════════════════ */

.swarm-on [data-build]:not(.is-built):not(.is-building) { visibility: hidden; }
.has-hud body { padding-bottom: 76px; }

.swarm { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 60; pointer-events: none; }
.agent { position: absolute; left: 0; top: 0; width: 16px; height: 18px; will-change: transform; }
.agent svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }

.sel {
  position: absolute; border: 1px solid var(--sw-sel); transform-origin: 0 0;
  opacity: 0; will-change: transform, opacity;
}
.sel i {
  position: absolute; width: 5px; height: 5px; background: #fff; border: 1px solid var(--sw-sel); opacity: 0;
}
.sel i:nth-child(1) { left: -3px; top: -3px; }
.sel i:nth-child(2) { right: -3px; top: -3px; }
.sel i:nth-child(3) { left: -3px; bottom: -3px; }
.sel i:nth-child(4) { right: -3px; bottom: -3px; }
.sel b {
  position: absolute; left: -1px; top: 100%; margin-top: 4px; opacity: 0;
  padding: 1px 5px; background: var(--sw-sel); color: #fff; white-space: nowrap;
  font: 500 10px/1.5 'Instrument Sans', sans-serif; letter-spacing: .02em;
}
.frame { position: absolute; border: 1px dashed currentColor; opacity: 0; transform-origin: 50% 50%; }

.guide { position: absolute; left: 0; top: 0; background: var(--sw-red); opacity: .7; }
.guide--v { width: 1px; transform-origin: 50% 0; }
.guide--h { height: 1px; width: 100%; background: var(--sw-blue); transform-origin: 0 50%; }

/* Tipeo: letras y líneas. El cursor de texto no ocupa espacio. */
.c { position: relative; }
.w { display: inline-block; } /* inline-block para que la línea pueda subir con transform */
.c.cur::after {
  content: ''; position: absolute; right: -2px; top: .12em; bottom: .08em; width: 2px;
  background: var(--bloom); animation: caret .5s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.veil { position: absolute; inset: 0; background: var(--ink-3); z-index: 2; }

/* Glitch RGB: franjas fijas, solo se mueven y se prenden */
.glitchable { position: relative; }
.gl {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  mix-blend-mode: screen; will-change: transform, opacity;
}
.gl, .gl * { color: var(--sw-red) !important; }
.gl--b, .gl--b * { color: var(--sw-blue) !important; }

/* HUD */
.hud {
  position: fixed; left: 50%; bottom: 16px; z-index: 70;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 12px 9px 14px; transform: translateX(-50%);
  background: var(--sw-hud); border: 1px solid var(--sw-hud-line); border-radius: 8px;
  font: 500 11px/1 'Instrument Sans', sans-serif; color: #d9d6d0;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
.hud__info { display: flex; align-items: center; gap: 12px; }
.hud__dots { display: flex; gap: 3px; }
.hud__dots span { width: 6px; height: 6px; border-radius: 50%; }
.hud__sep { width: 1px; height: 14px; background: var(--sw-hud-line); }
.hud__bar { width: 88px; height: 3px; background: #262626; border-radius: 2px; overflow: hidden; }
.hud__fill { height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.hud button {
  min-height: 28px; padding: 0 8px; border: 0; border-radius: 4px; cursor: pointer;
  background: transparent; color: #d9d6d0; font: inherit;
}
.hud button:hover { background: #222; color: #fff; }
.hud button:disabled { opacity: .35; cursor: default; background: transparent; }
.hud .hud__skip { color: #fff; background: #222; }
@media (max-width: 560px) {
  .hud { gap: 8px; padding: 6px 8px; bottom: 10px; }
  .hud__dots, .hud__sep { display: none; }
  .hud__bar { width: 40px; }
  .hud button { padding: 0 6px; }
}
