/* ==========================================================
   Cocobit — estilos del sitio
   Estilo: fondo gris claro, tarjetas blancas muy redondeadas,
   botones píldora en el color de marca y cifras grandes.
   Paleta "Carbón + Azul": grises carbón con azul de acento.
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Constantes (no cambian con el tema) */
  --carbon: #1E1E1E;            /* hero, bloques de código */
  --carbon-2: #262626;
  --carbon-3: #333333;
  --carbon-text: #E8E8E8;
  --carbon-muted: #9A9A9A;
  --azul: #3B82F6;
  --azul-2: #60A5FA;
  --azul-boton: #2563EB;        /* fondo de botones: blanco encima cumple 4.5:1 */
  --white: #FFFFFF;

  --bg-light: #F7F7F8;          --bg-dark: #1E1E1E;
  --surface-light: #FFFFFF;     --surface-dark: #262626;
  --tint-light: #E8F0FE;        --tint-dark: #1F2A40;      /* sección con tinte azul */
  --soft-light: #EEEEF0;        --soft-dark: #2E2E2E;      /* campos y chips */
  --text-light: #1E1E1E;        --text-dark: #E8E8E8;
  --muted-light: #5F5F66;       --muted-dark: #9A9A9A;
  --border-light: #E3E3E6;      --border-dark: #333333;
  --brand-ink-light: #1D4ED8;   --brand-ink-dark: #60A5FA; /* azul legible como texto */
  --brand-light: #2563EB;       --brand-dark: #2563EB;
  --on-brand-light: #FFFFFF;    --on-brand-dark: #FFFFFF;
  --hero-light: #1E1E1E;        --hero-dark: #262626;      /* bloque oscuro del hero */

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --tint: var(--tint-light);
  --soft: var(--soft-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --border: var(--border-light);
  --brand-ink: var(--brand-ink-light);
  --brand: var(--brand-light);
  --on-brand: var(--on-brand-light);
  --hero: var(--hero-light);

  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --tint: var(--tint-dark);
    --soft: var(--soft-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --border: var(--border-dark);
    --brand-ink: var(--brand-ink-dark);
    --brand: var(--brand-dark);
    --on-brand: var(--on-brand-dark);
    --hero: var(--hero-dark);
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --tint: light-dark(var(--tint-light), var(--tint-dark));
    --soft: light-dark(var(--soft-light), var(--soft-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --brand-ink: light-dark(var(--brand-ink-light), var(--brand-ink-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --on-brand: light-dark(var(--on-brand-light), var(--on-brand-dark));
    --hero: light-dark(var(--hero-light), var(--hero-dark));
  }

  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --radius-xl: 32px;
  --radius: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --pill: 999px;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;

  accent-color: var(--brand);
  scrollbar-color: var(--muted) var(--bg);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-size-adjust: from-font;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--brand-ink); text-underline-offset: .2em; }
img, svg { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--azul); color: var(--white); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: var(--pill);
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: clamp(56px, 9vw, 112px); }
.section.tinted { background: var(--tint); }
.section-head { max-width: 760px; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.eyebrow {
  display: inline-block; font-weight: 600; font-size: .95rem; color: var(--brand-ink); margin-bottom: .75rem;
}
.lead { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.5; color: var(--muted); }

/* ---------- Header / navegación ----------
   PC (.is-wide): logo + enlaces junto al logo, "Guías" abre un panel; a la derecha tema + botón píldora.
   Móvil (por defecto): logo + botón píldora + tema + ☰, que abre un panel a pantalla completa. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; gap: .5rem; min-height: var(--header-h); }
.header-inner > * { flex-shrink: 0; white-space: nowrap; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.45rem; letter-spacing: -0.03em;
  color: var(--text); text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.header-inner > .brand { margin-right: auto; }

.btn-icon, .menu-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-inline-size: 44px; min-block-size: 44px; padding: 0 .6rem;
  border: 0; border-radius: var(--pill);
  background: transparent; color: var(--text);
  font: 600 .95rem var(--font-sans); cursor: pointer;
}
.btn-icon:hover, .menu-button:hover { background: var(--soft); }
.btn-icon svg, .menu-button svg { width: 24px; height: 24px; }
.btn.header-cta { padding: .5rem 1.1rem; min-block-size: 42px; font-size: .95rem; }

/* Orden visual en móvil: logo · Instalar · tema · ☰ */
.header-inner > .header-cta { order: 1; }
.header-inner > .theme-toggle { order: 2; }
.header-inner > .site-nav { order: 3; }

.menu-main { list-style: none; margin: 0; padding: 0; }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--text); text-decoration: none; font: 500 1rem var(--font-sans);
  background: none; border: 0; cursor: pointer;
}
.nav-link[aria-current="page"], .dropdown-trigger[data-current] { color: var(--brand-ink); }
.chev { width: 16px; height: 16px; transition: rotate .2s ease; }
.dropdown-trigger[aria-expanded="true"] .chev { rotate: 180deg; }

.mega-title { margin: 0 0 .5rem; padding-inline: .75rem; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mega-link {
  display: flex; align-items: center; gap: .85rem; padding: .7rem .75rem;
  border-radius: var(--radius-md); color: var(--text); text-decoration: none;
}
.mega-link:hover { background: var(--soft); }
.mega-link[aria-current="page"] { background: var(--tint); }
.mega-link strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.mega-link small { display: block; color: var(--muted); font-size: .88rem; white-space: normal; }
.mega-icon {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px;
  background: var(--tint); color: var(--brand-ink);
}
.mega-icon svg { width: 22px; height: 22px; }

/* ---- Móvil: panel a pantalla completa ---- */
.site-header .menu-button { anchor-name: --menu-button; }
.site-menu[popover] {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0 var(--gutter) 2rem; border: 0;
  background: var(--bg); color: var(--text); overflow-y: auto;
  white-space: normal;
}
.site-menu[popover]::backdrop { background: transparent; }
:root:has(.site-menu[popover]:popover-open) { overflow: hidden; }
.menu-head { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.site-menu[popover] .menu-main { display: grid; gap: .25rem; padding-bottom: 1.5rem; }
.site-menu[popover] .dropdown-trigger { display: none; }
.site-menu[popover] .group-label { margin: .5rem 0 .5rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; }
.site-menu[popover] .dropdown-panel {
  display: grid; gap: 1.25rem; padding: 1rem .5rem; border-radius: var(--radius); background: var(--surface);
}
.site-menu[popover] > .menu-main > li > .nav-link {
  display: flex; justify-content: space-between; width: 100%; padding: 1rem .25rem;
  font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; border-bottom: 1px solid var(--border);
}
.site-menu[popover] > .menu-main > li > .dropdown-trigger { display: none; }
.site-menu[popover] .menu-cta { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .site-menu[popover] { transition: opacity .2s ease, translate .25s ease, display .25s allow-discrete, overlay .25s allow-discrete; }
  .site-menu[popover]:not(:popover-open) { opacity: 0; translate: 0 -12px; }
  @starting-style { .site-menu[popover]:popover-open { opacity: 0; translate: 0 -12px; } }
}

/* ---- PC: barra estilo Nu ---- */
.site-header.is-wide { --header-h: 80px; }
.site-header.is-wide .header-inner > .brand { margin-right: 1.5rem; }
.site-header.is-wide .header-inner > .site-nav { order: 0; flex: 1 0 auto; }
.site-header.is-wide .header-inner > .theme-toggle { order: 1; }
.site-header.is-wide .header-inner > .header-cta { order: 2; padding-inline: 1.4rem; }
.site-header.is-wide .menu-button,
.site-header.is-wide .menu-head,
.site-header.is-wide .group-label,
.site-header.is-wide .menu-cta { display: none; }
.site-header.is-wide .site-menu { display: block; position: static; }
.site-header.is-wide .menu-main { display: flex; align-items: center; gap: .25rem; }
.site-header.is-wide .menu-main > li > .nav-link { padding: .6rem .9rem; border-radius: var(--pill); }
.site-header.is-wide .menu-main > li > .nav-link:hover { background: var(--soft); }
.site-header.is-wide .nav-secondary { margin-left: auto; }
.site-header.is-wide .nav-dropdown { position: relative; }

/* Panel desplegable de "Guías" (popover anclado al botón) */
.site-header.is-wide .dropdown-panel[popover] {
  position: absolute; inset: auto;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-inline;
  height: auto; margin: .75rem 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 1.25rem;
  padding: 1.25rem; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); overflow: visible;
  box-shadow: 0 24px 60px rgb(0 0 0 / .16);
}
.site-header.is-wide .dropdown-panel::before {   /* puente para no perder el hover en el hueco */
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 100%; block-size: .75rem;
}
.site-header.is-wide .dropdown-panel:not(:is(:popover-open, .\:popover-open)) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .site-header.is-wide .dropdown-panel[popover] { transition: opacity .18s ease, translate .18s ease, display .18s allow-discrete, overlay .18s allow-discrete; }
  .site-header.is-wide .dropdown-panel[popover]:not(:popover-open) { opacity: 0; translate: 0 -6px; }
  @starting-style { .site-header.is-wide .dropdown-panel[popover]:popover-open { opacity: 0; translate: 0 -6px; } }
}
@supports not (position-area: block-end) {
  .site-header.is-wide .dropdown-panel[popover] { position: fixed; margin: 0; }
}
.is-measuring * { transition: none !important; }

@supports not selector(:popover-open) {
  .site-menu[popover]:not(.\:popover-open) { display: none; }
}

/* Selector de tema */
.theme-toggle .icon-moon, .theme-toggle .label-dark { display: inline; }
.theme-toggle .icon-sun, .theme-toggle .label-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(meta[name="color-scheme"][content="light"])) .theme-toggle .icon-moon,
  :root:not(:has(meta[name="color-scheme"][content="light"])) .theme-toggle .label-dark { display: none; }
  :root:not(:has(meta[name="color-scheme"][content="light"])) .theme-toggle .icon-sun,
  :root:not(:has(meta[name="color-scheme"][content="light"])) .theme-toggle .label-light { display: inline; }
}
:root:has(meta[name="color-scheme"][content="dark"]) .theme-toggle .icon-moon,
:root:has(meta[name="color-scheme"][content="dark"]) .theme-toggle .label-dark { display: none; }
:root:has(meta[name="color-scheme"][content="dark"]) .theme-toggle .icon-sun,
:root:has(meta[name="color-scheme"][content="dark"]) .theme-toggle .label-light { display: inline; }

