/* ==========================================================================
   Home V2 · Prototipo E
   Combinacion de las piezas elegidas en el Visual Lab.
   Blanco de lienzo, azul de identidad, marfil como surface de media.
   Sin dependencias del producto.
   ========================================================================== */

:root {
  --navy:      #1a2e5e;
  --navy-deep: #0f1f42;
  --gold:      #c5a06c;
  --teal:      #1f8a76;
  --clay:      #c4622f;
  --sand:      #e8d9c0;

  --ink:   #101418;
  --ink-2: #4e5865;
  --ink-3: #6b7480;

  --paper:  #ffffff;
  --ivory:  #f7f5f0;
  --ivory-2:#f1ede4;
  --line:   #e9e7e1;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --s3:8px; --s4:12px; --s5:16px; --s6:24px; --s7:32px; --s8:48px;
  --s9:64px; --s10:96px; --s11:140px; --s12:200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 1300px; margin: 0 auto; padding: 0 48px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 60; padding: 12px 18px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; }
.skip:focus { left: 12px; top: 12px; }

/* ================================================================ HEADER == */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.site-header.is-stuck { background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(14px); }

.header-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s7); min-height: 82px;
}
.brand { display: block; flex: none; }
.brand img { display: block; width: 172px; height: auto; }

.header-nav { display: flex; align-items: center; gap: var(--s7); }
.header-links { display: flex; align-items: center; gap: var(--s7); }
.header-actions { display: flex; align-items: center; gap: var(--s6); }

.link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  font-size: 15px; color: var(--ink-2);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.link:hover { color: var(--navy); border-color: var(--navy); }
.link.is-client { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 4px;
  font-family: inherit; font-size: 15px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); }
.btn-ghost { border-color: transparent; color: var(--ink); padding: 0 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-line { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn-line:hover { border-color: var(--navy); color: var(--navy); }
.ico { width: 12px; height: 12px; flex: none; stroke: currentColor; stroke-width: 1.7; fill: none; }

/* menu movil: funciona sin JavaScript */
.menu { position: relative; display: none; }
.menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  font-size: 15px; color: var(--ink);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-icon { width: 16px; height: 10px; position: relative; flex: none; }
.menu-icon span { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; }
.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 4.25px; }
.menu-icon span:nth-child(3) { top: 8.5px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  min-width: 240px; padding: var(--s5);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-panel a { display: flex; align-items: center; min-height: 44px; font-size: 16px; color: var(--ink); }
.menu-panel a:hover { color: var(--navy); }
.menu-panel .btn { margin-top: var(--s4); width: 100%; }

/* ================================================================== HERO == */

.hero { padding: var(--s9) 0 var(--s10); }
.hero-copy { display: flex; flex-direction: column; gap: var(--s6); max-width: 62rem; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); }
.h1 { margin: 0; font-size: clamp(40px, 5.2vw, 78px); line-height: 1.02; font-weight: 400; letter-spacing: 0; color: var(--ink); }
.h1 em { font-style: normal; color: var(--navy); }
.lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 50ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5) var(--s7); margin-top: var(--s3); }

.hero-piece { margin: var(--s9) 0 0; }
.piece {
  position: relative; overflow: hidden;
  border-radius: 22px; background: var(--ivory);
}
.piece svg { display: block; width: 100%; height: clamp(320px, 46vh, 480px); }

/* ============================================================ TRANSICION == */

.transition { padding: var(--s12) 0 var(--s11); }
.transition-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s7) var(--s6); align-items: start; }
.transition-copy { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: var(--s6); }
.transition-note { grid-column: 9 / span 4; padding-top: var(--s4); }
.h2 { margin: 0; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.08; font-weight: 400; letter-spacing: 0; color: var(--ink); }
.h2 em { font-style: normal; color: var(--navy); }
.body { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.conector { display: block; width: 148px; height: 34px; margin-top: var(--s5); }

/* =========================================================== CAPACIDADES = */

.caps { padding: 0 0 var(--s11); }
.caps-head { display: flex; flex-direction: column; gap: var(--s5); max-width: 40rem; margin-bottom: var(--s9); }

.cap-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s7) var(--s6); align-items: center; }
.cap-row + .cap-row { margin-top: var(--s11); }
.cap-row.is-flipped .cap-text { grid-column: 9 / span 4; grid-row: 1; }
.cap-row.is-flipped .cap-media { grid-column: 1 / span 7; grid-row: 1; }

.cap-text { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: var(--s5); align-items: flex-start; }
.cap-media { grid-column: 6 / span 7; }

.cap-name { margin: 0; font-size: clamp(24px, 2.1vw, 32px); line-height: 1.1; font-weight: 500; color: var(--ink); }
.cap-line { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); max-width: 42ch; }
.cap-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.cap-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--navy); border-bottom: 1px solid var(--line); }
.cap-cta:hover { border-color: var(--navy); }

/* senal editorial discreta: no es un badge */
.cap-signal { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.cap-signal::before { content: ""; width: 18px; height: 1px; background: var(--gold); flex: none; }
.cap-signal.is-pending::before { background: var(--line); }

.cap-media .frame {
  border-radius: 20px; background: var(--ivory); overflow: hidden;
}
.cap-media .frame svg { display: block; width: 100%; height: auto; }
.cap-media.is-tall .frame { aspect-ratio: 4 / 3; }
.cap-media.is-wide .frame { aspect-ratio: 16 / 9; }
.cap-media .frame svg { height: 100%; }

.caps-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s10) var(--s7); margin-top: var(--s11); }
.caps-pair .cap-block { display: flex; flex-direction: column; gap: var(--s7); min-width: 0; }
.caps-pair .cap-text { grid-column: auto; min-width: 0; }
.caps-pair .cap-media { grid-column: auto; min-width: 0; }
.caps-pair .frame { aspect-ratio: 4 / 3; }

/* ============================================================== CIERRE == */

.closing { padding: var(--s12) 0 var(--s11); }
.closing-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s7) var(--s6); align-items: end; }
.closing-copy { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: var(--s5); }
.closing-actions { grid-column: 9 / span 4; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); }
.closing-actions .btn { width: 100%; }
.closing .h2 { font-size: clamp(26px, 2.8vw, 40px); }

.site-foot { padding: 0 0 var(--s9); }
.foot-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s5) var(--s7); }
.foot-note { font-size: 13px; color: var(--ink-3); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s6); font-size: 13.5px; color: var(--ink-2); }
.foot-links a:hover { color: var(--navy); }

/* =============================================================== MOTION == */

