/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
ul, li { list-style: none; }
a { color: inherit; text-decoration: none; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img, svg { display: block; }

/* ---------- base ---------- */
html, body {
  height: 100%;
  overflow: hidden;            /* the engine owns scrolling (desktop virtual) */
  overscroll-behavior: none;
}
/* Mobile: the BROWSER owns scrolling — the engine reads scrollY per frame.
   The class is set by the engine on boot when a touch device is detected. */
html.native-scroll, html.native-scroll body {
  height: auto;
  overflow: auto;
}
body {
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  background: #f2f2f2;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}
body.is-dragging { user-select: none; cursor: grabbing; }

/* ---------- fixed layers ---------- */
#gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
#main-w { position: relative; z-index: 2; }
#shield { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#veil {
  position: fixed; inset: 0; z-index: 9998;
  background: #141414;
  transform: translate3d(0, 101%, 0);
  pointer-events: none;
}
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #f2f2f2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
#loader-logo { font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
#loader-counter { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; opacity: 0.6; }

/* ---------- nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 40px;
  opacity: 0;
}
#nav-logo { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
#nav-list { display: flex; gap: 32px; }
#nav-list a { font-size: 13px; display: flex; gap: 8px; opacity: 0.75; transition: opacity 0.3s; }
#nav-list a:hover, #nav-list a.is-active { opacity: 1; }
#nav-list a span { opacity: 0.4; font-variant-numeric: tabular-nums; }

/* ---------- page / sections (culler targets are .page children) ---------- */
.page { will-change: auto; }
.page > * { will-change: transform; }

/* ---------- split text ---------- */
.split-mask { display: block; overflow: hidden; }
.split-line { display: block; will-change: transform; }
[data-split="chars"] { overflow: hidden; } /* the title itself is the clip mask */
.split-char { display: inline-block; }

#nav-items { display: flex; gap: 32px; }

/* ---------- hero ---------- */
.hero {
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 40px 6vh;
}
.hero-title {
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.94;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  perspective: 1000px;
}
.hero-sub {
  margin-top: 32px;
  display: flex; align-items: flex-start; gap: 16px;
  font-size: 15px;
  max-width: 420px;
}
.hero-ring { width: 36px; height: 36px; flex: none; }
.hero-ring circle { stroke: currentColor; stroke-width: 1; }

/* ---------- cards ---------- */
.card-section { padding: 8vh 40px 4vh; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
}
.card-media {
  width: 100%;
  /* transparent — pixels are painted by the WebGL canvas behind the page */
}
.card-info { margin-top: 14px; font-size: 13px; }
.card-info a { display: inline; }
.card-info span { display: block; opacity: 0.5; margin-top: 2px; }

.card--1 { grid-column: 1 / 8; }
.card--1 .card-media { aspect-ratio: 4 / 3; }
.card--2 { grid-column: 9 / 13; margin-top: 22vh; }
.card--2 .card-media { aspect-ratio: 3 / 4; }
.card--3 { grid-column: 2 / 7; margin-top: 18vh; }
.card--3 .card-media { aspect-ratio: 4 / 5; }
.card--4 { grid-column: 8 / 13; margin-top: 8vh; }
.card--4 .card-media { aspect-ratio: 16 / 10; }
.card--5 { grid-column: 1 / 6; margin-top: 16vh; }
.card--5 .card-media { aspect-ratio: 4 / 3; }
.card--6 { grid-column: 7 / 12; margin-top: 10vh; }
.card--6 .card-media { aspect-ratio: 4 / 3; }

/* ---------- detail page ---------- */
.detail-hero { position: relative; height: 100vh; }
.detail-hero-media { position: absolute; inset: 0; }
.detail-hero-content {
  position: absolute; left: 40px; right: 40px; bottom: 6vh;
  color: #f5f4f2; z-index: 2;
}
.detail-hero-meta { margin-top: 18px; font-size: 14px; opacity: 0.9; }
.detail-body { padding: 12vh 40px; display: flex; justify-content: center; }
.detail-body p { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; max-width: 900px; letter-spacing: -0.015em; }
.detail-next { padding: 10vh 40px 14vh; }
.detail-next-label { display: block; font-size: 13px; opacity: 0.5; margin-bottom: 12px; }
.detail-next-link {
  font-size: clamp(40px, 7vw, 110px);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 0.96;
}
.detail-next-link:hover { opacity: 0.6; }

/* ---------- lab: sliders playground ---------- */
.hero--lab { min-height: 60vh; }
.lab-block { padding: 6vh 40px; }
.lab-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  opacity: .5; margin-bottom: 20px; font-weight: 500;
}
.rich { font-size: clamp(20px, 2.2vw, 30px); line-height: 1.35; max-width: 560px; letter-spacing: -0.015em; }

