/* =========================================================
   LEYBUX · Portfolio de Santiago Leybuscchoff
   Sistema: celdas (grilla) + frames + blur → foco
   ========================================================= */

/* ---------- Variables (identidad) ---------- */
:root {
  /* Paleta del brief */
  --navy: #0d2063;
  --navy-deep: #091750;
  --blue: #6389d7;
  --blue-soft: #c3d2f0;
  --orange: #e5651a;
  --orange-hot: #f15a24;

  /* Neutros */
  --paper: #fbfaf6;
  --paper-2: #f1efe7;
  --ink: #0b1640;
  --muted: #4f5878;
  --rule: rgba(13, 32, 99, 0.16);      /* líneas de la grilla */
  --rule-dark: rgba(255, 255, 255, 0.14);

  /* Tipografía */
  --font-sans: "Montserrat", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Medidas */
  --max-width: 1320px;
  --gutter: clamp(16px, 3vw, 40px);
  --cell-pad: clamp(18px, 2.2vw, 32px);
  --header-h: 64px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset básico ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  text-align: inherit;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* =========================================================
   SISTEMA DE CELDAS
   Cada sección se arma con celdas sobre una grilla de 12 columnas.
   Las líneas finas son la grilla: estructura, orden, método.
   ========================================================= */
.cells {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.cell {
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
  padding: var(--cell-pad);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.cell--navy {
  background: var(--navy);
  color: #fff;
}

.cell--navy .cell-kicker {
  color: var(--blue-soft);
}

.cells--dark,
.cells--dark .cell {
  border-color: var(--rule-dark);
}

/* ---------- Piezas reutilizables ---------- */

/* Texto técnico en mono */
.label,
.cell-kicker,
.interest-num,
.module-tag,
.connect-count,
.connect-steps,
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Contenido que falta completar: bien visible a propósito */
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--orange) !important;
}

/* Logo SVG — siempre el mismo, con los colores exactos del logo.
   Está dentro de <use>, así que los colores se cambian con
   variables (--logo-l, --logo-sq, --logo-accent, --logo-outline).
   Versión normal (fondo claro): azul oscuro + celeste + naranja.
   Versión fondo oscuro (.on-dark): todo blanco, el cuadrado naranja en contorno. */
:root {
  --logo-navy: #232d5b;
  --logo-blue: #6486c3;
  --logo-orange: #ec6223;
}

.on-dark {
  --logo-l: #fff;
  --logo-sq: #fff;
  --logo-accent: transparent;
  --logo-outline: #fff;
}

.logo-l {
  fill: var(--logo-l, var(--logo-navy));
}

.logo-sq {
  fill: var(--logo-sq, var(--logo-blue));
}

.logo-sq--accent {
  fill: var(--logo-accent, var(--logo-orange));
}

.logo-outline {
  fill: none;
  stroke: var(--logo-outline, none);
  stroke-width: 10;
}

.logo-outline {
  --i: 4;
}

.logo-l,
.logo-sq,
.logo-outline {
  transform-box: fill-box;
  transform-origin: center;
  animation: var(--logo-anim, none) 0.7s var(--ease) both;
  animation-delay: calc(0.3s + var(--i, 0) * 0.1s);
}

/* Frame de selección (tipo Figma): encuadre, foco */
.frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--orange);
  pointer-events: none;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.frame i {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--orange);
}

.frame i:nth-child(1) { top: -4px; left: -4px; }
.frame i:nth-child(2) { top: -4px; right: -4px; }
.frame i:nth-child(3) { bottom: -4px; left: -4px; }
.frame i:nth-child(4) { bottom: -4px; right: -4px; }

/* Media: imagen o, si falta, un marco con el nombre del archivo */
.media {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--rule) 0 1px, transparent 1px 12px),
    var(--paper-2);
  transition: filter 0.8s var(--ease), transform 0.8s var(--ease);
}

.media::after {
  content: attr(data-file);
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.media img,
.media video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Imagen entera, sin recortar (pantallas de celular, diagramas) */
.media--contain {
  background: var(--paper-2);
}

.media--contain img {
  object-fit: contain;
  padding: 10px;
}

.media--portrait { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1; }
.media--wide { aspect-ratio: 16 / 10; }
.media--step { aspect-ratio: 4 / 3; }

/* Blur → foco: lo que todavía no descubrimos */
.is-blurred {
  filter: blur(10px) saturate(0.6);
  transform: scale(1.04);
}

.is-blurred.is-focused {
  filter: none;
  transform: none;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1.5px solid var(--navy);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s, transform 0.2s var(--ease);
}

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-hot);
  border-color: var(--orange-hot);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: progress;
}

/* Aparición al hacer scroll: entra desenfocado y se enfoca */
.reveal {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  filter: none;
  transform: none;
}

/* =========================================================
   NAVBAR
   Barra dividida en celdas (como la grilla de la página).
   Siempre visible: se puede cambiar de sección en cualquier momento.
   ========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: var(--header-h);
  background: rgba(251, 250, 246, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: transform 0.45s var(--ease);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--gutter);
}

.brand-mark {
  width: 44px;
  height: 26px;
}

/* Logotipo "Leybux": la Montserrat con curvas del logo de Santiago (en vector) */
.brand-word {
  width: auto;
  height: 19px;
  aspect-ratio: 118.9 / 31.2;
  overflow: visible;
}

.wm-leyb {
  fill: var(--wm-text, var(--logo-navy));
}

.wm-ux {
  fill: var(--wm-ux, var(--logo-orange));
  stroke: var(--wm-ux-stroke, none);
  stroke-width: 1;
  stroke-linejoin: round;
}

/* Versión fondo oscuro: todo blanco y "ux" en contorno, como en el logo */
.on-dark {
  --wm-text: #fff;
  --wm-ux: transparent;
  --wm-ux-stroke: #fff;
}

.nav-links {
  display: flex;
  margin-left: auto;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(16px, 2vw, 28px);
  border-left: 1px solid var(--rule);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}

.nav-links sup {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s;
}

/* Línea naranja que entra desde la izquierda */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.nav-links a.is-active {
  color: var(--ink);
}

.nav-links a.is-active sup {
  color: var(--orange);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(20px, 2.4vw, 34px);
  background: var(--navy);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.3s;
}

.nav-cta span {
  transition: transform 0.3s var(--ease);
}

.nav-cta:hover,
.nav-cta.is-active {
  background: var(--orange);
}

.nav-cta:hover span {
  transform: translate(3px, -3px);
}

/* Botón de menú (solo mobile) */
.nav-menu {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 0 var(--gutter);
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-menu-icon {
  position: relative;
  width: 20px;
  height: 12px;
}

.nav-menu-icon i {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.nav-menu-icon i:nth-child(1) { top: 0; }
.nav-menu-icon i:nth-child(2) { top: 10px; }

.menu-open .nav-menu-icon i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.menu-open .nav-menu-icon i:nth-child(2) { top: 5px; transform: rotate(-45deg); }

/* Menú a pantalla completa (mobile) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: var(--navy);
  color: #fff;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease);
  visibility: hidden;
}

.menu-open .menu {
  clip-path: inset(0);
  visibility: visible;
}

.menu a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-dark);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.2s;
}

.menu a span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--orange);
}

.menu a.is-active {
  color: var(--orange);
}

.menu-open .menu a {
  opacity: 1;
  transform: none;
}

.menu-open .menu a:nth-child(1) { transition-delay: 0.15s; }
.menu-open .menu a:nth-child(2) { transition-delay: 0.2s; }
.menu-open .menu a:nth-child(3) { transition-delay: 0.25s; }
.menu-open .menu a:nth-child(4) { transition-delay: 0.3s; }
.menu-open .menu a:nth-child(5) { transition-delay: 0.35s; }

.menu-foot {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue-soft);
}

/* =========================================================
   SECCIONES (base)
   ========================================================= */
.section {
  padding: clamp(56px, 8vw, 112px) 0;
}

/* ---------- Fondos por sección ----------
   Una misma familia (azul, líneas finas, módulos), pero cada sección
   tiene el suyo según lo que cuenta. */

/* Sobre mí: la grilla de estructura (líneas, subdivisiones punteadas y cruces) */
.bg-grid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cg fill='none' stroke='%236389d7'%3E%3Cpath stroke-opacity='.2' d='M0 .5H480M0 240.5H480M.5 0V480M240.5 0V480'/%3E%3Cpath stroke-opacity='.18' stroke-dasharray='2 6' d='M0 120.5H480M0 360.5H480M120.5 0V480M360.5 0V480'/%3E%3Cpath stroke-opacity='.75' d='M120.5 114v13M114 120.5h13M360.5 234v13M354 240.5h13M240.5 354v13M234 360.5h13'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center top;
}

/* Proyectos: grilla milimetrada, más densa y fina (el detalle del proceso) */
.bg-fine {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg fill='none' stroke='%236389d7'%3E%3Cpath stroke-opacity='.08' d='M24.5 0V240M48.5 0V240M72.5 0V240M96.5 0V240M144.5 0V240M168.5 0V240M192.5 0V240M216.5 0V240M0 24.5H240M0 48.5H240M0 72.5H240M0 96.5H240M0 144.5H240M0 168.5H240M0 192.5H240M0 216.5H240'/%3E%3Cpath stroke-opacity='.16' d='M120.5 0V240M0 120.5H240'/%3E%3Cpath stroke-opacity='.26' d='M.5 0V240M0 .5H240'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center top;
}

/* Conexiones: un campo de puntos blancos con algún punto naranja suelto */
.bg-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='432' height='432'%3E%3Cdefs%3E%3Cpattern id='d' width='24' height='24' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='12' cy='12' r='1.1' fill='%23ffffff' fill-opacity='.2'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='432' height='432' fill='url(%23d)'/%3E%3Crect x='154' y='106' width='5' height='5' fill='%23e5651a'/%3E%3Crect x='346' y='298' width='5' height='5' fill='%23e5651a' fill-opacity='.7'/%3E%3C/svg%3E");
  background-position: center top;
}

/* Contacto: sin fondo, la pausa final después del azul de Conexiones */

/* ---------- Contraforma ----------
   El espacio que queda entre dos módulos redondeados (misma curva que la L)
   cuando se tocan en una esquina, con la cruz de la grilla en el punto de encuentro.
   Animación: las dos contraformas arrancan separadas y se juntan (se conectan).
   Está dentro de <use>, así que se controla con variables:
   --cf-off = cuánto están separadas (0 = conectadas) · --cf-grid = color de la cruz */
.star {
  display: block;
  fill: currentColor;
  pointer-events: none;
}

.cf-grid {
  fill: none;
  stroke: var(--cf-grid, currentColor);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.5;
}

.cf-shape {
  transition: transform 0.9s var(--ease);
}

.cf-a {
  transform: translate(calc(var(--cf-off, 0px) * -1), calc(var(--cf-off, 0px) * -1));
}

.cf-b {
  transform: translate(var(--cf-off, 0px), var(--cf-off, 0px));
}

/* ---------- Contacto: la conversación ----------
   Un globo de Santiago y, debajo, el de quien visita: mientras no escribe, el indicador de
   “escribiendo…” son los módulos del isotipo (azul, azul y el naranja, que marca el turno).
   Al pasar por un canal, esa persona “escribe” lo que le diría (data-chat-msg en cada link). */
.chat {
  position: absolute;
  right: var(--cell-pad);
  bottom: clamp(28px, 4vw, 56px);
  width: clamp(270px, 29vw, 390px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}

/* La celda del título tiene alto de sobra para la conversación (si no, pisaría la línea de arriba) */
@media (min-width: 961px) {
  .contact-cells .cell--head {
    min-height: 400px;
  }
}

.chat-bubble {
  padding: 16px 20px;
  border-radius: 22px;
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}

/* Santiago: abajo a la izquierda la esquina es recta, como la cola del globo */
.chat-santi {
  align-self: flex-start;
  max-width: 92%;
  background: var(--navy);
  color: #fff;
  border-bottom-left-radius: 0;
  transform-origin: bottom left;
}

/* Quien visita: se reserva el alto de tres líneas para que no salte nada al escribir */
.chat-turn {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-height: 118px;
}

.chat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.9s;
}

.chat-reply {
  display: flex;
  align-items: center;
  min-width: 96px;
  max-width: 100%;
  min-height: 56px;
  background: var(--paper);
  border: 1.5px solid var(--blue);
  border-bottom-right-radius: 0;
  color: var(--navy);
  font-weight: 500;
  transform-origin: bottom right;
}

