/* ============================================================
   SINCRO · Precisión
   Hoja principal. Los colores viven en brand/tokens-precision.css
   y acá no se escribe ni un hex suelto.
   ============================================================ */

/* ---------- fuentes ---------- */
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('fonts/schibsted-grotesk-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('fonts/schibsted-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--dur-move) var(--ease), color var(--dur-move) var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-input);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--s5); z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: var(--s3) var(--s5); border-radius: var(--r-pill);
  transition: top var(--dur-micro) var(--ease);
}
.skip-link:focus-visible { top: var(--s5); }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--s5);
}
@media (min-width: 900px) { .wrap { padding-inline: var(--s6); } }

.measure { max-width: 62ch; }
.measure-tight { max-width: 46ch; }

section { position: relative; }

.band {
  padding-block: clamp(88px, 13vw, 176px);
}
.band--mist { background: var(--mist); }
.band--edge { border-top: 1px solid var(--line); }

/* ---------- tipografía ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.06;
  text-wrap: balance;
}

.t-display {
  font-size: clamp(2.75rem, 7.4vw, 5.75rem);
  letter-spacing: -0.042em;
  line-height: 1.02;
}
.t-h2 {
  font-size: clamp(2.125rem, 4.6vw, 3.75rem);
  letter-spacing: -0.036em;
}
.t-h3 {
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  letter-spacing: -0.028em;
  line-height: 1.14;
}

.t-lead {
  font-size: clamp(1.125rem, 1.55vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-muted);
  margin: var(--s5) 0 0;
  text-wrap: pretty;
}
.t-body { margin: var(--s4) 0 0; color: var(--ink-muted); text-wrap: pretty; }
.t-caption { font-size: 0.875rem; line-height: 1.5; color: var(--ink-subtle); margin: 0; }

.t-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 var(--s5);
}

/* ---------- controles ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 14px var(--s5);
  border-radius: var(--r-pill);
  font-size: 1rem; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--dur-micro) var(--ease),
              color var(--dur-micro) var(--ease),
              border-color var(--dur-micro) var(--ease),
              transform var(--dur-micro) var(--ease);
}
.btn:active { transform: scale(0.975); }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

.btn--sm { padding: 9px var(--s4); font-size: 0.9375rem; }

/* enlace con flecha — el CTA que Apple usa en el hero */
.link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 500;
}
.link .arw {
  transition: transform var(--dur-micro) var(--ease);
}
.link:hover .arw { transform: translateX(4px); }
.link:hover .link-txt { text-decoration: underline; text-underline-offset: 4px; }

.cta-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s5); margin-top: var(--s6);
}
.cta-row--center { justify-content: center; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: 60px;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-move) var(--ease),
              border-color var(--dur-move) var(--ease),
              backdrop-filter var(--dur-move) var(--ease);
}
.nav[data-stuck="true"] {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s5); height: 100%;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand svg { width: 26px; height: 26px; color: var(--ink); }
.brand-name {
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em;
}
.nav-links { display: none; gap: var(--s5); }
@media (min-width: 940px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.9375rem; color: var(--ink-muted);
  transition: color var(--dur-micro) var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-side { display: flex; align-items: center; gap: var(--s3); }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  color: var(--ink-muted);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.icon-btn:hover { background: var(--mist); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }
[data-theme="dark"] .theme-btn .sun { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: clamp(128px, 17vw, 190px);
  padding-bottom: clamp(64px, 8vw, 104px);
  text-align: center;
}
.hero h1 { margin-inline: auto; max-width: 15ch; }
.hero .t-lead { margin-inline: auto; max-width: 54ch; }

/* marco del producto: el "objeto héroe" que a un software le suele faltar */
.stage {
  margin-top: clamp(48px, 7vw, 88px);
  border-radius: var(--r-surface);
  border: 1px solid var(--line);
  background: var(--mist);
  box-shadow: var(--e3);
  overflow: hidden;
  will-change: transform;
}
.stage img { width: 100%; height: auto; }

.stage-cap {
  margin-top: var(--s4);
  text-align: center;
}

/* ============================================================
   DECLARACIÓN · una idea por pantalla
   ============================================================ */
.claim {
  font-size: clamp(1.75rem, 4.1vw, 3.25rem);
  font-weight: 600; letter-spacing: -0.034em; line-height: 1.18;
  max-width: 20ch;
}
.claim .dim { color: var(--ink-subtle); }
.claim .hot { color: var(--accent); }

.leaks {
  display: grid; gap: 0;
  margin-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line);
}
.leak {
  display: grid; gap: var(--s2);
  grid-template-columns: 1fr;
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) {
  .leak { grid-template-columns: 200px 1fr; gap: var(--s6); align-items: baseline; }
}
.leak-k {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle);
}
.leak-v { margin: 0; color: var(--ink); font-size: 1.0625rem; }