/* ---------- lab-text: bloques SplitText ---------- */
.tsplit { max-width: 820px; }
.tsplit--l { font-size: clamp(28px, 3.4vw, 52px); line-height: 1.18; font-weight: 600; letter-spacing: -0.02em; }
.tsplit--m { font-size: clamp(18px, 2vw, 28px); line-height: 1.35; letter-spacing: -0.015em; }
.tsplit a { text-decoration: underline; }
.tsplit .line { white-space: nowrap; }
.t-link { white-space: nowrap; }
.t-arrow { display: inline-block; }
.t-arrow::before { content: '\2192'; margin-left: 6px; text-decoration: none; }
.t-replay {
  margin-top: 28px; padding: 10px 22px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px;
  opacity: .7; transition: opacity 250ms;
}
.t-replay:hover { opacity: 1; }
.rich a { text-decoration: underline; }
.line-mask { display: block; overflow: hidden; }
.line { display: block; }

/* BPM pone user-select:none en cada modulo de slider — sin esto el drag
   deja texto seleccionado (el "select patea"). */
.slider-section { -webkit-user-select: none; user-select: none; }
.slider-area { overflow: hidden; cursor: grab; touch-action: pan-y; }
.slider-area:active { cursor: grabbing; }
.track { display: flex; width: max-content; }
.slide { flex-shrink: 0; will-change: transform; }
.slide-img { overflow: hidden; }
.slide-img > span { display: block; width: 130%; height: 100%; will-change: transform; }
.slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider-count { font-size: 13px; margin-top: 14px; font-variant-numeric: tabular-nums; opacity: .5; }

/* Products (mo13, geometría BPM): grilla de 12 columnas — el slide mide 11
   col, la imagen va inserta 1 col adentro (ese inset ES el gap visual), el
   track arranca 1 slide a la izquierda (lead-in, data-base=1), el texto se
   superpone al banner, y el control centrado usa subrayado.
   CLAVE del loop infinito: TODOS los spans idénticos (sin excepción en el
   primer hijo) — la cinta uniforme es lo que hace invisible el wrap.
   El área es full-bleed (anula el padding del bloque): la imagen actual
   queda centrada y los vecinos asoman como slivers simétricos en los bordes
   de la ventana, como en BPM. */
.slider--products {
  --pmarge: 40px;
  --pgut: 24px;
  --pcol: calc((100vw - 2 * var(--pmarge) - 11 * var(--pgut)) / 12);
}
.slider--products .slider-area { margin-inline: -40px; }
.slider--products .track { margin-left: calc(var(--pmarge) - 11 * var(--pcol) - 11 * var(--pgut)); }
.slider--products .slide {
  position: relative;
  width: calc(11 * var(--pcol) + 11 * var(--pgut));
  margin-left: 0;
}
.slider--products .slide-img {
  margin-left: calc(var(--pcol) + var(--pgut));
  width: calc(10 * var(--pcol) + 9 * var(--pgut));
  aspect-ratio: 2700 / 1290;
}
.prod-txt {
  position: absolute; top: 0; left: calc(2 * var(--pcol) + 2 * var(--pgut)); height: 100%;
  display: flex; align-items: center; gap: 3vw;
  color: #fff; text-shadow: 0 1px 14px rgba(0,0,0,.35);
  pointer-events: none; z-index: 1;
}
.prod-index { font-size: 14px; font-variant-numeric: tabular-nums; opacity: .8; }
.prod-title { font-size: clamp(32px, 4.2vw, 64px); font-weight: 600; letter-spacing: -0.02em; }
.prod-label { font-size: 11px; letter-spacing: .1em; margin-top: 12px; opacity: .85; }
.stabs { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 26px; }
.stabs-arrow { font-size: 18px; opacity: .4; padding: 8px 10px; transition: opacity 300ms; }
.stabs-arrow:hover { opacity: 1; }
.stabs-list {
  position: relative; display: flex; justify-content: space-between;
  min-width: 240px; padding-bottom: 8px; font-weight: 500;
}
.stabs-item { position: relative; z-index: 1; font-size: 13px; padding: 4px 2px; }
.stabs-active {
  position: absolute; left: 0; bottom: 0; height: 2px; z-index: 0;
  background: currentColor;
  transform-origin: left center; will-change: transform;
}

