/* SiAM Launcher · sitio público
   Marca SiAM: verde #009682 (acento), tinta #0E1116, papel #F6F4EF.
   Sin dependencias externas. Compatible con CSP estricta (sin estilos inline). */

/* Fuentes locales opcionales: si se copian a web/fonts/ se usan; si no, pila de sistema.
   local() evita descargas cuando la fuente ya está instalada. */
@font-face {
  font-family: "Space Grotesk";
  src: local("Space Grotesk"), local("SpaceGrotesk-Bold"), url("../fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: local("Inter"), local("Inter Regular"), url("../fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --green: #009682;
  --green-hover: #007F6E;
  --ink: #0E1116;
  --ink-2: #151A21;
  --ink-3: #1C222B;
  --white: #FFFFFF;
  --paper: #F6F4EF;
  --text: #3A424D;
  --text-soft: #5B6470;
  --on-dark: #E9ECEF;
  --on-dark-soft: #A9B1BB;
  --line: #E3DFD6;
  --line-dark: rgba(255, 255, 255, .1);

  --font-display: "Space Grotesk", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: Inter, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --shadow-lg: 0 30px 60px -20px rgba(14, 17, 22, .45), 0 12px 24px -12px rgba(14, 17, 22, .3);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.1; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
code, pre { font-family: var(--font-mono); font-size: .9em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
main:focus { outline: none; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.section-ink :focus-visible, .hero :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: #3CC7B2; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(860px + var(--gutter) * 2); }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--white); color: var(--ink); padding: 12px 18px; border-radius: var(--r-sm);
  font-weight: 700; text-decoration: none; box-shadow: var(--shadow-lg);
}
.skip:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.3em; border-radius: var(--r-md);
  font-family: var(--font-text); font-weight: 700; font-size: 1.1875rem; line-height: 1.1;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
/* Verde de marca con texto blanco: siempre en negrita y ≥19px (texto grande WCAG). */
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-hover); }
.btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .03); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .08); }
.btn-lg { min-height: 56px; padding: .8em 1.5em; }
.btn-sm { min-height: 44px; padding: .5em 1em; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer;
  transition: border-color .2s, background-color .2s, opacity .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--line); }

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  background: rgba(14, 17, 22, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line-dark); background: rgba(14, 17, 22, .86); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding: 6px 0; }
.brand img { width: 132px; height: auto; }
.brand-tag {
  font-family: var(--font-display); color: var(--on-dark-soft); font-size: .95rem; font-weight: 500;
  letter-spacing: .02em; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .18); line-height: 1.6;
}
.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { list-style: none; display: flex; gap: 4px; }
.nav ul a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--on-dark); text-decoration: none; font-size: .975rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.nav ul a:hover { background: rgba(255, 255, 255, .07); color: var(--white); }
.nav-cta { font-size: 1.1875rem; }
.nav-toggle {
  display: none; width: 48px; height: 48px; border-radius: var(--r-md); border: 1px solid rgba(255, 255, 255, .2);
  background: transparent; color: var(--white); cursor: pointer; place-items: center;
}
.nav-toggle .icon { width: 24px; height: 24px; }