@keyframes fx-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fx-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift-a { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes drift-b { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-9px); } }
@keyframes drift-c { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes travel { from { transform: translateX(-40px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } to { transform: translateX(1180px); opacity: 0; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.motion .fu { animation: fx-up .8s cubic-bezier(.2,.7,.3,1) both; }
.motion .fu[data-d="1"] { animation-delay: .09s; }
.motion .fu[data-d="2"] { animation-delay: .18s; }
.motion .fu[data-d="3"] { animation-delay: .27s; }
.motion .fi { animation: fx-in 1.1s ease-out .12s both; }

.motion .drift-a { animation: drift-a 34s ease-in-out infinite; }
.motion .drift-b { animation: drift-b 27s ease-in-out infinite; }
.motion .drift-c { animation: drift-c 21s ease-in-out infinite; }
.motion .node-a { animation: breathe 11s ease-in-out infinite; }
.motion .node-b { animation: breathe 13s ease-in-out -4s infinite; }
.motion .node-c { animation: breathe 15s ease-in-out -8s infinite; }
.motion .travel { animation: travel 22s linear 2s infinite; }
.motion .sweep-a { animation: spin 64s linear infinite; transform-box: view-box; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion .fu, .motion .fi, .motion .drift-a, .motion .drift-b, .motion .drift-c,
  .motion .node-a, .motion .node-b, .motion .node-c, .motion .travel { animation: none !important; }
}

/* =========================================================== RESPONSIVE == */

@media (max-width: 1080px) {
  .wrap { padding: 0 32px; }
  .header-nav { gap: var(--s6); }
  .header-links { gap: var(--s6); }
  .cap-row .cap-text { grid-column: 1 / span 5; }
  .cap-row .cap-media { grid-column: 6 / span 7; }
  .cap-row.is-flipped .cap-text { grid-column: 8 / span 5; }
  .cap-row.is-flipped .cap-media { grid-column: 1 / span 7; }
}

@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .header-in { min-height: 68px; }
  .brand img { width: 150px; }
  .header-links, .header-actions .link { display: none; }
  .header-actions .btn { display: none; }
  .menu { display: block; }

  .hero { padding: var(--s8) 0 var(--s9); }
  .piece svg { height: 300px; }
  .transition { padding: var(--s10) 0 var(--s9); }
  .transition-in { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .transition-copy, .transition-note { grid-column: 1 / -1; }
  .transition-note { padding-top: 0; }

  .caps { padding-bottom: var(--s10); }
  .cap-row { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .cap-row .cap-text, .cap-row .cap-media,
  .cap-row.is-flipped .cap-text, .cap-row.is-flipped .cap-media { grid-column: 1 / -1; grid-row: auto; }
  .cap-row + .cap-row { margin-top: var(--s10); }
  .cap-media.is-tall .frame, .cap-media.is-wide .frame { aspect-ratio: 16 / 11; }

  .caps-pair { grid-template-columns: minmax(0, 1fr); gap: var(--s10); margin-top: var(--s10); }
  .caps-pair .frame { aspect-ratio: 16 / 11; }

  .closing { padding: var(--s10) 0 var(--s9); }
  .closing-in { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .closing-copy, .closing-actions { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .h1 { font-size: clamp(34px, 10vw, 46px); }
  .h2 { font-size: clamp(25px, 8vw, 34px); }
  .lede, .body { font-size: 16.5px; }
  .piece svg { height: 250px; }
  .piece { border-radius: 18px; }
  .actions { gap: var(--s5); }
  .actions .btn { width: 100%; }
  .actions .btn-ghost { width: auto; }
}

/* ==========================================================================
   PROTOTIPO F · REFINAMIENTO SOBRE E
   Cabecera mas fina, anchors visibles, tres capacidades verticales,
   tres variantes de transicion, pre-footer y footer real.
   ========================================================================== */

/* --------------------------------------------------- 1 · header mas fino - */

.header-in { min-height: 72px; transition: min-height .22s ease; }
.site-header.is-stuck .header-in { min-height: 58px; }
.brand img { width: 172px; transition: width .22s ease; }
.site-header.is-stuck .brand img { width: 152px; }

.header-links .link { color: var(--ink); }
.header-links .link.is-product { color: var(--navy); }
.header-links .link.is-client { font-size: 14px; color: var(--ink-3); }
.header-links .link.is-client:hover { color: var(--navy); }

/* --------------------------------------------- 2 · anchors bajo el sticky - */

html { scroll-padding-top: 96px; }
.caps, .cap-row, .cap-block, .transition, .closing { scroll-margin-top: 8px; }

/* -------------------------------------------------- 3 · transicion A/B/C -- */

.tr-switch { display: none; align-items: center; justify-content: flex-end; gap: var(--s5); margin-bottom: var(--s8); }
.js .tr-switch { display: flex; }
.tr-switch-label { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tr-switch-group { display: flex; gap: 6px; }
.tr-btn {
  min-height: 30px; padding: 0 11px; font-family: inherit; font-size: 11px; font-weight: 600;
  color: var(--navy); background: none; border: 1px solid var(--line); border-radius: 2px; cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}
.tr-btn:hover { border-color: var(--navy); }
.tr-btn[aria-pressed="true"] { border-color: var(--navy); background: var(--ivory); }

.tr { display: none; }
.tr.is-active { display: block; }

.tr-a-in { display: flex; flex-direction: column; gap: var(--s5); max-width: 44rem; }
.tr-statement { font-size: clamp(30px, 3.7vw, 52px); line-height: 1.06; }
.tr-caption { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-3); max-width: 44ch; padding-top: var(--s3); }

.tr-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s7) var(--s6); align-items: center; }
.tr-copy { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: var(--s5); }
.tr-figure { grid-column: 8 / span 5; margin: 0; }
.tr-anim { display: block; width: 100%; height: auto; }

.tr-visual { display: flex; flex-direction: column; gap: var(--s6); }
.tr-piece { display: block; width: 100%; height: auto; }
.tr-short { margin: 0; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.1; font-weight: 400; color: var(--ink); }
.tr-short em { font-style: normal; color: var(--navy); }

@keyframes align {
  0%, 10%   { transform: translate(var(--dx, 0), var(--dy, 0)); opacity: .3; }
  34%, 80%  { transform: translate(0, 0); opacity: 1; }
  96%, 100% { transform: translate(var(--dx, 0), var(--dy, 0)); opacity: .3; }
}
.motion .align { animation: align 17s cubic-bezier(.4, 0, .2, 1) infinite; }
.align.a1 { --dx: -188px; --dy: -20px; }
.align.a2 { --dx: -96px;  --dy: 26px;  animation-delay: -1.4s; }
.align.a3 { --dx: -246px; --dy: 6px;   animation-delay: -2.8s; }
.align.a4 { --dx: -134px; --dy: -28px; animation-delay: -4.2s; }
.align.a5 { --dx: -72px;  --dy: 18px;  animation-delay: -5.6s; }

/* ---------------------------------------- 4 · capacidades en vertical ------ */

.caps-pair { display: block; margin-top: 0; }
.caps-pair .cap-block {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s7) var(--s6); align-items: center; margin-top: var(--s11);
}
.caps-pair .cap-block .cap-text { grid-column: 1 / span 4; }
.caps-pair .cap-block .cap-media { grid-column: 6 / span 7; }
/* la primera de la pareja invierte el lado: Atlas izq, Radar der, Directo izq */
.caps-pair .cap-block:nth-child(1) .cap-text { grid-column: 9 / span 4; grid-row: 1; }
.caps-pair .cap-block:nth-child(1) .cap-media { grid-column: 1 / span 7; grid-row: 1; }

.cap-media .frame,
.cap-media.is-wide .frame,
.cap-media.is-tall .frame { aspect-ratio: 4 / 3; }

/* ------------------------------------------------------ 5 · ritmo variado - */

.hero { padding: var(--s9) 0 var(--s10); }
.transition { padding: var(--s11) 0 var(--s10); }
.caps { padding: 0 0 var(--s10); }
.caps-head { margin-bottom: var(--s9); }
.cap-row + .cap-row { margin-top: var(--s11); }
.closing { padding: var(--s11) 0 var(--s10); }

/* ------------------------------------------------------------- 6 · footer - */

.site-footer { padding: var(--s10) 0 var(--s8); background: var(--paper); }
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s8) var(--s6); }
.foot-brand { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: var(--s5); }
.foot-brand img { display: block; width: 168px; height: auto; }
.foot-claim { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 30ch; }
.foot-mail { margin: 0; }
.foot-mail a { font-size: 15px; color: var(--navy); border-bottom: 1px solid var(--line); }
.foot-mail a:hover { border-color: var(--navy); }

.foot-grid > .foot-col:nth-child(2) { grid-column: 6 / span 2; }
.foot-grid > .foot-col:nth-child(3) { grid-column: 8 / span 2; }
.foot-grid > .foot-col:nth-child(4) { grid-column: 10 / span 3; }
.foot-col { display: flex; flex-direction: column; gap: 8px; }
.foot-h { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.foot-col a { display: inline-flex; align-items: center; min-height: 30px; font-size: 15px; color: var(--ink); }
.foot-col a:hover { color: var(--navy); }

.foot-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px var(--s6);
  margin-top: var(--s9); padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}

/* ------------------------------------------------------------ 7 · mobile -- */

@media (prefers-reduced-motion: reduce) {
  .motion .align { animation: none !important; }
}

@media (max-width: 1080px) {
  .header-in { min-height: 68px; }
  .site-header.is-stuck .header-in { min-height: 56px; }
  .caps-pair .cap-block .cap-text { grid-column: 1 / span 5; }
  .caps-pair .cap-block .cap-media { grid-column: 6 / span 7; }
  .caps-pair .cap-block:nth-child(1) .cap-text { grid-column: 8 / span 5; }
  .caps-pair .cap-block:nth-child(1) .cap-media { grid-column: 1 / span 7; }
  .foot-brand { grid-column: 1 / span 4; }
  .foot-grid > .foot-col:nth-child(2) { grid-column: 6 / span 2; }
  .foot-grid > .foot-col:nth-child(3) { grid-column: 8 / span 2; }
  .foot-grid > .foot-col:nth-child(4) { grid-column: 10 / span 3; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 84px; }

  .header-in { min-height: 62px; }
  .site-header.is-stuck .header-in { min-height: 54px; }
  .brand img, .site-header.is-stuck .brand img { width: 146px; }

  .tr-switch { justify-content: flex-start; }
  .tr-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .tr-copy, .tr-figure { grid-column: 1 / -1; }

  .caps-pair .cap-block { grid-template-columns: minmax(0, 1fr); gap: var(--s7); margin-top: var(--s10); }
  .caps-pair .cap-block .cap-text, .caps-pair .cap-block .cap-media,
  .caps-pair .cap-block:nth-child(1) .cap-text, .caps-pair .cap-block:nth-child(1) .cap-media { grid-column: 1 / -1; grid-row: auto; }

  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s8) var(--s6); }
  .foot-brand { grid-column: 1 / -1; }
  .foot-grid > .foot-col:nth-child(2) { grid-column: 1 / span 1; }
  .foot-grid > .foot-col:nth-child(3) { grid-column: 2 / span 1; }
  .foot-grid > .foot-col:nth-child(4) { grid-column: 1 / -1; }

  .hero { padding: var(--s8) 0 var(--s9); }
  .transition { padding: var(--s10) 0 var(--s9); }
  .cap-row + .cap-row { margin-top: var(--s10); }
  .closing { padding: var(--s10) 0 var(--s9); }
  .site-footer { padding: var(--s9) 0 var(--s8); }
}

