/* zintergia | propuesta "Del modelo a la operación"
   Una retícula viva en el hero (el papel cuadriculado donde se dibuja el
   negocio) y un modelo animado que pasa de revuelto a ordenado, a real y a
   optimizado. Esquinas rectas, un solo acento, tema que sigue al sistema. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #FAFAFB;
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --muted: #5B6270;
  --faint: #8A909C;
  --line: #E1E3E8;
  --blue: #0B84FF;
  --on-blue: #0A0A0A;

  --nav: 64px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1360px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0A;
    --paper: #111113;
    --ink: #F4F4F5;
    --muted: #9CA3AF;
    --faint: #6B7280;
    --line: #26272B;
    --blue: #3D97FF;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
em { font-style: normal; color: var(--blue); }
button { font: inherit; color: inherit; }
::selection { background: var(--blue); color: var(--on-blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 16px;
  background: var(--ink); color: var(--bg); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Tipografía ---------- */
.display {
  font-weight: 650;
  font-size: clamp(2.1rem, 0.5rem + 6.2vw, 6.25rem);
  line-height: .98; letter-spacing: -0.045em; text-wrap: balance;
}
.h2 {
  font-size: clamp(2rem, 1.1rem + 3.2vw, 3.75rem);
  line-height: 1.02; letter-spacing: -0.04em; font-weight: 650; text-wrap: balance;
}
.h3 {
  font-size: clamp(1.625rem, 1rem + 2.4vw, 3rem);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 650; text-wrap: balance; max-width: 18ch;
}
.lede {
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.3125rem); line-height: 1.5;
  color: var(--muted); max-width: 54ch; text-wrap: pretty;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 0;
  background: var(--blue); color: var(--on-blue);
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s;
}
.btn:hover { background: color-mix(in srgb, var(--blue) 88%, var(--ink)); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .9375rem; }
.link {
  position: relative; display: inline-flex; align-items: center; min-height: 52px;
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 12px; height: 1px;
  background: currentColor; transform-origin: left; transition: transform .5s var(--ease);
}
.link:hover::after { transform: scaleX(.35); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav); background: var(--bg);
  box-shadow: 0 1px 0 transparent; transition: box-shadow .3s;
}
.nav.is-stuck { box-shadow: 0 1px 0 var(--line); }
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 22px; width: auto; }
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 719px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: calc(100dvh - var(--nav)); display: flex; }
.field {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 46%, transparent 84%);
  mask-image: linear-gradient(to bottom, #000 0, #000 46%, transparent 84%);
}
.hero-in {
  width: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding-top: clamp(40px, 8vh, 96px); padding-bottom: clamp(40px, 7vh, 80px);
}
.title { max-width: 14.5em; }
.sent { display: block; }
.hero-foot { display: flex; flex-direction: column; gap: 28px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 32px; }
@media (max-width: 719px) {
  .hero { min-height: 0; }
  .hero-in { min-height: min(calc(100svh - var(--nav)), 640px); }
}

.mask { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .08em .16em; margin-block: -.08em -.16em; }
.w { display: inline-block; }
.js .hero .w { transform: translateY(108%); transition: transform .95s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.js .hero .hero-foot { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease) .6s, transform .8s var(--ease) .6s; }
.js .hero.is-in .w { transform: none; }
.js .hero.is-in .hero-foot { opacity: 1; transform: none; }
.failsafe .hero .w, .failsafe .hero .hero-foot { transform: none; opacity: 1; transition: none; }

/* ---------- Del modelo a la operación ---------- */
.method { padding-block: clamp(80px, 14vh, 160px); }
.method-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px); align-items: start;
}
@media (max-width: 899px) { .method-grid { grid-template-columns: minmax(0, 1fr); } }
.method-copy { display: flex; flex-direction: column; gap: 32px; }