@media (max-width: 899px) {
  .js .nav-toggle { display: inline-grid; }
  .js .nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px var(--gutter) 24px; background: var(--ink); border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 24px 40px rgba(0, 0, 0, .4);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
  }
  .js .nav.is-ready { transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s; }
  .js .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .js .nav.is-ready.is-open { transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .js .nav ul { flex-direction: column; gap: 2px; }
  .js .nav ul a { min-height: 52px; font-size: 1.125rem; padding: 0 12px; }
  /* Sin JS: la navegación se muestra en una fila desplazable. */
  html:not(.js) .site-header { position: static; height: auto; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  html:not(.js) .nav { flex-wrap: wrap; gap: 8px; }
  html:not(.js) .nav ul { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .brand-tag { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(1200px 600px at 75% 30%, #18202A 0%, var(--ink) 60%);
  color: var(--on-dark);
  padding: calc(var(--header-h) + clamp(40px, 7vw, 96px)) 0 clamp(64px, 8vw, 112px);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-modules { position: absolute; height: auto; }
.hero-modules-a { width: clamp(220px, 26vw, 380px); top: calc(var(--header-h) + 8px); right: clamp(-160px, -8vw, -60px); }
.hero-modules-b { width: clamp(140px, 16vw, 240px); bottom: -48px; left: clamp(-60px, -2vw, -20px); }
.hero-modules .mod rect { fill: none; stroke: rgba(255, 255, 255, .055); stroke-width: 1.2; }
.hero-modules .mod-accent { fill: var(--green); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  font-size: .9rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(0, 150, 130, .18); }
.hero h1 { color: var(--white); font-size: clamp(2.6rem, 6.2vw, 5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; margin-bottom: 24px; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--on-dark-soft); max-width: 34em; margin-bottom: 36px; line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 22px; font-size: .95rem; color: var(--on-dark-soft); }
.hero-note strong { color: var(--white); font-weight: 600; }
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 22px; min-width: 0; }

.segmented {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.segmented [role="tab"] {
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: transparent;
  color: var(--on-dark-soft); font-weight: 600; font-size: .975rem; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.segmented [role="tab"]:hover { color: var(--white); }
.segmented [role="tab"][aria-selected="true"] { background: var(--white); color: var(--ink); }

/* ---------- Marco de TV ---------- */
.tv { margin: 0; width: 100%; position: relative; display: flex; flex-direction: column; }
.tv > .tv-screen { order: 1; }
.tv::after { order: 2; }
.tv > figcaption { order: 3; }
.tv-screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: #05070A;
  border-radius: 12px;
  /* Bisel fino: borde interior oscuro + filo exterior iluminado */
  box-shadow:
    0 0 0 clamp(5px, .7vw, 9px) #0A0C10,
    0 0 0 calc(clamp(5px, .7vw, 9px) + 1px) #2B323C,
    var(--shadow-lg);
}
.tv-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Reflejo sutil del cristal */
.tv-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .02) 32%, rgba(255, 255, 255, 0) 33%);
}
/* Peana discreta */
.tv::after {
  content: ""; display: block; margin: clamp(10px, 1.2vw, 16px) auto 0;
  width: 26%; height: clamp(6px, .7vw, 9px); border-radius: 0 0 8px 8px;
  background: linear-gradient(#2B323C, #151A21);
  box-shadow: 0 10px 18px -6px rgba(0, 0, 0, .45);
}
.tv figcaption { margin-top: 18px; text-align: center; font-size: .95rem; color: var(--text-soft); }
.tv figcaption strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 2px; }
.section-ink .tv figcaption { color: var(--on-dark-soft); }
.section-ink .tv-screen, .hero .tv-screen {
  box-shadow:
    0 0 0 clamp(5px, .7vw, 9px) #07090C,
    0 0 0 calc(clamp(5px, .7vw, 9px) + 1px) #363E49,
    0 40px 80px -24px rgba(0, 0, 0, .8), 0 0 120px -30px rgba(0, 150, 130, .25);
}
.tv-hero { max-width: 680px; }

.shot { opacity: 0; visibility: hidden; transition: opacity .55s var(--ease), visibility 0s linear .55s; }
.shot.is-active { opacity: 1; visibility: visible; transition: opacity .55s var(--ease), visibility 0s; }
html:not(.js) .shot-sin { display: none; }
html:not(.js) .shot-con { opacity: 1; }

/* ---------- Tocar para ampliar ---------- */
.tv-screen .zoom { position: absolute; inset: 0; display: block; cursor: zoom-in; color: inherit; -webkit-tap-highlight-color: transparent; }
.zoom:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.zoom-hint {
  position: absolute; right: 10px; bottom: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 11px 0 9px; border-radius: 999px;
  background: rgba(8, 10, 14, .72); color: #fff; font-size: .8125rem; font-weight: 600; line-height: 1;
  border: 1px solid rgba(255, 255, 255, .22); pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .2s var(--ease);
}
.zoom-hint .icon { width: 18px; height: 18px; flex: none; }
.zh-touch { display: none; }
.zh-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .zoom-hint { opacity: .85; padding-right: 9px; }
  .zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; padding-right: 11px; }
  .zoom:hover .zh-mouse, .zoom:focus-visible .zh-mouse { display: inline; }
}
@media (hover: none), (pointer: coarse) {
  .zh-touch { display: inline; }
}

