/* Taller Serrano Martínez CMA · MAMBO 2026
   Sistema visual tomado de la app del evento (site.css):
   marfil, negro, terracota, Roboto 300/400/500, filetes finos. */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-latin.woff2") format("woff2");
}

:root {
  --paper: #F7F4E9;
  --ink: #000;
  --muted: #57544c;
  --hair: #d8d2bf;
  --accent: #C25E3B;
  --accent-ink: #A84F2E;
  --ivory-soft: rgb(247 244 233 / .68);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad-x: 150px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  transition: background-color .4s var(--ease-out);
}
body.is-dark { background: #000; }

body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 300;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

/* ---------- Escenario fijo 1920 x 1080, escalado para caber en cualquier pantalla ---------- */
.deck {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage {
  flex: none;
  position: relative;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  overflow: hidden;
}

/* ---------- Diapositiva base ---------- */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 118px var(--pad-x) 150px;
  background: var(--paper);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s var(--ease-out), visibility 0s linear .45s;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .45s var(--ease-out), visibility 0s;
}
.slide.dark { background: #000; color: var(--paper); }
.slide.center { justify-content: center; }

/* Aparición escalonada de elementos */
.slide .r {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}
.slide.is-active .r { opacity: 1; transform: none; }

/* ---------- Tipografía ---------- */
h1, h2, h3, p, ol, ul, blockquote, figure { margin: 0; }

.t-display {
  font-weight: 500;
  font-size: 104px;
  line-height: 1.04;
  letter-spacing: .01em;
  max-width: 1240px;
  text-wrap: balance;
}
.t-title {
  font-weight: 500;
  font-size: 66px;
  line-height: 1.08;
  letter-spacing: .015em;
  max-width: 1480px;
  text-wrap: balance;
}
.t-lead {
  font-weight: 300;
  font-size: 38px;
  line-height: 1.36;
  color: var(--muted);
  max-width: 1250px;
  text-wrap: pretty;
}
.dark .t-lead { color: var(--ivory-soft); }
.t-h3 {
  font-weight: 500;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: .015em;
}
.t-body { font-size: 32px; line-height: 1.42; text-wrap: pretty; }
.t-small { font-size: 24px; line-height: 1.4; color: var(--muted); }
.dark .t-small { color: var(--ivory-soft); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.dark .muted { color: var(--ivory-soft); }
.mt-s { margin-top: 28px; }
.mt-m { margin-top: 56px; }
.mt-l { margin-top: 84px; }
.mt-auto { margin-top: auto; }

/* Cifras grandes, compuestas tipográficamente */
.num {
  display: block;
  font-weight: 300;
  font-size: 260px;
  line-height: .86;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}
.num.ink { color: var(--ink); }
.num.mid { font-size: 200px; }

/* ---------- Pie: fuente y logo ---------- */
.foot {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 80px;
  font-size: 19px;
  line-height: 1.4;
  color: var(--muted);
}
.dark .foot { color: var(--ivory-soft); }
.foot .src { max-width: 1320px; }
.foot .logo { flex: none; width: 214px; height: 32px; color: var(--ink); }
.dark .foot .logo { color: var(--paper); }

svg.logo { display: block; }

/* ---------- Columnas y filas con filetes ---------- */
.cols { display: grid; gap: 72px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ruled { border-top: 2px solid var(--ink); padding-top: 30px; }
.dark .ruled { border-top-color: var(--paper); }

.rows { list-style: none; padding: 0; border-bottom: 1px solid var(--hair); }
.rows > li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--hair);
}
.rows > li:first-child { border-top: 2px solid var(--ink); }
.rows .n {
  font-weight: 300;
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rows .what { font-size: 36px; line-height: 1.3; }
.rows .what strong { font-weight: 500; }
.rows .when { font-size: 28px; color: var(--muted); white-space: nowrap; }
.rows.tight > li { padding: 20px 0; }
.rows.big .what { font-size: 40px; }

/* Lista simple con filetes */
.plain { list-style: none; padding: 0; }
.plain > li { padding: 16px 0; border-top: 1px solid var(--hair); font-size: 30px; line-height: 1.35; }
.plain > li:last-child { border-bottom: 1px solid var(--hair); }

/* Casos: año o nombre a la izquierda, texto a la derecha */
.cases { list-style: none; padding: 0; border-bottom: 1px solid var(--hair); }
.cases > li {
  display: grid;
  grid-template-columns: 470px 1fr;
  gap: 56px;
  padding: 30px 0;
  border-top: 1px solid var(--hair);
}
.cases > li:first-child { border-top: 2px solid var(--ink); }
.cases .who { font-weight: 500; font-size: 34px; line-height: 1.2; }
.cases .who span { display: block; font-weight: 300; font-size: 26px; color: var(--muted); margin-top: 6px; }
.cases .what { font-size: 31px; line-height: 1.4; }

/* Casos con pantallazo de la noticia encima */
.press { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; }
.press img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 745;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--hair);
  background: #fff;
}
.press .who { font-weight: 500; font-size: 32px; line-height: 1.2; margin-top: 26px; }
.press .who span { display: block; font-weight: 300; font-size: 24px; color: var(--muted); margin-top: 4px; }
.press .what { font-size: 26px; line-height: 1.38; margin-top: 10px; text-wrap: pretty; }

/* ---------- Proceso en el papel, en la realidad y con agente ----------
   Usa data-step del controlador: 0 en el papel, 1 los desvíos, 2 el agente. */
.proc { display: block; width: 1620px; height: 500px; overflow: visible; }
.proc text { font-family: inherit; }
.proc .box rect { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.proc .box text { font-size: 32px; font-weight: 500; fill: var(--ink); text-anchor: middle; }
.proc .main path { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.proc .main .tip { fill: var(--ink); }

/* Desvíos: cada línea se dibuja; la punta y el texto aparecen al final */
.proc .detour .line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.proc .detour .tip { fill: var(--muted); opacity: 0; }
.proc .detour text { font-size: 26px; fill: var(--muted); text-anchor: middle; opacity: 0; }
.proc .side { opacity: 0; }
.proc .side rect { fill: var(--paper); stroke: var(--muted); stroke-width: 2; stroke-dasharray: 8 7; }
.proc .side text { fill: var(--ink); opacity: 1; }

.slide.is-active[data-step="1"] .proc .detour .line,
.slide.is-active[data-step="2"] .proc .detour .line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .9s var(--ease-out) var(--d, 0s);
}
.slide.is-active[data-step="1"] .proc .detour :is(.tip, text),
.slide.is-active[data-step="2"] .proc .detour :is(.tip, text),
.slide.is-active[data-step="1"] .proc .side,
.slide.is-active[data-step="2"] .proc .side {
  opacity: 1;
  transition: opacity .4s var(--ease-out) calc(var(--d, 0s) + .6s);
}

/* Agente: traza el camino real y lo recorre una y otra vez */
.proc .agent { opacity: 0; }
.proc .agent path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.proc .agent .trace { stroke-width: 5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.proc .agent .dot { stroke-width: 26; stroke-dasharray: .1 999.9; opacity: 0; }
.slide.is-active[data-step="2"] .proc .agent { opacity: 1; }
.slide.is-active[data-step="2"] .proc .detour .tip { fill: var(--accent); }
.slide.is-active[data-step="2"] .proc .agent .trace {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.4s cubic-bezier(.45, 0, .25, 1) .1s;
}
.slide.is-active[data-step="2"] .proc .agent .dot {
  animation: agent-run 4.2s linear infinite;
  animation-delay: calc(2.5s + var(--k, 0) * 1.4s);
}
@keyframes agent-run {
  0% { stroke-dashoffset: 0; opacity: 1; }
  96% { opacity: 1; }
  100% { stroke-dashoffset: -1000; opacity: 0; }
}

/* Texto bajo el diagrama: uno por paso, en el mismo lugar */
.proc-cap { display: grid; max-width: 1500px; }
.proc-cap p { grid-area: 1 / 1; opacity: 0; transition: opacity .4s var(--ease-out); }
.proc-cap .cap2 { color: var(--ink); }
.slide[data-step="0"] .proc-cap .cap0,
.slide[data-step="1"] .proc-cap .cap1,
.slide[data-step="2"] .proc-cap .cap2 { opacity: 1; }

/* ---------- Portada y cierre con imagen ---------- */
.hero { padding-top: 96px; justify-content: space-between; }
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / .86) 0%, rgb(0 0 0 / .45) 45%, transparent 74%);
}
.hero > :not(.hero-img):not(.hero-shade):not(.notes) { position: relative; }
.logo-hero { width: 330px; height: 49px; color: var(--paper); }
.hero-meta { font-size: 30px; line-height: 1.4; color: var(--ivory-soft); }
.hero-meta strong { font-weight: 400; color: var(--paper); }

