/* ==========================================================================
   SILICON LIGHT STUDIO — PRESENTACIÓN INTERACTIVA: ARQUITECTURA ARM
   UNAM · Facultad de Ingeniería · Organización y Arquitectura de Computadoras
   Diseño editorial luminoso de alto contraste (Apple Keynote + Arm Brand)
   ========================================================================== */

:root {
  --bg-canvas: #f4f7fb;
  --bg-card: #ffffff;
  --bg-subtle: #edf2f8;
  --border: #dde5f0;
  --border-strong: #c7d4e6;

  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-muted: #64748b;

  --arm-cyan: #0091bd;
  --arm-blue: #005b96;
  --arm-deep: #0b2545;
  --indigo: #4f46e5;
  --emerald: #059669;
  --amber: #d97706;
  --rose: #dc2626;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-display: "Outfit", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg-canvas); color: var(--ink);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------- Fondo arquitectónico luminoso ---------- */
.studio-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(0, 145, 189, 0.09), transparent 38%),
    radial-gradient(circle at 92% 88%, rgba(79, 70, 229, 0.08), transparent 40%),
    linear-gradient(180deg, #fafcff 0%, #f1f5fa 100%);
}
.studio-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---------- Barra superior minimalista ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 40;
  padding: 0 36px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 0.9rem; color: var(--arm-deep); }