/* Visor a pantalla completa (<dialog>): se crea desde js/site.js */
html.lb-open { overflow: hidden; }
.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #05070A; color: #fff; overflow: hidden;
}
.lb[open] { display: flex; flex-direction: column; animation: lb-in .2s var(--ease); }
.lb::backdrop { background: #05070A; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; flex: none; }
.lb-title { margin: 0; min-width: 0; color: #fff; font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-help { display: none; margin: 0; padding: 0 16px 8px; color: var(--on-dark-soft); font-size: .875rem; flex: none; }
.lb-close {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff;
}
.lb-close:hover { background: rgba(255, 255, 255, .2); }
.lb-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close .icon { width: 24px; height: 24px; }
.lb-scroll {
  flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; padding: 0 12px 12px; cursor: zoom-out;
  overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch;
}
.lb-img {
  display: block; margin: auto; flex: none; cursor: default; background: #0A0C10;
  max-width: 100%; max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px);
  box-shadow: 0 0 0 1px #2B323C, 0 24px 60px -20px rgba(0, 0, 0, .8);
}
@media (hover: none), (pointer: coarse) { .lb-help { display: block; } .lb-img { max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); } }
/* En pantallas estrechas la captura se muestra más ancha que la pantalla: se desliza o se pellizca para acercar. */
@media (max-width: 899px) {
  .lb-img { width: max(960px, 100%); max-width: none; max-height: none; height: auto; }
}

/* ---------- Cifras ---------- */
.stats { background: var(--ink-2); color: var(--on-dark); border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.stats-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-list li { padding: clamp(24px, 3vw, 36px) clamp(12px, 2vw, 28px); display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line-dark); }
.stats-list li:first-child { border-left: 0; padding-left: 0; }
.stat-num { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; color: var(--white); letter-spacing: -.02em; line-height: 1.1; }
.stat-num small { font-size: .55em; font-weight: 600; letter-spacing: 0; color: var(--on-dark); }
.stats-list span { color: var(--on-dark-soft); font-size: .975rem; line-height: 1.35; }

/* ---------- Secciones ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-paper { background: var(--paper); }
.section-white { background: var(--white); }
.section-ink { background: var(--ink); color: var(--on-dark-soft); }
.section-ink h2, .section-ink h3 { color: var(--white); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head-center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; margin-bottom: 16px; }
.section-lead { font-size: clamp(1.075rem, 1.4vw, 1.2rem); color: var(--text-soft); }
.section-ink .section-lead { color: var(--on-dark-soft); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.kicker::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--green); }
.kicker-dark { color: var(--white); }
.section-head-center .kicker { justify-content: center; }
.small { font-size: .925rem; color: var(--text-soft); }
.section-ink .small { color: var(--on-dark-soft); }

/* ---------- Funciones ---------- */
.features { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 24px; display: flex; flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(14, 17, 22, .35); border-color: #D6D1C6; }
.feature-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--ink); color: var(--white); margin-bottom: 20px;
}
.feature-icon .icon { width: 24px; height: 24px; }
.feature h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.feature p { font-size: .975rem; color: var(--text); line-height: 1.55; }
.feature-wide { grid-column: span 2; }
.feature-wide h3 { font-size: 1.4rem; }
.feature-wide p { font-size: 1.0125rem; max-width: 46ch; }
.feature-dark { background: var(--ink); border-color: var(--ink); color: var(--on-dark-soft); }
.feature-dark:hover { border-color: var(--ink); }
.feature-dark h3 { color: var(--white); }
.feature-dark p { color: var(--on-dark-soft); }
.feature-dark .feature-icon { background: var(--white); color: var(--ink); }
.feature-note { margin-top: auto; padding-top: 12px; font-size: .9rem !important; color: var(--text-soft) !important; }
.feature p + .feature-note { margin-top: auto; }

