/* =================================================
   UiFilm — Case Study
   Carmen Padró · 2024
   ================================================= */

:root {
  --bg: #000;
  --fg: #fff;
  --ink: #fff;
  --rule: rgba(255,255,255,0.18);
  --muted: rgba(255,255,255,0.55);
  --accent: #ff3b30;
  --tape: #f4d03f;
  --slate: #0e0e10;
  /* small mono label — reference style (matches "PRODUCT · END TO END" header) */
  --label-size: clamp(10px, min(0.85vw, 1.5vh), 14px);
  --label-tracking: 0.16em;
}
.label-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--muted);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
}
body {
  font-family: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
body.no-cursor-fx { cursor: auto; }
body.no-cursor-fx .cursor-dot, body.no-cursor-fx .cursor-disc { display: none; }

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ================ CURSOR (carry-over from index) ================ */
.cursor-dot, .cursor-disc {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-disc {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, background 0.25s, color 0.25s;
  display: flex; align-items: center; justify-content: center;
  color: #000; font-family: "JetBrains Mono", monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.cursor-disc.expanded {
  width: 110px; height: 110px;
  background: #fff;
}
.cursor-disc.expanded::after {
  content: attr(data-label);
}
/* Sobre zonas con mucho hover propio (sistema de diseño): el cursor personalizado
   se queda en su estado neutro (ring + dot blancos) PERO sin mix-blend-mode,
   para no invertir los colores de las celdas/swatches y conservar sus hovers. */
.cursor-disc.cursor-flat,
.cursor-dot.cursor-flat {
  mix-blend-mode: normal;
}
/* Cursor pulse: indica que el elemento bajo el cursor es trasteable
   (teclas del móvil, botones del laptop, input del laptop, etc.).
   Pulsa con un anillo blanco expansivo + el disco se llena. */
.cursor-disc.pulsing {
  animation: cursor-pulse 0.95s ease-out infinite;
}
@keyframes cursor-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.85);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255,255,255,0);
    background: rgba(255,255,255,0.4);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(255,255,255,0);
    background: transparent;
  }
}

/* ================ TOP NAV ================ */
.cs-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 32px;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}
.cs-nav > * { pointer-events: auto; }
.cs-nav .back {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.cs-nav .back .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
.cs-nav .back:hover .arrow { transform: translateX(-6px); }
.cs-nav .center { text-align: center; opacity: 0.7; }
.cs-nav .right { display: flex; justify-content: flex-end; align-items: center; gap: 24px; }
.cs-nav .right .cs-nav__count { opacity: 0.7; }

/* ================ HERO / TITLE CARD ================ */
.hero {
  height: 100vh;
  min-height: 640px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  /* abajo: aire + los 28px de la barra fija de scroll, que tapaba la última fila */
  padding: clamp(64px, 5.5vh, 90px) 32px calc(28px + clamp(18px, 2vh, 32px));
  position: relative;
  overflow: visible;
}
.hero-title-block {
  min-height: 0;
  align-self: center;
  width: 100%;
}

.hero-credits-top {
  /* 3 columnas 1fr·auto·1fr: la del centro queda centrada en el viewport
     aunque la izquierda y la derecha midan distinto (con flex se desviaba). */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  font-size: clamp(10px, min(0.85vw, 1.5vh), 14px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}
.hero-credits-top .col { white-space: nowrap; }
.hero-credits-top .col:nth-child(3) { justify-self: end; text-align: right; }
.hero-credits-top .col .label { display: block; opacity: 0.55; margin-bottom: 6px; }
.hero-credits-top .col .val { color: var(--fg); }

.hero-title-block {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: clamp(2vh, 3vh, 4vh);
}

.hero-pretitle {
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 14px;
}
.hero-pretitle::before {
  content: "";
  display: inline-block;
  width: 36px; height: 1px;
  background: currentColor;
}

.hero-title {
  font-family: "Inter Tight", sans-serif;
  font-weight: 900;
  /* gigante pero acotado por ancho y alto para no empujar el subtitle */
  font-size: clamp(72px, min(12.5vw, 24vh), 240px);
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin: 0;
  text-transform: none;
}
.hero-title .row { display: block; overflow: hidden; }
.hero-title .row > span {
  display: inline-block;
  transform: translateY(110%);
  animation: hero-rise 1.2s cubic-bezier(0.2,0.8,0.2,1) forwards;
}
.hero-title .row:nth-child(2) > span { animation-delay: 0.1s; }
.hero-title .it {
  font-style: italic;
  font-weight: 300;
  font-size: 0.75em;      /* 180/240 → relación fija */
  letter-spacing: -0.02em;
  display: inline-block;
}
@keyframes hero-rise {
  to { transform: translateY(0); }
}


.hero-subtitle {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-style: normal;
  font-size: clamp(15px, min(1.5vw, 2.6vh), 24px);
  letter-spacing: -0.005em;
  line-height: 1.35;
  max-width: 70ch;
  color: var(--fg);
  opacity: 0;
  transform: translateY(20px);
  animation: hero-fade 1s ease 0.6s forwards;
}
.hero-subtitle .punch {
  display: inline-block;
  font-size: calc(1em + 4px);
  font-variation-settings: 'wght' 400;
  animation: hero-subtitle-punch 1.4s cubic-bezier(0.2,0.8,0.2,1) 1.6s forwards;
}
@keyframes hero-subtitle-punch {
  0%   { font-variation-settings: 'wght' 400; letter-spacing: -0.005em; transform: scale(1); }
  60%  { font-variation-settings: 'wght' 900; letter-spacing: -0.02em; transform: scale(1.02); }
  100% { font-variation-settings: 'wght' 800; letter-spacing: -0.012em; transform: scale(1); }
}
@keyframes hero-fade {
  to { opacity: 1; transform: translateY(0); }
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.hero-bottom .left { font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--muted); }
.hero-bottom .center {
  font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.hero-bottom .center .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero-bottom .right { font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--muted); text-align: right; }

/* slate timecode bar */
.timecode-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: var(--slate);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  color: #888;
  z-index: 40;
  pointer-events: none;
}
.timecode-bar .tc { color: #fff; }
.timecode-bar .progress-track {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 24px;
  position: relative;
}
.timecode-bar .progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--fg);
  width: 0%;
  transition: width 0.1s linear;
}

/* ================ CHAPTER MARKERS ================ */
.chapter-marker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  padding: 32px;
  border-top: 1px solid var(--rule);
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--muted);
}
.chapter-marker .num {
  font-family: "JetBrains Mono", monospace;
  color: var(--fg);
  white-space: nowrap;
}
.chapter-marker .title {
  color: var(--fg);
  font-weight: 500;
}
/* avoid double line when a chapter-marker comes right after a full-bleed plate */
.fb-plate + .chapter-marker { border-top: none; }

/* ================ CHAPTER 01 — ORIGEN ================ */
.chapter {
  padding-top: 10vh;
  padding-right: 32px;
  padding-bottom: 10vh;
  padding-left: 32px;
  position: relative;
}

/* ================ FULL-BLEED IMAGE PLATES ================ */
.fb-plate {
  --enter: 0;
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  background: #050505;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.fb-plate img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: cover;
  object-position: center;
  transform-origin: center;
  will-change: transform, filter, clip-path;
}
.fb-plate.fb-tall img { max-height: 88vh; }
.fb-plate.fb-short img { max-height: 50vh; }