.arm-dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--arm-cyan), var(--indigo));
  box-shadow: 0 0 10px rgba(0, 145, 189, 0.5);
}
.chapter-pills { display: flex; gap: 6px; }
.chap-btn {
  border: 1px solid transparent; background: transparent; color: var(--ink-muted);
  font-family: var(--font-sans); font-size: 0.76rem; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all 0.2s;
}
.chap-btn:hover { background: var(--bg-subtle); color: var(--ink); }
.chap-btn.active { background: var(--arm-deep); color: #fff; box-shadow: var(--shadow-sm); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  border: 1px solid var(--border); background: #fff; color: var(--ink-soft);
  padding: 5px 11px; border-radius: 999px; font-family: var(--font-sans);
  font-size: 0.76rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 5px;
}
.icon-btn:hover { border-color: var(--arm-cyan); color: var(--arm-cyan); background: #f0f9ff; }
.icon-btn.active { background: var(--arm-cyan); color: #fff; border-color: var(--arm-cyan); }

/* ---------- Contenedor de slides ---------- */
.deck { position: relative; z-index: 2; width: 100vw; height: 100vh; overflow: hidden; }
.slide {
  position: absolute; inset: 54px 0 58px; padding: 20px 44px 16px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateX(32px);
  transition: opacity 0.45s var(--ease), transform 0.5s var(--ease), visibility 0.45s;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.slide.active { opacity: 1; visibility: visible; transform: translateX(0); }
.slide.prev-exit { transform: translateX(-32px); }

.slide [data-anim] {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.48s var(--ease), transform 0.52s var(--ease);
  transition-delay: var(--d, 0ms);
}
.slide.active [data-anim] { opacity: 1; transform: translateY(0); }

/* ---------- Cabecera limpia de cada lámina ---------- */
.s-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.s-kicker {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  color: var(--arm-cyan); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 3px;
}
.s-title {
  font-family: var(--font-display); font-size: clamp(1.45rem, 2.3vw, 2.15rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; color: var(--ink);
}
.s-sub { font-size: 0.9rem; color: var(--ink-muted); margin-top: 4px; }

.who-tag {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
}
.who-tag[data-who="Rea"] { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.who-tag[data-who="Jennifer"] { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.who-tag[data-who="Armando"] { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.who-tag[data-who="Equipo"] { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }

/* ---------- Tarjetas y Grids ---------- */
.s-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; flex: 1; min-height: 0; }
.g-2-asym { display: grid; grid-template-columns: 0.95fr 1.15fr; gap: 18px; flex: 1; min-height: 0; }
.g-2-wide { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 18px; flex: 1; min-height: 0; }
.g-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
  transition: transform 0.28s var(--ease), box-shadow 0.28s, border-color 0.28s;
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--arm-cyan); }
.card-dark {
  background: linear-gradient(155deg, #0b1c34 0%, #102a4c 100%);
  color: #f8fafc; border-color: rgba(0, 145, 189, 0.35);
}

/* ---------- SLIDE 1: PORTADA SILICON STUDIO ---------- */
.cover-split { display: grid; grid-template-columns: 1.15fr 0.95fr; gap: 32px; align-items: center; height: 100%; }
.cover-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: #e0f2fe; color: #0369a1; font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.cover-h1 {
  font-family: var(--font-display); font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; color: var(--ink); margin-bottom: 14px;
}
.cover-h1 span {
  background: linear-gradient(95deg, var(--arm-cyan) 0%, var(--indigo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cover-lead { font-size: 1.05rem; line-height: 1.5; color: var(--ink-soft); max-width: 560px; margin-bottom: 20px; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--c, var(--arm-cyan));
}
.stat-box strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.stat-box span { font-size: 0.76rem; color: var(--ink-muted); font-weight: 600; }

.team-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.team-chip {
  padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.team-chip:hover { border-color: var(--arm-cyan); color: var(--arm-cyan); transform: translateY(-2px); }

.cover-visual {
  display: flex; flex-direction: column; gap: 14px;
}
.unam-strip {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.unam-strip img { height: 54px; width: auto; object-fit: contain; }
.unam-strip h4 { font-size: 0.92rem; font-weight: 800; color: var(--ink); }
.unam-strip p { font-size: 0.76rem; color: var(--ink-muted); line-height: 1.38; }

.hero-showcase {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.hero-showcase img { width: 100%; height: 295px; object-fit: cover; display: block; }
.hero-badge-bar {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  padding: 10px 16px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; font-weight: 700; color: var(--ink);
}

/* ---------- Controles Interactivos (Tabs / Botones / Sliders) ---------- */
.seg-bar { display: flex; gap: 6px; flex-wrap: wrap; background: var(--bg-subtle); padding: 5px; border-radius: 999px; width: fit-content; }
.seg-btn {
  border: 0; background: transparent; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.22s var(--ease);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--arm-cyan); box-shadow: var(--shadow-sm); }

.act-btn {
  border: 1px solid var(--border-strong); background: #fff; color: var(--ink);
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 700;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all 0.22s var(--ease);
  display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-sm);
}
.act-btn:hover { transform: translateY(-1px); border-color: var(--arm-cyan); color: var(--arm-cyan); }
.act-btn.primary { background: var(--arm-cyan); color: #fff; border-color: var(--arm-cyan); }
.act-btn.primary:hover { background: var(--arm-blue); color: #fff; }
.act-btn.emerald { background: #ecfdf5; color: #047857; border-color: #6ee7b7; }
.act-btn.emerald.active { background: #059669; color: #fff; border-color: #059669; }
.act-btn.danger { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.act-btn.danger.active { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ---------- Timeline Interactiva (Slide 2) ---------- */
.tl-track {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  position: relative; padding: 6px 0;
}
.tl-node {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px 10px; text-align: center; cursor: pointer; transition: all 0.25s var(--ease);
}
.tl-node:hover { border-color: var(--arm-cyan); transform: translateY(-3px); }
.tl-node.active {
  background: var(--arm-deep); color: #fff; border-color: var(--arm-cyan);
  box-shadow: 0 12px 26px rgba(0, 145, 189, 0.25); transform: translateY(-4px);
}
.tl-year { font-family: var(--font-mono); font-size: 1rem; font-weight: 800; color: var(--arm-cyan); }
.tl-node.active .tl-year { color: #38bdf8; }
.tl-lbl { font-size: 0.74rem; font-weight: 700; margin-top: 3px; color: var(--ink-soft); }
.tl-node.active .tl-lbl { color: #e2e8f0; }

/* ---------- Gráficas Animadas ---------- */
.vchart { display: flex; align-items: flex-end; justify-content: space-around; height: 210px; padding: 18px 20px 8px; gap: 24px; border-bottom: 2px solid var(--border); }
.vbar-col { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 8px; }
.vbar-val { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 800; color: var(--ink); }
.vbar-body {
  width: 100%; height: 0%; border-radius: 12px 12px 4px 4px;
  background: var(--g, linear-gradient(180deg, #0091bd, #005b96));
  transition: height 1s var(--ease); box-shadow: 0 8px 20px rgba(0, 145, 189, 0.2);
}
.slide.active .vbar-body { height: var(--h, 70%); }
.vbar-lbl { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); text-align: center; }

.hbar-row { margin-bottom: 12px; }
.hbar-top { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; margin-bottom: 5px; }
.hbar-track { height: 12px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.hbar-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--c, var(--arm-cyan)); transition: width 1s var(--ease); }
.slide.active .hbar-fill { width: var(--w, 60%); }

/* ---------- Pipeline Gantt (Slide 4) ---------- */
.gantt-grid {
  display: grid; grid-template-columns: 95px repeat(5, 1fr); gap: 6px; align-items: center;
  font-size: 0.78rem;
}
.gantt-head { text-align: center; font-family: var(--font-mono); font-weight: 700; color: var(--ink-muted); padding: 4px; }
.gantt-inst { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.g-cell {
  height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.74rem; background: var(--bg-subtle); color: var(--ink-muted);
  border: 1px solid transparent; transition: all 0.3s var(--ease); opacity: 0.32;
}
.g-cell.lit { opacity: 1; transform: scale(1.03); box-shadow: var(--shadow-sm); }
.g-cell.if.lit { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.g-cell.id.lit { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.g-cell.ex.lit { background: #d1fae5; color: #047857; border-color: #6ee7b7; }
.g-cell.cur { outline: 2.5px solid var(--arm-cyan); outline-offset: 1px; }

/* ---------- SVG Interactivos (AMBA, TrustZone, Thumb, Value Chain) ---------- */
.svg-canvas { width: 100%; max-height: 300px; height: auto; overflow: visible; }
.wire-base { fill: none; stroke: #cbd5e1; stroke-width: 3; stroke-linecap: round; }
.wire-anim { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 10 8; animation: dashMove 1.1s linear infinite; }
.wire-anim.fast { animation-duration: 0.65s; }
.wire-anim.slow { animation-duration: 2.1s; }
.wire-anim.dim { opacity: 0.16; animation-play-state: paused; }
@keyframes dashMove { to { stroke-dashoffset: -36; } }

.snode rect { transition: all 0.3s var(--ease); }
.snode.active rect { stroke: var(--arm-cyan) !important; stroke-width: 2.8 !important; filter: drop-shadow(0 6px 14px rgba(0, 145, 189, 0.25)); }
.snode.ok rect { stroke: var(--emerald) !important; stroke-width: 2.8 !important; filter: drop-shadow(0 6px 14px rgba(5, 150, 105, 0.25)); }
.snode.danger rect { stroke: var(--rose) !important; stroke-width: 2.8 !important; filter: drop-shadow(0 6px 14px rgba(220, 38, 38, 0.25)); }
.snode.dim { opacity: 0.32; }

/* ---------- Slider big.LITTLE (Slide 6) ---------- */
.load-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #0091bd 50%, #f59e0b 100%); outline: none; cursor: pointer;
}
.load-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--arm-deep); box-shadow: var(--shadow-md);
}

/* ---------- Hotspots Raspberry Pi 5 (Slide 8) ---------- */
.hotspot-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); flex: 1; min-height: 210px; background: #0f172a; }
.hotspot-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.hs-pin {
  position: absolute; width: 28px; height: 28px; border-radius: 50%;
  background: var(--arm-cyan); color: #fff; border: 2.5px solid #fff;
  font-size: 0.74rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  animation: pinPulse 2s infinite; transition: transform 0.2s;
}
.hs-pin:hover, .hs-pin.active { transform: scale(1.2); background: var(--amber); }
@keyframes pinPulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 145, 189, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(0, 145, 189, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 145, 189, 0); }
}

/* ---------- Listas limpias ---------- */
.clean-list { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.clean-item {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius-md); background: var(--bg-subtle);
  border: 1px solid var(--border); border-left: 4px solid var(--c, var(--arm-cyan));
  transition: transform 0.2s, background 0.2s;
}
.clean-item:hover { transform: translateX(4px); background: #fff; }
.clean-num {
  min-width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 800; color: var(--c, var(--arm-cyan));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.clean-item h4 { font-size: 0.92rem; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.clean-item p { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.35; }

/* Status pill */
.status-box {
  padding: 10px 14px; border-radius: var(--radius-md);
  background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e;
  font-size: 0.84rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* Video embed */
.video-box { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; background: #0f172a; border: 1px solid var(--border); }
.video-box iframe, .video-box video { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Imagen viva en Lámina 15 (Cierre ARM) ---------- */
.alive-stage {
  position: relative; width: 100%; flex: 1; min-height: 250px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 0 36px rgba(0, 145, 189, 0.28);
}
.alive-stage img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: siliconBreathe 7s ease-in-out infinite alternate;
}
@keyframes siliconBreathe {
  0% { transform: scale(1.0); filter: brightness(0.98) saturate(1.02); }
  100% { transform: scale(1.06); filter: brightness(1.1) saturate(1.18); }
}
.alive-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.radar-ring {
  fill: none; stroke: #38bdf8; stroke-width: 1.6; opacity: 0;
  transform-origin: 200px 150px;
  animation: radarWave 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.radar-ring.r2 { animation-delay: 1.1s; stroke: #f5d66b; }
.radar-ring.r3 { animation-delay: 2.2s; stroke: #34d399; }
@keyframes radarWave {
  0% { transform: scale(0.35); opacity: 0.85; }
  100% { transform: scale(1.55); opacity: 0; }
}
.alive-chip-glow {
  position: absolute; left: 50%; top: 48%; width: 120px; height: 120px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.34), transparent 70%);
  animation: coreGlow 2.4s ease-in-out infinite alternate;
}
@keyframes coreGlow {
  0% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
}
.alive-tag {
  position: absolute; padding: 4px 10px; border-radius: 999px;
  background: rgba(7, 19, 38, 0.78); backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.5); color: #e0f2fe;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: tagBob 3.6s ease-in-out infinite alternate;
}
.alive-tag.t2 { animation-delay: -1.2s; border-color: rgba(245, 214, 107, 0.55); color: #fef3c7; }
.alive-tag.t3 { animation-delay: -2.4s; border-color: rgba(52, 211, 153, 0.55); color: #d1fae5; }
@keyframes tagBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* ---------- Imagen viva en Lámina 12 (Data Center Hiperescala) ---------- */
.dc-stage {
  position: relative; width: 100%; height: 100%; min-height: 210px;
  border-radius: 14px; overflow: hidden; cursor: zoom-in;
  border: 1px solid rgba(0, 145, 189, 0.35);
}
.dc-stage img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: siliconBreathe 8s ease-in-out infinite alternate;
}
.dc-scan {
  position: absolute; top: 0; bottom: 0; width: 90px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.24), transparent);
  animation: dcSweep 4.2s ease-in-out infinite;
}
@keyframes dcSweep {
  0% { left: -90px; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.dc-led {
  animation: ledBlink 1.4s ease-in-out infinite alternate;
}
.dc-led.d2 { animation-delay: 0.45s; }
.dc-led.d3 { animation-delay: 0.9s; }
@keyframes ledBlink {
  0% { opacity: 0.25; }
  100% { opacity: 1; }
}

/* ---------- Modal Lupa de Componentes Raspberry Pi 5 (Lámina 9) ---------- */
.rpi-modal-card {
  background: #fff; border-radius: var(--radius-xl); padding: 24px 26px;
  width: min(880px, 94vw); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px;
  animation: popIn 0.28s var(--ease);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.rpi-split { display: grid; grid-template-columns: 1.08fr 1fr; gap: 22px; align-items: stretch; }
.rpi-lens {
  position: relative; border-radius: 16px; overflow: hidden; min-height: 280px;
  background: #0b1c34; border: 2.5px solid var(--arm-cyan);
  box-shadow: 0 12px 30px rgba(0, 145, 189, 0.22);
}
.rpi-lens img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.65s var(--ease), transform-origin 0.65s var(--ease);
}
.rpi-reticle {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px;
  transform: translate(-50%, -50%); border-radius: 14px;
  border: 2.5px solid #38bdf8; box-shadow: 0 0 0 999px rgba(7, 19, 38, 0.34), 0 0 20px rgba(56, 189, 248, 0.8);
  pointer-events: none; animation: reticlePulse 2s ease-in-out infinite alternate;
}
@keyframes reticlePulse {
  0% { transform: translate(-50%, -50%) scale(0.96); }
  100% { transform: translate(-50%, -50%) scale(1.06); }
}
.rpi-zoom-tag {
  position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(7, 19, 38, 0.85); color: #38bdf8; font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 800; border: 1px solid rgba(56, 189, 248, 0.5);
}
.rpi-specs {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
.rpi-chip-list { display: flex; flex-direction: column; gap: 8px; }
.rpi-spec-row {
  padding: 10px 13px; border-radius: 10px; background: var(--bg-subtle);
  border: 1px solid var(--border); font-size: 0.84rem; color: var(--ink-soft);
}
.rpi-spec-row strong { color: var(--ink); display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--arm-cyan); margin-bottom: 2px; }

/* ---------- Barra inferior limpia ---------- */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px; z-index: 40;
  padding: 0 36px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.prog-wrap { flex: 1; max-width: 420px; height: 6px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; margin: 0 18px; }
.prog-fill { height: 100%; width: 7.1%; background: linear-gradient(90deg, var(--arm-cyan), var(--indigo)); transition: width 0.4s var(--ease); }

/* ---------- Modales y Guion ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-bg.open { display: flex; }
.modal-card {
  background: #fff; border-radius: var(--radius-xl); padding: 24px;
  width: min(1080px, 94vw); max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.ov-card {
  padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--bg-canvas); cursor: pointer; transition: all 0.2s;
}
.ov-card:hover, .ov-card.current { border-color: var(--arm-cyan); background: #f0f9ff; transform: translateY(-2px); }

.notes-panel {
  position: fixed; right: 24px; bottom: 68px; width: min(440px, 92vw); z-index: 60;
  background: #0f172a; color: #f8fafc; border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(0, 145, 189, 0.5); display: none;
}
.notes-panel.open { display: block; }
.notes-panel h4 { color: #38bdf8; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.notes-panel p { font-size: 0.85rem; line-height: 1.5; color: #e2e8f0; margin-top: 8px; }

.lightbox-inner { max-width: 90vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox-inner img { max-width: 88vw; max-height: 76vh; object-fit: contain; border-radius: var(--radius-lg); background: #fff; padding: 6px; box-shadow: var(--shadow-lg); }

@media (max-width: 1024px) {
  .topbar, .bottombar { padding: 0 16px; }
  .chapter-pills, .prog-wrap { display: none; }
  .slide { padding: 16px 18px; }
  .cover-split, .g-2, .g-2-asym, .g-2-wide { grid-template-columns: 1fr; }
  .tl-track { grid-template-columns: repeat(3, 1fr); }
}