/* ---------- Sección ---------- */
.section-line { width: 120px; height: 3px; background: var(--accent); margin-bottom: 56px; }

/* ---------- Pregunta a la sala ---------- */
.ask { font-weight: 500; font-size: 120px; line-height: 1.04; letter-spacing: .005em; max-width: 1500px; text-wrap: balance; }

/* ---------- Ecuación ---------- */
.equation {
  display: grid;
  grid-template-columns: auto auto auto auto auto;
  align-items: start;
  justify-content: start;
  column-gap: 36px;
  font-size: 108px;
  line-height: 1;
  letter-spacing: -.005em;
}
.equation .term { display: flex; flex-direction: column; gap: 26px; }
.equation .term b { font-weight: 500; white-space: nowrap; }
/* El texto pequeño toma el ancho de la palabra grande y no ensancha la columna */
.equation .term span { font-size: 30px; line-height: 1.3; color: var(--muted); width: 0; min-width: 100%; }
.equation .op { font-weight: 300; color: var(--accent); }

/* ---------- Gráfico ---------- */
.chart-wrap { display: grid; grid-template-columns: 560px 1fr; gap: 90px; align-items: start; }
.chart-wrap .chart { display: block; width: 820px; height: 506px; }
.legend { display: flex; gap: 40px; font-size: 26px; color: var(--muted); margin-bottom: 18px; }
.legend i { display: inline-block; width: 22px; height: 22px; vertical-align: -3px; margin-right: 12px; }
.chart text { font-family: inherit; }