/* 3D iframe variant — no clip/scale, pure embedded scene */
.fb-plate.fb-3d {
  background: #15161a;
  height: 80vh;
  min-height: 520px;
  overflow: hidden;
  border-color: rgba(255,255,255,0.04);
}
.fb-plate.fb-3d .fb-3d-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0; padding: 0;
}

/* ─── Pan from right: image enters shifted right, slides into place ─── */
.fb-fx-pan-right img {
  transform: translateX(calc((1 - var(--enter)) * 22%)) scale(calc(1.08 - var(--enter) * 0.08));
  filter: brightness(calc(0.5 + var(--enter) * 0.5));
  clip-path: inset(0 calc((1 - var(--enter)) * 12%) 0 0);
}

/* ─── Pan from left: image enters shifted left, slides into place ─── */
.fb-fx-pan-left img {
  transform: translateX(calc((var(--enter) - 1) * 22%)) scale(calc(1.08 - var(--enter) * 0.08));
  filter: brightness(calc(0.5 + var(--enter) * 0.5));
  clip-path: inset(0 0 0 calc((1 - var(--enter)) * 12%));
}

/* legacy alias kept for compatibility */
.fb-fx-pan img {
  transform: translateX(calc((1 - var(--enter)) * 22%)) scale(calc(1.08 - var(--enter) * 0.08));
  filter: brightness(calc(0.5 + var(--enter) * 0.5));
  clip-path: inset(0 calc((1 - var(--enter)) * 12%) 0 0);
}
.fb-plate .fb-caption {
  position: absolute;
  bottom: 24px; left: 32px; right: 32px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
  /* caption staggers in once the image is mostly revealed */
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1);
  transition-delay: 220ms;
}
.fb-plate.fb-in .fb-caption { opacity: 1; transform: translateY(0); }
.fb-plate .fb-caption .label-em { color: #fff; opacity: 0.95; }
/* tiny ticker above the caption — appears with the same stagger */
.fb-plate .fb-caption::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -10px;
  height: 1px; background: rgba(255,255,255,0.2);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 900ms cubic-bezier(.7,0,.2,1);
  transition-delay: 120ms;
}
.fb-plate.fb-in .fb-caption::before { transform: scaleX(1); }