.chat.is-in .chat-santi,
.chat.is-in .chat-reply {
  opacity: 1;
  transform: none;
}

.chat.is-in .chat-reply {
  transition-delay: 0.8s;
}

.chat.is-in .chat-label {
  opacity: 1;
}

/* Indicador de “escribiendo…”: los módulos del logo en ola */
.chat-dots {
  display: flex;
  gap: 8px;
}

.chat-dots i {
  width: 12px;
  height: 12px;
  background: var(--blue);
  animation: chat-dot 1.3s var(--ease) infinite;
}

.chat-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-dots i:nth-child(3) {
  background: var(--orange);
  animation-delay: 0.32s;
}

@keyframes chat-dot {
  0%,
  60%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-6px);
  }
}

.chat-text {
  display: none;
}

/* Cuando escribe, los puntos se van y aparece el texto con un módulo naranja de cursor */
.chat-reply.is-writing .chat-dots {
  display: none;
}

.chat-reply.is-writing .chat-text {
  display: block;
}

.chat-reply.is-writing .chat-text::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 5px;
  background: var(--orange);
  animation: chat-caret 0.9s steps(1) infinite;
}

@keyframes chat-caret {
  50% {
    opacity: 0;
  }
}

.cell--head:hover .chat-reply {
  border-color: var(--orange);
}

.cell--head {
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(28px, 4vw, 56px);
}

/* Encabezado de sección: mini isotipo que marca en qué módulo estás */
.section-tag {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tag-mark {
  flex: none;
  width: 46px;
  height: 28px;
  overflow: visible;
}

/* Los módulos del logo se arman cuando aparece el encabezado */
.reveal.is-visible .tag-mark {
  --logo-anim: module-in;
}

.tag-name {
  font-size: 1rem;
  font-weight: 700;
}

.tag-line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.tag-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.section--dark .tag-line { background: var(--rule-dark); }
.section--dark .tag-count { color: var(--blue-soft); }

.section-title {
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(2.2rem, 5.6vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-intro {
  max-width: 520px;
  margin-top: 18px;
  font-size: 1.02rem;
  color: var(--muted);
}

.cell-kicker {
  display: block;
}

/* =========================================================
   01 · INICIO
   Un campo de puntos que a simple vista no dice nada.
   La lente (el cursor) descubre las conexiones ocultas.
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding: calc(var(--header-h) + clamp(24px, 4vw, 48px)) 0 clamp(20px, 3vw, 32px);
}

.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-lens {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: var(--lens, 240px);
  height: var(--lens, 240px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}

.hero-lens.is-on {
  opacity: 1;
}

.hero-lens .frame {
  opacity: 1;
  transform: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  min-height: calc(100svh - var(--header-h) - clamp(44px, 7vw, 80px));
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.hero-concept {
  max-width: 12ch;
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--navy);
  animation: fade-focus 1s 0.2s var(--ease) both;
}

/* "no ven" arranca desenfocado y se descubre */
.focus-word {
  color: var(--orange);
  filter: blur(8px);
  opacity: 0.5;
  transition: filter 1s var(--ease), opacity 1s var(--ease);
}

.focus-word.is-focused {
  filter: none;
  opacity: 1;
}

@keyframes fade-focus {
  from {
    opacity: 0;
    filter: blur(10px);
  }
}

.hero-mark {
  flex: none;
  width: clamp(96px, 15vw, 210px);
  height: auto;
  aspect-ratio: 5 / 3;
  overflow: visible;
  --logo-anim: module-in;
}

@keyframes module-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

.hero-mid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  animation: fade-focus 1s 0.6s var(--ease) both;
}

.hero-role {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
}

.hero-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: right;
}

.hint-dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--orange);
  animation: blink 1.6s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* El nombre ocupa todo el ancho: cada línea se ajusta con JS */
.hero-title {
  font-weight: 900;
  letter-spacing: -0.055em;
  color: var(--navy);
}

/* Cada línea tiene aire arriba y abajo para que no se corten las letras
   (la "y", la "g", la "f"); el margen negativo las mantiene juntas */
.hero-title .fit {
  display: block;
  /* Recorta solo abajo (para que las letras suban desde ahí);
     a los costados deja margen para que no se corte la última "f" */
  clip-path: inset(-0.2em -0.3em 0 -0.3em);
  line-height: 1.1;
  white-space: nowrap;
  font-size: clamp(3rem, 14vw, 13rem); /* valor inicial, JS lo ajusta */
}

.hero-title .fit + .fit {
  margin-top: -0.24em;
}

.hero-title .fit > span {
  display: inline-block;
  animation: rise 1.1s var(--ease) both;
}

.hero-title .fit:nth-child(2) > span {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
}

/* =========================================================
   TRANSICIONES ENTRE SECCIONES
   ========================================================= */

/* Disolución modular (solo en la entrada a Conexiones):
   el azul se construye módulo a módulo a medida que scrolleás. */
.dissolve {
  display: grid;
  grid-template-columns: repeat(var(--cols, 24), 1fr);
  grid-auto-rows: var(--size, 48px);
  margin-top: calc(var(--rows, 3) * var(--size, 48px) * -0.5);
}

/* La franja ya es parte del azul de arriba: se descuenta del aire de la sección
   para que quede la misma distancia arriba que abajo (--band-half lo pone landing.js) */
.dissolve + .section {
  padding-top: max(0px, calc(clamp(56px, 8vw, 112px) - var(--band-half, 0px)));
}

.dissolve i {
  background: var(--navy);
  transform: scale(0);
  transition: transform 0.35s var(--ease), background 0.3s;
}

.dissolve i.is-on {
  transform: none;
}

.dissolve i.is-odd.is-on {
  background: var(--orange);
}

/* =========================================================
   RECURSOS DEL SISTEMA
   ========================================================= */

/* Matriz de puntos con un punto distinto (el que otros no ven).
   Los puntos aparecen de a uno (patrón, iteración) y el naranja queda encuadrado. */
.dot-matrix {
  position: absolute;
  right: var(--cell-pad);
  bottom: var(--cell-pad);
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), 4px);
  gap: 12px;
  pointer-events: none;
}

.dot-matrix i {
  position: relative;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background 0.3s;
  transition-delay: calc(var(--k, 0) * 18ms);
}

.reveal.is-visible .dot-matrix i,
.is-visible > .dot-matrix i {
  opacity: 0.55;
  transform: none;
}

.dot-matrix i.is-odd {
  background: var(--orange);
  border-radius: 0;
  opacity: 1 !important;
}

/* Encuadre del punto detectado */
.dot-matrix i.is-odd::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid var(--orange);
  opacity: 0;
  transform: scale(1.6);
  transition: opacity 0.4s 0.9s var(--ease), transform 0.4s 0.9s var(--ease);
}

.reveal.is-visible .dot-matrix i.is-odd::after,
.is-visible > .dot-matrix i.is-odd::after {
  opacity: 1;
  transform: none;
}

.section--dark .dot-matrix i,
.cell--navy .dot-matrix i {
  background: #fff;
}

.section--dark .dot-matrix i.is-odd,
.cell--navy .dot-matrix i.is-odd {
  background: var(--orange);
}

/* Esquinas de encuadre: aparecen cuando la imagen entra en foco */
.media-wrap {
  position: relative;
}

.corners {
  position: absolute;
  inset: -7px;
  pointer-events: none;
}

.corners i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--orange);
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.corners i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; transform: translate(8px, 8px); }
.corners i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; transform: translate(-8px, 8px); }
.corners i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; transform: translate(8px, -8px); }
.corners i:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; transform: translate(-8px, -8px); }

/* Las esquinas aparecen solo al pasar el mouse (o con el teclado): señalan "esto se puede tocar" */
.media-wrap:hover .corners i,
.media-wrap:focus-visible .corners i {
  opacity: 1;
  transform: none;
}

/* Imagen entera, con su proporción real (sin recortes) */
.media--natural {
  aspect-ratio: auto;
}

.media--natural img {
  position: static;
  display: block;
  height: auto;
}

/* Mientras falta la imagen, el marcador mantiene un tamaño */
.media--natural:not(:has(img)) {
  aspect-ratio: 4 / 3;
}

/* Imágenes que se pueden ampliar */
.is-zoomable {
  cursor: zoom-in;
}

.is-zoomable:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

.is-zoomable:has(img)::after {
  content: "⤢ Ampliar";
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #fff;
  background: rgba(9, 23, 80, 0.85);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: none;
}

.is-zoomable:hover::after,
.is-zoomable:focus-visible::after {
  opacity: 1;
  transform: none;
}

/* En celular no hay "pasar por encima": el aviso queda siempre visible, más discreto */
@media (hover: none) {
  .is-zoomable:has(img)::after {
    content: "⤢";
    opacity: 1;
    transform: none;
  }
}

/* Visor de imágenes ampliadas */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 56px 72px 48px;
  border: 0;
  background: rgba(9, 23, 80, 0.985); /* casi opaco: que no se vea la página detrás */
  color: #fff;
}

/* En qué etapa estás y qué imagen de esa etapa */
.lightbox-head {
  position: absolute;
  top: 20px;
  left: 24px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.lightbox-stage::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--orange);
}

/* Al llegar a la primera o la última imagen de la etapa, la flecha se apaga */
.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.lightbox-nav:disabled:hover {
  background: none;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Si la etapa tiene una sola imagen, no hay flechas */
.lightbox.is-single .lightbox-nav {
  visibility: hidden;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

/* Sin flechas (una sola imagen, como en el crucigrama): la imagen ocupa todo el centro */
.lightbox--solo[open] {
  grid-template-columns: minmax(0, 1fr);
}

.lightbox::backdrop {
  background: rgba(9, 23, 80, 0.9);
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
  justify-content: center;
}

.lightbox-figure img,
.lightbox-figure video {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

.lightbox-figure [hidden] {
  display: none;
}

.lightbox-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue-soft);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s, border-color 0.2s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--orange);
  border-color: var(--orange);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.lightbox-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue-soft);
}

@media (max-width: 720px) {
  .lightbox {
    padding: 64px 12px 72px;
  }

  .lightbox[open] {
    grid-template-columns: minmax(0, 1fr);
  }

  .lightbox-nav {
    position: absolute;
    bottom: 16px;
  }

  .lightbox-prev {
    left: calc(50% - 56px);
  }

  .lightbox-next {
    left: calc(50% + 8px);
  }
}

/* =========================================================
   02 · SOBRE MÍ
   ========================================================= */
.about-photo {
  grid-column: 1 / 5;
  grid-row: 2 / 4;
}

.photo-frame {
  position: relative;
}

.photo-frame .media img {
  object-position: center 35%;
}

.photo-frame .frame {
  inset: -1px;
}

.photo-frame .media.is-focused ~ .frame {
  opacity: 1;
  transform: none;
  transition-delay: 0.4s;
}

/* Cursor con nombre, como en Figma */
.cursor-tag {
  position: absolute;
  right: -10px;
  bottom: 16%;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.5s 0.7s var(--ease);
  animation: drift 5s ease-in-out infinite;
}

.photo-frame .media.is-focused ~ .cursor-tag {
  opacity: 1;
}