.steps { display: grid; }
.step {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 14px 0 14px 34px; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer;
  font-size: clamp(1.5rem, 1rem + 1.8vw, 2.25rem); line-height: 1.1; letter-spacing: -0.035em; font-weight: 600;
  color: var(--faint); transition: color .3s;
}
.steps li:last-child .step { border-bottom: 1px solid var(--line); }
.step::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  background: var(--blue); transform: scale(0); transition: transform .4s var(--ease);
}
.step:hover, .step[aria-current="step"] { color: var(--ink); }
.step[aria-current="step"]::before { transform: scale(1); }

.step-text { margin-top: 10px; color: var(--muted); max-width: 46ch; }
.js .step-text { display: none; }

.readout { min-height: 9.5rem; }
.plain {
  font-size: clamp(1.375rem, 1rem + 1.4vw, 2.125rem); line-height: 1.18; letter-spacing: -0.03em;
  font-weight: 600; text-wrap: balance; max-width: 22em;
}
html:not(.js) .readout, html:not(.js) .model { display: none; }
html:not(.js) .step { cursor: default; padding-left: 0; color: var(--ink); }

/* El modelo: 25 puntos que pasan de revueltos a ordenados, conectados, reales y optimizados */
.model { position: relative; width: 100%; max-width: 580px; margin-left: auto; aspect-ratio: 1; container-type: size; }
@media (max-width: 899px) { .model { margin-left: 0; } }

.n {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--ink); opacity: .22;
  translate: calc(var(--jx) * 1cqw) calc(var(--jy) * 1cqw);
  transition: translate .9s var(--ease), opacity .5s, scale .6s var(--ease), background-color .5s;
}
.model:not([data-step="1"]) .n { translate: 0 0; }
.model:not([data-step="1"]) .n.is-model { background: var(--blue); opacity: 1; scale: 1.5; }
.model[data-step="3"] .n.is-model, .model[data-step="4"] .n.is-model { scale: 2.2; }
.model[data-step="4"] .n.is-model.is-dup { opacity: .07; scale: 1; }

.edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.edge {
  fill: none; stroke: var(--blue); stroke-width: .5; stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .8s var(--ease), opacity .6s; transition-delay: calc(var(--e) * 110ms);
}
.model:not([data-step="1"]) .edge { stroke-dashoffset: 0; }
.model[data-step="4"] .edge.dup { opacity: 0; transition-delay: 0s; }

/* Flujo del paso 4: rayitas que corren por las conexiones que quedaron */
.flow { fill: none; stroke: var(--bg); stroke-width: .6; stroke-dasharray: .9 2.7; opacity: 0; transition: opacity .5s .6s; }
.model[data-step="4"] .flow { opacity: 1; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -3.6; } }

.lab {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  font: 500 .8125rem/1 var(--mono); color: var(--ink); white-space: nowrap; pointer-events: none;
  opacity: 0; translate: var(--lx) var(--ly); transition: opacity .5s;
}
.model[data-step="3"] .lab, .model[data-step="4"] .lab { opacity: 1; transition-delay: .25s; }
@media (max-width: 599px) { .lab { font-size: .6875rem; translate: var(--lxm) var(--lym); } }

/* ---------- Tienda ---------- */
.shop { padding-block: clamp(80px, 14vh, 160px); }
.shop .lede { margin-top: 20px; }
.product {
  margin-top: clamp(48px, 8vw, 96px); padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start;
}
@media (max-width: 899px) { .product { grid-template-columns: minmax(0, 1fr); } }
.product-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.product-copy .h3 { max-width: 13ch; }
.product-name { font: 500 .9375rem/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 12px; }
.product-name::before { content: ""; width: 10px; height: 10px; background: var(--blue); }
.facts { display: grid; gap: 8px; color: var(--muted); font: 500 .875rem/1.4 var(--mono); }