.pull-quote {
  font-family: "Inter Tight", sans-serif;
  font-weight: 200;
  font-size: clamp(56px, 8.6vw, 156px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.pull-quote.pull-quote--sm {
  font-size: clamp(48px, 6.4vw, 112px);
  line-height: 1.02;
  margin: 0;
  max-width: 14ch;
}
/* Variante alineada a la izquierda — para que case con otros bloques (subtítulos, etc.) */
.pull-quote.pull-quote--left {
  margin: 0;
  max-width: none;
}

/* Origen layout — titular left, body right */
.origen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  align-items: center;
}
.origen-body {
  display: flex; flex-direction: column;
  gap: 12px;
}
.origen-body p {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  margin: 0;
  max-width: 48ch;
  text-wrap: pretty;
}
.origen-body p em,
.origen-body p strong {
  display: inline;
  transition:
    font-variation-settings 380ms cubic-bezier(.2,.7,.2,1),
    letter-spacing 380ms;
  cursor: default;
}
.origen-body p em {
  font-style: italic;
  font-variation-settings: 'wght' 400;
  /* corrección óptica: el itálico inclina la última letra y crea un hueco visual */
  margin-right: -0.05em;
}
.origen-body p strong {
  font-style: normal;
  font-variation-settings: 'wght' 600;
}
@media (max-width: 900px) {
  .origen-grid { grid-template-columns: 1fr; gap: 40px; }
}
/* Párrafo de entrada de capítulo: grande, a todo el ancho del grid, sobre los bloques */
.origen-lead { max-width: 1280px; margin: 8vh auto 0; padding: 0 16px; }
.origen-lead p { max-width: none; }
.origen-lead + .research-grid { margin-top: 6vh; }

/* Apuesta layout — three columns in a single row, center is 2x wider */
.apuesta-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 56px;
  max-width: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.apuesta-grid .origen-body p { max-width: 100%; }

/* FlowPhone mount — centers the React-rendered mockup */
.flow-phone-mount {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

@media (max-width: 900px) {
  .apuesta-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* Research grid — three parallel blocks in one row (Conversación) */
.research-grid {
  /* Mismo layout en los tres case studies: dos columnas, la caja centrada en
     la pantalla y el texto a la izquierda. Con un número impar de bloques, el
     que sobra se queda abajo a la izquierda, sin estirarse ni centrarse. */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 8vh auto 0;
  padding: 0 16px;
  align-items: start;
  text-align: left;
}
.research-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.research-block__title {
  font-family: "Inter Tight", sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 1.5vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 4px;
}
.research-block p {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: pretty;
}
.research-block p em,
.research-block p strong {
  display: inline;
  transition:
    font-variation-settings 380ms cubic-bezier(.2,.7,.2,1),
    letter-spacing 380ms;
  cursor: default;
}
.research-block p em {
  font-style: italic;
  font-variation-settings: 'wght' 400;
}
.research-block p strong {
  font-style: normal;
  font-variation-settings: 'wght' 600;
}
@media (max-width: 600px) {
  .research-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ================ CHAPTER 05 — EL CONTROL EN VIVO ================ */
.control-hero {
  min-height: 56vh;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 0 32px 2vh;
}
.control-hero + .chapter { padding-top: 3vh; }
.control-hero__quote {
  margin: 0;
  max-width: 22ch;
  text-align: left;
}

.control-grid {
  --mockup-h: clamp(280px, min(65vh, (100vw - 120px) * 0.35), 580px);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(24px, 3vw, 56px);
  width: 100%;
  margin: 5vh 0 0;
  padding: 0;
  align-items: start;
  position: relative;
}
.control-side {
  display: flex; flex-direction: column;
  gap: clamp(16px, 2vh, 28px);
}
.control-side__label {
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin: 0;
  /* Siempre por encima del overlay (z-index 5) — same look siempre */
  position: relative;
  z-index: 10;
}
.control-side__mockup {
  display: flex; align-items: center; justify-content: center;
}
.control-side__copy {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 42ch;
  width: 100%;
}
.control-side__copy p {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: pretty;
}
.control-side__copy p em,
.control-side__copy p strong {
  display: inline-block;
  white-space: nowrap;
  transition:
    font-variation-settings 380ms cubic-bezier(.2,.7,.2,1),
    letter-spacing 380ms;
  cursor: default;
}
.control-side__copy p em { font-style: italic; font-variation-settings: 'wght' 400; }
.control-side__copy p strong { font-style: normal; font-variation-settings: 'wght' 600; }
.control-side__mockup {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

/* ─── Mockups difuminados (capa inferior) ─── */
.mockup-flat {
  transition: filter 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.control-grid:not(.is-playing) .mockup-flat {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

/* ─── Capa superior: grid de 3 partes iguales (A | B | C) sobre los mockups ─── */
.control-stage {
  position: relative;
}
.control-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  pointer-events: none;
  z-index: 5;
  /* El fondo oscuro entra de golpe al revelarse el stage */
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.control-stage.is-scroll-revealed .control-overlay {
  opacity: 1;
  pointer-events: auto;
}
.control-overlay__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2vw, 28px);
  height: 100%;
}
/* Contenido (textos y botón) — entra staggered con timings orgánicos
   y un slide-up sutil. Estado base: invisible y desplazado hacia abajo.
   bg overlay: aparece a 0s · 0.5s
   Texto A:   delay 0.65s · dur 0.65s  → visible ~1.3s
   Texto B:   delay 1.55s · dur 0.65s  → visible ~2.2s  (Δ A→B: 0.9s)
   Botón C:   delay 2.70s · dur 0.75s  → visible ~3.4s  (Δ B→C: 1.15s, pausa más larga) */
.control-overlay__cell > * {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity   0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Centrado y 50px más estrecho que el cell */
  max-width: calc(100% - 50px);
  width: 100%;
  margin: 0 auto;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.85);
}
.control-stage.is-scroll-revealed .control-overlay__cell--A > * {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0.65s;
}
.control-stage.is-scroll-revealed .control-overlay__cell--B > * {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 1.55s;
}
.control-stage.is-scroll-revealed .control-overlay__cell--C > * {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 2.7s;
  transition-duration: 0.75s;
}

/* Estado "playing": ocultar la capa superior por completo */
.control-grid.is-playing + .control-overlay,
.control-stage:has(.control-grid.is-playing) .control-overlay { display: none; }
.cta-jugar {
  font-family: "Inter Tight", sans-serif;
  font-variation-settings: 'wght' 600;
  font-size: clamp(15px, 1.1vw, 18px);
  letter-spacing: 0.01em;
  padding: clamp(11px, 0.95vw, 15px) clamp(20px, 1.6vw, 28px);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  white-space: nowrap;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease,
    font-variation-settings 0.3s,
    letter-spacing 0.3s;
}
/* Hover del botón — más específico que la regla de reveal del cell para que el translate funcione */
.control-overlay__cell .cta-jugar:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  font-variation-settings: 'wght' 900;
  letter-spacing: 0.04em;
}
.cta-jugar .arrow { display: inline-block; transition: transform 0.3s ease; }
.cta-jugar:hover .arrow { transform: translateX(5px); }

/* ─── Estado "playing": mockups limpios e interactivos ─── */
.control-grid.is-playing .mockup-flat {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}
/* Limpieza: la capa de overlay vieja ya no existe; el .control-cta tampoco vive aquí. */

/* Realistic device mockups — phone & laptop with subtle bezel detail */
.mockup-flat {
  position: relative;
}
.mockup-flat img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}

/* ─── Phone — altura compartida con el portátil ─── */
.mockup-flat--phone {
  height: var(--mockup-h);
  width: auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 38px;
  padding: 6px;
  margin: 0 auto;
  /* container query target: hijos pueden usar cqw para escalar con el ancho del móvil */
  container-type: inline-size;
  container-name: phone;
  background: linear-gradient(135deg, #2a2a2e 0%, #1a1a1d 22%, #0a0a0c 60%, #1a1a1d 88%, #2a2a2e 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 60px -10px rgba(255,255,255,0.04),
    0 30px 60px -20px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.5);
}
/* Dynamic island (notch) */
.mockup-flat--phone::before {
  content: ''; position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 18px;
  background: #050507;
  border-radius: 999px;
  z-index: 3;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.04);
}
.mockup-flat--phone img { border-radius: 30px; }
.phone-b-mount {
  position: absolute;
  inset: 6px;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  /* font-size proporcional al ancho del .mockup-flat--phone (container) */
  font-size: 5.5cqw;
}
.phone-b-mount, .phone-b-mount * { cursor: none !important; }
.live-demo-iframe { cursor: none !important; }
[data-cursor="JUGAR"], [data-cursor="JUGAR"] * { cursor: none !important; }
/* Botones laterales del iPhone */
.phone-btn {
  position: absolute;
  pointer-events: none;
  background: linear-gradient(90deg, #050507 0%, #2a2a2e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.phone-btn--mute {
  left: -1.5px; top: 16%;
  width: 2.5px; height: 18px;
  border-radius: 1px 0 0 1px;
}
.phone-btn--volup {
  left: -1.5px; top: 25%;
  width: 2.5px; height: 26px;
  border-radius: 1px 0 0 1px;
}
.phone-btn--voldown {
  left: -1.5px; top: 32%;
  width: 2.5px; height: 26px;
  border-radius: 1px 0 0 1px;
}
.phone-btn--power {
  right: -1.5px; top: 22%;
  width: 2.5px; height: 36px;
  background: linear-gradient(270deg, #050507 0%, #2a2a2e 100%);
  border-radius: 0 1px 1px 0;
}

/* ─── Laptop — misma altura que el móvil ─── */
.mockup-flat--laptop {
  height: var(--mockup-h);
  width: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px 12px 5px 5px;
  padding: 18px 12px 14px;
  margin: 0 auto;
  background: linear-gradient(180deg, #1f1f22 0%, #16161a 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 30px 60px -20px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
/* Webcam dot */
.mockup-flat--laptop::before {
  content: ''; position: absolute;
  top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  background: #0a0a0c;
  border-radius: 999px;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.15);
}
/* Hinge / base — más realista */
.mockup-flat--laptop::after {
  content: ''; position: absolute;
  bottom: -8px; left: -7%; right: -7%; height: 10px;
  background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1d 50%, #0a0a0c 100%);
  border-radius: 0 0 14px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 6px 12px -2px rgba(0,0,0,0.6);
}
.mockup-flat--laptop img { border-radius: 4px; }
.live-demo-iframe {
  position: absolute;
  inset: 14px 12px 18px;
  width: calc(100% - 24px);
  height: calc(100% - 32px);
  border: 0;
  border-radius: 4px;
  background: #0a0a0e;
  /* iframe captura eventos → scroll dentro funciona.
     El cursor del SO va oculto vía cursor: none dentro del iframe.
     El cursor del padre se sincroniza con mousemove forwarding desde el iframe (ver JS). */
}

.control-tagline {
  font-family: "Inter Tight", sans-serif;
  font-weight: 200;
  font-size: clamp(28px, 3.4vw, 60px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-align: center;
  max-width: 32ch;
  margin: 3vh auto 0;
  text-wrap: balance;
  /* Solo aparece tras pulsar Jugar */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.chapter:has(.control-grid.is-playing) .control-tagline {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.control-tagline strong {
  display: inline;
  font-style: normal;
  font-variation-settings: 'wght' 700;
  transition: font-variation-settings 380ms cubic-bezier(.2,.7,.2,1);
  cursor: default;
}
.control-tagline strong:hover {
    text-shadow: 0.012em 0 0 currentColor, -0.012em 0 0 currentColor;
  }

@media (max-width: 900px) {
  .control-side { grid-template-columns: 1fr; gap: 32px; }
  .control-side--B .control-side__mockup { order: -1; }
  .laptop-frame { max-width: 480px; }
}
.pull-quote .word {
  display: inline-block;
  margin-right: 0.22em;
  opacity: 0.18;
  transition: opacity 0.5s ease, font-weight 0.5s ease;
}
.pull-quote .word.lit {
  opacity: 1;
}
.pull-quote .em {
  font-style: italic;
  font-weight: 400;
}
.pull-quote .strong {
  font-weight: 700;
  font-style: normal;
}

.scene-meta {
  display: flex; justify-content: space-between;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 14px; margin-top: 14vh;
}

/* paragraph blocks for chapters with prose */
.prose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1280px;
  margin: 14vh auto 0;
  padding: 0 16px;
}
.prose-grid .label {
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.prose-grid p {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  margin: 16px 0;
  max-width: 42ch;
  text-wrap: pretty;
}
.prose-grid p em,
.prose-grid p strong {
  display: inline;
  transition:
    font-variation-settings 380ms cubic-bezier(.2,.7,.2,1),
    letter-spacing 380ms;
  cursor: default;
}
.prose-grid p em {
  font-style: italic;
  font-variation-settings: 'wght' 400;
}
.prose-grid p strong {
  font-style: normal;
  font-variation-settings: 'wght' 600;
}
.prose-link {
  border-bottom: 1px solid rgba(255,255,255,0.4);
  transition: border-color 250ms, font-variation-settings 380ms cubic-bezier(.2,.7,.2,1);
  font-variation-settings: 'wght' 400;
}
.prose-link:hover {
  border-bottom-color: var(--fg);
    text-shadow: 0.02em 0 0 currentColor, -0.02em 0 0 currentColor;
  }

/* ================ CHAPTER 03 — APUESTA (the bet diagram) ================ */
.bet-diagram {
  max-width: 1200px;
  margin: 10vh auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}
.bet-card {
  border: 1px solid var(--rule);
  padding: 36px 28px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.bet-card .tag {
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase; color: var(--muted);
}
.bet-card h4 {
  font-family: "Inter Tight";
  font-weight: 200;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.bet-card.before h4 { color: rgba(255,255,255,0.5); }
.bet-card.after h4 { font-weight: 600; }
.bet-card p {
  font-size: 13px; line-height: 1.55;
  color: var(--muted); margin: 0;
  max-width: 32ch;
}
.bet-arrow {
  display: flex; align-items: center; justify-content: center;
  padding: 0 28px;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--label-size); letter-spacing: var(--label-tracking); color: var(--muted);
  flex-direction: column;
  gap: 8px;
}
.bet-arrow .ar {
  font-size: 22px; color: var(--fg);
  letter-spacing: 0;
}

/* ================ CHAPTER 04 — CORAZÓN (horizontal scroll vistas) ================ */
.vistas-pin {
  position: relative;
  height: 360vh;
}
.vistas-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.vistas-track {
  display: flex;
  gap: 4vw;
  padding: 0 8vw;
  will-change: transform;
  min-width: max-content;
}
.vista {
  flex: 0 0 auto;
  width: 78vw;
  height: 78vh;
  display: flex; flex-direction: column;
  position: relative;
}
.vista .v-meta {
  display: flex; justify-content: space-between;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.vista .v-meta .role { color: var(--fg); }
.vista .v-screen {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  background: #0a0a0c;
  cursor: pointer;
}
.v-real-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
  z-index: 0;
}
.vista .v-screen .v-detail {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; justify-content: flex-end;
  z-index: 1;
  padding: 32px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.vista .v-screen:hover .v-detail { opacity: 1; }
.vista .v-detail h5 {
  font-family: "Inter Tight";
  font-weight: 300;
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 22ch;
}
.vista .v-detail ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 32px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.vista .v-detail ul li::before {
  content: "+ ";
  color: var(--fg);
}

.vista-progress {
  position: absolute;
  bottom: 4vh; left: 8vw; right: 8vw;
  display: flex; gap: 8px;
  z-index: 5;
}
.vista-progress .seg {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.15);
  position: relative;
}
.vista-progress .seg.active { background: var(--fg); }

/* === Vista mocks (CSS-only) === */
.mock {
  position: absolute; inset: 0;
  font-family: "Inter Tight", sans-serif;
  color: #e8e8ea;
}

/* ADMIN — dashboard, lots of cards */
.mock-admin {
  background: linear-gradient(180deg, #0d0d10, #0a0a0c);
  padding: 5%;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
}
.mock-admin .sidebar {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 11px;
}
.mock-admin .sidebar .logo {
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.mock-admin .sidebar .nav-item {
  padding: 8px 10px;
  border-radius: 3px;
  color: rgba(232,232,234,0.55);
}
.mock-admin .sidebar .nav-item.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.mock-admin .main {
  display: flex; flex-direction: column; gap: 14px;
}
.mock-admin .topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.mock-admin .topbar h6 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.mock-admin .topbar .pill {
  padding: 4px 10px; border-radius: 99px;
  background: var(--accent); color: #fff;
  font-size: 10px; letter-spacing: 0.08em;
  font-family: "JetBrains Mono", monospace;
}
.mock-admin .grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.mock-admin .card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 11px;
  background: rgba(255,255,255,0.015);
}
.mock-admin .card .ttl { color: rgba(232,232,234,0.55); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.mock-admin .card .big { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.mock-admin .card .meter {
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.mock-admin .card .meter .f { height: 100%; background: #fff; }
.mock-admin .timeline {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 14px;
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 11px;
}
.mock-admin .timeline .row {
  display: grid; grid-template-columns: 80px 1fr 60px;
  gap: 12px; align-items: center;
}
.mock-admin .timeline .bar {
  height: 6px; border-radius: 2px;
  background: rgba(255,255,255,0.08);
  position: relative;
}
.mock-admin .timeline .bar::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  background: #fff; border-radius: 2px;
}

/* CONTROL — operator console */
.mock-control {
  background: #0a0a0c;
  display: flex; flex-direction: column;
  padding: 4%;
  gap: 12px;
}
.mock-control .header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.mock-control .header .live {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em;
}
.mock-control .header .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}
.mock-control .stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
  min-height: 0;
}
.mock-control .preview {
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, #1a1a1e, #0a0a0c);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.mock-control .preview .now-text {
  position: absolute;
  inset: 12% 10% auto 10%;
  font-family: "Inter Tight";
  font-weight: 800;
  font-size: clamp(20px, 2.4vw, 36px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: pre-line;
}
.mock-control .preview .now-tag {
  position: absolute; top: 12px; left: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em;
  color: #fff;
}
.mock-control .preview .corner-tc {
  position: absolute; bottom: 12px; right: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.7);
}
.mock-control .queue {
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: 11px;
}
.mock-control .queue .q-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em; color: var(--muted);
  margin-bottom: 4px;
}
.mock-control .queue .q-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
}
.mock-control .queue .q-item.next {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.03);
}
.mock-control .queue .q-item .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; color: var(--muted);
}
.mock-control .queue .q-item .name { flex: 1; }
.mock-control .toolbar {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.12em;
}
.mock-control .toolbar .btn {
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}
.mock-control .toolbar .btn.go {
  background: #fff; color: #000; border-color: #fff;
}

/* SLAVE — what the screen in shot shows */
.mock-slave {
  background: #000;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.mock-slave .frame-aspect {
  width: 92%;
  aspect-ratio: 16 / 9;
  background: #0a0a0c;
  position: relative;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mock-slave .big-text {
  font-family: "Inter Tight";
  font-weight: 900;
  font-size: clamp(36px, 4.6vw, 86px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-align: center;
  max-width: 80%;
  color: #fff;
}
.mock-slave .big-text .accent { color: var(--accent); }
.mock-slave .corners {
  position: absolute; inset: 0;
  pointer-events: none;
}
.mock-slave .corners::before,
.mock-slave .corners::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  border: 1px solid rgba(255,255,255,0.3);
}
.mock-slave .corners::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.mock-slave .corners::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.mock-slave .safe-label {
  position: absolute;
  top: 12px; right: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; letter-spacing: 0.16em;
  color: rgba(255,255,255,0.4);
}

/* ================ CHAPTER 05 — DS IFRAME ================ */
.ds-embed-wrap {
  margin-top: 6vh;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.ds-embed-label {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,0.02);
}
.ds-iframe {
  display: block; width: 100%; height: 85vh; border: none; background: #0a0a0c;
}

/* (dead code from showcase attempt — kept for reference) */
.dss-block {
  padding: 40px 32px;
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 28px;
}
.dss-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}

/* ── Color ── */
.dss-palette { display: flex; gap: 1px; background: var(--rule); }
.dss-chip {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.dss-chip-color { height: 80px; }
.dss-chip-text {
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.dss-chip-token {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; color: var(--muted); letter-spacing: 0.06em;
}
.dss-chip-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; color: var(--fg);
}
.dss-rule {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; color: var(--muted); line-height: 1.7; margin: 0;
  padding-top: 20px; border-top: 1px solid var(--rule);
}
.dss-rule strong { color: var(--fg); font-weight: 500; }

/* ── Tipografía ── */
.dss-type-specimens { display: flex; flex-direction: column; }
.dss-type-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px 0; border-bottom: 1px solid var(--rule);
}
.dss-type-row:last-child { border-bottom: none; padding-bottom: 0; }
.dss-type-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dss-type-display {
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.04em;
}
.dss-type-h2 {
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.03em;
  color: var(--muted);
}
.dss-type-body {
  font-family: "Inter Tight", sans-serif;
  font-size: 15px; font-weight: 400; line-height: 1.6;
  color: var(--muted); max-width: 60ch;
}
.dss-grad {
  background: linear-gradient(135deg, rgb(232,212,77) 0%, rgb(78,205,196) 60%, rgb(0,85,98) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Componentes ── */
.dss-comps-rows { display: flex; flex-direction: column; gap: 32px; }
.dss-comp-row { display: flex; flex-direction: column; gap: 12px; }
.dss-comp-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
}
.dss-comp-stage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Pill */
.dss-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dss-pill--mute   { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10); color: rgba(255,255,255,0.5); text-transform: none; letter-spacing: 0; }
.dss-pill--accent { background: rgba(232,212,77,0.10); border: 1px solid rgba(232,212,77,0.35); color: rgb(232,212,77); }
.dss-pill--teal   { background: rgba(78,205,196,0.10); border: 1px solid rgba(78,205,196,0.35); color: rgb(78,205,196); }
.dss-pdot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; animation: dss-pulse 2s ease-in-out infinite; }
.dss-pdot--accent { background: rgb(232,212,77); box-shadow: 0 0 6px rgb(232,212,77); }
.dss-pdot--teal   { background: rgb(78,205,196);  box-shadow: 0 0 6px rgb(78,205,196); }
@keyframes dss-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.65; } }

/* Buttons */
.dss-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, rgb(232,212,77), rgb(0,85,98));
  color: #0a0a0c; font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(232,212,77,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
}
.dss-btn-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(10,10,12,0.18);
}
.dss-btn-secondary {
  display: inline-flex; align-items: center; padding: 11px 18px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14);
  color: var(--fg); font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.dss-btn-ghost {
  display: inline-flex; align-items: center; padding: 11px 18px; border-radius: 12px;
  background: transparent; border: 1px solid rgba(255,255,255,0.14);
  color: var(--fg); font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
}