/* ---------- Mando ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.split-copy h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin-bottom: 20px; }
.split-copy > p { font-size: 1.075rem; }
.remap { list-style: none; display: grid; gap: 12px; margin: 28px 0; }
.remap li {
  display: grid; grid-template-columns: 7.75rem 22px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 16px; row-gap: 2px;
  padding: 14px 18px; border-radius: var(--r-md); background: var(--ink-3); border: 1px solid var(--line-dark);
}
.key {
  grid-row: 1 / span 2; justify-self: start; font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--white);
  padding: 8px 14px; border-radius: 999px; background: #2A313B; border: 1px solid #3A424D;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35); white-space: nowrap;
}
.remap-arrow { grid-row: 1 / span 2; color: var(--green); width: 22px; height: 22px; }
.remap-after { grid-column: 3; color: var(--white); font-weight: 700; font-size: 1.1rem; line-height: 1.3; align-self: end; }
.remap-before { grid-column: 3; color: #8E97A3; font-size: .9rem; line-height: 1.35; align-self: start; }
.muted-dark { font-size: .95rem; color: var(--on-dark-soft); }

/* ---------- Carrusel ---------- */
.carousel {
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; margin: 0 calc(50% - 50vw) 0 calc(var(--gutter) * -1); padding: 8px var(--gutter) 24px;
  scroll-padding: 0 var(--gutter);
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { outline-offset: -3px; }
.carousel-track { list-style: none; display: flex; gap: clamp(28px, 4vw, 56px); }
.slide { flex: 0 0 min(760px, 82%); scroll-snap-align: start; padding: 12px 10px 0; }
.slide:last-child { margin-right: max(var(--gutter), calc(50vw - 50% - 10px)); }
.carousel-controls { display: flex; gap: 10px; flex: none; }
.carousel-dots { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.carousel-dots button {
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.carousel-dots button::before {
  content: ""; width: 10px; height: 10px; border-radius: 999px; background: #C9C4B8; transition: width .25s var(--ease), background-color .25s;
}
.carousel-dots button[aria-current="true"]::before { width: 28px; background: var(--ink); }

/* ---------- Flujo de actualización ---------- */
.flow {
  list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
  position: relative; counter-reset: paso;
}
.flow::before {
  content: ""; position: absolute; top: 32px; left: 8%; right: 8%; height: 2px;
  background: repeating-linear-gradient(90deg, #C9C4B8 0 8px, transparent 8px 14px);
}
.flow-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; counter-increment: paso; }
.flow-icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-lg);
  background: var(--white); border: 1px solid var(--line); color: var(--ink); margin-bottom: 10px;
  box-shadow: 0 8px 20px -12px rgba(14, 17, 22, .3); position: relative;
}
.flow-icon::after {
  content: counter(paso); position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--white); font-size: .75rem; font-weight: 700; display: grid; place-items: center;
  font-family: var(--font-text);
}
.flow-icon .icon { width: 28px; height: 28px; }
.flow-step-end .flow-icon { background: var(--ink); color: var(--white); border-color: var(--ink); }
.flow-step-end .flow-icon .icon { color: #3CC7B2; }
.flow-step-end .flow-icon::after { background: var(--green); }
.flow-step strong { font-family: var(--font-display); color: var(--ink); font-size: 1.05rem; line-height: 1.2; }
.flow-step span:last-child { color: var(--text-soft); font-size: .9rem; line-height: 1.35; }
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(40px, 5vw, 56px); max-width: 820px; margin-left: auto; margin-right: auto; }
.channel { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; background: var(--white); border-radius: var(--r-lg); border: 1px solid var(--line); }
.channel p { font-size: .975rem; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  line-height: 1.5; vertical-align: middle;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-stable { background: rgba(0, 150, 130, .12); color: var(--ink); border: 1px solid rgba(0, 150, 130, .45); }
.badge-stable::before { background: var(--green); }
.badge-beta { background: #FFF4D6; color: #5C4300; border: 1px solid #E8C766; }
.section-ink .badge-stable { color: var(--white); background: rgba(0, 150, 130, .18); }
.section-ink .badge-beta { background: rgba(232, 199, 102, .14); color: #F3D98A; border-color: rgba(232, 199, 102, .4); }

/* ---------- Descarga ---------- */
.dl-card {
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line-dark);
  border-radius: 20px; padding: clamp(20px, 3vw, 36px); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8);
}
.dl-tabs {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; margin-bottom: 28px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-dark);
}
.dl-tabs [role="tab"], .inst-tabs [role="tab"] { cursor: pointer; }
.dl-tabs [role="tab"] {
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: transparent;
  color: var(--on-dark-soft); font-weight: 600; transition: background-color .2s, color .2s;
}
.dl-tabs [role="tab"]:hover { color: var(--white); }
.dl-tabs [role="tab"][aria-selected="true"] { background: var(--white); color: var(--ink); }
.dl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; }
.dl-head .btn { flex: none; }
.dl-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.dl-title img { width: 64px; height: 64px; border-radius: 14px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.dl-name { font-family: var(--font-display); color: var(--white); font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 700; line-height: 1.15; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.dl-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; color: var(--on-dark); font-size: .9rem; }
.dl-meta li { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-dark); line-height: 1.5; }
.dl-notes { margin-top: 24px; padding: 18px 20px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-dark); }
.dl-notes h3 { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-soft); font-family: var(--font-text); font-weight: 700; margin-bottom: 8px; }
.dl-notes p { color: var(--on-dark); white-space: pre-line; font-size: 1rem; }
.hash { margin-top: 20px; }
.hash-label { display: block; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-soft); font-weight: 700; margin-bottom: 8px; }
.hash-row { display: flex; gap: 10px; align-items: stretch; }
.hash code {
  flex: 1; min-width: 0; display: block; padding: 12px 14px; border-radius: var(--r-sm);
  background: #07090C; border: 1px solid var(--line-dark); color: #CFE9E4; font-size: .875rem;
  overflow-wrap: anywhere; word-break: break-all; line-height: 1.5;
}
.dl-msg { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px dashed rgba(255, 255, 255, .18); color: var(--on-dark); }
.dl-msg .icon { color: var(--on-dark-soft); margin-top: 2px; }
.dl-msg a { color: var(--white); }
.dl-loading p { color: var(--on-dark-soft); }
.dl-loading::before {
  content: ""; display: block; height: 64px; border-radius: var(--r-md); margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: var(--white);
  font-size: .925rem; font-weight: 600; transition: background-color .2s, border-color .2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); }