.cursor-tag svg {
  width: 22px;
  height: 22px;
  fill: var(--orange);
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.cursor-tag span {
  margin: 16px 0 0 -4px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #fff;
  background: var(--orange);
}

/* Con mouse, el cartel solo existe mientras estás encima de la foto
   (en celular queda quieto al costado, porque ahí no hay puntero) */
@media (hover: hover) {
  .photo-frame .media.is-focused ~ .cursor-tag {
    opacity: 0;
    transition: none; /* al salir desaparece al toque, no vuelve a su lugar */
  }

  .photo-frame.is-following .media ~ .cursor-tag {
    opacity: 1;
  }
}

/* Con el mouse encima: tu flecha es la flecha, el cartel la acompaña */
.photo-frame.is-following .cursor-tag {
  top: var(--cy);
  left: var(--cx);
  right: auto;
  bottom: auto;
  pointer-events: none;
  opacity: 1;
  animation: none;
  transform: translate(10px, 4px);
  transition: none;
}

.photo-frame.is-following .cursor-tag svg {
  visibility: hidden;
  width: 0;
}

.photo-frame.is-following .cursor-tag span {
  margin: 14px 0 0;
}

@keyframes drift {
  50% {
    transform: translate(-10px, -8px);
  }
}

.about-text {
  grid-column: 5 / 13;
}

.lead {
  max-width: 760px;
  font-size: clamp(1.3rem, 2.4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.about-text p + p {
  max-width: 620px;
  margin-top: 20px;
  color: var(--muted);
}

/* Herramientas: agrupadas por disciplina; cada una conecta con el proyecto donde la usé */
.about-tools {
  grid-column: 5 / 13;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tool-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-group-name {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue-soft);
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Con mouse, pasar por encima ya muestra el detalle: no hay nada que hacer clic,
   así que va la flecha común y no la manito */
@media (hover: hover) {
  .tool-list button {
    cursor: default;
  }
}

.tool-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 5px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: background 0.2s, border-color 0.2s;
}

.tool-list button:hover,
.tool-list button.is-active {
  background: var(--orange);
  border-color: var(--orange);
}

/* Logo sobre un recuadro claro, así todos se leen igual sobre el azul */
.tool-logo {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 4px;
  background: var(--paper);
}

.tool-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Si falta el archivo del logo: las iniciales */
.tool-logo:not(:has(img))::after {
  content: attr(data-initials);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--navy);
}

.tool-detail {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 132px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-dark);
}

.tool-logo--big {
  width: 56px;
  height: 56px;
  padding: 10px;
}

.tool-logo--big::after {
  font-size: 1rem !important;
}

.tool-name {
  font-size: 1.15rem;
  font-weight: 800;
}

.tool-what {
  max-width: 560px;
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #dfe6f7;
}

.tool-where {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue-soft);
}

.tool-where a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-where a:hover {
  color: var(--orange);
}

/* ---------- Crucigrama: fuera del diseño ----------
   Ya resuelto: no es un juego, es la forma de contarlo.
   Las casillas son la misma grilla de celdas de toda la web. */
.xw-board {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.xw-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 460px;
}

.xw-cell,
.xw-void {
  aspect-ratio: 1;
}

.xw-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.6vw, 1.35rem);
  font-weight: 700;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid rgba(13, 32, 99, 0.35);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.xw-cell sup {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--orange);
}

/* Las letras se escriben en diagonal, como si alguien lo fuera completando */
.xw-cell b {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  transition-delay: calc(var(--d) * 60ms);
}

.xw-grid.is-written .xw-cell b {
  opacity: 1;
  transform: none;
}

/* La palabra elegida se marca en naranja (atención) */
.xw-cell.is-active {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.xw-cell.is-active sup {
  color: #fff;
}

.xw-clues {
  grid-column: 6 / 10;
}

.xw-title {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.xw-intro {
  margin: 10px 0 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

.xw-dir {
  margin: 18px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.xw-list button {
  display: block;
  width: 100%;
  padding: 7px 0 7px 30px;
  text-indent: -30px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
  transition: color 0.2s;
}

.xw-num {
  display: inline-block;
  width: 30px;
  text-indent: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
}

.xw-len {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
}

.xw-list button:hover,
.xw-list button.is-active {
  color: var(--ink);
}

.xw-list button.is-active {
  font-weight: 600;
}

.xw-photo {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xw-photo .media {
  transition: filter 0.25s var(--ease), transform 0.25s var(--ease);
}

.xw-photo .media.is-focused {
  transition-duration: 0.6s;
}

.xw-photo .media img:not([src]) {
  display: none;
}

.xw-caption {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.xw-caption b {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
}

/* =========================================================
   03 · PROYECTOS — vista previa en la landing
   Instancia de descubrimiento: imagen, nombre, descripción breve y CTA.
   El primero es el destacado (a todo el ancho).
   ========================================================= */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border-left: 1px solid var(--rule);
}

.pcard {
  position: relative;
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--cell-pad);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background 0.3s;
}

.pcard:hover {
  background: rgba(241, 239, 231, 0.7);
}

.pcard--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--cell-pad);
}

.pcard-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.pcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pcard-num {
  color: var(--orange);
}

.pcard-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.pcard--featured .pcard-title {
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  letter-spacing: -0.04em;
}

/* Descripción breve: se corta a 3 líneas (5 en el destacado) */
.pcard-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 0.95rem;
  color: var(--muted);
}

.pcard--featured .pcard-desc {
  -webkit-line-clamp: 5;
}

.pcard-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
  transition: color 0.25s;
}

.pcard-cta span {
  transition: transform 0.35s var(--ease);
}

.pcard:hover .pcard-cta {
  color: var(--orange);
}

.pcard:hover .pcard-cta span {
  transform: translateX(6px);
}

/* Herramientas: etiquetas */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tools li {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.tools li.is-empty {
  border-style: dashed;
  text-transform: none;
}

/* =========================================================
   CASE STUDY (proyecto.html)
   ========================================================= */
.page-case main {
  padding-top: var(--header-h);
}

.case-hero {
  padding: clamp(32px, 5vw, 64px) 0 0;
}

.case-head .case-path {
  margin-bottom: clamp(20px, 3vw, 36px);
}

.case-path a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.case-path a:hover {
  color: var(--orange);
}

.case-title {
  font-size: clamp(2.6rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--navy);
}

.case-lead {
  max-width: 760px;
  margin-top: 24px;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.55;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.case-external {
  grid-column: 1 / -1;
}

.case-fact {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-fact > p:last-child {
  font-weight: 600;
}

/* Con quiénes lo hice (trabajos grupales) */
.case-fact > p.case-team {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
}

.case-hero.on-dark .case-team {
  color: var(--blue-soft);
}

.case-cover {
  grid-column: 1 / -1;
}

/* Cuerpo: índice fijo del proceso + pasos */
.case-body {
  padding: clamp(48px, 7vw, 96px) 0;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(200px, 3fr) minmax(0, 9fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.case-nav {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.case-nav-inner {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: var(--cell-pad);
}

/* Breadcrumb: dónde estás */
.case-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.case-path > * {
  display: flex;
  align-items: center;
}

.case-path > * + *::before {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 10px 0 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.case-path .is-current {
  font-weight: 700;
  color: var(--ink);
}

.case-nav ol {
  position: relative;
  margin-top: 22px;
  padding-left: 18px;
}

/* Línea de progreso */
.case-nav ol::before,
.case-nav ol::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--rule);
}

.case-nav ol::after {
  background: var(--orange);
  transform-origin: top;
  transform: scaleY(var(--progress, 0));
  transition: transform 0.5s var(--ease);
}

.case-nav button {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 7px 0;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.25s;
}

.case-nav button::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}

.case-nav button span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding-top: 3px;
}

.case-nav button:hover {
  color: var(--ink);
}

.case-nav button.is-active {
  color: var(--ink);
  font-weight: 700;
}

.case-nav button.is-active::before {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.3);
}

.case-steps {
  min-width: 0;
  border-right: 1px solid var(--rule);
}

.step {
  padding: clamp(32px, 4vw, 56px) var(--cell-pad);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + var(--step-offset, 0px));
}

.step-head {
  margin-bottom: 20px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--orange);
}

.step-title {
  margin: 6px 0 4px;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.step-hint {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--blue);
}

.step-text {
  max-width: 620px;
  margin-bottom: 28px;
}

figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

/* 01 Desafío: texto + imagen */
.step-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--cell-pad);
  align-items: start;
}

/* Imágenes con su proporción real: el JS guarda la proporción de cada una en --ar */
.media--fluid {
  aspect-ratio: var(--ar, 4 / 3);
}

/* Pantallas de celular muy largas: se ven desde arriba (enteras al ampliarlas) */
.media--phone img {
  object-position: top;
}

/* Si la imagen está, no se muestra el nombre del archivo de fondo */
.media:has(img)::after {
  display: none;
}

/* 02 Exploración: fila pareja. Misma altura para todas; cada una ocupa
   un ancho proporcional a su formato, así ninguna se recorta */
.gallery {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.gallery > figure {
  flex: var(--ar, 1.333) 1 0;
  min-width: 0;
}

/* 03 Iteración: secuencia de versiones (V01 → V02 → … → Final).
   Todas con la misma altura (--vh); el ancho sale de la proporción de cada imagen */
.versions {
  --vh: 220px;
  display: flex;
  align-items: flex-start;
  gap: 44px;
  overflow-x: auto;
  padding: 8px 8px 12px;
  scrollbar-width: none; /* sin barra: se recorre con la ruedita, las flechas o el dedo */
  overscroll-behavior-x: contain;
}

.versions::-webkit-scrollbar {
  display: none;
}

/* Iteración con scroll horizontal: la sección queda fija y el scroll vertical
   mueve las versiones hacia el costado (el JS le da el alto y mueve la fila) */
.hscroll.is-pinned .hscroll-sticky {
  position: sticky;
  top: 16px;
  overflow: hidden;
  transition: top 0.45s var(--ease);
}

/* Si la navbar está visible, la sección fija queda debajo */
.nav-shown .hscroll.is-pinned .hscroll-sticky {
  top: calc(var(--header-h) + 16px);
}

.hscroll.is-pinned .versions {
  overflow: visible;
  will-change: transform;
}

/* La fila se mueve adentro de esta ventana fija (que recorta lo que sale de los bordes) */
.hscroll.is-pinned .versions-window {
  overflow: hidden;
}

/* Desvanecido a la derecha mientras quedan versiones por ver.
   Va en la ventana (que no se mueve), no en la fila: así nunca tapa una imagen a la mitad */
.hscroll.is-pinned:not(.is-end) .versions-window {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 56px), transparent);
}

.hscroll-hint {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.hscroll.is-pinned .hscroll-hint {
  display: flex;
}

.hscroll.is-end .hscroll-hint .hint-dot {
  animation: none;
}

/* Historial de versiones (tipo Git): una línea con un punto por versión.
   Se enciende mientras avanzás; la rama que baja y termina en ✕ es lo descartado */
.vhistory {
  --step: calc(100% / (var(--n) - 1));
  position: relative;
  height: 48px;
  margin: 22px 28px 0;
}

.vhistory.has-branch {
  height: 78px;
}

.vh-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 2px;
  background: var(--rule);
}

.vh-fill {
  display: block;
  height: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
}

.vh-nodes {
  position: absolute;
  inset: 0;
}

.vh-nodes li {
  position: absolute;
  top: 0;
  left: calc(var(--i) * var(--step));
  transform: translateX(-50%);
}

.vh-nodes button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vh-dot {
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 1.5px solid var(--navy);
  transition: background 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}

.vh-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.25s;
}

.vh-nodes li.is-past .vh-dot {
  background: var(--navy);
}

.vh-nodes li.is-current .vh-dot {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.3);
}

.vh-nodes li.is-current .vh-label,
.vh-nodes button:hover .vh-label {
  color: var(--ink);
}

.vh-nodes li.is-final .vh-label {
  color: var(--orange);
}

/* La rama descartada: baja desde una versión con la curva de tu módulo y termina en ✕ */
.vh-branch {
  position: absolute;
  top: 11px;
  left: calc(var(--a) * var(--step));
  width: calc((var(--b) - var(--a)) * var(--step) * 0.55);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 46px;
}

.vh-branch-line {
  flex: 1;
  height: 100%;
  border-left: 1.5px dashed #9aa3bd;
  border-bottom: 1.5px dashed #9aa3bd;
  border-bottom-left-radius: 14px;
}

.vh-branch-end {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-bottom: -9px;
  font-size: 0.65rem;
  color: #6f7894;
  border: 1.5px solid #9aa3bd;
  background: var(--paper);
}

.vh-branch-label {
  position: absolute;
  left: calc(100% + 8px);
  bottom: -8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  color: #6f7894;
  transition: color 0.2s;
}

.vh-branch:hover .vh-branch-label,
.vh-branch:hover .vh-branch-end {
  color: var(--orange);
  border-color: var(--orange);
}

.versions:has(.media--phone) {
  --vh: 300px;
}

.version {
  position: relative;
  flex: 0 0 auto;
  width: max(150px, calc(var(--vh) * var(--ar, 1.333)));
  scroll-snap-align: start;
}

.version .media-wrap {
  width: calc(var(--vh) * var(--ar, 1.333));
}

/* La flecha entre versiones: cada una sale de la anterior */
.version + .version::before {
  content: "→";
  position: absolute;
  left: -32px;
  top: 45%;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--orange);
}

.version-name {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.version--final .version-name {
  font-weight: 500;
  color: var(--orange);
}

.version--final .media-wrap {
  outline: 2px solid var(--orange);
  outline-offset: 5px;
}

.version-note {
  margin-top: 12px;
  font-size: 0.88rem;
}

/* Iteración por etapas (reloj): las pestañas de espacios de trabajo de Blender.
   La encendida es la etapa que estás viendo en la fila; tocarlas lleva a esa etapa */
.ws-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  padding: 4px;
  background: #06102c;
  border: 1px solid var(--rule-dark);
  overflow-x: auto;
  scrollbar-width: none;
}