@media (max-width: 640px) {
  .tr-switch { flex-direction: column; align-items: flex-start; gap: var(--s4); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-grid > .foot-col:nth-child(2),
  .foot-grid > .foot-col:nth-child(3),
  .foot-grid > .foot-col:nth-child(4) { grid-column: 1 / -1; }
  .foot-col { gap: 2px; }
}

/* ==========================================================================
   PROTOTIPO G
   1) causa del espacio superior: el <svg class="defs-host"> no tenia regla
      y se renderizaba en linea a su tamano por defecto (300x150).
   2) copy de hero conmutable
   3) transicion nueva: tres tipos de informacion publica
   4) capacidades en tres media cards verticales (Capabilities B)
   ========================================================================== */

.defs-host { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------- atlas: ilustracion o captura */

.atlas-switch { display: none; align-items: center; gap: var(--s5); padding-top: var(--s5); }
.js .atlas-switch { display: flex; }
.cap-media img.atlas-img { display: none; }
.cap-media img.atlas-img.is-on { display: block; }
.map-mode #capacidad-atlas .cap-overlay { display: none; }

/* ==========================================================================
   G.1 · PIEZAS DE PRODUCTO
   Tres representaciones distintas, misma gramatica: marfil, trazo fino,
   navy, dorado puntual, movimiento lento.
   ========================================================================== */

.cap-media { position: relative; overflow: hidden; }
.cap-media > svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------- ATLAS ----- */

.mapa .anillo { fill: none; stroke: #1a2e5e; stroke-width: 1; opacity: 0.15; }
.mapa .anillo-label { fill: #6b7480; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 1.8px; }
.mapa .rel { stroke: #1a2e5e; stroke-width: 1; opacity: 0.16; }
.mapa .rel.is-dashed { stroke-dasharray: 2 5; }
.mapa .nodo-disco { fill: #ffffff; stroke: #d3d1cb; stroke-width: 1; }
.mapa .nodo.is-dashed .nodo-disco { stroke-dasharray: 3 3; }
.mapa .nodo-nombre { fill: #1a2e5e; font-family: var(--sans); font-weight: 600; text-anchor: middle; }
.mapa .nodo-rol { fill: #6b7480; font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.6px; text-anchor: middle; }
.mapa .nodo-foco { fill: none; stroke: #c5a06c; stroke-width: 1.6; opacity: 0; }
.mapa .nodo-logo { opacity: 0.9; }
.mapa .centro-disco { fill: #0f1f42; }
.mapa .centro-halo { fill: none; stroke: #c5a06c; stroke-width: 1.4; opacity: 0; }
.mapa .centro-kicker { fill: #c5a06c; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 2.4px; text-anchor: middle; }
.mapa .centro-nombre { fill: #ffffff; font-family: var(--sans); font-size: 30px; text-anchor: middle; }

/* secuencia de Atlas: 44s, con una pausa larga al final */
@keyframes m-centro { 0%, 3% { opacity: 0; } 8%, 16% { opacity: 1; } 26%, 100% { opacity: 0; } }
@keyframes m-anillo { 0%, 8% { opacity: 0.15; } 14%, 22% { opacity: 0.5; } 32%, 100% { opacity: 0.15; } }
@keyframes m-rel { 0%, 16% { opacity: 0.16; stroke-width: 1; } 22%, 32% { opacity: 0.9; stroke-width: 2; } 42%, 100% { opacity: 0.16; stroke-width: 1; } }
@keyframes m-nodo { 0%, 18% { opacity: 0; } 24%, 34% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes m-nodo2 { 0%, 30% { opacity: 0; } 36%, 46% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes m-rel2 { 0%, 34% { opacity: 0.16; stroke-width: 1; } 40%, 50% { opacity: 0.9; stroke-width: 2; } 60%, 100% { opacity: 0.16; stroke-width: 1; } }

.is-live[data-piece="atlas"] .centro-halo { animation: m-centro 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .anillo[data-ring="legislation"] { animation: m-anillo 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .rel[data-a="ministerio-de-sanidad"],
.is-live[data-piece="atlas"] .rel[data-b="ministerio-de-sanidad"] { animation: m-rel 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .nodo[data-node="ministerio-de-sanidad"] .nodo-foco { animation: m-nodo 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .nodo[data-node="aemps"] .nodo-foco { animation: m-nodo2 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .rel[data-a="ep"], .is-live[data-piece="atlas"] .rel[data-b="ep"] { animation: m-rel2 44s ease-in-out infinite; }
.is-live[data-piece="atlas"] .nodo[data-node="ep"] .nodo-foco { animation: m-nodo2 44s ease-in-out infinite; }

/* ------------------------------------------------------------- RADAR ----- */

.radar .rd-arcs circle { opacity: 0.12; }
.radar .rd-field line { opacity: 0.16; }
.radar .rd-sweep { opacity: 0; }
.radar .rd-dot { fill: #1a2e5e; opacity: 1; }
/* sin JS y con reduced motion las fichas estan visibles: el estado estatico es completo */
.radar .rd-card { opacity: 1; }
.radar .rd-card rect { fill: #ffffff; stroke: #e9e7e1; }
.radar .rd-kicker { fill: #a8813d; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 1.6px; }
.radar .rd-title { fill: #1a2e5e; font-family: var(--sans); font-size: 19px; font-weight: 500; }

@keyframes rd-travel { 0% { transform: translateY(90px); opacity: 0; } 6% { opacity: 0.9; } 92% { opacity: 0.9; } 100% { transform: translateY(930px); opacity: 0; } }
@keyframes rd-sig { 0%, 12% { opacity: 0; } 18%, 30% { opacity: 1; } 38%, 100% { opacity: 0; } }
@keyframes rd-sig2 { 0%, 38% { opacity: 0; } 44%, 56% { opacity: 1; } 64%, 100% { opacity: 0; } }
@keyframes rd-sig3 { 0%, 64% { opacity: 0; } 70%, 82% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes rd-dot { 0%, 12% { opacity: 0.35; } 18%, 30% { opacity: 1; } 38%, 100% { opacity: 0.35; } }

.is-live[data-piece="radar"] .rd-sweep { animation: rd-travel 26s linear infinite; }
.is-live[data-piece="radar"] .rd-sig[data-sig="1"] .rd-card { animation: rd-sig 26s ease-in-out infinite; }
.is-live[data-piece="radar"] .rd-sig[data-sig="2"] .rd-card { animation: rd-sig2 26s ease-in-out infinite; }
.is-live[data-piece="radar"] .rd-sig[data-sig="3"] .rd-card { animation: rd-sig3 26s ease-in-out infinite; }
.is-live[data-piece="radar"] .rd-sig[data-sig="1"] .rd-dot { animation: rd-dot 26s ease-in-out infinite; }
.is-live[data-piece="radar"] .rd-sig[data-sig="2"] .rd-dot { animation: rd-dot 26s ease-in-out infinite 6.5s; }
.is-live[data-piece="radar"] .rd-sig[data-sig="3"] .rd-dot { animation: rd-dot 26s ease-in-out infinite 13s; }

/* ----------------------------------------------------------- DIRECTO ----- */

.directo .dc-rail { opacity: 0.45; }
.directo .dc-time { fill: #6b7480; font-family: var(--sans); font-size: 11px; letter-spacing: 1.4px; }
.directo .dc-avatar { fill: none; stroke: #1a2e5e; stroke-width: 1.4; }
.directo .dc-avatar-t { fill: #1a2e5e; font-family: var(--sans); font-size: 12px; font-weight: 600; text-anchor: middle; }
.directo .dc-line { fill: #1a2e5e; opacity: 0.26; }
.directo .dc-mark line { opacity: 0.45; }

@keyframes dc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.directo .dc-mark, .directo .dc-speaker, .directo .dc-line { opacity: 1; }
.is-live[data-piece="directo"] .dc-mark,
.is-live[data-piece="directo"] .dc-speaker,
.is-live[data-piece="directo"] .dc-line { animation: dc-in 1.1s cubic-bezier(.2,.7,.3,1) both; }
.is-live[data-piece="directo"] .dc-mark[data-i="1"] { animation-delay: .1s; }
.is-live[data-piece="directo"] .dc-speaker[data-i="1"] { animation-delay: .5s; }
.is-live[data-piece="directo"] .dc-line[data-i="1"] { animation-delay: .9s; }
.is-live[data-piece="directo"] .dc-mark[data-i="2"] { animation-delay: 2.1s; }
.is-live[data-piece="directo"] .dc-speaker[data-i="2"] { animation-delay: 2.5s; }
.is-live[data-piece="directo"] .dc-line[data-i="2"] { animation-delay: 2.9s; }
.is-live[data-piece="directo"] .dc-mark[data-i="3"] { animation-delay: 4.2s; }
.is-live[data-piece="directo"] .dc-line[data-i="3"] { animation-delay: 4.6s; }

@media (prefers-reduced-motion: reduce) {
  .is-live[data-piece] * { animation: none !important; }
  .radar .rd-sweep { opacity: 0 !important; }
}

/* ==========================================================================
   G.2
   1) capacidades: contenidas, centradas y estaticas
   2) el motion vive en el hero y en la transicion
   ========================================================================== */

/* ------------------------------------------- 1 · capacidades contenidas -- */

.caps-grid { max-width: 1150px; margin-left: auto; margin-right: auto; gap: var(--s9) 40px; }
.caps-head { max-width: 1150px; margin-left: auto; margin-right: auto; }
.cap-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* en Home las ilustraciones no ejecutan secuencias: solo un hover minimo */
.cap-media { transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.cap:hover .cap-media { transform: translateY(-3px); }

/* ------------------------------------------------------- 2 · hero vivo --- */

@keyframes hz-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(16px); } }
@keyframes hz-settle { 0%, 100% { transform: translateY(0); } 14% { transform: translateY(-8px); } 26%, 92% { transform: translateY(-5px); } }
@keyframes hz-sweep { 0% { transform: translateY(40px); opacity: 0; } 6% { opacity: 0.85; } 56% { opacity: 0.85; } 64% { transform: translateY(590px); opacity: 0; } 100% { transform: translateY(590px); opacity: 0; } }
@keyframes hz-state { 0%, 6% { fill: #c9cac6; } 14%, 34% { fill: #1f8a76; } 42%, 100% { fill: #c9cac6; } }
@keyframes hz-update { 0%, 6% { width: 0; } 16%, 32% { width: 60px; } 40%, 100% { width: 0; } }
@keyframes hz-bars-a { 0%, 28% { transform: translateX(0); } 40%, 56% { transform: translateX(36px); } 68%, 100% { transform: translateX(0); } }
@keyframes hz-bars-b { 0%, 32% { transform: translateX(0); } 44%, 60% { transform: translateX(-36px); } 72%, 100% { transform: translateX(0); } }
@keyframes hz-seg { 0%, 50% { width: 0; } 62%, 88% { width: 90px; } 94%, 100% { width: 0; } }
@keyframes hz-tick { 0% { transform: translateX(0); } 70% { transform: translateX(880px); } 100% { transform: translateX(880px); } }

.hero-piece.is-live .hz-plane { animation: hz-drift 38s ease-in-out infinite; }
.hero-piece.is-live .hz-doc { animation: hz-settle 26s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-state { animation: hz-state 26s ease-in-out infinite; }
.hero-piece.is-live .hz-update { animation: hz-update 26s ease-in-out infinite; }
.hero-piece.is-live .hz-bar.b3 { animation: hz-bars-a 26s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-bar.b5 { animation: hz-bars-b 26s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-blk.k5 { animation: hz-seg 26s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-tick { animation: hz-tick 26s linear infinite; }
.hero-piece.is-live .hz-sweep { animation: hz-sweep 26s linear infinite; }

/* -------------------------------------------------- 3 · transicion viva -- */

@keyframes ts-fold { 0%, 8% { opacity: 0; transform: translateY(0); } 18%, 44% { opacity: 1; transform: translateY(0); } 52%, 100% { opacity: 0; } }
@keyframes ts-dot { 0%, 20% { fill: #c9cac6; } 30%, 56% { fill: #1f8a76; } 64%, 100% { fill: #c9cac6; } }
@keyframes ts-mark { 0%, 22% { width: 0; } 34%, 58% { width: 120px; } 66%, 100% { width: 0; } }
@keyframes ts-seg { 0%, 38% { width: 0; } 50%, 74% { width: 104px; } 82%, 100% { width: 0; } }
@keyframes ts-tick { 0%, 40% { transform: translateY(0); } 52%, 74% { transform: translateY(68px); } 84%, 100% { transform: translateY(0); } }

.transition.is-live .ts-fold { animation: ts-fold 20s ease-in-out infinite; }
.transition.is-live .ts-dot { animation: ts-dot 20s ease-in-out infinite; }
.transition.is-live .ts-mark { animation: ts-mark 20s ease-in-out infinite; }
.transition.is-live .ts-seg { animation: ts-seg 20s ease-in-out infinite; }
.transition.is-live .ts-tick { animation: ts-tick 20s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .hero-piece.is-live .hz-plane, .hero-piece.is-live .hz-doc, .hero-piece.is-live .hz-state,
  .hero-piece.is-live .hz-update, .hero-piece.is-live .hz-bar, .hero-piece.is-live .hz-blk,
  .hero-piece.is-live .hz-tick, .hero-piece.is-live .hz-sweep,
  .transition.is-live .ts-fold, .transition.is-live .ts-dot,
  .transition.is-live .ts-mark, .transition.is-live .ts-seg, .transition.is-live .ts-tick { animation: none !important; }
  .hero-piece .hz-sweep { opacity: 0 !important; }
  .transition .ts-fold { opacity: 1 !important; }
}

@media (max-width: 1080px) {
  .caps-grid { max-width: 900px; }
}
@media (max-width: 900px) {
  .caps-grid { max-width: none; }
}

/* ==========================================================================
   G.3
   hero y transicion: ilustraciones vivas con eventos y pausas.
   capacidades: estaticas. Atlas vuelve al mapa real completo.
   ========================================================================== */

.mapa { display: block; width: 100%; height: 100%; }
.mapa .anillo { fill: none; stroke: #1a2e5e; stroke-width: 1; opacity: 0.14; }
.mapa .rel { stroke: #1a2e5e; stroke-width: 1; opacity: 0.15; }
.mapa .rel.is-dashed { stroke-dasharray: 2 5; }
.mapa .nodo-disco { fill: #ffffff; stroke: #d9d6cf; stroke-width: 1; }
.mapa .nodo.is-dashed .nodo-disco { stroke-dasharray: 3 3; }
.mapa .nodo-nombre { fill: #1a2e5e; font-family: var(--sans); font-weight: 600; text-anchor: middle; }
.mapa .nodo-rol { fill: #6b7480; font-family: var(--sans); font-size: 12px; letter-spacing: 0.4px; text-anchor: middle; }
.mapa .anillo-label { fill: #6b7480; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 2px; }
.mapa .centro-disco { fill: #0f1f42; }
.mapa .centro-kicker { fill: #c5a06c; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-anchor: middle; }
.mapa .centro-nombre { fill: #ffffff; font-family: var(--sans); font-size: 32px; text-anchor: middle; }
.mapa .nodo-logo { opacity: 0.92; }

/* --- hero vivo: 36 s con eventos y pausas ------------------------------- */

@keyframes g3-plane { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, -8px); } }
@keyframes g3-arcs { 0%, 100% { transform: translateX(0); opacity: 0.14; } 50% { transform: translateX(-18px); opacity: 0.2; } }
@keyframes g3-sheet { 0%, 4% { transform: translate(-70px, 34px); opacity: 0; } 12% { transform: translate(0, 0); opacity: 1; } 92% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes g3-stack { 0%, 14% { transform: translateY(0); } 20% { transform: translateY(-9px); } 30%, 100% { transform: translateY(-6px); } }
@keyframes g3-state { 0%, 20% { fill: #c9cac6; } 28%, 46% { fill: #1f8a76; } 54%, 100% { fill: #c9cac6; } }
@keyframes g3-update { 0%, 20% { width: 0; } 30%, 46% { width: 62px; } 54%, 100% { width: 0; } }
@keyframes g3-pref { 0%, 42% { width: 0; } 52%, 72% { width: 180px; } 80%, 100% { width: 0; } }
@keyframes g3-bar-a { 0%, 46% { transform: translateX(0); } 56%, 72% { transform: translateX(38px); } 82%, 100% { transform: translateX(0); } }
@keyframes g3-bar-b { 0%, 50% { transform: translateX(0); } 60%, 76% { transform: translateX(-38px); } 86%, 100% { transform: translateX(0); } }
@keyframes g3-blk { 0%, 74% { width: 0; } 84%, 96% { width: 118px; } 100% { width: 118px; } }
@keyframes g3-cursor { 0% { transform: translateX(0); } 68% { transform: translateX(600px); } 100% { transform: translateX(600px); } }
@keyframes g3-sweep { 0% { transform: translateY(60px); opacity: 0; } 5% { opacity: 0.8; } 62% { opacity: 0.8; } 72% { transform: translateY(630px); opacity: 0; } 100% { transform: translateY(630px); opacity: 0; } }

.hero-piece.is-live .hz-plane { animation: g3-plane 44s ease-in-out infinite; }
.hero-piece.is-live .hz-arcs { animation: g3-arcs 52s ease-in-out infinite; }
.hero-piece.is-live .hz-sheet.s4 { animation: g3-sheet 36s cubic-bezier(.35,.2,.2,1) infinite; }
.hero-piece.is-live .hz-doc { animation: g3-stack 36s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-state { animation: g3-state 36s ease-in-out infinite; }
.hero-piece.is-live .hz-update { animation: g3-update 36s ease-in-out infinite; }
.hero-piece.is-live .hz-pref { animation: g3-pref 36s ease-in-out infinite; }
.hero-piece.is-live .hz-bar.b3 { animation: g3-bar-a 36s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-bar.b5 { animation: g3-bar-b 36s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-blk.k5 { animation: g3-blk 36s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hz-cursor { animation: g3-cursor 36s cubic-bezier(.35,.2,.3,1) infinite; }
.hero-piece.is-live .hz-mark { animation: g3-cursor 36s cubic-bezier(.35,.2,.3,1) infinite; }
.hero-piece.is-live .hz-sweep { animation: g3-sweep 36s linear infinite; }

/* --- transicion viva: 16 s, dos eventos por canal ----------------------- */

@keyframes g3-sheet-in { 0%, 6% { transform: translate(-40px, 16px); opacity: 0; } 18%, 88% { transform: translate(0, 0); opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes g3-ref { 0%, 24% { width: 0; } 34%, 74% { width: 104px; } 82%, 100% { width: 0; } }
@keyframes g3-dot { 0%, 16% { fill: #c9cac6; } 26%, 62% { fill: #1f8a76; } 70%, 100% { fill: #c9cac6; } }
@keyframes g3-mark { 0%, 20% { width: 0; } 30%, 62% { width: 120px; } 70%, 100% { width: 0; } }
@keyframes g3-step { 0%, 44% { opacity: 0; transform: translateY(6px); } 54%, 78% { opacity: 1; transform: none; } 86%, 100% { opacity: 0; } }
@keyframes g3-next { 0%, 46% { width: 0; } 56%, 78% { width: 96px; } 86%, 100% { width: 0; } }
@keyframes g3-seg { 0%, 58% { width: 0; } 68%, 92% { width: 104px; } 100% { width: 104px; } }
@keyframes g3-spk { 0%, 58% { opacity: 0.5; } 66%, 82% { opacity: 1; } 90%, 100% { opacity: 0.5; } }

.transition.is-live .ts-sheet { animation: g3-sheet-in 16s cubic-bezier(.3,.7,.3,1) infinite; }
.transition.is-live .ts-ref { animation: g3-ref 16s ease-in-out infinite; }
.transition.is-live .ts-dot { animation: g3-dot 16s ease-in-out infinite; }
.transition.is-live .ts-mark { animation: g3-mark 16s ease-in-out infinite; }
.transition.is-live .ts-step { animation: g3-step 16s ease-in-out infinite; }
.transition.is-live .ts-next { animation: g3-next 16s ease-in-out infinite; }
.transition.is-live .ts-seg { animation: g3-seg 16s ease-in-out infinite; }
.transition.is-live .ts-spk { animation: g3-spk 16s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .hero-piece.is-live *, .transition.is-live * { animation: none !important; }
  .hero-piece .hz-sweep { opacity: 0 !important; }
  .transition .ts-sheet { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   G.4
   1) una sola superficie para las tres capacidades
   2) Atlas: mapa real con mejor encuadre y etiquetas legibles
   3) hero y transicion rehechos
   ========================================================================== */

:root { --ivory: #f7f7f4; }

.mapa .anillo-label {
  fill: #6b7480; paint-order: stroke; stroke: #f7f7f4; stroke-width: 6px;
  stroke-linejoin: round; font-size: 14px; letter-spacing: 2.2px;
}
.mapa .nodo-disco { fill: #ffffff; stroke: #dcd9d2; stroke-width: 1; }
.mapa .rel { stroke: #1a2e5e; stroke-width: 1; opacity: 0.17; }
.mapa .anillo { stroke: #1a2e5e; stroke-width: 1; opacity: 0.16; }
.mapa .nodo-rol { fill: #6b7480; font-size: 12.5px; }

/* --- hero: corografia de eventos, 48 s ---------------------------------- */

@keyframes hx-grid   { 0%, 100% { opacity: 0.1; transform: translateX(0); } 50% { opacity: 0.16; transform: translateX(10px); } }
@keyframes hx-plane  { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(16px, -10px); } }
@keyframes hx-pub    { 0%, 100% { opacity: 0.24; } 46% { opacity: 0.24; } 52%, 66% { opacity: 0.5; } 74%, 100% { opacity: 0.24; } }
@keyframes hx-newpub { 0%, 8% { width: 0; opacity: 0; } 16% { width: 66px; opacity: 1; } 84% { width: 66px; opacity: 1; } 92%, 100% { width: 0; opacity: 0; } }
@keyframes hx-sheet  { 0%, 56% { transform: translate(-80px, 40px); opacity: 0; } 66% { transform: translate(0, 0); opacity: 1; } 94% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes hx-stack  { 0%, 62% { transform: translateY(0); } 70% { transform: translateY(-10px); } 80%, 100% { transform: translateY(-7px); } }
@keyframes hx-regnew { 0%, 18% { width: 0; } 28%, 88% { width: 190px; } 94%, 100% { width: 0; } }
@keyframes hx-cursor { 0% { transform: translateY(0); } 70% { transform: translateY(432px); } 100% { transform: translateY(432px); } }
@keyframes hx-prio   { 0%, 32% { fill: #c9cac6; } 42%, 74% { fill: #c5a06c; } 82%, 100% { fill: #c9cac6; } }
@keyframes hx-priorule { 0%, 34% { width: 0; } 46%, 74% { width: 180px; } 82%, 100% { width: 0; } }
@keyframes hx-blk    { 0%, 74% { width: 0; } 84%, 97% { width: 130px; } 100% { width: 130px; } }
@keyframes hx-mark   { 0% { transform: translateX(0); } 76% { transform: translateX(1000px); } 100% { transform: translateX(1000px); } }
@keyframes hx-sweep  { 0% { transform: translateY(70px); opacity: 0; } 4% { opacity: 0.75; } 66% { opacity: 0.75; } 76% { transform: translateY(670px); opacity: 0; } 100% { transform: translateY(670px); opacity: 0; } }

.hero-piece.is-live .hx-grid { animation: hx-grid 54s ease-in-out infinite; }
.hero-piece.is-live .hx-plane { animation: hx-plane 46s ease-in-out infinite; }
.hero-piece.is-live .hx-pub { animation: hx-pub 48s ease-in-out infinite; }
.hero-piece.is-live .hx-pub:nth-of-type(4n) { animation-delay: -2s; }
.hero-piece.is-live .hx-newpub { animation: hx-newpub 48s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hx-sheet.s4 { animation: hx-sheet 48s cubic-bezier(.35,.2,.2,1) infinite; }
.hero-piece.is-live .hx-doc { animation: hx-stack 48s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hx-regnew { animation: hx-regnew 48s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hx-cursor { animation: hx-cursor 48s cubic-bezier(.4,.2,.3,1) infinite; }
.hero-piece.is-live .hx-prio { animation: hx-prio 48s ease-in-out infinite; }
.hero-piece.is-live .hx-priorule { animation: hx-priorule 48s ease-in-out infinite; }
.hero-piece.is-live .hx-blk.k5 { animation: hx-blk 48s cubic-bezier(.3,.7,.3,1) infinite; }
.hero-piece.is-live .hx-mark { animation: hx-mark 48s cubic-bezier(.4,.2,.3,1) infinite; }
.hero-piece.is-live .hx-sweep { animation: hx-sweep 48s linear infinite; }

/* --- transicion: tres mini-sistemas, 18 s --------------------------------- */

.tr-types .tx-k { fill: #6b7480; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 2px; }

@keyframes tx-sheet-in { 0%, 4% { transform: translate(-46px, 18px); opacity: 0; } 18%, 92% { transform: translate(0, 0); opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes tx-ref { 0%, 20% { width: 0; } 32%, 82% { width: 150px; } 90%, 100% { width: 0; } }
@keyframes tx-dot1 { 0%, 16% { fill: #c9cac6; } 26%, 70% { fill: #1f8a76; } 78%, 100% { fill: #c9cac6; } }
@keyframes tx-step { 0%, 26% { fill: #c9cac6; } 36%, 62% { fill: #1f8a5e; } 70%, 100% { fill: #c9cac6; } }
@keyframes tx-next { 0%, 38% { width: 0; } 50%, 78% { width: 108px; } 86%, 100% { width: 0; } }
@keyframes tx-prev { 0%, 46% { opacity: 0.3; } 58%, 80% { opacity: 0.85; } 88%, 100% { opacity: 0.3; } }
@keyframes tx-seg { 0%, 54% { width: 0; } 66%, 92% { width: 170px; } 100% { width: 170px; } }
@keyframes tx-spk { 0%, 54% { opacity: 0.45; } 64%, 84% { opacity: 1; } 92%, 100% { opacity: 0.45; } }

.transition.is-live .tx-sheet { animation: tx-sheet-in 18s cubic-bezier(.3,.7,.3,1) infinite; }
.transition.is-live .tx-ref { animation: tx-ref 18s ease-in-out infinite; }
.transition.is-live .tx-dot1 { animation: tx-dot1 18s ease-in-out infinite; }
.transition.is-live .tx-step { animation: tx-step 18s ease-in-out infinite; }
.transition.is-live .tx-next { animation: tx-next 18s ease-in-out infinite; }
.transition.is-live .tx-prev { animation: tx-prev 18s ease-in-out infinite; }
.transition.is-live .tx-seg { animation: tx-seg 18s ease-in-out infinite; }
.transition.is-live .tx-spk { animation: tx-spk 18s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .hero-piece.is-live *, .transition.is-live * { animation: none !important; }
  .hero-piece .hx-sweep { opacity: 0 !important; }
  .transition .tx-sheet { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 900px) {
  .hero-piece.is-live .hx-pub, .hero-piece.is-live .hx-mark, .hero-piece.is-live .hx-sweep { animation: none !important; }
}

/* ------------------------------------------------- 2 · header mas ligero - */

.header-in { min-height: 64px; }
.site-header.is-stuck .header-in { min-height: 54px; }
.brand img { width: 164px; }
.site-header.is-stuck .brand img { width: 148px; }

/* ------------------------------------------------------ 3 · hero · copies - */

.hc { display: none; flex-direction: column; gap: var(--s6); }
.hc.is-active { display: flex; }
.hc-switch { display: none; align-items: center; gap: var(--s5); margin-top: var(--s4); }
.js .hc-switch { display: flex; }
.hc-label { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.hc-group { display: flex; gap: 6px; }

/* -------------------------------- 4 · transicion: tres tipos de informacion */

.tc { display: none; }
.tc.is-active { display: block; }
.tc-switch { display: none; align-items: center; gap: var(--s5); padding-top: var(--s4); }
.js .tc-switch { display: flex; }

.tr-types { display: block; width: 100%; height: auto; }

@keyframes t-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.motion .t-enter { animation: t-in 1.3s cubic-bezier(.2,.7,.3,1) both; }
.motion .t-enter.t1 { animation-delay: .15s; }
.motion .t-enter.t2 { animation-delay: .45s; }
.motion .t-enter.t3 { animation-delay: .75s; }

/* -------------------------------------- 5 · capacidades en media cards ---- */

.caps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s10) var(--s7); }
.cap { display: flex; flex-direction: column; gap: var(--s6); }

.cap-media {
  position: relative; margin: 0; overflow: hidden;
  aspect-ratio: 4 / 5; border-radius: 20px; background: var(--ivory);
}
.cap-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cap-overlay { position: absolute; inset: 0; pointer-events: none; }
.cap-overlay svg { display: block; width: 100%; height: 100%; }

.cap-body { display: flex; flex-direction: column; gap: var(--s4); }
.cap-line { max-width: 38ch; }

@keyframes cap-advance { from { transform: translateY(-4%); } to { transform: translateY(104%); } }
@keyframes cap-pulse { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }

.motion .cap-travel { animation: cap-advance 17s linear infinite; }
.motion .pulse { animation: cap-pulse 9s ease-in-out infinite; }
.motion .pulse.p2 { animation-delay: -3s; }
.motion .pulse.p3 { animation-delay: -6s; }
.motion .cap-dot { animation: cap-pulse 11s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .motion .t-enter, .motion .cap-travel, .motion .pulse, .motion .cap-dot { animation: none !important; }
}

/* ------------------------------------------------------------ 6 · movable - */

@media (max-width: 1080px) {
  .caps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s9) var(--s6); }
  .caps-grid .cap:nth-child(3) { grid-column: span 2; max-width: 52%; }
}

@media (max-width: 900px) {
  .header-in { min-height: 58px; }
  .site-header.is-stuck .header-in { min-height: 52px; }
  .brand img, .site-header.is-stuck .brand img { width: 144px; }

  .caps-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s10); }
  .caps-grid .cap:nth-child(3) { grid-column: 1 / -1; max-width: none; }
  .cap-media { border-radius: 18px; }
  .hc-switch, .tc-switch { flex-direction: column; align-items: flex-start; gap: var(--s3); }
}

/* ==========================================================================
   G.5 · LAS PIEZAS GENERADAS ENTRAN EN EL PROTOTIPO
   1) una sola superficie para las tres capacidades
   2) hero: composicion generada + capa de motion ligera encima
   3) transicion: composicion generada + capa de motion ligera encima
   4) Atlas: encuadre mayor, etiquetas sobre el mapa, sin controles
   ========================================================================== */

:root { --ivory: #f7f6f2; }

/* ------------------------------------------- 1 · superficie de las media -- */

.cap-media, .cap-media img { background: var(--ivory); }

/* ------------------------------------------- 2 · hero con la pieza real -- */

.piece {
  position: relative; height: clamp(320px, 46vh, 480px);
  background: var(--ivory);
}
.piece > .piece-img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.tr-fx path, .tr-fx circle, .tr-fx rect { vector-effect: non-scaling-stroke; }

/* ------------------------------------- 3 · transicion con la pieza real -- */

.tr-figure { position: relative; margin: 0; }
.tr-img { display: block; width: 100%; height: auto; background: var(--ivory); }
.tr-figure > svg.tr-fx {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; pointer-events: none;
}

.tr-fx .tg-step { opacity: 0.9; }
.tr-fx .tg-frame { opacity: 0.75; }
.tr-fx .tg-mark { opacity: 0.5; }

@keyframes g5tg-ref { 0%, 3% { width: 0; opacity: 0; } 12% { opacity: 1; } 24%, 92% { width: 118px; opacity: 1; } 98%, 100% { width: 118px; opacity: 0; } }
@keyframes g5tg-step { 0%, 8% { transform: translateX(0); opacity: 0; } 14% { opacity: 1; } 42% { opacity: 1; } 50%, 100% { transform: translateX(203px); opacity: 0; } }
@keyframes g5tg-halo { 0%, 44% { opacity: 0; } 54%, 70% { opacity: 0.7; } 78%, 100% { opacity: 0; } }
@keyframes g5tg-next { 0%, 56% { width: 0; } 66%, 88% { width: 96px; } 94%, 100% { width: 0; } }
@keyframes g5tg-frame { 0%, 62% { width: 0; } 80%, 96% { width: 223px; } 100% { width: 223px; } }
@keyframes g5tg-mark { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.is-live .tr-fx .tg-ref { animation: g5tg-ref 18s cubic-bezier(.3, .7, .3, 1) infinite; }
.is-live .tr-fx .tg-step { animation: g5tg-step 18s cubic-bezier(.3, .7, .3, 1) infinite; }
.is-live .tr-fx .tg-halo { animation: g5tg-halo 18s ease-in-out infinite; }
.is-live .tr-fx .tg-next { animation: g5tg-next 18s ease-in-out infinite; }
.is-live .tr-fx .tg-frame { animation: g5tg-frame 18s cubic-bezier(.3, .7, .3, 1) infinite; }
.is-live .tr-fx .tg-mark { animation: g5tg-mark 9s ease-in-out infinite; }
.is-live .tr-fx .tg-mark.m2 { animation-delay: -3s; }
.is-live .tr-fx .tg-mark.m3 { animation-delay: -6s; }

@media (prefers-reduced-motion: reduce) {
  .tr-fx * { animation: none !important; }
  .tr-fx .tg-halo { opacity: 0 !important; }
}

/* ----------------------------------------------- 4 · Atlas ajustado ----- */

.mapa .anillo-label {
  fill: #6b7480; paint-order: stroke; stroke: #f7f6f2; stroke-width: 3.5px;
  stroke-linejoin: round; font-size: 12px; letter-spacing: 1.7px;
}
.mapa .nodo-rol { font-size: 11px; letter-spacing: 0.2px; }
.mapa .nodo-nombre { font-size: 21px; }

/* ------------------------------------------------- 5 · responsive ------ */

@media (max-width: 900px) {
  .piece { height: 300px; }
  .piece > .piece-img { object-position: 42% 50%; }
}
@media (max-width: 640px) {
  .piece { height: 250px; }
  .piece > .piece-img { object-position: 40% 50%; }
}

/* ==========================================================================
   G.5.1 · PASADA FOCAL
   Integracion de la transicion, rutas internas preparadas y una sola
   gramatica de señal sobre las tres medias. G.5 queda intacto.
   ========================================================================== */

/* -------------------------------- transicion sobre el lienzo blanco ------- */

.tr-figure {
  background: #fff;
  isolation: isolate;
}
.tr-img {
  background: #fff;
  filter: brightness(1.06) saturate(.95);
}
.tr-fx { mix-blend-mode: multiply; }

/* -------------------------------- affordance de Atlas --------------------- */

.cap-media-link {
  display: block;
  cursor: pointer;
  transition: filter .22s ease;
}
.cap:hover .cap-media { transform: none; }
.cap-media-link:hover,
.cap-media-link:focus-visible { filter: contrast(1.015); }
.cap-title-link {
  color: inherit;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.cap-title-link:hover,
.cap-title-link:focus-visible { color: var(--navy); border-color: var(--navy); }

/* -------------------------------- capa vectorial comun -------------------- */

.cap-fx {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cap-fx circle { vector-effect: non-scaling-stroke; }
.cap-signal-dot {
  fill: #c5a06c;
  opacity: .76;
}
.cap-signal-hit {
  fill: none;
  stroke: #c5a06c;
  stroke-width: 1.4;
  opacity: 0;
}
.cap-signal-radar { fill: #1f8a76; }

/* Atlas: Salud -> Ministerio de Sanidad -> Consejo UE, relaciones existentes */
@keyframes cap-atlas-signal {
  0%, 8% { cx: 500px; cy: 500px; r: 1px; opacity: 0; }
  14% { cx: 500px; cy: 500px; r: 4px; opacity: .88; }
  42% { cx: 620px; cy: 315px; r: 4px; opacity: .88; }
  50% { cx: 620px; cy: 315px; r: 1px; opacity: 0; }
  58%, 64% { cx: 500px; cy: 500px; r: 1px; opacity: 0; }
  70% { cx: 500px; cy: 500px; r: 4px; opacity: .88; }
  94% { cx: 302px; cy: 596px; r: 4px; opacity: .88; }
  100% { cx: 302px; cy: 596px; r: 1px; opacity: 0; }
}
@keyframes cap-atlas-hit {
  0%, 38% { r: 7px; opacity: 0; }
  42%, 50% { r: 14px; opacity: .42; }
  54%, 100% { r: 7px; opacity: 0; }
}

/* Radar: sigue la diagonal de señal ya presente en la imagen */
@keyframes cap-radar-signal {
  0%, 8% { cx: 54px; cy: 1040px; r: 1px; opacity: 0; }
  14% { cx: 54px; cy: 1040px; r: 4px; opacity: .84; }
  66% { cx: 1086px; cy: 120px; r: 4px; opacity: .84; }
  74% { cx: 1086px; cy: 120px; r: 1px; opacity: 0; }
  100% { cx: 54px; cy: 1040px; r: 1px; opacity: 0; }
}
@keyframes cap-radar-hit {
  0%, 62% { r: 7px; opacity: 0; }
  66%, 74% { r: 14px; opacity: .34; }
  78%, 100% { r: 7px; opacity: 0; }
}

/* Directo: recorre el rail temporal y se detiene en dos marcas */
@keyframes cap-directo-signal {
  0%, 8% { cx: 500px; cy: 165px; r: 1px; opacity: 0; }
  14% { cx: 500px; cy: 165px; r: 4px; opacity: .84; }
  36% { cx: 500px; cy: 165px; r: 4px; opacity: .84; }
  58% { cx: 500px; cy: 813px; r: 4px; opacity: .84; }
  66% { cx: 500px; cy: 813px; r: 1px; opacity: 0; }
  74%, 80% { cx: 500px; cy: 813px; r: 1px; opacity: 0; }
  86% { cx: 500px; cy: 1050px; r: 4px; opacity: .84; }
  96% { cx: 500px; cy: 1050px; r: 4px; opacity: .84; }
  100% { cx: 500px; cy: 1050px; r: 1px; opacity: 0; }
}
@keyframes cap-directo-hit {
  0%, 54% { r: 7px; opacity: 0; }
  58%, 66% { r: 14px; opacity: .34; }
  70%, 100% { r: 7px; opacity: 0; }
}

.cap-media.is-live .cap-signal-atlas { animation: cap-atlas-signal 12s cubic-bezier(.35,.2,.25,1) infinite; }
.cap-media.is-live .cap-signal-atlas-hit { animation: cap-atlas-hit 12s ease-in-out infinite; }
.cap-media.is-live .cap-signal-radar { animation: cap-radar-signal 12s cubic-bezier(.35,.2,.25,1) infinite; }
.cap-media.is-live .cap-signal-radar-hit { animation: cap-radar-hit 12s ease-in-out infinite; }
.cap-media.is-live .cap-signal-directo { animation: cap-directo-signal 12s cubic-bezier(.35,.2,.25,1) infinite; }
.cap-media.is-live .cap-signal-directo-hit { animation: cap-directo-hit 12s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .cap-fx * { animation: none !important; }
  .cap-signal-hit { opacity: 0 !important; }
}

/* ==========================================================================
   Hero · primera ilustracion: limpia y estatica

   La pieza es solo su asset aprobado (.piece-img) dentro del mismo encuadre;
   no lleva ninguna capa SVG superpuesta ni animacion propia. Se deja una
   garantia explicita de cero motion por si alguna regla futura lo intentara.
   El resto de la pagina (transicion y capacidades) mantiene su motion.
   ========================================================================== */

.hero-piece, .hero-piece * { animation: none !important; }