/* StepRow */
.dss-steps { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.dss-step {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--rule);
  position: relative;
}
.dss-step:last-child { border-bottom: none; }
.dss-step-bar { position: absolute; left: 0; top: 0; width: 2px; height: 100%; }
.dss-step--accent .dss-step-bar { background: linear-gradient(180deg, rgba(232,212,77,0.85), transparent); }
.dss-step--teal   .dss-step-bar { background: linear-gradient(180deg, rgba(78,205,196,0.85), transparent); }
.dss-step-num { font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -0.04em; padding-top: 4px; }
.dss-step--accent .dss-step-num { color: rgba(232,212,77,0.85); }
.dss-step--teal   .dss-step-num { color: rgba(78,205,196,0.85); }
.dss-step-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 5px; }
.dss-step-copy  { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; max-width: 52ch; }

/* ── Counter ── */
.dss-counter {
  display: flex; align-items: stretch;
  border-top: 1px solid var(--rule);
}
.dss-stat {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 28px 32px;
  border-right: 1px solid var(--rule);
}
.dss-stat:last-child { border-right: none; }
.dss-stat-n {
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(32px, 3.5vw, 56px);
  font-weight: 200; line-height: 1; letter-spacing: -0.04em;
}
.dss-stat-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.dss-stat-sep { display: none; }