.ws-tabs button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 0 auto;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue-soft);
  transition: background 0.25s, color 0.25s;
}

.ws-tabs button span,
.ws-tabs button small {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
}

.ws-tabs button small {
  margin-left: auto;
  opacity: 0.7;
}

.ws-tabs button:hover {
  color: #fff;
}

.ws-tabs button.is-on {
  color: #fff;
  background: rgba(99, 137, 215, 0.3);
  box-shadow: inset 0 -2px 0 var(--orange);
}

.ws-tabs button.is-on span {
  color: var(--orange);
}

/* La portada de cada etapa, dentro de la fila: corta el recorrido en capítulos */
.etapa-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  width: 230px;
  min-height: calc(var(--vh) + 30px);
  padding: 18px 20px;
  color: #fff;
  background-color: #0a1638;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

.etapa-num,
.etapa-ws {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue-soft);
}

.etapa-title {
  margin: 8px 0 2px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.etapa-ws {
  color: var(--orange);
}

.etapa-text {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #d9e1f5;
}

/* Iteración por etapas en vertical: las pestañas quedan fijas arriba mientras leés */
.ws-tabs--fijas {
  position: sticky;
  top: 12px;
  z-index: 5;
  transition: top 0.45s var(--ease);
}

.nav-shown .ws-tabs--fijas {
  top: calc(var(--header-h) + 12px);
}

.etapa {
  scroll-margin-top: calc(var(--header-h) + 80px);
}

.etapa + .etapa {
  margin-top: 72px;
}

/* La portada de la etapa: una franja de viewport con el número, el nombre y el texto */
.etapa > .etapa-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px 28px;
  width: auto;
  min-height: 0;
  margin-bottom: 28px;
  padding: 22px 24px;
}

.etapa > .etapa-card .etapa-num { grid-column: 1; }
.etapa > .etapa-card .etapa-title { grid-column: 1; margin: 0; }
.etapa > .etapa-card .etapa-ws { grid-column: 1; }

.etapa > .etapa-card .etapa-text {
  grid-column: 2;
  grid-row: 1 / 4;
  max-width: 60ch;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

/* Las piezas: tantas columnas como entren (mínimo 340 px cada una, para que se vean grandes); las que tienen varias imágenes ocupan todo el ancho */
.piezas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 40px 28px;
}

.pieza--ancha {
  grid-column: 1 / -1;
}

.pieza .media-wrap,
.pieza-media .media-wrap {
  width: 100%;
}

/* Imágenes en fila con la misma altura: cada una ocupa el ancho de su proporción */
.pieza-row {
  display: flex;
  gap: 10px;
}

.pieza-row .pieza-media {
  flex: var(--ar, 1.333) 1 0;
  min-width: 0;
}

.pieza > .pieza-media + .pieza-row {
  margin-top: 10px;
}

/* El render solo, a lo ancho, no tan alto que no entre en pantalla */
.pieza > .pieza-media:first-of-type .media-wrap {
  max-width: calc(68vh * var(--ar, 1.78));
}

.pieza-media {
  position: relative;
}

.pieza-media figcaption {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: #fff;
  background: rgba(6, 16, 44, 0.8);
  pointer-events: none;
}

.pieza--ancha .version-note {
  max-width: 64ch;
}

.pieza-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
}



@media (max-width: 560px) {
  .piezas {
    grid-template-columns: 1fr;
  }

  .etapa > .etapa-card {
    grid-template-columns: 1fr;
  }

  .etapa > .etapa-card .etapa-text {
    grid-column: 1;
    grid-row: auto;
    margin-top: 10px;
  }

  .ws-tabs button small {
    display: none;
  }
}

/* Versiones con varias imágenes en fila (material + nodos, render + vistas) */
.version--multi {
  width: auto;
}

.version-row {
  display: flex;
  gap: 10px;
}

.version-media {
  position: relative;
  flex: none;
  width: calc(var(--vh) * var(--ar, 1.333));
}

.version-media .media-wrap {
  width: 100%;
}

.version-media figcaption {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: #fff;
  background: rgba(6, 16, 44, 0.8);
  pointer-events: none;
}

/* Con etapas, las imágenes son más altas: los nodos y las vistas de luces tienen
   mucho detalle, y la fila igual se recorre hacia el costado (sobra ancho).
   Se achica en pantallas bajas para que la sección fija siga entrando entera */
.hscroll--etapas .versions {
  --vh: clamp(220px, calc(100vh - 560px), 360px);
}

.version--multi .version-note {
  max-width: 52ch;
}

/* Las herramientas de Blender que usé en cada pieza */
.version-ops {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.version-ops div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.version-ops dt {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.version-ops dd {
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--navy);
  border: 1px solid var(--rule);
}

/* Modificadores: rellenos en azul, como los paneles de modificadores de Blender */
.version-ops .is-mods dd {
  color: #fff;
  background: #2b4a8f;
  border-color: #2b4a8f;
}

.version-ops + .version-note {
  margin-top: 8px;
}

/* En el historial, con tantas piezas, solo se lee el nombre de la que estás viendo;
   un corte separa una etapa de la siguiente */
.vhistory--etapas .vh-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.25s, color 0.25s;
}

.vhistory--etapas li.is-current .vh-label,
.vhistory--etapas button:hover .vh-label {
  opacity: 1;
}

/* En las puntas, el nombre se apoya hacia adentro para no salirse */
.vhistory--etapas li:first-child .vh-label {
  left: -6px;
  transform: none;
}

.vhistory--etapas li:last-child .vh-label {
  left: auto;
  right: -6px;
  transform: none;
}

.vh-cut {
  position: absolute;
  top: -3px;
  left: calc(var(--c) * var(--step));
  width: 2px;
  height: 18px;
  background: var(--orange);
  transform: translateX(-50%);
}

/* 04 Decisión: la frase + descartada vs. elegida */
.decision-quote {
  max-width: 24ch;
  margin: 8px 0 28px;
  padding-left: 20px;
  border-left: 4px solid var(--orange);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.compare {
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.compare > figure {
  display: flex;
  flex: var(--ar, 1.333) 1 0;
  flex-direction: column;
  min-width: 0;
}

/* Descartada sin imagen: una tarjeta que la describe */
.compare-text {
  display: flex;
  flex: 1;
  align-items: center;
  padding: 24px;
  border: 1.5px dashed var(--rule);
  background: var(--paper-2);
}

.compare-text p {
  font-size: 1.02rem;
  color: var(--muted);
}

.compare-label {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare-item--chosen .compare-label {
  color: var(--orange);
}

/* Descartada vs. elegida: se ven nítidas; la descartada en gris y marcada con ✕ */
.compare-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  border: 1.5px solid currentColor;
}

.compare-item--chosen .compare-mark {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.compare-item--discarded .media img {
  filter: grayscale(1);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.compare-item--discarded:hover .media img {
  opacity: 0.9;
}

/* Visor 3D: el modelo se gira con el mouse o el dedo */
.viewer {
  position: relative;
  margin-bottom: 20px;
}

.viewer-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(ellipse at 50% 40%, #2a3555 0%, var(--navy-deep) 70%);
}

.viewer-stage:active {
  cursor: grabbing;
}

.viewer-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.8s var(--ease), filter 1s var(--ease);
}

/* Al terminar de cargar, el modelo entra desenfocado y se enfoca */
.viewer.is-ready .viewer-stage canvas {
  opacity: 1;
  filter: none;
}

.viewer-status {
  position: absolute;
  inset: 0 0 52px;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--blue-soft);
  pointer-events: none;
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 0;
  padding: 12px 14px;
  background: var(--navy);
  color: var(--blue-soft);
}

.viewer-hint {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cuando la persona ya lo movió, la ayuda deja de titilar */
.viewer.is-touched .hint-dot {
  animation: none;
}

.viewer-reset {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s, border-color 0.2s;
}

.viewer-reset:hover {
  background: var(--orange);
  border-color: var(--orange);
}

.viewer.is-ready:hover .corners i {
  opacity: 1;
  transform: none;
}

.viewer.is-error .viewer-bar {
  display: none;
}

@media (max-width: 720px) {
  .viewer-stage {
    aspect-ratio: 4 / 5;
  }
}

/* 05 Resultado: protagonismo visual */
.result-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}

/* Video de YouTube: en su proporción, 16:9 */
.result-frame--video {
  aspect-ratio: 16 / 9;
  background: #000;
}

/* Prototipo de celular: alto como la pantalla, así se ve entero de entrada */
.result-frame--phone {
  aspect-ratio: auto;
  height: min(calc(100vh - var(--header-h) - 48px), 920px);
  min-height: 560px;
}

.result-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.result-gallery {
  display: grid;
  gap: 20px;
}

/* 06 Aprendizaje: puntos cortos numerados */
.learnings {
  counter-reset: learning;
  border-top: 1px solid var(--rule);
}

.learnings li {
  position: relative;
  counter-increment: learning;
  padding: 18px 0 18px 56px;
  border-bottom: 1px solid var(--rule);
  font-size: 1.1rem;
  font-weight: 600;
}

.learnings li::before {
  content: counter(learning, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--orange);
}

/* Anterior / siguiente / volver */
.case-more {
  padding: 0 0 clamp(56px, 8vw, 96px);
}

/* Otros proyectos: título + una tarjeta por proyecto, con su imagen */
.other-head {
  grid-column: 1 / -1;
}

.other-heading {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.other-head .section-intro {
  margin-top: 12px;
}

.other-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.3s;
}

.other-card:hover {
  background: rgba(241, 239, 231, 0.7);
}

.other-media {
  margin-bottom: 6px;
}

.other-title {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Al pasar por encima: la imagen se acerca apenas y aparece el encuadre */
.other-card .media img {
  transition: transform 0.6s var(--ease);
}

.other-card:hover .media img {
  transform: scale(1.04);
}

.other-card:hover .corners i,
.other-card:focus-visible .corners i {
  opacity: 1;
  transform: none;
}

.other-card:hover .pcard-cta {
  color: var(--orange);
}

.other-card:hover .pcard-cta span {
  transform: translateX(6px);
}

.case-back {
  grid-column: 1 / -1;
  font-weight: 700;
  text-align: center;
  transition: color 0.2s, background 0.2s;
}

.case-back:hover {
  color: #fff;
  background: var(--orange);
}

.text-link {
  font-weight: 700;
  color: var(--orange);
}

/* ---------- Responsive de proyectos y case study ---------- */
@media (max-width: 960px) {
  .pcard {
    grid-column: span 6;
  }

  .pcard:not(.pcard--featured):last-child:nth-child(even) {
    grid-column: 1 / -1;
  }

  .pcard--featured {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-fact {
    grid-column: span 6;
  }

  .case-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* El índice del proceso pasa a ser una tira horizontal fija */
  .case-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--paper);
    transition: top 0.45s var(--ease);
  }

  .nav-shown .case-nav {
    top: var(--header-h);
  }

  .case-nav-inner {
    position: static;
    padding: 10px var(--cell-pad);
  }

  .case-nav ol {
    display: flex;
    gap: 18px;
    margin: 6px 0 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .case-nav ol::before,
  .case-nav ol::after,
  .case-nav button::before {
    display: none;
  }

  .case-nav button {
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }

  .case-nav button.is-active {
    border-bottom-color: var(--orange);
  }

  .case-steps {
    --step-offset: 80px; /* alto de la tira del proceso */
  }

  .step-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .pcard,
  .pcard:not(.pcard--featured):last-child:nth-child(even) {
    grid-column: 1 / -1;
  }

  /* En celular: una debajo de la otra, a todo el ancho, cada una con su proporción */
  .gallery,
  .compare {
    flex-direction: column;
  }

  .gallery > figure,
  .compare > figure {
    flex: none;
    width: 100%;
  }

  .versions {
    --vh: 200px;
  }

  .versions:has(.media--phone) {
    --vh: 280px;
  }

  .other-card {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   04 · CONEXIONES
   elementos separados → conexión → nueva posibilidad
   ========================================================= */
.section--dark {
  background-color: var(--navy);
  color: #fff;
}

.section--dark .section-intro,
.section--dark .module-tag,
.section--dark .connect-count,
.section--dark .connect-steps {
  color: var(--blue-soft);
}

.section-title--xl {
  font-size: clamp(3rem, 11vw, 9.5rem);
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.connect-question {
  max-width: 760px;
  margin-top: 28px;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.connect {
  border-left: 1px solid var(--rule-dark);
  border-right: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}

.connect-stage {
  display: grid;
  grid-template-columns: 1fr 56px 1fr 56px 1fr;
  align-items: stretch;
  padding: clamp(24px, 4vw, 56px) var(--cell-pad);
}

/* Módulo */
.module {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  transition:
    filter 0.35s var(--ease),
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease),
    border-color 0.3s;
}

.module-word {
  font-size: min(2.3rem, calc(125cqi / var(--len, 8)));
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* Módulo desenfocado mientras busca: borde punteado = todavía no definido */
.module.is-searching {
  border-style: dashed;
  filter: blur(9px);
  opacity: 0.55;
  transform: translate(var(--dx, 0), var(--dy, 0));
}

/* Antes de generar: las palabras y el color están desenfocados (todavía no se descubrieron)
   y los módulos no están conectados. Las etiquetas se leen: sabés qué va a salir, no cuál */
.connect.is-idle .module {
  border-style: dashed;
}

.connect.is-idle .module-word,
.connect.is-idle .swatch {
  filter: blur(10px);
  opacity: 0.5;
  user-select: none;
}

.connect.is-idle .swatch {
  background: rgba(255, 255, 255, 0.35);
}

.connect.is-idle .link-line {
  transform: scaleX(0);
}

.connect.is-idle .link-x {
  transform: rotate(90deg) scale(0.8);
}

.module-word,
.swatch {
  transition: filter 0.35s var(--ease), opacity 0.35s var(--ease), background 0.4s var(--ease);
}

/* Módulo en foco: aparece el frame */
.module.is-picked {
  border-color: rgba(255, 255, 255, 0.45);
}

.module.is-picked .frame {
  opacity: 1;
  transform: none;
}

.module .frame {
  inset: -1px;
}

/* El color aparece como bloque, no solo como texto */
.swatch {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 30%;
  aspect-ratio: 1;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: background 0.4s var(--ease);
}

/* Conectores × entre módulos */
.link {
  position: relative;
  display: grid;
  place-items: center;
}

.link-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--orange);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.link-x {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--orange);
  background: var(--navy);
  border: 1.5px solid var(--orange);
  transition: transform 0.45s var(--ease);
}

.connect.is-searching .link-line {
  transform: scaleX(0);
}

.connect.is-searching .link-x {
  transform: rotate(90deg) scale(0.8);
}

.connect-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding: var(--cell-pad);
  border-top: 1px solid var(--rule-dark);
}

.connect-steps {
  margin-left: auto;
}

/* Historial: las combinaciones generadas quedan guardadas (iterar, comparar) */
.connect-history {
  padding: 0 var(--cell-pad) var(--cell-pad);
}

.connect-history-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-soft);
}

.connect-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.connect-history-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  border: 1px solid var(--rule-dark);
  transition: border-color 0.2s, background 0.2s;
}

.connect-history-list button span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--blue-soft);
}