.copy-btn.is-done { border-color: var(--green); }
.copy-btn .icon { width: 18px; height: 18px; }

.sig { margin-top: 20px; border-radius: var(--r-lg); border: 1px solid var(--line-dark); background: var(--ink-2); }
.sig summary {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px 20px; cursor: pointer;
  color: var(--white); font-weight: 600; list-style: none; border-radius: var(--r-lg);
}
.sig summary::-webkit-details-marker { display: none; }
.sig summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; font-weight: 400; color: var(--on-dark-soft); line-height: 1; }
.sig[open] summary::after { content: "−"; }
.sig-body { padding: 0 20px 22px; }
.sig-body p { font-size: .975rem; }
.sig-body strong { color: var(--white); }
.sig-list { margin: 18px 0; display: grid; gap: 14px; }
.sig-list dt { font-size: .875rem; color: var(--on-dark-soft); margin-bottom: 6px; font-weight: 600; }
.sig-list dd { margin: 0; }
.fp {
  display: block; padding: 12px 14px; border-radius: var(--r-sm); background: #07090C; border: 1px solid var(--line-dark);
  color: #CFE9E4; font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; word-break: break-all;
}
.sig-body code:not(.fp) { color: var(--on-dark); background: rgba(255, 255, 255, .06); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }

/* ---------- Instalar ---------- */
.inst { background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.inst-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #FBFAF7; }
.inst-tabs [role="tab"] {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 12px 16px;
  border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-soft); font-weight: 600; font-size: 1rem; text-align: left;
  transition: color .2s, background-color .2s, border-color .2s;
}
.inst-tabs [role="tab"] + [role="tab"] { border-left: 1px solid var(--line); }
.inst-tabs [role="tab"]:hover { color: var(--ink); background: var(--white); }
.inst-tabs [role="tab"][aria-selected="true"] { color: var(--ink); background: var(--white); border-bottom-color: var(--green); }
.inst-tabs em { font-style: normal; font-size: .8rem; color: var(--text-soft); display: block; font-weight: 500; }
.inst-panel { padding: clamp(22px, 4vw, 44px); }
.inst-title { font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.js .inst-title { display: none; }
html:not(.js) .inst-tabs { display: none; }
html:not(.js) .inst-panel + .inst-panel { border-top: 1px solid var(--line); }
.inst-panel > p { max-width: 70ch; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 18px; margin-top: 20px; max-width: 820px; }
.steps > li { counter-increment: s; position: relative; padding-left: 48px; min-height: 32px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.steps a, .inst-panel a { color: var(--ink); font-weight: 600; text-decoration-color: var(--green); text-decoration-thickness: 2px; }
.inst-panel code:not(pre code) { white-space: nowrap; background: #F1EEE7; color: var(--ink); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.code {
  position: relative; display: flex; gap: 10px; align-items: flex-start; margin-top: 12px;
  background: var(--ink); border-radius: var(--r-md); padding: 6px 6px 6px 0;
}
.code pre { flex: 1; min-width: 0; margin: 0; padding: 12px 16px; overflow-x: auto; color: #E9ECEF; font-size: .9rem; line-height: 1.6; }
.code pre code { background: none; padding: 0; color: inherit; }
.code .copy-btn { margin: 4px 0; }
.callout {
  display: flex; gap: 16px; margin-top: 24px; padding: 22px 24px; border-radius: var(--r-lg);
  background: #FFF8E6; border: 1px solid #EBD9A6; color: #3F3519;
}
.callout .icon { width: 24px; height: 24px; color: #8A6A10; margin-top: 2px; }
.callout strong { color: #2B2410; }
.callout p { font-size: 1rem; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: #CFC9BC; box-shadow: 0 14px 30px -22px rgba(14, 17, 22, .4); }
.faq summary {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 16px 22px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); list-style: none; border-radius: var(--r-lg);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; flex: none; width: 12px; height: 12px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-3px) rotate(45deg);
  transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq details p { padding: 0 22px 20px; margin: 0; max-width: 68ch; }
.faq code { background: #F1EEE7; color: var(--ink); padding: 2px 6px; border-radius: 4px; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: var(--on-dark-soft); padding: 56px 0 48px; border-top: 1px solid var(--line-dark); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand img { width: 140px; height: auto; }
.footer-brand p { font-size: .95rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -12px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--on-dark); text-decoration: none; border-radius: var(--r-sm); }
.footer-links a:hover { background: rgba(255, 255, 255, .07); }
.footer-version { width: 100%; font-size: .9rem; padding-top: 24px; border-top: 1px solid var(--line-dark); }
.footer-version strong { color: var(--on-dark); font-weight: 600; }

/* ---------- Animaciones de entrada (solo con JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .features .reveal:nth-child(4n+2) { transition-delay: .06s; }
.js .features .reveal:nth-child(4n+3) { transition-delay: .12s; }
.js .features .reveal:nth-child(4n+4) { transition-delay: .18s; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-wide { grid-column: span 2; }
  .features .feature:nth-child(7), .features .feature:nth-child(8) { grid-column: auto; }
  .js .features .reveal:nth-child(n) { transition-delay: 0s; }
  .js .features .reveal:nth-child(2n) { transition-delay: .06s; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 680px; }
  .hero-visual { margin-top: 8px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split .tv { max-width: 720px; margin: 0 auto; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
  .flow::before { display: none; }
}
@media (max-width: 899px) {
  .stats-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-list li:nth-child(3) { border-left: 0; padding-left: 0; }
  .stats-list li:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
  .stats-list li:nth-child(2n) { padding-right: 0; }
}
@media (max-width: 699px) {
  body { font-size: 1rem; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .feature-wide { grid-column: auto; }
  .feature-wide h3 { font-size: 1.2rem; }
  .feature { padding: 22px 20px; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .feature-icon { width: 44px; height: 44px; margin: 0; }
  .feature > p { grid-column: 1 / -1; margin-top: 12px; margin-bottom: 0; }
  .feature-note { padding-top: 0; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
  .carousel-controls { display: none; }
  .zoom-hint { min-height: 30px; right: 8px; bottom: 8px; font-size: .75rem; padding: 0 10px 0 8px; }
  .zoom-hint .icon { width: 16px; height: 16px; }
  .slide { flex-basis: 88%; padding: 10px 6px 0; }
  .carousel-track { gap: 20px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flow::before { display: block; top: 32px; bottom: 32px; left: 31px; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, #C9C4B8 0 8px, transparent 8px 14px); }
  .flow-step { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 18px; row-gap: 2px; text-align: left; align-items: center; padding: 10px 0; }
  .flow-icon { grid-row: 1 / span 2; margin: 0; }
  .flow-step strong { align-self: end; }
  .flow-step span:last-child { align-self: start; }
  .channels { grid-template-columns: minmax(0, 1fr); }
  .channel { flex-direction: column; gap: 10px; }
  .inst-tabs { grid-template-columns: minmax(0, 1fr); }
  .inst-tabs [role="tab"] { justify-content: flex-start; min-height: 56px; }
  .inst-tabs [role="tab"] + [role="tab"] { border-left: 0; border-top: 1px solid var(--line); }
  .inst-tabs [role="tab"][aria-selected="true"] { border-bottom-color: transparent; box-shadow: inset 4px 0 0 var(--green); }
  .inst-tabs em { display: inline; margin-left: 6px; }
  .remap li { grid-template-columns: auto 20px minmax(0, 1fr); column-gap: 12px; padding: 12px 14px; }
  .key { font-size: .875rem; padding: 7px 12px; }
  .hash-row { flex-direction: column; }
  .dl-title { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dl-title img { width: 52px; height: 52px; border-radius: 12px; }
  .dl-head .btn { width: 100%; }
  .hero-modules-a { width: 220px; right: -110px; top: calc(var(--header-h) - 16px); }
  .carousel { padding-bottom: 8px; }
  .callout { flex-direction: column; gap: 10px; padding: 20px; }
  .steps > li { padding-left: 42px; }
  .steps > li::before { width: 30px; height: 30px; }
  .inst-panel { padding: 22px 16px 24px; }
  .steps .code { margin-left: -42px; }
  .code { flex-direction: column; align-items: stretch; padding: 6px; }
  .code .copy-btn { align-self: flex-end; margin: 0; }
  .code pre { padding: 10px 10px 4px; }
  .cta-row .btn { flex: 1 1 100%; }
  .dl-tabs { display: flex; }
  .dl-tabs [role="tab"] { flex: 1; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .remap li { grid-template-columns: 20px minmax(0, 1fr); grid-template-rows: auto auto auto; row-gap: 2px; }
  .remap li .key { grid-column: 1 / -1; grid-row: 1; margin-bottom: 10px; }
  .remap-arrow { grid-column: 1; grid-row: 2 / span 2; width: 20px; height: 20px; }
  .remap-after { grid-column: 2; grid-row: 2; }
  .remap-before { grid-column: 2; grid-row: 3; }
}
@media (max-width: 380px) {
  .stats-list { grid-template-columns: minmax(0, 1fr); }
  .stats-list li { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line-dark); }
  .stats-list li:first-child { border-top: 0; }
  .segmented [role="tab"] { padding: 0 14px; font-size: .925rem; }
}

/* Pantallas grandes (TV / 4K): escala tipográfica algo mayor */
@media (min-width: 1800px) {
  html { font-size: 112.5%; }
  :root { --wrap: 1360px; }
}

/* ---------- Preferencias ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  .feature:hover { transform: none; }
}
/* prefers-color-scheme: la página es oscura+papel por marca y se ve igual en ambos modos;
   la cabecera, el héroe, la descarga y el pie ya son oscuros. */
@media (forced-colors: active) {
  .btn, .segmented [role="tab"], .dl-tabs [role="tab"], .copy-btn, .icon-btn { border: 1px solid ButtonText; }
  .tv-screen { outline: 2px solid CanvasText; }
}
@media print {
  .site-header, .hero-bg, .carousel-controls, .carousel-dots, .copy-btn { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