/* ================ CHAPTER 05 — SISTEMA (token grid) ================ */
.system-grid {
  max-width: 1280px;
  margin: 14vh auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.sys-cell {
  background: var(--bg);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px;
}
/* .sys-cell .label → gobernado por la regla unificada en .ds-type-label */
.sys-cell .value {
  font-family: "Inter Tight";
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.sys-cell .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--label-size); color: var(--muted);
  margin-top: auto;
}
.sys-cell.span-4 { grid-column: span 4; }
.sys-cell.span-6 { grid-column: span 6; }
.sys-cell.span-8 { grid-column: span 8; }
.sys-cell.span-12 { grid-column: span 12; }

.sys-swatch {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.sys-swatch .sw {
  width: 44px; height: 44px;
  border-radius: 2px;
  border: 1px solid var(--rule);
}
.sys-type-stack {
  display: flex; flex-direction: column; gap: 6px;
  font-family: "Inter Tight";
  letter-spacing: -0.02em;
  line-height: 1;
}
.sys-type-stack .t1 { font-size: 56px; font-weight: 800; }
.sys-type-stack .t2 { font-size: 32px; font-weight: 400; font-style: italic; }
.sys-type-stack .t3 { font-size: 18px; font-weight: 300; }
.sys-type-stack .t4 { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: 0.12em; }

.sys-grid-demo {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  flex: 1;
}
.sys-grid-demo .col-bar {
  background: rgba(255,255,255,0.04);
  height: 100%;
  border-radius: 1px;
}
.sys-grid-demo .col-bar.hl { background: var(--fg); }

/* DS token inline rows */
.sys-token-row {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.6;
}

/* DS section · subtítulo bajo la H1 — explica la cromática del rodaje */
.ds-subtitle {
  font-family: "Inter Tight", sans-serif;
  font-weight: 300;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: rgba(255,255,255,0.65);
  max-width: 56ch;
  margin: 18px 0 0;
}
.ds-subtitle strong {
  font-weight: 600;
  font-style: normal;
  color: var(--fg);
  font-variation-settings: 'wght' 600;
  transition: font-variation-settings 380ms cubic-bezier(.2,.7,.2,1), letter-spacing 380ms;
  cursor: default;
}
.ds-subtitle strong:hover {
    text-shadow: 0.012em 0 0 currentColor, -0.012em 0 0 currentColor;
  }

/* DS section · regla unificada para los enunciados (cell labels, group labels,
   type labels). Mono → blanco. */
.ds-type-label,
.sys-cell .label,
.ds-comp-group__label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
}
.ds-type-label,
.ds-comp-group__label { font-size: 10px; }

/* Títulos de bloque (01 · Tipografía, 02 · Color, …) — más grandes y grosos
   para que se leen claros como cabeceras del DS. */