.connect-history-list button:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.connect-history-list button.is-current {
  border-color: var(--orange);
  background: rgba(229, 101, 26, 0.15);
}

.connect-history-list button.is-current span {
  color: var(--orange);
}

/* La más nueva entra con un pequeño foco */
.connect-history-list li:first-child {
  animation: fade-focus 0.5s var(--ease) both;
}

/* =========================================================
   05 · CONTACTO
   ========================================================= */
.contact-link {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 220px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s;
}

.contact-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}

.contact-link:hover {
  color: #fff;
}

.contact-link:hover::before {
  transform: scaleY(1);
}

.contact-link:hover .cell-kicker,
.contact-link:hover .placeholder {
  color: #fff !important;
}

/* El mail es largo: la letra se achica según el ancho de su celda para que entre
   en una sola línea (nunca cortado a la mitad) */
.contact-link:has(.contact-value--mail) {
  container-type: inline-size;
}

.contact-value--mail {
  white-space: nowrap;
  font-size: min(clamp(1.2rem, 2.2vw, 1.8rem), 7.4cqi) !important;
}

.contact-value {
  overflow-wrap: anywhere; /* por las dudas: si algo no entra, que corte antes que salirse */
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.contact-arrow {
  position: absolute;
  top: var(--cell-pad);
  right: var(--cell-pad);
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 0.35s var(--ease);
}

.contact-link:hover .contact-arrow {
  transform: translate(4px, -4px);
}

/* Redes: una fila más baja, en partes iguales (tantas como redes haya), con la misma línea fina */
.contact-socials {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 0;
}

.social-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 130px;
  padding: var(--cell-pad);
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s;
}

.social-link + .social-link {
  border-left: 1px solid var(--rule);
}

.social-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}

.social-link:hover {
  color: #fff;
}

.social-link:hover::before {
  transform: scaleY(1);
}

.social-link:hover .cell-kicker,
.social-link:hover .placeholder {
  color: #fff !important;
}

.social-link .contact-arrow {
  font-size: 1.2rem;
}

/* Las redes que todavía no existen (sin link): no se pintan al pasar, porque no llevan a ningún lado */
span.social-link:hover {
  color: inherit;
}

span.social-link:hover::before {
  transform: scaleY(0);
}

span.social-link:hover .cell-kicker {
  color: inherit !important;
}

span.social-link:hover .placeholder {
  color: var(--orange) !important;
}

.social-link:hover .contact-arrow {
  transform: translate(4px, -4px);
}

.social-value {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--navy-deep);
  color: #fff;
  padding: 32px 0;
}