/* ---------- Botones píldora ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-block-size: 52px; padding: .8rem 1.6rem;
  border-radius: var(--pill); border: 0;
  font: 600 1.02rem var(--font-sans); letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn-ghost { background: var(--soft); color: var(--text); }
.btn-ghost:hover { background: color-mix(in srgb, var(--soft) 85%, var(--text)); }
.btn-wide { width: 100%; justify-content: space-between; }
@media (prefers-reduced-motion: no-preference) { .btn:active { transform: scale(.98); } }
.btn svg { width: 20px; height: 20px; }

/* ---------- Hero oscuro con tarjeta superpuesta ---------- */
.hero {
  position: relative; overflow: hidden;
  margin-inline: clamp(0px, 1.5vw, 16px);
  padding-block: clamp(56px, 10vw, 120px) clamp(140px, 18vw, 200px);
  border-radius: var(--radius-xl);
  background: var(--hero); color: var(--carbon-text); color-scheme: dark;
}
.hero .eyebrow { color: var(--azul-2); }
.hero h1 { max-width: 13ch; color: #FFF; }
.hero .lead { max-width: 36rem; color: #B5B5B5; }
.hero-art {
  position: absolute; right: clamp(-60px, 2vw, 60px); bottom: clamp(-40px, -2vw, 20px);
  width: clamp(220px, 34vw, 460px); opacity: .4; pointer-events: none;
}
.hero-art img { width: 100%; border-radius: 22%; rotate: -8deg; }
@media (max-width: 720px) { .hero-art { opacity: .12; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: sway 7s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes sway { 50% { rotate: -11deg; translate: 0 -8px; } }
}

.hero-card-wrap { position: relative; z-index: 2; margin-top: clamp(-150px, -14vw, -110px); }
.hero-card {
  max-width: 640px; padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-xl); background: var(--surface);
  box-shadow: 0 30px 70px rgb(0 0 0 / .14);
}
.hero-card h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.hero-card .code { margin: 0 0 .9rem; }
.hero-card .btn { margin-top: .5rem; }

/* ---------- Cifras ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.stat { padding: 2rem; border-radius: var(--radius); background: var(--surface); }
.stat strong {
  display: block; font-size: clamp(3rem, 7vw, 4.5rem); font-weight: 600; letter-spacing: -0.04em;
  line-height: 1; color: var(--brand-ink); margin-bottom: .75rem;
}
.stat span { font-size: 1.1rem; font-weight: 500; }

/* ---------- Bloques de código ---------- */
.code {
  position: relative; margin: 1.25rem 0; text-align: left;
  border-radius: var(--radius-md); overflow: hidden;
  background: #161616; color: var(--carbon-text); color-scheme: dark;
  border: 1px solid var(--carbon-3);
}
.code-label {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .55rem .55rem .55rem 1.1rem; font: 600 .8rem var(--font-sans);
  color: var(--carbon-muted); border-bottom: 1px solid var(--carbon-3);
}
.code pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; font: .92rem/1.65 var(--font-mono); tab-size: 2; }
.code pre:focus-visible { outline-offset: -3px; }
:not(pre) > code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--soft); padding: .12em .45em; border-radius: 7px; white-space: nowrap;
}