.sys-cell .label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* La etiqueta del componente group conserva su separador inferior */
.ds-comp-group__label {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

/* DS component demos */
.ds-comp-demo { display: flex; flex-direction: column; gap: 14px; }
.ds-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.04em; font-weight: 600;
  text-transform: uppercase;
}
.ds-pill-mute {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
}
.ds-pill-accent {
  background: rgba(232,212,77,0.10);
  border: 1px solid rgba(232,212,77,0.35);
  color: rgb(232,212,77);
}
.ds-pill-teal {
  background: rgba(78,205,196,0.10);
  border: 1px solid rgba(78,205,196,0.35);
  color: rgb(78,205,196);
}
.ds-dot {
  width: 6px; height: 6px; border-radius: 999px;
}
.ds-dot-accent { background: rgb(232,212,77); box-shadow: 0 0 6px rgb(232,212,77); }
.ds-dot-teal   { background: rgb(78,205,196);  box-shadow: 0 0 6px rgb(78,205,196); }

.ds-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, rgb(232,212,77) 0%, rgb(0,85,98) 100%);
  color: #0a0a0c;
  font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; align-self: flex-start;
  box-shadow: 0 8px 24px -8px rgba(232,212,77,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 160ms cubic-bezier(.2,.7,.2,1), box-shadow 200ms ease;
}
.ds-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(232,212,77,0.55), inset 0 1px 0 rgba(255,255,255,0.35);
}
.ds-btn-primary:hover .ds-btn-arrow { transform: translateX(3px); }
.ds-btn-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(10,10,12,0.18);
  transition: transform 200ms cubic-bezier(.2,.7,.2,1);
}
.ds-btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14);
  color: #f5f5f7; font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer; align-self: flex-start;
  transition: background 200ms, border-color 200ms;
}
.ds-btn-secondary:hover {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.28);
}
.ds-btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 12px;
  background: transparent; border: 1px solid rgba(255,255,255,0.14);
  color: #f5f5f7; font-family: "Inter Tight", sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer; align-self: flex-start;
  transition: background 200ms, border-color 200ms;
}
.ds-btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.28); }

.ds-btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14);
  color: #f5f5f7; cursor: pointer;
  transition: background 200ms, border-color 200ms, transform 160ms cubic-bezier(.2,.7,.2,1);
}
.ds-btn-icon:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.28); transform: translateY(-1px); }
.ds-btn-icon--sm { width: 28px; height: 28px; border-radius: 8px; }
.ds-btn-icon--lg { width: 44px; height: 44px; border-radius: 12px; }

.ds-feat-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #f5f5f7; }
.ds-feat-check__icon { display: inline-flex; align-items: center; justify-content: center; color: rgb(232,212,77); flex-shrink: 0; }

.ds-comp-group { display: flex; flex-direction: column; gap: 6px; }
/* .ds-comp-group__label → gobernado por la regla unificada arriba */

/* Pulse animation for ds-dot */
@keyframes ds-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}
.ds-dot-accent, .ds-dot-teal { animation: ds-dot-pulse 2s ease-in-out infinite; }

/* DS Step component */
.ds-step {
  display: grid; grid-template-columns: 44px 1fr;
  gap: 12px; padding: 14px 0 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  border-radius: 0 8px 8px 0;
  transition: background 250ms;
}
.ds-step--accent:hover { background: rgba(232,212,77,0.06); }
.ds-step--teal:hover   { background: rgba(78,205,196,0.06); }
.ds-step:last-child { border-bottom: none; }
.ds-step__bar {
  position: absolute; left: 0; top: 0; width: 2px; height: 100%;
}
.ds-step--accent .ds-step__bar { background: linear-gradient(180deg, rgba(232,212,77,0.85), transparent); }
.ds-step--teal   .ds-step__bar { background: linear-gradient(180deg, rgba(78,205,196,0.85), transparent); }
.ds-step__num { font-size: 36px; font-weight: 300; line-height: 1; letter-spacing: -0.04em; transition: text-shadow 250ms; }
.ds-step--accent .ds-step__num { color: rgba(232,212,77,0.85); text-shadow: 0 0 20px rgba(232,212,77,0.4); }
.ds-step--teal   .ds-step__num { color: rgba(78,205,196,0.85); text-shadow: 0 0 20px rgba(78,205,196,0.4); }
.ds-step--accent:hover .ds-step__num { text-shadow: 0 0 48px rgba(232,212,77,1), 0 0 80px rgba(232,212,77,0.5); }
.ds-step--teal:hover   .ds-step__num { text-shadow: 0 0 48px rgba(78,205,196,1), 0 0 80px rgba(78,205,196,0.5); }
.ds-step__title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.ds-step__copy  { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.45; margin-top: 3px; }

/* DS Swatch chips */
.ds-swatch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ds-swatch-card {
  background: #131318; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; overflow: hidden;
  transition: border-color 250ms, box-shadow 250ms;
}
.ds-swatch-card:hover { border-color: rgba(255,255,255,0.24); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.ds-swatch-chip { height: 52px; }
.ds-swatch-body { padding: 7px 9px; }
.ds-swatch-name  { font-size: 12px; font-weight: 600; color: var(--fg); display: block; line-height: 1.2; }
.ds-swatch-token { font-family: ui-monospace, 'SF Mono', monospace; font-size: 10px; color: rgba(255,255,255,0.55); display: block; margin-top: 3px; }

/* Swatch del gradiente — animado: ángulo girando suavemente.
   Usa @property para poder interpolar el ángulo (no funciona con background plano). */
@property --grad-angle {
  syntax: '<angle>';
  initial-value: 135deg;
  inherits: false;
}
.ds-swatch-chip--grad {
  --grad-angle: 135deg;
  background: linear-gradient(var(--grad-angle), rgb(232,212,77) 0%, rgb(0,85,98) 100%);
  animation: ds-grad-rotate 6s linear infinite;
}
@keyframes ds-grad-rotate {
  from { --grad-angle:   0deg; }
  to   { --grad-angle: 360deg; }
}
/* Fallback para navegadores sin @property: mismo gradiente animando background-position */
@supports not (background: linear-gradient(var(--grad-angle), red, blue)) {
  .ds-swatch-chip--grad {
    background: linear-gradient(135deg, rgb(232,212,77) 0%, rgb(0,85,98) 50%, rgb(232,212,77) 100%);
    background-size: 220% 220%;
    animation: ds-grad-shift 5s ease-in-out infinite alternate;
  }
  @keyframes ds-grad-shift {
    0%   { background-position:   0% 50%; }
    100% { background-position: 100% 50%; }
  }
}
/* Respeta accesibilidad: sin movimiento si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
  .ds-swatch-chip--grad { animation: none; }
}

/* Gradient text helper — shimmer animado igual que la landing */
@keyframes sg-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
.sg-grad {
  background: linear-gradient(135deg, rgb(232,212,77) 0%, rgb(78,205,196) 55%, rgb(0,115,130) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: sg-shimmer 4s ease-in-out infinite;
  will-change: background-position;
  display: inline-block; padding-bottom: 0.08em;
}

/* DS section mock (mini, for cell 05) */
.ds-section-mock {
  background: rgba(255,255,255,0.02); border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 18px; position: relative; overflow: hidden; flex: 1;
}
.ds-section-mock__glow {
  position: absolute; pointer-events: none;
  width: 200px; height: 200px;
  background: radial-gradient(closest-side, rgba(232,212,77,0.10), transparent 70%);
  filter: blur(20px); top: -60px; right: -60px;
}

/* DS Radius demo */
.ds-radius-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.ds-radius-item { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; }
.ds-radius-box {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  flex: 1; min-height: 0;
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}
.ds-radius-item:hover .ds-radius-box {
  background: rgba(78,205,196,0.12); border-color: rgba(78,205,196,0.4);
  box-shadow: 0 0 14px rgba(78,205,196,0.25);
}
.ds-radius-label { font-family: ui-monospace, monospace; font-size: 11px; color: rgba(255,255,255,0.7); text-align: center; }

/* DS Manifest — stats + component list */
.ds-manifest {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-top: none;
}
.ds-manifest-stats {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1px solid var(--rule);
}
.ds-stat {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 36px 28px 28px;
  border-right: 1px solid var(--rule);
}
.ds-stat:last-child { border-right: none; }
.ds-stat__num {
  font-size: clamp(56px, 6vw, 88px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--fg);
}
.ds-stat__num--accent { color: rgba(232,212,77,0.85); text-shadow: 0 0 40px rgba(232,212,77,0.3); }
.ds-stat__num--teal   { color: rgba(78,205,196,0.85); text-shadow: 0 0 40px rgba(78,205,196,0.3); }
.ds-stat__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.ds-comp-list {
  display: flex; flex-wrap: wrap;
  gap: 0;
}
.ds-comp-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--muted);
  padding: 14px 20px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, background 200ms;
  white-space: nowrap;
}
.ds-comp-name:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.03);
}