.footer .nav-brand {
  padding: 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer p {
  font-size: 0.9rem;
}

.footer .footer-copy {
  font-size: 0.74rem;
  color: var(--blue-soft);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .about-photo {
    grid-column: 1 / 6;
    grid-row: auto;
  }

  .about-text {
    grid-column: 6 / 13;
  }

  .about-tools {
    grid-column: 1 / -1;
  }
}

/* Crucigrama en dos columnas: tablero + foto arriba, definiciones abajo */
@media (max-width: 1120px) {
  .xw-board {
    grid-column: 1 / 7;
  }

  .xw-photo {
    grid-column: 7 / 13;
  }

  .xw-clues {
    grid-column: 1 / -1;
    order: 1; /* después del tablero y la foto */
  }
}

/* Contacto: si no entra al lado del título, la conversación va debajo */
@media (max-width: 960px) {
  .chat {
    position: static;
    width: 100%;
    max-width: 420px;
    margin-top: 28px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 60px;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-menu {
    display: flex;
  }

  .hero-mid {
    flex-direction: column;
    align-items: flex-start;
  }

  .cell--head .dot-matrix {
    display: none;
  }


  .hero-hint {
    text-align: left;
  }

  .about-photo,
  .about-text,
  .about-tools,
  .xw-board,
  .xw-clues,
  .xw-photo {
    grid-column: 1 / -1;
  }

  .xw-photo .media {
    max-width: 420px;
  }

  .tool-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-frame {
    max-width: 340px;
  }

  /* Conexiones en vertical, como el boceto */
  .connect-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .module {
    min-height: 150px;
  }

  .swatch {
    width: 48px;
  }

  .link {
    height: 52px;
  }

  .link .link-line {
    left: 50%;
    right: auto;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
    margin: 0 0 0 -1px;
    transform-origin: top;
  }

  .connect.is-searching .link .link-line {
    transform: scaleY(0);
  }

  .connect-steps {
    margin-left: 0;
  }

  .contact-link {
    grid-column: 1 / -1;
    min-height: 150px;
  }

  /* En celular las redes pasan a una lista: una por renglón */
  .contact-socials {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }

  .social-link {
    min-height: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 16px;
    padding-right: 56px;
  }

  .social-link + .social-link {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .cursor-tag {
    animation: none;
  }
}

/* =========================================================
   ESTÉTICA POR PROYECTO
   Lo compartido no cambia (menú, logo, colores, tipografía, grilla, 6 pasos).
   Cambia el marco: cada proyecto habla el idioma de su disciplina.
   ========================================================= */

/* ---------- Base común de los marcos ---------- */
.case-chrome {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
}

.chrome-end {
  margin-left: auto;
}

.case-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Hero oscuro (3D y cine) */
.case-hero.on-dark {
  padding-bottom: clamp(32px, 5vw, 64px);
  background: var(--navy-deep);
  color: #fff;
}

.case-hero.on-dark .case-title,
.case-hero.on-dark .case-path .is-current {
  color: #fff;
}

.case-hero.on-dark .case-path,
.case-hero.on-dark .cell-kicker {
  color: var(--blue-soft);
}

.case-hero.on-dark .case-lead {
  color: #dfe6f7;
}

.case-hero.on-dark .tools li {
  background: transparent;
  border-color: var(--rule-dark);
}

/* ---------- 3D: viewport de Blender ---------- */
.tema-3d .case-window {
  background-color: #0a1638;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--rule-dark);
}

.tema-3d .case-window > .cells {
  border-top: 0;
  border-left: 0;
}

.tema-3d .case-chrome {
  overflow: hidden; /* en celular, lo que no entra de la barra se corta en vez de ensanchar la página */
  color: var(--blue-soft);
  background: #06102c;
  border-bottom: 1px solid var(--rule-dark);
}

.tema-3d .case-chrome .is-on {
  padding: 2px 8px;
  color: #fff;
  background: rgba(99, 137, 215, 0.3);
}

.tema-3d .case-chrome--bottom {
  border-top: 1px solid var(--rule-dark);
  border-bottom: 0;
}

.tema-3d .case-chrome--bottom .chrome-end {
  color: var(--orange);
}

.tema-3d .case-head {
  padding-right: clamp(160px, 22vw, 300px);
}

.wire {
  fill: none;
  stroke: var(--blue-soft);
  stroke-width: 0.8;
}

.wire-faint {
  stroke-opacity: 0.35;
}

.wire-hands {
  stroke: var(--orange);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.wire-body,
.wire-hands {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.case-head .wire {
  position: absolute;
  top: 50%;
  right: clamp(24px, 4vw, 64px);
  width: clamp(120px, 16vw, 210px);
  transform: translateY(-50%);
}

.gizmo {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44px;
  fill: var(--blue-soft);
  font-family: var(--font-mono);
  font-size: 7px;
  stroke-width: 2;
}

.gizmo text {
  stroke: none;
}

.gz-x { stroke: var(--orange); }
.gz-z { stroke: #fff; }
.gz-y { stroke: var(--blue); }

.tema-3d .case-status .wire {
  width: 40px;
  flex: none;
  stroke: var(--navy);
}

/* Imágenes enteras sobre el fondo del viewport */
.tema-3d .media--contain {
  background-color: #0a1638;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Puntos del índice: vértices */
.tema-3d .case-nav button::before {
  transform: rotate(45deg) scale(0.85);
}

.tema-3d .case-nav button.is-active::before {
  transform: rotate(45deg) scale(1.15);
}

/* ---------- Cine: franjas negras + línea de tiempo ---------- */
.tema-cine .case-hero.on-dark {
  background: #04060f;
}

.tema-cine .case-window {
  background: var(--navy);
}

.tema-cine .case-window > .cells {
  border-left: 0;
}

.tema-cine .case-chrome {
  padding: clamp(12px, 1.6vw, 20px) 16px;
  color: #9aa3bd;
  background: #000;
}

.tema-cine .rec {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.rec::before,
.rec-dot {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: rec 1.4s steps(2, jump-none) infinite;
}

@keyframes rec {
  50% {
    opacity: 0.25;
  }
}

/* Línea de tiempo de edición, fija abajo mientras recorrés el proceso (entra deslizándose).
   No repite el índice: V1 es la pista de video (cada clip, una escena del proceso) y
   A1 la de audio, con la forma de la canción del film. El cabezal avanza con el scroll. */
.case-timeline {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  width: min(100% - 2 * var(--gutter), var(--max-width) - 2 * var(--gutter));
  padding: 8px 12px 10px;
  font-family: var(--font-mono);
  background: #0b0d12;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, 110%);
  transition: transform 0.45s var(--ease);
}

.case-timeline.is-shown {
  transform: translate(-50%, 0);
}

/* Los nombres de las pistas, como en Premiere */
.tl-labels {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
}

.tl-labels span {
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 0.62rem;
  color: #9aa3bd;
  background: #1a1d26;
}

.tl-lanes {
  position: relative;
  display: grid;
  grid-template-rows: 26px 26px;
  gap: 3px;
}

.tl-lane {
  display: flex;
  gap: 2px;
  min-width: 0;
}

/* Cada clip de la pista de video es una escena: se toca para ir a esa parte */
.tl-clip {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  font-size: 0.6rem;
  text-align: left;
  color: #cfd6ea;
  white-space: nowrap;
  overflow: hidden;
  background: #3d4a8f;
  border-left: 2px solid #6b7bd1;
  transition: background 0.3s;
}

.tl-clip:hover,
.tl-clip.is-active {
  color: #fff;
  background: #5363b8;
}

/* La pista de audio: el volumen de la canción, barra por barra */
.tl-lane--audio {
  position: relative;
  align-items: center;
  padding: 0 4px;
  background: #1f3b2c;
  border-left: 2px solid #3f8a5f;
}

.tl-track-name {
  position: absolute;
  left: 8px;
  top: 2px;
  z-index: 1;
  padding: 0 4px;
  font-size: 0.55rem;
  color: #b9e2c8;
  background: rgba(31, 59, 44, 0.85);
}

.tl-wave {
  display: flex;
  align-items: center;
  gap: 1px;
  width: 100%;
  height: 100%;
}

.tl-wave i {
  flex: 1;
  height: calc(var(--v) * 80% + 2px);
  background: #5fc58a;
  opacity: 0.8;
}

/* Cabezal: avanza escena por escena con el scroll */
.tl-head {
  position: absolute;
  top: -6px;
  bottom: -2px;
  left: calc(100% * var(--p, 0));
  z-index: 2;
  width: 2px;
  background: var(--orange);
  pointer-events: none;
}

.tl-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  border: 5px solid transparent;
  border-top-color: var(--orange);
}

/* El código de tiempo, a la derecha */
.tl-tc {
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  background: #1a1d26;
}

/* Que la línea fija no tape el final de cada paso */
.tema-cine .case-steps {
  padding-bottom: 90px;
}

.tema-cine .case-status {
  color: var(--ink);
  font-weight: 600;
}

/* Cada imagen del proceso dentro de su cuadro de cine */
.tema-cine .case-steps .media-wrap,
.tema-cine .case-cover .media-wrap {
  padding-block: clamp(5px, 0.7vw, 9px);
  background: #000;
}

/* Puntos del índice: fotogramas */
.tema-cine .case-nav button::before {
  width: 11px;
  left: -20.5px;
}

/* ---------- Interfaz: ventana de navegador ---------- */
.tema-interfaz .case-window {
  border: 1px solid var(--navy);
  background: var(--paper);
}

.tema-interfaz .case-window > .cells {
  border-top: 0;
  border-left: 0;
}

.tema-interfaz .case-chrome {
  border-bottom: 1px solid var(--navy);
  background: var(--paper-2);
}

.chrome-dots {
  display: flex;
  gap: 6px;
}

.chrome-dots i {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(13, 32, 99, 0.4);
}

.chrome-dots i:last-child {
  background: var(--orange);
  border-color: var(--orange);
}

.chrome-url {
  flex: 1;
  min-width: 0;
  padding: 4px 12px;
  color: var(--muted);
  border: 1px solid var(--rule);
  background: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-url b,
.tema-interfaz .case-status b {
  color: var(--orange);
}

.tema-interfaz .case-status {
  gap: 0;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

/* Las capturas del proceso se ven como ventanas; las de celular, como celular */
.tema-interfaz .case-steps .media-wrap:not(:has(.media--phone)) {
  padding-top: 18px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}

.tema-interfaz .case-steps .media-wrap:not(:has(.media--phone))::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 8px;
  width: 30px;
  height: 6px;
  background:
    linear-gradient(90deg, rgba(13, 32, 99, 0.35) 6px, transparent 6px 12px, rgba(13, 32, 99, 0.35) 12px 18px, transparent 18px 24px, var(--orange) 24px);
}

.tema-interfaz .case-steps .media-wrap:has(.media--phone) {
  padding: 6px;
  border: 1.5px solid var(--navy);
  border-radius: 18px;
}

.tema-interfaz .case-steps .media-wrap:has(.media--phone) .media {
  border-radius: 12px;
}

/* Puntos del índice: botones de opción */
.tema-interfaz .case-nav button::before {
  border-radius: 50%;
}

/* ---------- Motion graphics: composición de After Effects ---------- */
.tema-motion .case-window {
  border: 1px solid var(--navy);
  background: var(--paper);
}

.tema-motion .case-window > .cells {
  border-top: 0;
  border-left: 0;
}

.tema-motion .case-chrome {
  color: var(--blue-soft);
  background: var(--navy);
}

.tema-motion .case-chrome .is-on {
  padding: 2px 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.tema-motion .case-chrome .chrome-end {
  color: var(--orange);
}

.tema-motion .case-head {
  padding-right: clamp(200px, 26vw, 340px);
}

/* Curva de animación (editor de gráficos) */
.ease {
  position: absolute;
  top: 50%;
  right: clamp(20px, 3vw, 48px);
  width: clamp(170px, 20vw, 260px);
  transform: translateY(-50%);
}

.ease svg {
  overflow: visible;
  fill: none;
}

.ease-grid {
  stroke: var(--rule);
}

.ease-handle {
  stroke: var(--blue);
  stroke-dasharray: 3 3;
}

.ease-curve {
  stroke: var(--navy);
  stroke-width: 2;
}

.ease-dot {
  fill: var(--orange);
}

.ease-track {
  position: relative;
  height: 26px;
  margin: 14px 5% 0;
  border-bottom: 1px solid var(--rule);
}

/* La pelota avanza con la curva y se estira cuando va rápido (aplastar y estirar) */
.ease-ball {
  position: absolute;
  bottom: 2px;
  left: calc(var(--v, 0) * (100% - 20px));
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--orange);
  transform: scale(var(--stretch, 1), calc(2 - var(--stretch, 1)));
  transform-origin: 50% 100%;
}

.ease figcaption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
  color: var(--muted);
}

/* Línea de tiempo: una capa por paso, con su keyframe */
.kf {
  --kfn: 200px; /* ancho de la columna con el nombre de la capa */
  position: relative;
  padding: 8px 0 10px;
  background: var(--navy);
}

.kf-row {
  display: grid;
  grid-template-columns: var(--kfn) minmax(0, 1fr);
  align-items: center;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--blue-soft);
  transition: background 0.2s, color 0.2s;
}

.kf-row:hover,
.kf-row.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.kf-name {
  display: flex;
  gap: 8px;
  padding: 5px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.kf-name span {
  color: var(--orange);
}

.kf-track {
  position: relative;
  height: 22px;
  margin: 0 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

/* El keyframe: un rombo */
.kf-track i {
  position: absolute;
  top: 50%;
  left: calc(var(--x) * 100%);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--blue-soft);
  transform: rotate(45deg);
}

.kf-row.is-active .kf-track i {
  background: var(--orange);
}

.kf-head {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: calc(var(--kfn) + 16px + (100% - var(--kfn) - 32px) * var(--p, 0));
  width: 2px;
  background: var(--orange);
  pointer-events: none;
}

.kf-mini {
  width: 9px;
  height: 9px;
  background: var(--orange);
  transform: rotate(45deg);
}

/* Imágenes enteras sobre la grilla de transparencia de After Effects */
.tema-motion .media--contain {
  background:
    repeating-conic-gradient(#e9e6dd 0 25%, #fbfaf6 0 50%) 0 0 / 16px 16px;
}

/* Puntos del índice: keyframes */
.tema-motion .case-nav button::before {
  transform: rotate(45deg) scale(0.85);
}

.tema-motion .case-nav button.is-active::before {
  transform: rotate(45deg) scale(1.15);
}

/* La cursada como playlist (igual que en el video): cada canción es un trabajo */
.pl {
  margin-top: 24px;
  border: 1px solid var(--rule);
}

.pl-head,
.pl-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.pl-head {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.pl-list > li + li {
  border-top: 1px solid var(--rule);
}

.pl-row {
  width: 100%;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.pl-row:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.pl-title {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  color: var(--ink);
}

.pl-title small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.pl-num {
  position: relative;
  font-family: var(--font-mono);
}

.pl-dur {
  font-family: var(--font-mono);
  text-align: right;
}

.pl-album {
  display: flex;
  flex-direction: column;
}

.pl-album small {
  font-size: 0.72rem;
}

/* Línea de tiempo de cada trabajo: la barra mide lo que dura, con un keyframe al entrar y otro al salir */
.pl-kf {
  position: relative;
  display: block;
  height: 20px;
  border-bottom: 1px dashed var(--rule);
}

.pl-kf-bar {
  position: absolute;
  top: 50%;
  left: 0;
  width: max(18px, calc(var(--w) * 100%));
  height: 2px;
  margin-top: -1px;
  background: var(--navy);
}

.pl-kf-bar i {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--navy);
  transform: rotate(45deg);
}

.pl-kf-bar i:last-of-type {
  left: 100%;
}

/* El cabezal: recorre el trabajo en su tiempo real mientras "suena" */
.pl-kf-bar b {
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: 0;
  width: 2px;
  background: var(--orange);
  opacity: 0;
}

.pl-row.is-playing .pl-kf-bar,
.pl-row.is-playing .pl-kf-bar i {
  background: var(--orange);
}

.pl-row.is-playing .pl-kf-bar b {
  opacity: 1;
  background: var(--ink);
  animation: kf-play var(--dur) linear infinite;
}

@keyframes kf-play {
  to {
    left: 100%;
  }
}

/* La que "suena": en naranja, con el ecualizador en lugar del número */
.pl-row.is-playing .pl-title {
  color: var(--orange);
}

.pl-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.pl-row.is-playing .pl-num b {
  display: none;
}

.pl-row.is-playing .pl-eq {
  display: inline-flex;
}

.pl-eq i {
  width: 3px;
  height: 100%;
  background: var(--orange);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.pl-eq i:nth-child(2) { animation-delay: -0.3s; }
.pl-eq i:nth-child(3) { animation-delay: -0.6s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.pl-detail {
  padding: 4px 16px 22px 72px;
  animation: fade-focus 0.4s var(--ease) both;
}

.pl-mine {
  margin: 12px 0 16px;
  padding: 10px 14px;
  font-size: 0.92rem;
  border-left: 3px solid var(--orange);
  background: var(--paper-2);
}

.pl-mine b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--orange);
}

.pl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 18px;
}

.pl-tags li {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--navy);
}

.pl-empty {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .pl-head {
    display: none;
  }

  .pl-row {
    grid-template-columns: 30px minmax(0, 1fr) 44px;
  }

  .pl-album,
  .pl-kf {
    display: none;
  }

  .pl-detail {
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-eq i,
  .pl-row.is-playing .pl-kf-bar b {
    animation: none;
  }
}

/* ---------- Cine: preproducción ---------- */
.storyline span {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--orange);
}

/* La canción: como la tarjeta de un tema, con un vinilo que gira */
.song-card {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 26px 0 8px;
  padding: 18px 20px;
  color: #fff;
  background: #000;
}

.song-disc {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--orange) 0 14%, #000 15% 18%, transparent 19%),
    conic-gradient(rgba(255, 255, 255, 0.16), transparent 18%, transparent 50%, rgba(255, 255, 255, 0.16) 55%, transparent 72%),
    repeating-radial-gradient(circle, #1b1b1b 0 2px, #2b2b2b 2px 4px);
  animation: spin-disc 4s linear infinite;
}

@keyframes spin-disc {
  to {
    transform: rotate(360deg);
  }
}

.song-card .cell-kicker {
  color: #9aa3bd;
}

.song-title {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 900;
  line-height: 1.05;
}

.song-artist {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
}

.song-text {
  max-width: 560px;
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #dfe3ee;
}

@media (prefers-reduced-motion: reduce) {
  .song-disc {
    animation: none;
  }
}

.film-palette {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.film-palette li {
  width: 52px;
  height: 52px;
  background: var(--c);
  border: 1px solid var(--rule);
}

/* Desplegable: lo técnico de cada proyecto queda plegado. Cerrado muestra el título,
   un resumen y miniaturas; al abrirlo aparece todo (ver fold() en proyecto.js) */
.fold {
  margin-top: 32px;
  border: 1px solid var(--rule);
}

.fold summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 24px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary:hover {
  background: rgba(13, 32, 99, 0.04);
}

.fold-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}

.fold-meta {
  grid-column: 1;
  max-width: 80ch;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.fold-cta {
  grid-column: 2;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
}

/* El + que gira y queda como −: abierto / cerrado */
.fold-cta::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  border: 1.5px solid var(--orange);
  transition: transform 0.3s var(--ease);
}

.fold[open] .fold-cta::after {
  content: "−";
  transform: rotate(180deg);
}

.fold .is-open,
.fold[open] .is-closed {
  display: none;
}

.fold[open] .is-open {
  display: inline;
}

/* Miniaturas de lo que hay adentro: se ven sin abrir, para saber qué vas a encontrar */
.fold-thumbs {
  grid-column: 1;
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow: hidden; /* en pantallas chicas entran las que entran, sin empujar la página */
}

.fold-thumbs img {
  flex: none;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.fold[open] .fold-thumbs {
  display: none;
}

.fold-body {
  padding: 4px 20px 24px;
  border-top: 1px solid var(--rule);
}

.fold-body > :first-child {
  margin-top: 20px;
}

/* En el reloj, el desplegable va pegado a la portada de su etapa */
.etapa > .fold {
  margin-top: 0;
}

.fold-body--flush {
  padding: 0;
}

.fold-body--flush > :first-child {
  margin-top: 0;
}

.fold .shoot-plan {
  border: 0;
  border-top: 0;
}

/* Plan de rodaje: como una planilla de producción */
.shoot-plan {
  border: 1px solid var(--rule);
  font-size: 0.86rem;
}

.shoot-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
}

.shoot-row--head {
  border-top: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--paper-2);
}

.shoot-date b {
  display: block;
  font-size: 1rem;
}

.shoot-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.shoot-row small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.shoot-phase {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
}

/* ---------- Cine: el rodaje con claqueta ---------- */
.take-plan {
  margin-top: 24px;
}

.clapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 800;
}

.clapper span {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #000;
  /* las rayas de la claqueta */
  background-image: repeating-linear-gradient(135deg, #000 0 8px, #2a2a2a 8px 16px);
}

.clapper span:last-child {
  margin-left: auto;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
}

/* Un plano con una sola toma no ocupa todo el ancho */
.gallery--single {
  max-width: 50%;
}

@media (max-width: 720px) {
  .gallery--single {
    max-width: none;
  }
}

/* ---------- Cine: el montaje sobre la forma de la música ---------- */
.edit-map {
  margin-top: 26px;
  padding: 18px;
  color: #fff;
  background: #000;
}

.edit-map .cell-kicker {
  color: #9aa3bd;
}

.edit-wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  height: 90px;
  margin: 14px 0 16px;
}

.edit-wave i {
  flex: 1;
  height: calc(var(--v) * 1%);
  background: #3b4a75;
  border-radius: 1px;
}

/* Dónde empieza cada momento del montaje */
.edit-wave b {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: calc(var(--x) * 100%);
  width: 2px;
  background: var(--orange);
}

.edit-moments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
}

.edit-moments button {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 0.82rem;
  color: #dfe3ee;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.edit-moments button span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--orange);
}

.edit-moments button:hover,
.edit-moments button.is-active {
  background: rgba(229, 101, 26, 0.3);
}

@media (max-width: 720px) {
  .shoot-row,
  .shoot-row--head {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .shoot-row--head {
    display: none;
  }
}

/* Sistema de etiquetas: un vino por pestaña, y lo que se mantiene / lo que cambia */
.sys {
  margin-top: 22px;
}

.sys-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--rule);
}

.sys-tabs button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.sys-tabs button + button {
  border-left: 1px solid var(--rule);
}

.sys-tabs b {
  font-size: 1.05rem;
}

.sys-tabs span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.sys-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--navy);
}

.sys-tabs button[aria-selected="true"] span {
  color: var(--blue-soft);
}

.sys-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.sys-rules > div {
  padding: 16px;
  border: 1px solid var(--rule);
}

.sys-rules ul {
  margin-top: 8px;
}

.sys-rules li {
  padding: 5px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--rule);
}