.copy { position: relative; display: inline-flex; }
.copy-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-inline-size: 32px; min-block-size: 32px; padding: 0 .8rem;
  border: 0; border-radius: var(--pill);
  background: var(--carbon-2); color: var(--carbon-text); font: 600 .8rem var(--font-sans); cursor: pointer;
}
.copy-button:hover { background: var(--carbon-3); }
.copy-button svg { width: 15px; height: 15px; }
.copy-button .i-check { display: none; }
.copy-button[data-copied] .i-copy { display: none; }
.copy-button[data-copied] .i-check { display: inline; color: #7BE0A5; }
.copy .tip {
  position: absolute; right: calc(100% + .4rem); top: 50%; translate: 0 -50%;
  background: var(--azul-boton); color: var(--white); font: 600 .75rem var(--font-sans);
  padding: .25rem .65rem; border-radius: var(--pill); white-space: nowrap;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.copy .tip:not(:empty) { opacity: 1; }

/* ---------- Rutas ---------- */
.paths { display: grid; gap: 1rem; counter-reset: path; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.path {
  counter-increment: path; display: flex; flex-direction: column;
  padding: 2rem; border-radius: var(--radius); background: var(--surface);
}
.path::before {
  content: counter(path); display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%; margin-bottom: 1.5rem;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 1.2rem;
}
.path p { color: var(--muted); }
.path a {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 600; color: var(--brand-ink); text-decoration: none;
}
.path a:hover { text-decoration: underline; }
.path a svg { width: 18px; height: 18px; }

/* ---------- Tarjetas de herramientas ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: .6rem;
  padding: 1.75rem; border-radius: var(--radius); background: var(--surface);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; }
.card .card-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: var(--tint); color: var(--brand-ink); margin-bottom: .75rem;
}
.card .card-icon svg { width: 28px; height: 28px; }
.card a.stretched { color: var(--text); text-decoration: none; }
.card a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(a.stretched:focus-visible) { outline: 3px solid var(--brand); outline-offset: 3px; }
.card a.stretched:focus-visible { outline: none; }
.card:hover { box-shadow: 0 18px 40px rgb(0 0 0 / .10); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-4px); } }
.tag {
  align-self: flex-start; font-size: .78rem; font-weight: 600;
  padding: .25rem .7rem; border-radius: var(--pill); background: var(--soft); color: var(--muted);
}

/* ---------- Atajos ---------- */
.shortcuts {
  display: grid; gap: .5rem 2rem; padding: clamp(1rem, 3vw, 2rem);
  border-radius: var(--radius); background: var(--surface);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.shortcut { display: flex; gap: 1rem; align-items: baseline; padding: .9rem .25rem; border-bottom: 1px solid var(--border); }
.shortcut p { margin: 0; color: var(--muted); font-size: .98rem; }
kbd {
  display: inline-block; flex-shrink: 0; min-width: 2.4em; text-align: center;
  font: 600 .82rem var(--font-mono); padding: .3em .7em;
  border-radius: var(--pill); background: var(--tint); color: var(--brand-ink);
}

/* ---------- Tarjeta "Únete a Cocobit" (componente reutilizable) ---------- */
.jt-card {
  position: relative; display: flex; align-items: flex-start;
  width: 100%; min-height: 340px; padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.75rem, 5vw, 3.5rem) 5rem;
  border-radius: var(--radius-xl); background: var(--brand); overflow: hidden; isolation: isolate;
  color-scheme: light;
}
.jt-waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 64px; z-index: 0; }
.jt-circle {
  position: absolute; bottom: -20px; left: 50%; width: 20px; height: 20px; border-radius: 50%;
  background: var(--carbon); transform: translateX(-50%) scale(0);
  transition: transform 1.1s ease-in-out; z-index: 0;
}
.jt-card:hover .jt-circle, .jt-card:focus-within .jt-circle { transform: translateX(-50%) scale(130); }
.jt-coco {
  position: absolute; right: 6%; bottom: 28px; width: clamp(130px, 22vw, 220px); height: auto; z-index: 1;
  transform-origin: 50% 90%; transition: transform .9s ease-in-out;
}
.jt-card:hover .jt-coco, .jt-card:focus-within .jt-coco { transform: rotate(-7deg) translateY(-6px); }
.jt-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
.jt-title {
  font-size: clamp(2.6rem, 7vw, 4.25rem); line-height: 1; margin: 0;
  color: var(--white); transition: color .9s ease-in-out;
}
.jt-btn {
  display: inline-flex; align-items: center; gap: 12px; border-radius: var(--pill);
  background: var(--carbon); color: var(--white); padding: 10px 10px 10px 22px; min-block-size: 52px;
  font: 600 1rem var(--font-sans); text-decoration: none;
  transition: background .9s ease-in-out, color .9s ease-in-out;
}
.jt-btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.jt-btn::after { content: ""; position: absolute; inset: 0; }
.jt-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%;
  background: var(--white); color: var(--azul-boton);
  transition: background .9s ease-in-out, color .9s ease-in-out;
}
.jt-arrow svg { width: 18px; height: 18px; }
.jt-card:hover .jt-title, .jt-card:focus-within .jt-title { color: var(--white); }
.jt-card:hover .jt-btn, .jt-card:focus-within .jt-btn { background: var(--azul-boton); color: var(--white); }
.jt-card:hover .jt-arrow, .jt-card:focus-within .jt-arrow { background: var(--white); color: var(--azul-boton); }
@media (max-width: 560px) {
  .jt-card { min-height: 380px; }
  .jt-coco { width: 110px; right: 14px; bottom: auto; top: 14px; }
  .jt-title { max-width: 60%; }
}
@media (prefers-reduced-motion: reduce) {
  .jt-circle, .jt-title, .jt-btn, .jt-arrow, .jt-coco { transition-duration: .01s; }
  .jt-card:hover .jt-coco, .jt-card:focus-within .jt-coco { transform: none; }
}

/* ---------- Guías ---------- */
.page-hero {
  margin-inline: clamp(0px, 1.5vw, 16px);
  padding-block: clamp(40px, 7vw, 88px) clamp(36px, 6vw, 64px);
  border-radius: var(--radius-xl); background: var(--hero); color: var(--carbon-text); color-scheme: dark;
}
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); max-width: 16ch; color: #FFF; }
.page-hero .lead { max-width: 44rem; color: #B5B5B5; }
.page-hero .eyebrow { color: var(--azul-2); }
.page-hero code { background: rgb(255 255 255 / .1); color: #FFF; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.5rem; font-size: .92rem; color: var(--carbon-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; }
.breadcrumb a { color: #C8C8C8; text-decoration: none; }
.breadcrumb a:hover { color: #FFF; text-decoration: underline; }
.page-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-meta span { padding: .3rem .8rem; border-radius: var(--pill); background: rgb(255 255 255 / .08); color: #C8C8C8; font-size: .85rem; font-weight: 500; }

.doc { display: grid; gap: 2rem; padding-block: 2rem 5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .doc { grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; padding-top: 2.5rem; } }
.toc { font-size: .95rem; }
.toc details { border-radius: var(--radius); background: var(--surface); padding: 1rem 1.25rem; }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .15rem; }
.toc a { display: block; padding: .5rem .85rem; border-radius: var(--pill); color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--soft); }
.toc a[aria-current="true"] { color: var(--brand-ink); background: var(--tint); font-weight: 600; }
@media (min-width: 960px) {
  .toc > div { position: sticky; top: calc(var(--header-h) + 16px); }
  .toc summary { pointer-events: none; list-style: none; margin-bottom: .25rem; }
  .toc summary::-webkit-details-marker { display: none; }
}

.prose { min-width: 0; }
.prose > section {
  padding: clamp(1.5rem, 4vw, 2.75rem); margin-bottom: 1rem;
  border-radius: var(--radius); background: var(--surface);
}
.prose > section > :last-child { margin-bottom: 0; }
.prose > section > * { max-width: 70ch; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--brand-ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .96rem; }
.table-wrap { overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 600; background: var(--soft); }
.prose th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.prose th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.note { margin: 1.5rem 0; padding: 1.1rem 1.35rem; border-radius: var(--radius-md); background: var(--soft); }
.note p:last-child { margin: 0; }
.note.warn { background: var(--tint); }

.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 3.25rem; margin-bottom: 1.5rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 700;
}

/* Pestañas tipo píldora */
.tabs { margin: 1.25rem 0; }
.tablist {
  display: flex; gap: .35rem; overflow-x: auto; padding: .35rem; scrollbar-width: none;
  border-radius: var(--pill); background: var(--soft); width: fit-content; max-width: 100%;
}
.tablist > button {
  flex: none; padding: .6rem 1.2rem; border: 0; border-radius: var(--pill); background: none; cursor: pointer;
  font: 600 .96rem var(--font-sans); color: var(--muted);
}
.tablist > button:hover { color: var(--text); }
.tablist [aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / .08); }
.tab-panels { display: grid; grid-template-columns: minmax(0, 1fr); }
.tab-panels > [role="tabpanel"] { grid-area: 1 / 1; }
.tab-panels > [role="tabpanel"] > .panel-inner { padding-top: .75rem; }

.next-guide { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 1rem; }
.next-guide a {
  padding: 1.4rem 1.6rem; border-radius: var(--radius); background: var(--surface);
  text-decoration: none; color: var(--text); transition: box-shadow .2s;
}
.next-guide a:hover { box-shadow: 0 14px 30px rgb(0 0 0 / .10); }
.next-guide small { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.next-guide span { font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--brand-ink); }
.next-guide .next { text-align: right; }

/* ---------- Footer ---------- */
.site-footer {
  margin: clamp(32px, 6vw, 64px) clamp(0px, 1.5vw, 16px) clamp(0px, 1.5vw, 16px);
  padding-block: clamp(48px, 7vw, 80px) 2.5rem;
  border-radius: var(--radius-xl); background: var(--surface);
}
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.site-footer h2 { font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand-ink); }
.site-footer p { color: var(--muted); }
.site-footer .brand { color: var(--text); margin-bottom: 1rem; }
.disclaimer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .86rem; }

/* ---------- Impresión (cheatsheet) ---------- */
@media print {
  .site-header, .site-footer, .toc, .copy, .next-guide, .no-print { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .page-hero { background: none; color: black; }
  .page-hero h1 { color: black; }
  .code { background: #f6f6f6; color: black; }
  .shortcut, .card { break-inside: avoid; }
}

@media (forced-colors: active) {
  .tablist [aria-selected="true"] { outline: 2px solid Highlight; }
  .toc a[aria-current="true"] { outline: 2px solid Highlight; }
}