/* DS preview cells */
.sys-preview-cell { min-height: 300px; }
.sys-preview-img {
  flex: 1;
  border-radius: 4px; overflow: hidden;
  background: #0a0a0c;
  display: flex; align-items: center; justify-content: center;
}
.sys-preview-img img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.sys-preview-img--portrait img {
  object-fit: contain; object-position: center;
}

/* DS token list */
.ds-token-list { display: flex; flex-direction: column; gap: 0; }
.ds-token-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: "JetBrains Mono", monospace; font-size: 10px;
  border-bottom: 1px solid var(--rule);
  padding: 8px 0;
  gap: 12px;
}
.ds-token-row:last-child { border-bottom: none; }
.tok-name { color: var(--muted); flex-shrink: 0; }
.tok-val  { color: var(--fg); text-align: right; }

/* ================ CHAPTER 06 — APRENDIZAJES ================ */
.lessons {
  max-width: 1080px;
  margin: 6vh auto 0;
  padding: 0 16px;
  display: flex; flex-direction: column;
}
.lesson {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.lesson:last-child { border-bottom: 1px solid var(--rule); }
.lesson .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--muted);
  padding-top: 6px;
}
.lesson .body h5 {
  font-family: "Inter Tight";
  font-weight: 300;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  text-wrap: balance;
  max-width: 28ch;
}
.lesson .body h5 em,
.lesson .body p em,
.lesson .body p strong {
  display: inline;
  transition:
    font-variation-settings 380ms cubic-bezier(.2,.7,.2,1),
    letter-spacing 380ms;
  cursor: default;
}
.lesson .body h5 em {
  font-style: italic;
  font-variation-settings: 'wght' 500;
}
.lesson .body p em {
  font-style: italic;
  font-variation-settings: 'wght' 400;
}
.lesson .body p strong {
  font-style: normal;
  font-variation-settings: 'wght' 600;
}
.lesson .body p {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 50ch;
  margin: 0;
}

/* ================ CHAPTER 07 — ESTADO ================ */
/* Cuadro estado · estilo unificado con el cuadro del DS (system-grid + sys-cell) */
.estado {
  /* sin padding: el fondo de la rejilla (las líneas) asomaba como franjas grises a los lados */
  max-width: 1248px;
  margin: 3vh auto 0;
  padding: 0;
  display: grid;
  /* mismo cuadro en los tres case studies: 3 columnas (2 en móvil) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.estado-cell {
  background: var(--bg);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px;
  container-type: inline-size;
}
/* Labels en estilo DS — mono blanco 13px weight 700 */
.estado-cell .lbl {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
}
.estado-cell .num {
  font-family: "Inter Tight";
  font-weight: 200;
  /* tope por ancho de celda (cqw): una palabra como "Rehecho" nunca se sale */
  font-size: min(clamp(48px, 5vw, 88px), 24cqw);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.estado-cell .num .unit {
  font-size: 0.4em;
  font-weight: 300;
  margin-left: 4px;
  color: var(--muted);
  letter-spacing: 0;
}
.estado-cell .desc {
  font-family: "Inter Tight", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.005em;
  color: rgba(255,255,255,0.85);
  /* la descripción va siempre pegada a la cifra (antes se iba al fondo y
     quedaba a alturas distintas según cuántas líneas tuviera) */
  margin-top: 4px;
  max-width: 44ch;
}

/* ================ END CREDITS ================ */
.end-credits {
  margin-top: 10vh;
  padding: 10vh 32px 12vh;
  position: relative;
  text-align: center;
  border-top: 1px solid var(--rule);
}
.end-credits .top-mark {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.32em;
  color: var(--muted);
  margin-bottom: 4vh;
}
.credits-block {
  max-width: 720px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 36px;
}
.credit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 24px;
  text-align: left;
}
.credit-row .role {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  padding-right: 32px;
}
.credit-row .name {
  font-family: "Inter Tight";
  font-weight: 300;
  font-size: clamp(18px, 1.6vw, 24px);
  letter-spacing: -0.01em;
  color: var(--fg);
}
.credit-row .name em { font-style: italic; font-weight: 400; }
.credit-row.headline .name {
  font-weight: 600;
  font-size: clamp(22px, 2vw, 32px);
}

.credits-spacer { height: 6vh; }

.credits-finale {
  text-align: center;
  font-family: "Inter Tight";
  font-weight: 200;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 36px);
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 28ch;
  margin: 0 auto;
  line-height: 1.3;
}

/* ================ NEXT PROJECT ================ */
.next-project {
  border-top: 1px solid var(--rule);
  padding: 8vh 32px 10vh;
  display: flex; flex-direction: column; align-items: center;
  gap: 28px;
  text-align: center;
  position: relative;
}
.next-project .label {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  color: var(--muted);
  text-transform: uppercase;
}
.next-project .next-link {
  display: inline-block;
  font-family: "Inter Tight";
  font-weight: 800;
  font-size: clamp(64px, 12vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  position: relative;
  padding: 0 12px;
}
.next-project .next-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 8%;
  height: 6px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
}
.next-project .next-link:hover::after {
  transform: scaleX(1);
}
.next-project .next-meta {
  display: flex; gap: 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--label-size); letter-spacing: var(--label-tracking);
  color: var(--muted);
  text-transform: uppercase;
}
.next-project .home-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding: 6px 0;
}
.next-project .home-link:hover { color: var(--fg); border-color: var(--fg); }

/* ================ FOOTER MINIMAL ================ */
footer.cs-footer {
  border-top: 1px solid var(--rule);
  padding: 32px;
  display: flex; justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  flex-wrap: wrap; gap: 8px 24px;
}
footer.cs-footer a { color: inherit; text-decoration: none; }