.sys-rules li::before {
  content: "— ";
  color: var(--orange);
}

/* Decisión sin "problemas" (ej.: las etapas de los vinos): borde sereno, no rojo */
.idea-map--neutral .idea-pain {
  border: 1.5px solid var(--rule);
}

.idea-map--neutral .idea-pain b {
  color: var(--navy);
}

@media (max-width: 720px) {
  .sys-tabs,
  .sys-rules {
    grid-template-columns: minmax(0, 1fr);
  }

  .sys-tabs button + button {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* ---------- Tipografía: specimen ---------- */
.tema-tipografia .case-hero {
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, rgba(13, 32, 99, 0.07) 23px 24px);
}

.tema-tipografia .case-window {
  border-top: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
}

.tema-tipografia .case-window > .cells {
  border-top: 0;
}

.tema-tipografia .case-chrome {
  padding-left: 0;
  padding-right: 0;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.tema-tipografia .case-chrome .is-on {
  font-weight: 700;
  color: var(--ink);
}

.tema-tipografia .case-chrome b {
  color: var(--orange);
}

.tema-tipografia .case-title {
  position: relative;
  z-index: 1;
  transition: font-weight 0.15s linear;
}

/* Las líneas guía, con su nombre al costado */
.type-guides i {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid rgba(229, 101, 26, 0.55);
}

.type-guides i[data-guide="x"] {
  border-top-style: dashed;
}

.type-guides i[data-guide="base"] {
  border-top-color: var(--orange);
}

.type-guides span {
  position: absolute;
  right: var(--cell-pad);
  bottom: 2px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-style: normal;
  color: var(--orange);
}

/* Capitular: la inicial del paso actual */
.drop-cap {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 0.8;
  color: var(--navy);
  border-bottom: 2px solid var(--orange);
}

.tema-tipografia .case-status {
  align-items: flex-end;
}

/* La capitular cambia de peso con el scroll: ancho fijo para que el texto de al lado no salte */
.case-status--type .drop-cap {
  flex: none;
  width: 2.6rem;
  text-align: center;
  transition: font-weight 0.15s linear;
}

.type-status {
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* El eje de peso de la fuente variable, como en un probador de tipografías */
.wght-axis {
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}

.wght-axis b {
  color: var(--orange);
}

.wght-track {
  position: relative;
  display: block;
  height: 2px;
  background: var(--rule);
}

.wght-knob {
  position: absolute;
  top: 50%;
  left: calc(var(--w, 1) * 100%);
  width: 10px;
  height: 10px;
  background: var(--paper);
  border: 2px solid var(--orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.wght-ends {
  display: flex;
  justify-content: space-between;
}

/* Iteración "el giro": las etapas de corrección en orden */
.giro-steps {
  display: flex;
  flex-wrap: wrap;
  margin: 22px 0 6px;
  border-bottom: 1px solid var(--rule);
}

.giro-steps button {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.giro-steps button span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange);
}

.giro-steps button[aria-selected="true"] {
  color: var(--ink);
  border-color: var(--orange);
}

.giro-panel {
  animation: fade-focus 0.4s var(--ease) both;
}

/* Idea descartada (sin imagen: se cuenta con texto) */
.discarded-idea {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1.5px dashed var(--rule);
}

.discarded-name {
  margin: 10px 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--muted);
}

.discarded-name s {
  text-decoration-color: var(--orange);
  text-decoration-thickness: 3px;
}

.discarded-name span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
}

.discarded-variants {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.discarded-variants li {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--rule);
}

/* Papel cebolla: las versiones apiladas, una se ve a través de la otra */
.onion {
  width: min(100%, 380px);
  margin: 0 auto;
}

.onion-stack {
  position: relative;
  aspect-ratio: 0.585; /* la proporción de las etiquetas */
  background: #fff;
}

.onion-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.1s linear;
}

.onion input {
  width: 100%;
  margin-top: 14px;
  accent-color: var(--orange);
}

.onion-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.onion-labels li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
}

.onion-labels li.is-on {
  font-weight: 700;
  color: var(--orange);
}

/* Comparador antes / después: la imagen final se recorta según la línea */
.cmp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.cmp-tabs button {
  padding: 8px 14px;
  font-weight: 700;
  border: 1px solid var(--rule);
}

.cmp-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.cmp {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 0.585;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper-2);
}

.cmp-pair,
.cmp-pair img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cmp-pair img {
  object-fit: cover;
}

.cmp-after {
  clip-path: inset(0 0 0 var(--pos));
}

.cmp-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 22, 64, 0.35);
  pointer-events: none;
}

.cmp-line::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
  color: #fff;
  background: var(--orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cmp input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.cmp-label {
  position: absolute;
  top: 10px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #fff;
  background: rgba(11, 22, 64, 0.75);
  pointer-events: none;
}

.cmp-label--before {
  left: 10px;
}

.cmp-label--after {
  right: 10px;
}

/* Puntos del índice: el cursor de texto */
.tema-tipografia .case-nav button::before {
  width: 2px;
  height: 16px;
  margin-top: -8px;
  left: -16px;
  border: 0;
  background: var(--rule);
}

.tema-tipografia .case-nav button.is-active::before {
  background: var(--orange);
  transform: none;
  animation: caret 1s steps(2, jump-none) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

/* El 3D: los puntos son vértices (cuadrados) */
.tema-3d .case-nav button::before {
  transform: none;
}

.tema-3d .case-nav button.is-active::before {
  transform: scale(1.3);
}

@media (max-width: 720px) {
  .tema-motion .case-head {
    padding-right: var(--cell-pad);
  }

  .ease {
    display: none;
  }

  .kf {
    --kfn: 110px;
  }

  .type-guides span {
    display: none;
  }
}

/* =========================================================
   FORMATOS DE PROCESO PARA PROYECTOS DE INTERACCIÓN (APTO)
   ========================================================= */

/* ---------- Subtítulos dentro de un paso ---------- */
.sub-title {
  margin: 40px 0 14px;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}

/* ---------- Desafío: los problemas y el recorrido ---------- */
/* Los problemas del desafío: etiquetas, no botones (sin caja ni relleno, para que no
   parezcan tocables). Un cuadradito rojo, como los módulos del logo, marca cada uno */
.pains {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 22px;
}

.pains li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a2019;
  cursor: default;
}

.pains li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: #b3372b;
}

.journey {
  margin-top: 34px;
}

.journey-list {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid var(--rule);
}

.journey-list li + li {
  border-left: 1px solid var(--rule);
}

.journey-list a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px 14px 18px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  transition: background 0.2s;
}

.journey-list a:hover {
  background: var(--paper-2);
}

.journey-list b {
  font-size: 1rem;
  color: var(--navy);
}

.journey-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--orange);
}

/* Flecha entre etapas */
.journey-list li + li a::before {
  content: "→";
  position: absolute;
  top: 14px;
  left: -8px;
  padding: 0 2px;
  font-size: 0.8rem;
  color: var(--orange);
  background: var(--paper);
}

/* ---------- Exploración: investigación ---------- */
.research {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--rule);
}

.research-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.research-card + .research-card {
  border-left: 1px solid var(--rule);
}

.research-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}

.research-stat {
  font-size: 0.85rem;
  line-height: 1.35;
}

.research-stat b {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--orange);
}

.research-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.research-list li {
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--rule);
}

.research-note {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.research-source {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.insights {
  margin-top: 16px;
  padding: 18px;
  color: #fff;
  background: var(--navy);
}

.insights .cell-kicker {
  color: var(--blue-soft);
}

.insights ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
  margin-top: 10px;
}

.insights li b {
  display: block;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 800;
}

.insights li b::before {
  content: "· ";
  color: var(--orange);
}

.insights li p {
  margin-top: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--blue-soft);
}

.flows-title {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
}

.ds-intro {
  margin-bottom: 22px;
}

.ds-doc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 24px;
}

.ds-doc li {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--rule);
}

.ds-doc li::before {
  content: counter(list-item, decimal-leading-zero) " ";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--orange);
}

.ds-lead--gap {
  margin-top: 28px;
}