/* ---------- Cita ---------- */
.quote {
  font-weight: 300;
  font-size: 64px;
  line-height: 1.16;
  letter-spacing: .005em;
  text-wrap: balance;
}
.quote .accent { font-weight: 400; }

/* ---------- Ejercicios ---------- */
.exercise { padding-top: 104px; }
.ex-img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 1100px;
  object-fit: cover;
  object-position: center;
  opacity: .9;
}
.ex-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000 0%, #000 48%, rgb(0 0 0 / .62) 72%, rgb(0 0 0 / .2) 100%);
}
.exercise > :not(.ex-img):not(.ex-shade):not(.notes) { position: relative; }
.ex-grid { display: grid; grid-template-columns: 980px 1fr; gap: 80px; flex: 1; min-height: 0; align-items: center; }
.ex-steps { list-style: none; padding: 0; margin-top: 52px; counter-reset: step; }
.ex-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 64px 1fr;
  font-size: 32px;
  line-height: 1.38;
  padding: 18px 0;
  border-top: 1px solid rgb(247 244 233 / .22);
}
.ex-steps li::before { content: counter(step); color: var(--accent); font-weight: 400; }
.ex-side { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 34px; padding-top: 8px; }
.qr-box { width: 420px; height: 420px; padding: 30px; background: var(--paper); }
.qr-box svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.qr-url { font-size: 30px; font-weight: 400; letter-spacing: .01em; color: var(--paper); }
.timer {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-weight: 300;
  font-size: 150px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.timer.is-running { color: var(--paper); }
.timer.is-done { color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Video con subtítulos debajo ---------- */
.video-slide { padding: 56px var(--pad-x) 0; align-items: center; }
.player { position: relative; width: 1216px; height: 684px; background: #111; cursor: pointer; }
.player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / .35);
  transition: opacity .3s var(--ease-out);
}
.player.is-playing .play { opacity: 0; }
.player .play span {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  display: grid;
  place-items: center;
}
.player .play span::after {
  content: "";
  margin-left: 10px;
  border-left: 40px solid var(--paper);
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
}
.scrub { width: 1216px; height: 4px; background: rgb(247 244 233 / .18); margin-top: 14px; position: relative; cursor: pointer; }
.scrub i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
.vtime { width: 1216px; display: flex; justify-content: flex-end; font-size: 18px; color: var(--ivory-soft); margin-top: 8px; font-variant-numeric: tabular-nums; }
.captions {
  width: 1500px;
  min-height: 124px;
  margin-top: 10px;
  text-align: center;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.32;
  color: var(--paper);
  text-wrap: balance;
}

/* ---------- Estructura de pedido (prompt) ---------- */
.prompt { list-style: none; padding: 0; border-top: 2px solid var(--ink); }
.prompt li { font-size: 33px; line-height: 1.38; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.prompt b { font-weight: 500; }
.prompt .slot { color: var(--accent-ink); }

/* ---------- Barra de progreso ---------- */
.progress { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); width: 0; transition: width .5s var(--ease-out); z-index: 5; }

/* ---------- Notas del presentador ---------- */
.notes { display: none; }
.notes-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 42vh;
  overflow: auto;
  padding: 22px 32px 26px;
  background: rgb(20 19 17 / .94);
  color: var(--paper);
  font-size: 17px;
  line-height: 1.5;
  z-index: 50;
  transform: translateY(100%);
  transition: transform .35s var(--ease-out);
}
.notes-panel.is-open { transform: none; }
.notes-panel .np-head { display: flex; justify-content: space-between; gap: 24px; color: var(--ivory-soft); font-size: 14px; margin-bottom: 10px; }
.notes-panel p { margin: 0 0 10px; max-width: 1100px; }
.notes-panel .datos { color: var(--ivory-soft); }