/* ================ RESPONSIVE ================ */
@media (max-width: 900px) {
  .hero-credits-top { grid-template-columns: 1fr; gap: 12px; }
  .hero-credits-top .col:nth-child(3) { justify-self: start; text-align: left; }
  .hero-bottom { grid-template-columns: 1fr; gap: 12px; text-align: left; }
  .hero-bottom .right, .hero-bottom .center { text-align: left; }
  .prose-grid { grid-template-columns: 1fr; gap: 32px; }
  .bet-diagram { grid-template-columns: 1fr; }
  .bet-arrow { padding: 24px 0; flex-direction: row; }
  .bet-arrow .ar { transform: rotate(90deg); }
  .system-grid { grid-template-columns: repeat(4, 1fr); }
  .sys-cell.span-8, .sys-cell.span-6, .sys-cell.span-4 { grid-column: span 4; }
  .estado { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson { grid-template-columns: 1fr; gap: 8px; }
  .vista { width: 88vw; }
  .credit-row { grid-template-columns: 1fr; gap: 4px; text-align: left; }
  .credit-row .role { text-align: left; padding-right: 0; }
}

/* ─── Hovers en texto corrido: engordan SIN cambiar el ancho ───────────────
   Norma (2026-10-14): ningún hover de texto puede cambiar el tamaño, porque
   las frases saltaban de línea. En vez de peso/tracking, sombra del mismo color
   a ambos lados (negrita óptica). Mismo criterio que Sobre mí en la home. */
.origen-body p em, .origen-body p strong,
.research-block p em, .research-block p strong,
.control-side__copy p em, .control-side__copy p strong,
.control-tagline strong,
.prose-grid p em, .prose-grid p strong,
.prose-link,
.ds-subtitle strong,
.lesson .body h5 em, .lesson .body p em, .lesson .body p strong {
  transition: text-shadow 450ms cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

/* ─── Cursivas del texto corrido: cursiva → negrita recta, sin reflow ──────
   hover-ghosts.js envuelve cada palabra en .hw con dos fantasmas (.hw-g).
   El hueco = el más ancho de los dos; la palabra visible (.hw-v) va en
   absolute. Negrita 800 con tracking compensado (≈ mismo ancho que la
   cursiva 400). Transición suave, como Sobre mí. */
.hx .hw { display: inline-grid; position: relative; }
.hx .hw > * { grid-area: 1 / 1; }
.hx .hw-v {
  position: absolute; left: 0; top: 0;
  transition: font-variation-settings 450ms cubic-bezier(0.4, 0, 0.2, 1),
              letter-spacing 450ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hx .hw-g { visibility: hidden; user-select: none; }
/* el hueco lo marca SOLO la versión en reposo; la negrita se calibra por
   palabra (--hx-ls, en hover-ghosts.js) para medir lo mismo */
.hx .hw-g:not(.hw-gi) {
  display: none;               /* solo se muestra un instante para medir */
  font-style: normal;
  font-weight: 800;
  font-variation-settings: 'wght' 800;
}
em.hx:hover .hw-v {
  font-style: normal;
  font-weight: 800;
  font-variation-settings: 'wght' 800;
  letter-spacing: var(--hx-ls, -0.05em);
}

/* Negritas del texto corrido: de base MEDIUM (500) y en hover BOLD (800), para
   que el cambio se note. Mismo sistema de fantasmas (sin reflow). */
.hx.hx-s { font-weight: 500; font-variation-settings: 'wght' 500; }
.hx.hx-s:hover .hw-v {
  font-weight: 800;
  font-variation-settings: 'wght' 800;
  letter-spacing: var(--hx-ls, -0.03em);
}

/* ─── Móvil (≤700px) · revisión responsive 15-oct ─────────────────────────
   Lo que comparten los tres case studies en pantallas pequeñas. */
@media (max-width: 700px) {
  /* Header: solo la flecha de volver y el capítulo; fondo negro para que no se
     monte sobre el texto al hacer scroll. */
  .cs-nav { background: #000; mix-blend-mode: normal; padding: 14px 16px; grid-template-columns: auto 1fr; gap: 14px; }
  .cs-nav .back span:not(.arrow) { display: none; }
  .cs-nav .center { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cs-nav { grid-template-columns: auto 1fr auto; }
  .cs-nav .right .cs-nav__count { display: none; }

  /* Hero: alto según su contenido (con 100vh fijo, las tres líneas de arriba
     se montaban sobre el "01 · Live · …" y el título) */
  .hero { height: auto; min-height: 100svh; row-gap: 28px; }

  /* Pie del hero: nombre y cargo | año y empresa en una fila; "Live" debajo,
     a lo ancho. Con más aire respecto al texto de arriba. */
  .hero-bottom {
    grid-template-columns: 1fr auto;
    grid-template-areas: "left right" "center center";
    gap: 18px 16px;
    margin-top: 40px;
  }
  .hero-bottom .left { grid-area: left; }
  .hero-bottom .right { grid-area: right; text-align: right; }
  .hero-bottom .center { grid-area: center; text-align: left; }
  .hero-bottom .m-line { display: block; }
  .hero-bottom .m-sep { display: none; }  /* corte en móvil: los dos bloques del pie, misma altura */

  /* Todo un poco más apretado: menos margen lateral y menos aire entre bloques */
  .chapter { padding: 7vh 20px; }
  .chapter-marker { padding: 20px; gap: 20px; }
  .research-grid { margin-top: 5vh; padding: 0; gap: 28px; }
  .origen-lead { margin-top: 5vh; padding: 0; }
  .origen-lead + .research-grid { margin-top: 4vh; }
  .estado { margin-top: 2vh; }

  /* Cuadro de cifras: las etiquetas largas ("Experimentación") no caben a 13px */
  .estado-cell { padding: 22px 16px; }
  .estado-cell .lbl { font-size: 11px; letter-spacing: 0.06em; }

  /* Sistema de UiFilm: una columna, cada celda a lo ancho */
  .system-grid { grid-template-columns: minmax(0, 1fr); padding: 0; margin-top: 6vh; }
  .system-grid > .sys-cell { grid-column: 1 / -1; padding: 22px 16px; min-height: 0; min-width: 0; }
  .ds-swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-radius-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 56px; }
  .sys-cell .ds-ease-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sys-cell .ds-ease-grid > div { padding: 14px 12px !important; min-width: 0; }
  .sys-cell .ds-ease-grid span { overflow-wrap: anywhere; }
  .ds-manifest { padding: 0; }
  .ds-manifest-stats { flex-wrap: wrap; }
  .ds-stat { flex: 1 1 33%; padding: 20px 14px 16px; border-bottom: 1px solid var(--rule); min-width: 0; }
  .ds-stat__num { font-size: 44px; }
  .sys-cell * { max-width: 100%; }
  .sys-cell .ds-pill, .sys-cell .ds-btn-primary { flex-wrap: wrap; }
  /* Siguiente proyecto: rol · sector · disciplina en filas, no en columnas estrechas */
  .next-meta { flex-wrap: wrap; justify-content: center; gap: 4px 10px; text-align: center; }

  /* Demo del control en vivo: móvil y portátil apilados, cada uno a su tamaño */
  .control-grid { grid-template-columns: 1fr; gap: 40px; }
  .control-grid .mockup-flat--phone { height: min(560px, 125vw); }
  .control-grid .mockup-flat--laptop { height: auto; width: 100%; }

  /* Ruedas de mockups (Davante, Hiperdino): en móvil solo el teléfono, más grande */
  .mockup-group__stage .uf-laptop { display: none; }
  .fb-mockup:not(.fb-customs) .uf-stage.uf-stage--rail { --mockup-h: min(520px, 62vh); }
}

/* Táctil: sin cursor personalizado (se quedaba flotando en el centro) */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot, .cursor-disc { display: none !important; }
  body { cursor: auto; }
}