/* ---------- Decisión: de lo que aprendimos a la idea ---------- */
.idea-map {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.idea-map li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.idea-map li > p {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.idea-arrow {
  align-self: center;
}

.idea-kicker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.idea-kicker span:last-child {
  grid-column: 3;
}

.idea-pain {
  padding: 12px 14px;
  border: 1.5px dashed #c0392b;
}

.idea-pain b {
  display: block;
  color: #7a2019;
}

.idea-pain span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.idea-arrow {
  font-size: 1.2rem;
  color: var(--orange);
}

.idea-answer {
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1.5px solid var(--navy);
}

.idea-answer b {
  display: block;
  font-size: 1rem;
  color: var(--navy);
}

.mockups figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: var(--navy);
}

/* ---------- Flujos: taskflow y user flow ---------- */
.flows {
  margin-top: 28px;
}

.flows-tabs,
.flows-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flows-tabs button {
  padding: 10px 16px;
  font-weight: 700;
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.flows-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.flows-kind {
  margin: 18px 0 14px;
}

.flows-kind button {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.flows-kind button span {
  font-weight: 400;
}

.flows-kind button.is-active {
  color: var(--ink);
  border-color: var(--orange);
}

/* El diagrama: cajas acomodadas por CSS, flechas dibujadas encima (svg) */
.ft-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--rule);
  background:
    radial-gradient(circle, rgba(13, 32, 99, 0.13) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--paper);
}

.ft {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  width: max-content;
  min-width: 100%;
  padding: 26px 26px 44px; /* abajo, lugar para las flechas que vuelven */
}

.ft-lines {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.5;
}

.ft-lines marker path {
  fill: var(--navy);
  stroke: none;
}

.ft-lines .is-ref {
  stroke: var(--orange);
  stroke-dasharray: 5 4;
}

.ft-lines text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--orange);
  stroke: none;
}

/* De izquierda a derecha: cada rama es su caja + la columna de hijos */
.ft-b {
  display: flex;
  align-items: center;
  gap: 26px;
}

.ft-k {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.ft-final {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* De arriba hacia abajo (user flow, y todo en celular) */
.ft.is-v {
  flex-direction: column;
  gap: 36px;
}

.ft.is-v .ft-b {
  flex-direction: column;
  gap: 30px;
}

.ft.is-v .ft-k {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.ft.is-v .ft-final {
  flex-direction: column;
  gap: 30px;
}

.ft-node {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 52px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  background: #fff;
  border: 1.5px solid var(--navy);
}

.ft-node--inicio {
  color: #fff;
  background: var(--navy);
  border-radius: 999px;
}

.ft-node--ok {
  color: #fff;
  background: #2d5c45;
  border-color: #2d5c45;
}

/* Decisión: un rombo (la caja girada) con el texto derecho adentro */
.ft-node--decision {
  width: 96px;
  min-height: 96px;
  padding: 0;
  font-size: 0.7rem;
  color: var(--orange);
  background: none;
  border: 0;
}

.ft-node--decision::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  background: #fff;
  border: 1.5px solid var(--orange);
  transform: rotate(45deg);
}

.ft-node--decision span {
  max-width: 64px;
}

.ft-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.lg {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: -10px;
  vertical-align: -1px;
}

.lg--decision {
  border: 1.5px solid var(--orange);
  transform: rotate(45deg) scale(0.8);
}

.lg--ok {
  background: #2d5c45;
}

.lg--ref {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--orange);
}

/* ---------- Mapa de sitio (mismo dibujo que los flujos, sin flechas) ---------- */
.sitemap .ft {
  justify-content: center;
}

/* Cajas más compactas: el árbol se lee entero, sin scroll */
.sitemap .ft-node {
  width: 96px;
  min-height: 46px;
  font-size: 0.74rem;
}

.sitemap .ft.is-v .ft-k {
  gap: 10px;
}

.sitemap .ft-node--inicio {
  width: auto;
  padding: 10px 20px;
}

.ft-node--raiz {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

/* Botón del hero: ir directo al resultado */
.case-jump {
  margin-top: 26px;
}

/* Cuando una flecha lleva texto (Aceptar, Sí, No) se deja más aire para que entre */
.ft:not(.is-v) .ft-b.has-label {
  gap: 84px;
}

/* ---------- Iteración por fidelidad ---------- */
.fid {
  margin-top: 24px;
}

.fid-sticky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.fid.is-pinned .fid-sticky {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.fid-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fid-tabs button {
  padding: 8px 14px;
  font-weight: 700;
  border: 1px solid var(--rule);
  transition: background 0.2s, color 0.2s;
}

.fid-tabs button.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.fid-screen-note {
  margin: 14px 0 22px;
  font-size: 1.05rem;
  font-weight: 600;
}

.fid-levels {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--rule);
}

.fid-levels button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-left: -2px;
  padding: 10px 0 10px 16px;
  border-left: 2px solid transparent;
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s;
}

.fid-levels b {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.fid-levels span {
  font-size: 0.9rem;
}

.fid-levels .is-past {
  border-color: var(--navy);
}

.fid-levels .is-active {
  color: var(--ink);
  border-color: var(--orange);
}

.fid-levels .is-active b {
  color: var(--orange);
}

.fid-hint {
  margin-top: 22px;
}

/* El celular: grande, para que las pantallas se lean sin abrirlas */
.phone-mock {
  --pw: clamp(240px, 24vw, 330px);
  width: var(--pw);
}

.phone-screen {
  position: relative;
  aspect-ratio: 428 / 926;
  overflow: hidden;
  border: 10px solid var(--ink);
  border-radius: calc(var(--pw) * 0.14);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(13, 32, 99, 0.25);
}

/* Cámara del celular */
.phone-screen::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  width: 30%;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-50%);
}

.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.phone-screen img.is-on {
  opacity: 1;
}

.phone-label {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--orange);
}

/* Pantallas finales, en fila */
.mockups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
  margin: 8px 0 40px;
}

.mockups .phone-mock {
  --pw: 100%;
  width: 100%;
}

.mockups .phone-screen {
  border-width: 7px;
  border-radius: 26px;
}

.mockups .phone-screen::before {
  height: 12px;
  top: 6px;
}

.result-kicker {
  margin-bottom: 10px;
}

/* ---------- Design system: recorrible por partes ---------- */
.ds {
  margin-top: 48px;
}

.ds-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.ds-tabs button {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.ds-tabs button:hover {
  color: var(--ink);
}

.ds-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-color: var(--orange);
}

.ds-panel {
  animation: fade-focus 0.4s var(--ease) both;
}

.ds-lead {
  max-width: 640px;
  margin-bottom: 18px;
  color: var(--muted);
}

.ds-colors {
  display: grid;
  gap: 12px;
}

.ds-color {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.ds-name {
  font-weight: 700;
}

.ds-name span {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
}

.ds-ramp {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
}

.ds-ramp li {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 52px;
  padding: 4px 5px;
  background: var(--c);
}

.ds-ramp span,
.ds-ramp i {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  color: #fff;
  mix-blend-mode: difference;
}

/* El hex aparece al pasar el mouse */
.ds-ramp i {
  opacity: 0;
  transition: opacity 0.2s;
}

.ds-ramp li:hover i {
  opacity: 1;
}

.ds-type-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.ds-type-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
}

.ds-type-sample {
  font-family: var(--ds-font), var(--font-sans);
  color: #2e2420;
  overflow-wrap: anywhere;
}

/* Espaciado: cada token como una barra de su medida real */
.ds-space {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--rule);
}

.ds-space li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.ds-space b {
  color: var(--ink);
}

.ds-space-bar {
  width: 100%;
  height: calc(var(--s) * 2 + 2px);
  background: #e57d3e;
}

/* Radios y elevación: las formas reales */
.ds-shapes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ds-shapes--elev {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ds-shapes li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.ds-shapes b {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink);
}

.ds-radius,
.ds-elev {
  height: 72px;
  background: #ede6e0;
}

.ds-radius {
  width: 72px;
  border: 1.5px solid var(--b);
  border-radius: var(--r);
}

.ds-elev {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--e);
}

/* Componentes en vivo */
.ds-comp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ds-comp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--rule);
}

.ds-comp-stage {
  display: grid;
  place-items: center;
  min-height: 130px;
  border-radius: 12px;
  background: var(--n100);
}

.ds-chips,
.ds-comp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ds-chips button {
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border: 1px solid var(--rule);
}

.ds-chips button.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.ds-comp-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* El botón de APTO, con sus tokens */
.apto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--ds-font), var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--b500);
  border: 1.5px solid var(--b500);
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--n300);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.apto-btn:hover,
.apto-btn[data-state="hover"] {
  background: var(--b300);
  border-color: var(--b300);
}

.apto-btn:active,
.apto-btn[data-state="pressing"] {
  background: var(--b300);
  border-color: var(--b300);
  box-shadow: 0 0 0 4px var(--b200);
}

.apto-btn[data-state="selected"] {
  background: var(--b700);
  border-color: var(--b700);
}

.apto-btn:disabled {
  color: var(--n700);
  background: var(--n300);
  border-color: var(--n300);
  box-shadow: none;
  cursor: not-allowed;
}

.apto-btn--sec {
  color: var(--b500);
  background: #fff;
}

.apto-btn--ter {
  color: var(--b500);
  background: none;
  border-color: transparent;
  box-shadow: none;
}

.apto-btn--sec:hover,
.apto-btn--ter:hover {
  color: #fff;
}

.ds-comp-row .apto-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
}

/* Ejemplos fijos (variantes y Do & Don't): no reaccionan al mouse, así se ve cada variante tal cual es */
.apto-btn.is-static {
  pointer-events: none;
}

.apto-btn.is-disabled {
  color: var(--n700);
  background: var(--n300);
  border-color: var(--n300);
  box-shadow: none;
}

.apto-btn.is-selected {
  background: var(--b700);
  border-color: var(--b700);
}

/* ---------- Do & Don't ---------- */
.dd-group {
  margin: 22px 0 10px;
}

.dd-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dd-rule {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.dd-rule b {
  font-size: 0.92rem;
  color: var(--ink);
}

.dd-case {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 12px;
  background: var(--n100);
}

.dd-case figcaption {
  font-size: 0.8rem;
  font-weight: 700;
}

.dd-case--do figcaption {
  color: #2d5c45;
}

.dd-case--dont figcaption {
  color: #c0392b;
}

.dd-stage {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 8px;
  min-height: 120px;
  font-family: var(--ds-font, "Plus Jakarta Sans"), var(--font-sans);
}

.dd-stage .apto-btn {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.dd-arrow {
  font-size: 1.3rem;
  color: #2e2420;
}

.dd-x {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  background: #c0392b;
}

.dd-stars {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.dd-stars i {
  width: var(--sz);
  height: var(--sz);
}

.dd-stars svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.dd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(237, 230, 224, 0.9);
}

.dd-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2e2420;
}

.dd-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d4c8c0;
}

.dd-stage .apto-btn.dd-small {
  padding: 5px 12px;
  font-size: 0.75rem;
}

.dd-score {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #2e2420;
}

/* La calificación de APTO */
.apto-stars {
  display: flex;
  gap: 4px;
}

.apto-stars button {
  width: 40px;
  color: #b8a89e;
  transition: color 0.2s, transform 0.2s var(--ease);
}

.apto-stars button:hover {
  transform: scale(1.12);
}

.apto-stars svg {
  fill: currentColor;
  filter: drop-shadow(0 2px 2px rgba(92, 38, 13, 0.25));
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .fid-sticky {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .fid-info {
    width: 100%;
  }

  .fid-hint {
    display: none;
  }

  .phone-mock {
    --pw: min(78vw, 320px);
  }

  .mockups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-color,
  .ds-type-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .ds-ramp span,
  .ds-ramp i {
    display: none;
  }

  .ds-shapes,
  .ds-shapes--elev {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-comp {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-space {
    gap: 4px;
    padding: 12px;
  }

  .research,
  .journey-list,
  .insights ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .research-card + .research-card,
  .journey-list li + li {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .journey-list li + li a::before {
    content: "↓";
    top: -10px;
    left: 14px;
  }

  .idea-map li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .idea-kicker {
    display: none;
  }

  .dd-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .dd-rule {
    grid-column: 1 / -1;
  }

  .idea-arrow {
    transform: rotate(90deg);
    justify-self: start;
    margin-left: 14px;
  }
}

/* Recorrido en pantallas medianas: dos filas */
@media (max-width: 1100px) and (min-width: 721px) {
  .research {
    grid-template-columns: minmax(0, 1fr);
  }

  .research-card + .research-card {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .case-chrome > span:not(:first-child):not(.chrome-end):not(.chrome-url) {
    display: none;
  }

  .tema-3d .case-head {
    padding-right: var(--cell-pad);
  }

  .case-head .wire {
    display: none;
  }

  /* En celular, los clips muestran solo el número de escena y sin el nombre de la canción */
  .tl-clip span {
    font-size: 0;
  }

  .tl-clip span::after {
    content: attr(data-n);
    font-size: 0.6rem;
  }

  .tl-track-name,
  .tl-tc {
    display: none;
  }

  .case-timeline {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .case-status {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rec::before,
  .rec-dot {
    animation: none;
  }
}