/* ============================================================
   FLUJO · el momento con scroll
   ============================================================ */
.flow { position: relative; }
.flow-grid { display: grid; gap: var(--s6); }
@media (min-width: 1000px) {
  .flow-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s8); align-items: start; }
}

/* El diagrama se centra en el alto de la pantalla: si va pegado arriba
   deja un pozo de aire abajo y se despega del paso que se esta leyendo. */
.flow-sticky {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 999px) {
  .flow-sticky {
    top: 60px;
    height: auto;
    z-index: 2;
    padding-block: var(--s4) var(--s6);
    background: linear-gradient(var(--paper) 78%, transparent);
  }
}

.flow-steps { display: grid; }
.step {
  padding-block: clamp(48px, 12vh, 120px);
  opacity: 0.42;
  transition: opacity var(--dur-move) var(--ease);
}
.step[data-on="true"] { opacity: 1; }
.step-n {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.1em; color: var(--accent); margin: 0 0 var(--s3);
}
.step h3 { margin-bottom: var(--s3); }
.step p { margin: 0; color: var(--ink-muted); }

/* --- el diagrama --- */
.diagram {
  width: 100%;
  aspect-ratio: 560 / 500;
  max-height: min(62vh, 520px);
  margin-inline: auto;
}
@media (max-width: 999px) { .diagram { max-height: 40vh; } }

.diagram .node rect,
.diagram .node circle { transition: fill var(--dur-move) var(--ease), stroke var(--dur-move) var(--ease); }
.diagram .node text { transition: fill var(--dur-move) var(--ease); }

.diagram .n-box { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .n-txt { fill: var(--ink-subtle); font-family: var(--font); font-size: 13px; font-weight: 500; }
.diagram .wire {
  stroke: var(--line-strong); stroke-width: 1.5; fill: none;
  stroke-dasharray: 1 0;
  transition: stroke var(--dur-move) var(--ease), stroke-width var(--dur-move) var(--ease);
}

/* nodo activo */
.diagram .node.is-on .n-box { fill: var(--accent); stroke: var(--accent); }
.diagram .node.is-on .n-txt { fill: var(--on-accent); }
.diagram .wire.is-on { stroke: var(--accent); stroke-width: 2.5; }

/* el núcleo */
.diagram .core rect { fill: var(--ink); stroke: var(--ink); }
.diagram .core text { fill: var(--paper); font-weight: 600; font-size: 15px; }
.diagram .core.is-on rect { fill: var(--accent); stroke: var(--accent); }

/* El pulso viaja por el cable encendido: dice que algo se movio de un
   lado al otro, no solo que un nodo cambio de color. */
.pulse {
  stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round;
  opacity: 0;
  transition: opacity var(--dur-move) var(--ease);
}
.pulse.is-on {
  opacity: 1;
  stroke-dasharray: 16 320;
  animation: travel 1.9s linear infinite;
}
@keyframes travel {
  from { stroke-dashoffset: 336; }
  to   { stroke-dashoffset: 0; }
}

/* ============================================================
   CLIENTES
   Los cuatro se ven juntos: es lo primero que la pagina tiene que probar.
   Antes era un carrusel y el cuarto quedaba fuera de pantalla.
   ============================================================ */
.work {
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  margin-top: clamp(48px, 6vw, 80px);
}
@media (min-width: 860px) {
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.work-head {
  display: flex; align-items: center; gap: var(--s4);
  margin-bottom: var(--s5);
}

/* Ficha del logo. Los cuatro logos vienen con fondos distintos —dorado,
   azul, transparente oscuro, lettering claro— asi que se igualan por
   tamano y radio, no por fondo. */
.chip {
  flex: 0 0 auto;
  width: 54px; height: 54px;
  border-radius: var(--r-icon);
  overflow: hidden;
  display: grid; place-items: center;
}
.chip img { width: 100%; height: 100%; object-fit: contain; }

.chip--bleed img { object-fit: cover; }
.chip--light { background: var(--chip-light); border: 1px solid var(--line); padding: 7px; }
.chip--dark  { background: var(--chip-dark); padding: 7px; }

.work-id h3 { font-size: 1.1875rem; letter-spacing: -0.024em; }
.work-id p { margin: 3px 0 0; color: var(--ink-subtle); font-size: 0.9375rem; }

.card-shot {
  border-radius: var(--r-surface);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper);
  /* Las capturas son 1200x750 = 16:10. Con 4:3 se recortaban los costados
     y a JLT le cortaba el nombre. Con la proporcion real se ven enteras. */
  aspect-ratio: 16 / 10;
  box-shadow: var(--e1);
  transition: box-shadow var(--dur-move) var(--ease), transform var(--dur-move) var(--ease);
}
.card-shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 700ms var(--ease);
}
.work-item:hover .card-shot { box-shadow: var(--e2); transform: translateY(-4px); }
.work-item:hover .card-shot img { transform: scale(1.035); }