.views { display: grid; gap: 16px; }
.view { margin: 0; }
.shot { background: #0F1115; border: 1px solid var(--line); aspect-ratio: 3 / 2; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.view figcaption { margin-top: 16px; max-width: 52ch; color: var(--muted); text-wrap: pretty; }
.sample { font: 500 .75rem/1 var(--mono); color: var(--faint); }
.view-tabs { display: inline-flex; justify-self: start; border: 1px solid var(--line); }
.view-tab {
  min-height: 44px; padding: 0 20px; background: none; border: 0; cursor: pointer;
  font-weight: 600; letter-spacing: -0.01em; transition: background-color .25s, color .25s;
}
.view-tab + .view-tab { border-left: 1px solid var(--line); }
.view-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
/* Con JS, las vistas se apilan en la misma celda y se funden entre sí */
.js .view-tabs { grid-area: 1 / 1; }
.js .view { grid-area: 2 / 1; transition: opacity .45s var(--ease), visibility 0s; }
.js .view:not(.is-active) { opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }
.js .sample { grid-area: 3 / 1; }

.features {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px 40px;
  padding-top: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9375rem;
}
.features b { display: block; margin-bottom: 6px; color: var(--ink); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

.next {
  margin-top: clamp(56px, 8vw, 96px); padding-top: 32px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px;
}

/* ---------- Cómo trabajamos ---------- */
.how { padding-block: clamp(64px, 12vh, 140px); }
.how-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.how-title { position: sticky; top: calc(var(--nav) + 32px); max-width: 11em; }
.how-list { display: grid; }
.how-item { display: grid; gap: 20px; padding-block: clamp(40px, 7vw, 88px); border-top: 1px solid var(--line); }
.how-item:first-child { border-top: 0; padding-top: 0; }
.word { font: 500 .9375rem/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 12px; }
.word::before { content: ""; width: 10px; height: 10px; background: var(--blue); }
.card-p { max-width: 52ch; color: var(--muted); font-size: clamp(1rem, .95rem + .3vw, 1.1875rem); text-wrap: pretty; }
@media (max-width: 899px) {
  .how-grid { grid-template-columns: minmax(0, 1fr); }
  .how-title { position: static; }
}

/* ---------- Contacto y pie ---------- */
.contact { padding-block: clamp(96px, 18vh, 200px) clamp(72px, 12vh, 140px); }
.contact .display { max-width: 11em; }
.contact .lede { margin-top: 32px; }
.btn-xl { margin-top: 48px; gap: 22px; padding: 0 clamp(24px, 4vw, 44px); min-height: clamp(72px, 9vw, 96px); max-width: 100%; }
.btn-xl .ico { width: clamp(30px, 4vw, 40px); height: clamp(30px, 4vw, 40px); flex: none; }
.btn-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.btn-label { font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); letter-spacing: -0.02em; }
.btn-num { font: 500 clamp(.9375rem, .85rem + .4vw, 1.125rem)/1 var(--mono); opacity: .8; }
.btn-xl .arrow { margin-left: 16px; width: 28px; height: 28px; transition: transform .45s var(--ease); }
.btn-xl:hover .arrow { transform: translate(4px, -4px); }
.fine { margin-top: 40px; max-width: 46ch; color: var(--muted); font-size: .9375rem; }

.foot { padding-block: clamp(24px, 4vw, 48px) 28px; overflow: hidden; }
.foot-mark img { width: 100%; height: auto; }
.foot-row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(24px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .875rem;
}
.foot-row a { color: inherit; text-decoration: none; font-family: var(--mono); font-weight: 500; }
.foot-row a:hover { color: var(--ink); }

/* ---------- Revelado al entrar ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .foot-mark { display: block; clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease); }
.js .foot.in .foot-mark { clip-path: inset(0); }
.failsafe [data-reveal], .failsafe .foot-mark { opacity: 1; transform: none; clip-path: none; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
  .js .hero .w, .js .hero .hero-foot, .js [data-reveal] { opacity: 1; transform: none; }
  .js .foot-mark { clip-path: none; }
}