/* Access To (mo14, geometría BPM): slide 2col+2gut, imagen 2col+1gut 16:9
   inset 1 gutter; el focuseado escala 2.066 desde origin 0 0. El texto (.focus-x)
   mide 6col y desborda el slide — los offsets del engine corren los vecinos.
   Clipping en la SECCIÓN (como .mo14 { overflow:hidden }), área y slide-img
   abiertos para que la imagen escalada respire. */
.slider--focus {
  --fmarge: 40px;
  --fgut: 24px;
  --fcol: calc((100vw - 2 * var(--fmarge) - 11 * var(--fgut)) / 12);
  overflow: hidden;
}
.slider--focus .slider-area { overflow: visible; margin-inline: -40px; padding-bottom: 9vw; }
.slider--focus .track { margin-left: calc(var(--fmarge) - var(--fgut) * 2 - var(--fcol)); }
.slider--focus .slide { position: relative; width: calc(var(--fcol) * 2 + var(--fgut) * 2); }
.focus-x { width: calc(var(--fcol) * 6 + var(--fgut) * 5); will-change: transform; }
.focus-top { height: 160px; display: flex; }
.focus-line_ { position: relative; width: var(--fgut); height: 100%; }
.focus-line { width: 1px; height: 100%; background: rgba(0, 0, 0, .18); }
.focus-title { width: calc(var(--fcol) * 2 + var(--fgut)); display: flex; font-weight: 500; }
.focus-title-index { width: 12px; font-size: 12px; line-height: 20px; }
.focus-title-txt { flex: 1; margin-left: 12px; max-width: 135px; font-size: 16px; line-height: 20px; }
.focus-p { margin-left: var(--fgut); width: calc(var(--fcol) * 2 + var(--fgut)); max-width: 290px; font-size: 13px; line-height: 18px; opacity: .55; }
/* Como BPM (.t-s .y etc): la linea spliteada no re-wrapea dentro de su mascara */
.slider--focus .line { white-space: nowrap; }
.slider--focus .slide-img {
  position: relative; overflow: visible;
  margin-top: 32px; margin-left: var(--fgut);
  width: calc(var(--fcol) * 2 + var(--fgut));
  aspect-ratio: 16 / 9;
}
.focus-link {
  display: block; width: 100%; height: 100%;
  transform-origin: 0 0; overflow: hidden;
  background: #e2e0dc; pointer-events: none;
}
.focus-pa { width: auto; height: 100%; will-change: transform; }
.slider--focus .slide-img img { width: auto; height: 100%; display: block; }
.focus-play {
  position: absolute; top: -14px; left: -14px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .8); border-radius: 100%;
  color: #fff; font-size: 11px; text-indent: 2px;
  will-change: transform; pointer-events: none;
}
.focus-hero { display: flex; align-items: baseline; justify-content: space-between; }
.focus-pg { display: flex; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.slider--focus .slider-count { margin-top: 0; font-size: 13px; opacity: 1; }
.focus-pg-total { opacity: .5; }
.stimer { margin-left: 8px; height: 4px; display: flex; }
.stimer > div {
  margin-left: 4px; width: 4px; height: 100%; border-radius: 4px; overflow: hidden;
  background: rgba(0, 0, 0, .25); will-change: width; transition: width 600ms cubic-bezier(.25, 1, .5, 1);
}
.stimer > div.fx { width: 100px; }
.stimer-bar { width: 100%; height: 100%; border-radius: 4px; background: #111; transform: translate3d(-110%, 0, 0); }

/* Culture (mo08): cards verticales 4:5 con link.
   Calcado `.mo08 .sa a>*` (idem mo14): los hijos del link NO reciben
   eventos — el target del drag es el <a> mismo, la condicion de moveD
   (target.tagName === 'A') dispara y setLinks apaga los links durante el
   gesto → soltar un drag jamas navega. */
.slider--culture .slide a > *,
.focus-link > * { pointer-events: none; }
.slider--culture .slide { width: min(24vw, 340px); margin-left: 24px; }
.slider--culture .slide:first-child { margin-left: 0; }
.slider--culture .slide-img { aspect-ratio: 4 / 5; }
.cult-txt { margin-top: 12px; }
.cult-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cult-label { font-size: 11px; letter-spacing: .08em; opacity: .55; margin-top: 4px; }

/* Basic */
.slider--basic .slide { width: min(26vw, 340px); margin-left: 24px; }
.slider--basic .slide:first-child { margin-left: 0; }
.slider--basic .slide-img { aspect-ratio: 340 / 220; }
.slide-cap { font-size: 13px; margin-top: 10px; opacity: .7; }

/* ---------- case: images repeater ---------- */
.case-images {
  padding: 14vh 40px 4vh;
  display: grid; grid-template-columns: repeat(12, 1fr);
  column-gap: 24px; row-gap: 12vh;
}
.case-image {
  width: 100%; /* transparent — pixels painted by the GL canvas */
  /* Real image proportion from the CMS (--ratio, set per element in the
     build) — layout reserves the exact box before any texture loads. */
  aspect-ratio: var(--ratio, 4 / 3);
}
.case-image:nth-child(3n + 1) { grid-column: 2 / 12; }
.case-image:nth-child(3n + 2) { grid-column: 1 / 7; }
.case-image:nth-child(3n) { grid-column: 8 / 13; align-self: center; }

/* ---------- case: scope of work ---------- */
.scope { padding: 12vh 40px 6vh; }
.scope-title {
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 6vh;
}
.scope-list li {
  display: grid; grid-template-columns: 60px 1fr 1.4fr; column-gap: 24px;
  align-items: baseline;
  padding: 26px 0; border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.scope-index { font-size: 13px; opacity: 0.4; font-variant-numeric: tabular-nums; }
.scope-list h3 { font-size: clamp(20px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; }
.scope-list p { font-size: 15px; line-height: 1.45; opacity: 0.75; max-width: 560px; }

/* ---------- footer ---------- */
.footer { padding: 14vh 40px 40px; }
.footer-claim {
  font-size: clamp(36px, 5.5vw, 84px);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 10vh;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; opacity: 0.75;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 24px;
}
.footer-top:hover { opacity: 0.5; }

/* ---------- ease tuner (dev) ---------- */
#ease-tuner {
  position: fixed; bottom: 12px; right: 12px; z-index: 10001;
  display: flex; gap: 12px; align-items: center;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  background: rgba(20, 20, 20, 0.88); color: #eee;
  padding: 8px 12px; border-radius: 6px;
}
#ease-tuner label { display: flex; gap: 6px; align-items: center; opacity: 0.9; }
#ease-tuner select, #ease-tuner input {
  font: inherit; color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px;
  padding: 3px 6px;
}
#ease-tuner input[type="number"] { width: 60px; }

/* ---------- perf hud (?perf) ---------- */
#perf-hud {
  position: fixed; bottom: 12px; left: 12px; z-index: 10001;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.4;
  background: rgba(20, 20, 20, 0.85); color: #9f9;
  padding: 6px 10px; border-radius: 4px;
  pointer-events: none; white-space: nowrap;
}

/* ---------- misc ---------- */
.noscript {
  position: fixed; inset: 0; z-index: 10000;
  background: #fff; display: grid; place-items: center;
}