/* ---------- Vista del presentador (ventana aparte) ---------- */
body.presenter { background: #141311; color: var(--paper); overflow: auto; }
body.presenter .deck { display: none; }
.pv { display: none; }
body.presenter .pv { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding: 36px 44px; min-height: 100vh; }
.pv h1 { font-weight: 500; font-size: 30px; line-height: 1.2; margin: 6px 0 22px; }
.pv .pv-meta { font-size: 15px; color: var(--ivory-soft); }
.pv .pv-notes { font-size: 22px; line-height: 1.55; max-width: 980px; }
.pv .pv-notes p { margin: 0 0 14px; }
.pv .pv-notes .datos { color: var(--ivory-soft); font-size: 18px; }
.pv aside { border-left: 1px solid rgb(247 244 233 / .2); padding-left: 32px; display: flex; flex-direction: column; gap: 26px; }
.pv .clock { font-size: 64px; font-weight: 300; font-variant-numeric: tabular-nums; }
.pv .next { font-size: 18px; color: var(--ivory-soft); }
.pv .next b { display: block; color: var(--paper); font-weight: 400; font-size: 22px; margin-top: 6px; }
.pv .keys { font-size: 14px; color: var(--ivory-soft); line-height: 1.7; margin-top: auto; }
.pv button { font: inherit; font-size: 16px; color: var(--paper); background: none; border: 1px solid rgb(247 244 233 / .35); padding: 8px 14px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .slide, .slide .r, .progress, .notes-panel, body { transition: none !important; }
  .slide .r { transform: none; }
  .timer.is-done { animation: none; }
  .proc *, .proc-cap p { transition: none !important; }
  .proc .agent .dot { animation: none !important; }
}