/* ============================================================
   INTEGRACIONES · una sola marquesina, no tres
   ============================================================ */
.ticker {
  position: relative; overflow: hidden;
  margin-top: clamp(40px, 5vw, 64px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track {
  display: flex; width: max-content; gap: var(--s6);
  animation: slide 46s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500;
  color: var(--ink-subtle); white-space: nowrap;
}
@keyframes slide { to { transform: translateX(-50%); } }

/* ============================================================
   CLIENTES / PRUEBA
   ============================================================ */
.facts { display: grid; gap: var(--s6); margin-top: clamp(48px, 6vw, 80px); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); max-width: 860px; } }
.fact-n {
  font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 600;
  letter-spacing: -0.04em; line-height: 1; margin: 0;
}
.fact-t { margin: var(--s3) 0 0; font-size: 1rem; }
.fact-d { margin: 6px 0 0; color: var(--ink-subtle); font-size: 0.9375rem; }

/* ============================================================
   CIERRE
   ============================================================ */
.close { text-align: center; }
.close h2 { margin-inline: auto; max-width: 17ch; }
.close .t-lead { margin-inline: auto; max-width: 50ch; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { border-top: 1px solid var(--line); padding-block: var(--s7) var(--s6); }
.foot-grid {
  display: flex; flex-wrap: wrap; gap: var(--s5);
  align-items: center; justify-content: space-between;
}
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s5); }
.foot-links a { font-size: 0.9375rem; color: var(--ink-muted); }
.foot-links a:hover { color: var(--ink); }
.foot-legal { margin-top: var(--s6); font-size: 0.875rem; color: var(--ink-subtle); }

/* ============================================================
   MOVIMIENTO
   Todo lo de abajo se apaga entero bajo reduced-motion.
   ============================================================ */

/* revelado al entrar en pantalla */
.rv {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: var(--d, 0ms);
}
.rv.on { opacity: 1; transform: none; }

/* revelado del titular por líneas, con máscara */
.mask-line {
  overflow: hidden; display: block;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.mask-line > span {
  display: block;
  transform: translateY(128%);
  transition: transform 1000ms var(--ease);
  transition-delay: var(--d, 0ms);
}
.on .mask-line > span,
.mask-line.on > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .mask-line > span { transform: none; transition: none; }
  .ticker-track { animation: none; }
  .stage { transform: none !important; }
  .step { opacity: 1; }
  .pulse.is-on { animation: none; stroke-dasharray: none; }
}

/* ============================================================
   MENÚ MÓVIL
   Abajo de 940px los enlaces del nav desaparecen; sin esto la
   página se queda sin navegación.
   ============================================================ */
.nav-toggle { display: grid; }
@media (min-width: 940px) { .nav-toggle { display: none; } }

.nav-toggle .bars { width: 18px; height: 12px; position: relative; }
.nav-toggle .bars span {
  position: absolute; left: 0; right: 0; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: transform var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { bottom: 0; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { transform: translateY(-5.25px) rotate(-45deg); }

.sheet {
  position: fixed; inset: 60px 0 0; z-index: 99;
  background: var(--paper);
  padding: var(--s6) var(--s5) var(--s7);
  display: flex; flex-direction: column; gap: var(--s2);
  opacity: 0; visibility: hidden;
  transition: opacity 320ms var(--ease), visibility 320ms var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet[data-open="true"] { opacity: 1; visibility: visible; }
@media (min-width: 940px) { .sheet { display: none; } }

.sheet a {
  font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em;
  padding-block: var(--s4);
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(14px);
  transition: opacity 460ms var(--ease), transform 460ms var(--ease);
  transition-delay: var(--d, 0ms);
}
.sheet[data-open="true"] a { opacity: 1; transform: none; }
.sheet .btn { margin-top: var(--s5); justify-content: center; }
.sheet .btn { opacity: 1; transform: none; border-bottom: 0; font-size: 1rem; }

body[data-locked="true"] { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet a { transition: none; }
  .sheet a { opacity: 1; transform: none; }
}

/* En móvil el diagrama fijo ya ocupa media pantalla: si además los pasos
   llevan el padding de escritorio, queda un pozo de aire entre uno y otro. */
@media (max-width: 999px) {
  .step { padding-block: clamp(32px, 7vh, 64px); }
  .flow-grid { gap: 0; }
}

/* En pantallas chicas el panel entero se achica hasta volverse una mancha
   gris. Mejor mostrar un pedazo real del producto, a tamaño legible, que
   la captura completa ilegible. */
@media (max-width: 700px) {
  .stage { aspect-ratio: 4 / 3; }
  .stage img {
    width: 200%;
    height: 100%;
    object-fit: cover;
    object-position: 14% 20%;
  }
}
