/* =========================================================
   Side Effects — misma línea visual que roivazquezmorandeira.es
   ========================================================= */
:root {
  --ink: #111111;
  --muted: #777777;
  --line: #d9d9d9;
  --line-2: #ececec;
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --red: #e23a2e;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --serif: 'Source Serif Pro', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --gutter: clamp(16px, 4vw, 64px);
  --row-pad: clamp(18px, 2.2vw, 28px);
  --frame-pad: clamp(28px, 5vh, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f3ef; --muted: #8a8a85; --line: #2a2a28; --line-2: #1f1f1d;
    --bg: #141414; --bg-elev: #1c1c1c; --red: #ff5a4d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f4f3ef; --muted: #8a8a85; --line: #2a2a28; --line-2: #1f1f1d;
  --bg: #141414; --bg-elev: #1c1c1c; --red: #ff5a4d; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
img { max-width: 100%; display: block; }

/* ----------- MARCO ----------- */
.app {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin: var(--frame-pad) 0;
}
.left { padding: 36px var(--gutter) 28px; border-bottom: 1px solid var(--ink); }
.right { padding: 0 var(--gutter); }
.right__inner { max-width: 880px; margin: 0 auto; padding-bottom: 12vh; }

@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: minmax(340px, 34%) 1fr;
    height: calc(100dvh - var(--frame-pad) * 2);
  }
  .left {
    height: 100%; padding: 56px var(--gutter); border-bottom: 0;
    border-right: 1px solid var(--ink);
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    overflow-y: auto; scrollbar-width: none;
  }
  .right { height: 100%; overflow-y: auto; scrollbar-width: thin; scroll-behavior: smooth; }
  .right__inner { padding-bottom: 25vh; }
}

/* ----------- COLUMNA IZQUIERDA ----------- */
.back {
  display: inline-block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
}
.name {
  font-size: clamp(40px, 5.2vw, 66px); line-height: .88; font-weight: 800;
  letter-spacing: -.045em; margin: 0 0 18px;
}
.name em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; color: var(--red); }
.role { margin: 0; font-size: 14px; }
.tagline { margin: 2px 0 0; color: var(--red); font-size: 14px; }
.intro { margin: 24px 0 0; max-width: 40ch; font-size: 14px; color: var(--ink); }
.intro p { margin: 0 0 10px; }

.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin: 22px 0 18px; }
.tabs__btn { font-size: 13px; letter-spacing: .06em; padding: 4px 1px; transition: color 140ms ease; }
.tabs__btn:hover:not(.is-active) { color: var(--muted); }
.tabs__btn.is-active { color: var(--red); font-style: italic; }
.tabs__sep { display: none; }
.tabs { column-gap: 16px; }

.foot {
  font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px;
  padding-top: 16px; border-top: 1px solid var(--line-2); margin-top: 24px;
}
.foot a { color: var(--ink); }
.foot a:hover { color: var(--red); }

/* ----------- LISTA DE PROYECTOS ----------- */
.list { padding-top: clamp(24px, 12vh, 25vh); }
.list__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 10px;
}
.item { border-top: 1px solid var(--ink); }
.item:last-child { border-bottom: 1px solid var(--ink); }
.item[hidden] { display: none; }
.item__bar {
  display: grid; grid-template-columns: 2.4em 1fr auto; gap: 16px; align-items: baseline;
  padding: var(--row-pad) 0 10px;
}
.item__num { font-size: 11px; color: var(--muted); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.item__name { font-size: clamp(16px, 1.5vw, 19px); letter-spacing: .02em; margin: 0; font-weight: 400; }
.item__name a:hover { color: var(--red); }
.item__year { font-size: clamp(15px, 1.4vw, 18px); font-variant-numeric: tabular-nums; }
.item__body { padding: 0 0 var(--row-pad) calc(2.4em + 16px); display: grid; gap: 14px; }
.item__desc { margin: 0; max-width: 60ch; text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); padding: 2px 8px;
}
.chip--live { color: var(--red); border-color: var(--red); }
.chip--dev { color: var(--ink); border-color: var(--ink); }
.item__stack { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; margin: 2px 0; }
.shots a { display: block; border: 1px solid var(--line); background: var(--bg-elev); overflow: hidden; }
.shots a:hover { border-color: var(--ink); }
.shots img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 300ms ease; }
.shots a:hover img { transform: scale(1.02); }
.shots--single { grid-template-columns: 1fr; }
.shots figcaption { font-size: 11.5px; color: var(--muted); padding: 6px 8px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--ink); font-size: 11.5px; letter-spacing: .06em;
  transition: background 140ms ease, color 140ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--ghost { border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { border-color: var(--ink); }
@media (max-width: 599px) {
  .item__body { padding-left: 0; }
}

/* ----------- DOCUMENTO ----------- */
.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: 24px; }
.meta__label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta__value { font-size: 13px; }

.toc { margin-top: 28px; display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 2.4em 1fr; padding: 3px 0; font-size: 13px; color: var(--muted);
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-size: 11px; letter-spacing: .06em; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.toc a.is-active { color: var(--red); font-style: italic; }
@media (min-width: 900px) { .toc { display: block; } }

.hero { padding: clamp(32px, 10vh, 96px) 0 clamp(24px, 6vh, 56px); }
.hero__title {
  font-size: clamp(32px, 4.4vw, 60px); line-height: 1; font-weight: 300; letter-spacing: -.02em; margin: 0 0 28px;
}
.hero__title .a { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--red); }
.hero__title .arrow { font-weight: 300; }
.hero__lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; max-width: 46ch; margin: 0; text-wrap: pretty; }

.sec { border-top: 1px solid var(--ink); padding: var(--row-pad) 0 clamp(32px, 6vh, 64px); scroll-margin-top: 0; }
.sec__head { display: grid; grid-template-columns: 2.4em 1fr; gap: 16px; align-items: baseline; margin-bottom: 20px; }
.sec__num { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.sec__title { font-size: clamp(16px, 1.5vw, 19px); letter-spacing: .02em; font-weight: 400; margin: 0; text-transform: uppercase; }
.sec__body { padding-left: calc(2.4em + 16px); }
.sec__body > p, .sec__body > ul, .sec__body > ol { max-width: 62ch; }
.sec__body p { margin: 0 0 14px; text-wrap: pretty; }
.sec__body ul, .sec__body ol { margin: 0 0 14px; padding-left: 1.2em; }
.sec__body li { margin-bottom: 6px; }
.sec__body strong { font-weight: 700; }
.sec h3 { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 28px 0 10px; }
@media (max-width: 599px) { .sec__body { padding-left: 0; } }

.quote {
  font-size: clamp(19px, 2vw, 26px); line-height: 1.3; letter-spacing: -.01em; margin: 0 0 20px;
  max-width: 34ch; text-wrap: balance;
}
.quote em { font-family: var(--serif); color: var(--red); }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin: 8px 0 0; }
.pillar { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.pillar__n { font-family: var(--mono); font-size: 11px; color: var(--red); }
.pillar h4 { margin: 4px 0 6px; font-size: 15px; font-weight: 700; }
.pillar p { margin: 0; font-size: 14px; color: var(--ink); }

/* tablas */
.tbl-wrap { overflow-x: auto; margin: 8px 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
th { text-align: left; font-weight: 400; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink); }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-wrap: pretty; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.hot td { color: var(--red); }
@media (max-width: 599px) {
  table { min-width: 0; font-size: 13px; }
  td.num { white-space: normal; }
  .list { padding-top: 28px; }
}

/* matriz de capas: el universo crece */
.matrix { display: grid; grid-template-columns: minmax(90px, 1.1fr) repeat(4, minmax(0, 1fr)); margin: 8px 0 8px; font-size: 12.5px; }
.matrix > div { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.matrix .mh { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
.matrix .rl { color: var(--muted); }
.cell { position: relative; }
.cell::after { content: ""; position: absolute; inset: 9px 6px; border: 1px solid var(--line); }
.cell.on::after { background: var(--ink); border-color: var(--ink); }
.cell.new::after { background: var(--red); border-color: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); margin: 6px 0 16px; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 6px; border: 1px solid var(--line); }
.legend i.on { background: var(--ink); border-color: var(--ink); }
.legend i.new { background: var(--red); border-color: var(--red); }

/* escalera de fidelidad */
.stairs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 6px; margin: 12px 0 8px; }
.step { border: 1px solid var(--ink); border-bottom-width: 3px; padding: 8px; font-size: 12px; line-height: 1.3; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.step b { font-size: 13px; }
.step span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.step:nth-child(1) { min-height: 80px; } .step:nth-child(2) { min-height: 110px; }
.step:nth-child(3) { min-height: 140px; } .step:nth-child(4) { min-height: 170px; }
.step:nth-child(5) { min-height: 200px; border-color: var(--red); }
.step:nth-child(5) b { color: var(--red); }
@media (max-width: 599px) {
  .stairs { grid-template-columns: 1fr; }
  .step { min-height: 0 !important; flex-direction: row; align-items: baseline; }
}

/* dos columnas comparativas */
.versus { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; margin: 8px 0 16px; }
.versus > div { padding: 16px 20px 16px 0; border-top: 1px solid var(--line); }
.versus h4 { margin: 0 0 6px; font-size: 15px; }
.versus p { margin: 0; font-size: 14px; }
.versus .yes h4 { color: var(--red); }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 14px; font-size: 14px; }
.flow span { border: 1px solid var(--ink); padding: 3px 10px; }
.flow span.q { border-style: dashed; color: var(--muted); }
.flow i { font-style: normal; color: var(--muted); }

.note { font-size: 12.5px; color: var(--muted); max-width: 62ch; }
.sources { font-size: 12.5px; color: var(--muted); padding-left: 1.2em; }
.sources a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.sources a:hover { color: var(--red); }

.theme-toggle { font-size: 12.5px; color: var(--ink); }
.theme-toggle:hover { color: var(--red); }

/* ----------- COLUMNA IZQUIERDA COMO LA DE LA PORTADA -----------
   La portada de Side Effects repite la columna de roivazquezmorandeira.es:
   nombre, menú (con SIDE EFFECTS activo), rol y pie de contacto. Mismas
   medidas que .bio / .left .navtabs / .left__footer en styles.css. */
@media (min-width: 900px) {
  .se-home .app { grid-template-columns: minmax(300px, 33.333%) 1fr; }
}
.bio__name {
  font-size: clamp(40px, 5.6vw, 66px); line-height: .88; font-weight: 800;
  letter-spacing: -.045em; margin: 0 0 18px; white-space: nowrap;
}
.left .navtabs { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 14px 0 4px; }
.left .navtabs__btn { font-size: 13px; letter-spacing: .04em; color: var(--ink); white-space: nowrap; transition: color 140ms ease; }
.left .navtabs__btn:hover:not(.is-active) { color: var(--muted); }
.left .navtabs__btn.is-active { color: var(--red); font-style: italic; }
.left .navtabs__sep { font-size: 13px; color: var(--line); margin: 0 2px; user-select: none; }
.bio__role { margin: 4px 0 0; font-size: 13.5px; }
.bio__tagline { margin: 2px 0 0; color: var(--red); font-size: 13.5px; }
.left__footer {
  font-size: 12.5px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px 8px; padding-top: 16px; border-top: 1px solid var(--line-2); margin-top: 24px;
}
.left__footer a { color: var(--ink); }
.left__footer a:hover { color: var(--red); }
.left__footer .dot { color: var(--line); }
@media (max-width: 899px) {
  .left .navtabs { gap: 6px; }
  .left .navtabs__sep { margin: 0; }
}

/* Título, intro y filtros de Side Effects: ahora encabezan la lista. */
.se-head { padding-top: clamp(24px, 12vh, 25vh); }
.se-head + .list { padding-top: 8px; }
.se-head__title {
  font-size: clamp(34px, 4.2vw, 52px); line-height: .9; font-weight: 800;
  letter-spacing: -.045em; margin: 0 0 12px;
}
.se-head__title em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; color: var(--red); }
.se-head__role { margin: 0; font-size: 14px; }
.se-head__role span { color: var(--red); margin-left: 6px; white-space: nowrap; }
.se-head .intro { max-width: 60ch; margin-top: 4px; }
/* Mismo margen lateral e interlineado que la portada. */
.se-home { --gutter: clamp(24px, 4vw, 64px); }
.se-home .left { line-height: 1.55; }
@media (max-width: 899px) {
  .se-head { padding-top: 40px; }
  .se-head__role span { display: block; margin: 2px 0 0; }
}

/* ----------- VISOR DE IMÁGENES -----------
   Mismo velo y misma entrada que el modal de contacto de la portada, pero
   solo con la imagen: sin caja, sin botones. Se cierra con Esc o al pulsar. */
.img-veil {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(105%);
  backdrop-filter: blur(7px) saturate(105%);
  animation: imgVeilIn 180ms ease both;
}
.img-veil img {
  max-width: 100%; max-height: calc(100dvh - 48px); width: auto; height: auto;
  object-fit: contain; box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  animation: imgIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes imgVeilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes imgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.shots a { cursor: zoom-in; }
@media (prefers-reduced-motion: reduce) {
  .img-veil, .img-veil img { animation: none; }
}

/* ----------- DOCUMENTO DENTRO DE LA COLUMNA DERECHA ----------- */
.doc-head { padding-bottom: 8px; }
.doc-head__back {
  display: inline-block; margin-bottom: 22px; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.doc-head__back:hover { color: var(--red); }
.doc-head__role { margin: 0; font-size: 14px; }
.doc-head__tagline { margin: 2px 0 0; color: var(--red); font-size: 14px; }
.doc-head .meta { max-width: 520px; }
.hero__links { margin-top: 24px; }

/* =========================================================
   BULE BULE — componentes de la documentación técnica, en el
   lenguaje de Side Effects (tinta, gris y rojo). Todo va dentro
   de .bb (las secciones del documento) para no tocar Universos.
   ========================================================= */
.bb h3 { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 30px 0 12px; }
.bb h4 { font-size: 14px; font-weight: 700; margin: 22px 0 8px; color: var(--ink); }
.bb code { font-family: var(--mono); font-size: .86em; background: var(--bg-elev); border: 1px solid var(--line-2); padding: .05em .35em; }
.bb pre { font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--bg-elev); border: 1px solid var(--line); padding: 14px 16px; overflow-x: auto; margin: 8px 0 18px; }
.bb pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.bb .num { text-align: right; font-variant-numeric: tabular-nums; }

/* marcas de texto traducidas de los estilos en línea */
.bb .is-red { color: var(--red); }
.bb .is-ok { color: var(--ink); }
.bb .is-warn { color: var(--muted); font-style: italic; }
.bb .is-muted { color: var(--muted); }
.bb .is-struck { text-decoration: line-through; }
.bb .is-strong { font-weight: 700; }

/* tarjetas y rejillas */
.bb .card-grid, .bb .roadmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; border-top: 1px solid var(--line); margin: 8px 0 18px; }
.bb .card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bb .card h3, .bb .card h4 { font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0 0 6px; }
.bb .card p, .bb .card ul { font-size: 14px; margin-bottom: 6px; }
.bb .card > :last-child { margin-bottom: 0; }

/* avisos */
.bb .alert { border-left: 2px solid var(--ink); padding: 8px 0 8px 16px; margin: 12px 0 20px; font-size: 14px; max-width: 66ch; }
.bb .alert-red { border-left-color: var(--red); }
.bb .alert-red strong { color: var(--red); }
.bb .alert-yellow { border-left-color: var(--muted); }

/* monetización: bloques con etiqueta de estado */
.bb .mon-block { border-top: 1px solid var(--ink); padding: 16px 0 6px; margin: 0 0 12px; }
.bb .mon-block--red { border-top-color: var(--red); }
.bb .mon-block--yellow { border-top-color: var(--muted); }
.bb .mon-block h4 { margin-top: 0; }
.bb .mon-block p, .bb .mon-block ul { font-size: 14px; }
.bb .mon-label, .bb .tag, .bb .tl-cat, .bb .who, .bb .gitem-cat {
  display: inline-block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5;
  color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; vertical-align: 1px; font-weight: 400; white-space: nowrap;
}
.bb .mon-label { margin-bottom: 8px; }
.bb .mon-label--red, .bb .cat-fix, .bb .who--com { color: var(--red); border-color: var(--red); }
.bb .mon-label--green, .bb .cat-feat, .bb .who--dev, .bb .tag.tone-ok { color: var(--ink); border-color: var(--ink); }
.bb .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* arquitectura */
.bb .arch { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 8px 0 20px; }
.bb .arch-box { flex: 1; min-width: 180px; border: 1px solid var(--ink); padding: 14px 16px; font-size: 14px; }
.bb .arch-box h4 { margin-top: 0; }
.bb .arch-box ul { margin-bottom: 0; }
.bb .arch-arrow { align-self: center; color: var(--muted); font-size: 20px; user-select: none; }
@media (max-width: 599px) { .bb .arch { flex-direction: column; } .bb .arch-arrow { transform: rotate(90deg); } }

/* histórico de commits */
.bb .timeline { border-left: 1px solid var(--line); padding-left: 20px; margin: 8px 0 12px; }
.bb .tl-group { margin-bottom: 26px; }
.bb .tl-date { position: relative; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.bb .tl-date::before { content: ""; position: absolute; left: -24.5px; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: var(--red); border-radius: 50%; }
.bb .tl-item { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; line-height: 1.5; }
.bb .tl-hash { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-right: 8px; }
.bb .tl-cat { margin-right: 8px; }

/* glosario */
.bb .glosario-search {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 8px 0; margin: 4px 0 16px; outline: none;
}
.bb .glosario-search:focus { border-bottom-color: var(--red); }
.bb .glosario-cats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 22px; }
.bb .gcat-btn { font-size: 13px; letter-spacing: .06em; padding: 4px 1px; text-transform: uppercase; transition: color 140ms ease; }
.bb .gcat-btn:hover:not(.is-active) { color: var(--muted); }
.bb .gcat-btn.is-active { color: var(--red); font-style: italic; }
.bb .glosario-grid { columns: 2; column-gap: 32px; }
@media (max-width: 699px) { .bb .glosario-grid { columns: 1; } }
.bb .gitem { break-inside: avoid; padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.bb .gitem[hidden] { display: none; }
.bb .gitem-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; }
.bb .gitem-term { font-weight: 700; font-size: 15px; }
.bb .gitem-short { font-size: 12.5px; color: var(--muted); font-style: italic; }
.bb .gitem-def { font-size: 14px; line-height: 1.55; margin: 0; }
.bb .gitem-example { font-size: 12.5px; color: var(--muted); font-style: italic; margin: 4px 0 0; }
.bb .glosario-empty { color: var(--muted); padding: 24px 0; }
.bb .glosario-empty[hidden] { display: none; }

/* plan de acción */
.bb .phases-timeline { display: flex; margin: 8px 0 26px; }
.bb .pt-item { flex: 1; min-width: 90px; text-align: center; position: relative; }
.bb .pt-item::after { content: ""; position: absolute; top: 12px; left: 50%; width: 100%; height: 1px; background: var(--line); }
.bb .pt-item:last-child::after { display: none; }
.bb .pt-dot { position: relative; z-index: 1; width: 24px; height: 24px; margin: 0 auto 6px; border: 1px solid var(--ink); border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.bb .pt-item.is-active .pt-dot { background: var(--red); border-color: var(--red); color: #fff; }
.bb .pt-label { font-size: 11px; color: var(--muted); line-height: 1.3; }
.bb .pt-value { font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.bb .plan-phase { border-top: 1px solid var(--ink); padding: 16px 0 8px; margin-bottom: 8px; }
.bb .plan-phase--prep { border-top-color: var(--muted); }
.bb .plan-phase--1 { border-top-color: var(--red); }
.bb .plan-phase h4 { margin: 0 0 2px; font-size: 16px; }
.bb .phase-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.bb .phase-goal { font-size: 14px; }
.bb .task-list { list-style: none; padding: 0; margin: 0 0 12px; }
.bb .task-list li { position: relative; font-size: 14px; padding: 6px 0 6px 22px; margin: 0; border-bottom: 1px solid var(--line-2); }
.bb .task-list li::before { content: "○"; position: absolute; left: 0; top: 6px; color: var(--muted); font-size: 12px; }
.bb .who { margin-right: 6px; }
.bb .milestone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--ink); color: var(--bg); padding: 9px 14px; margin: 10px 0 4px; font-size: 13.5px; }
@media (max-width: 599px) {
  .bb .phases-timeline { flex-wrap: wrap; row-gap: 14px; }
  .bb .pt-item::after { display: none; } /* en varias filas, la línea se salía por la derecha */
}

/* riesgos, escenarios y cifras */
.bb .risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 24px; margin: 8px 0 20px; }
.bb .risk-card { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; }
.bb .risk-card h4 { margin: 0 0 4px; font-size: 14px; }
.bb .risk-card p { font-size: 13.5px; margin: 4px 0 0; }
.bb .risk--low, .bb .risk-card.tone-ok { border-left-color: var(--ink); }
.bb .risk--med, .bb .risk-card.tone-warn { border-left-color: var(--muted); }
.bb .risk--high, .bb .risk-card.tone-bad { border-left-color: var(--red); }
.bb .invest-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.bb .metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 24px; border-top: 1px solid var(--line); margin: 8px 0 20px; }
.bb .scenario-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 0 24px; margin: 8px 0 20px; }
.bb .metric-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bb .scenario-grid > .metric-card { border-top: 1px solid var(--line); border-bottom: 0; }
.bb .metric-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bb .metric-value { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.bb .metric-val { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bb .metric-sub { font-size: 12.5px; color: var(--muted); }
.bb .metric-card--accent .metric-value, .bb .metric-card.tone-bad .metric-value, .bb .metric-card.tone-bad .metric-val { color: var(--red); }
.bb .scenario-card { border-top: 1px solid var(--ink); padding: 14px 0; }
.bb .scenario-card--human { border-top-color: var(--red); }
.bb .scenario-card h4 { margin-top: 0; }
.bb .scenario-card ul { font-size: 14px; }
.bb .roi-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 16px 0; margin: 12px 0 22px; font-size: 14px; }
.bb .roi-number { font-size: clamp(32px, 3.6vw, 46px); font-weight: 800; letter-spacing: -.04em; color: var(--red); white-space: nowrap; line-height: 1; }
.bb .roi-desc { flex: 1; min-width: 220px; font-size: 14px; line-height: 1.55; }
.bb .semaforo { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 8px 0 20px; }
.bb .semaforo-item { flex: 1; min-width: 160px; border-top: 3px solid var(--ink); padding-top: 10px; font-size: 14px; }
.bb .sem--red { border-top-color: var(--red); }
.bb .sem--yellow { border-top-color: var(--muted); }
.bb .sem-head { font-weight: 700; margin-bottom: 4px; }
.bb .sem-body { font-size: 13.5px; }
@media (max-width: 599px) {
  .bb .scenario-grid, .bb .invest-split { grid-template-columns: 1fr; }
}

/* tooltips (definiciones de términos) */
.bb .tip { border-bottom: 1px dotted var(--muted); cursor: help; position: relative; }
.bb .tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 50;
  width: max-content; max-width: 240px; padding: 7px 10px; background: var(--ink); color: var(--bg);
  font-size: 12px; line-height: 1.45; font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  pointer-events: none; transform: translateX(-50%);
  display: none; /* invisible también ocupaba sitio y ensanchaba la página en móvil */
  animation: tipIn 150ms ease both;
}
.bb .tip:hover::after { display: block; }
@keyframes tipIn { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }

/* =========================================================
   DOCUMENTO ABIERTO (.se-home .app.is-focus) — como un proyecto
   abierto en la portada: la columna izquierda se pliega al raíl
   (RVM · menú · contacto), el documento gana ancho y aparece el
   minimapa. Mismos tiempos, medidas y curva que styles.css.
   ========================================================= */
:root { --focus-ease: cubic-bezier(0.22, 1, 0.36, 1); --focus-dur: 650ms; }
.left__rail, .minimap { display: none; }

@media (min-width: 900px) {
  .se-home .app {
    grid-template-columns: 33.333% 1fr;
    transition: grid-template-columns var(--focus-dur) var(--focus-ease);
  }
  .se-home .app.is-focus { grid-template-columns: 192px 1fr; }
  .se-home .left {
    position: relative; display: block; overflow: hidden;
    transition: padding var(--focus-dur) var(--focus-ease);
  }
  .se-home .app.is-focus .left { padding-left: 0; padding-right: 0; }
  /* el bloque interior conserva su ancho mientras la columna se estrecha:
     se recorta, encoge y se desvanece en lugar de recolocar el texto */
  .se-home .left__inner {
    width: calc(33.333vw - var(--gutter) * 2); height: 100%;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    transform-origin: left top;
    transition: opacity 320ms ease, transform var(--focus-dur) var(--focus-ease);
  }
  .se-home .app.is-focus .left__inner { opacity: 0; transform: scale(0.55); pointer-events: none; }

  .se-home .left__rail {
    display: flex; position: absolute; inset: 0;
    flex-direction: column; align-items: flex-start; justify-content: space-between;
    padding: 40px 24px 36px;
    opacity: 0; transform: translateX(-12px); pointer-events: none;
    transition: opacity 280ms ease, transform 280ms ease;
  }
  .se-home .app.is-focus .left__rail { opacity: 1; transform: none; pointer-events: auto; transition-delay: 320ms; }
  .rail__top { display: flex; flex-direction: column; align-items: flex-start; }
  .rail__mono { margin: 0; font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -0.08em; color: var(--ink); }
  .rail__nav { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 40px; }
  .rail__nav .navtabs__btn { font-size: 13px; letter-spacing: 0.04em; line-height: 1.4; color: var(--ink); white-space: nowrap; }
  .rail__nav .navtabs__btn:hover:not(.is-active) { color: var(--muted); }
  .rail__nav .navtabs__btn.is-active { color: var(--red); font-style: italic; }
  .rail__links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%;
    padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted);
  }
  .rail__links a { color: var(--ink); white-space: nowrap; }
  .rail__links a:hover { color: var(--red); }

  /* más aire para el documento, con hueco a la derecha para el minimapa */
  .se-home .app.is-focus .right__inner { max-width: 1360px; padding: 0 184px 25vh clamp(0px, 4vw, 72px); }

  /* minimapa (tipo Sublime Text): copia a escala del documento con un
     recuadro sobre la parte visible; clic para saltar, arrastrar para moverse */
  .se-home .app.is-focus .minimap {
    display: block; position: fixed;
    top: calc(var(--frame-pad) + 72px); bottom: calc(var(--frame-pad) + 16px); right: 28px;
    width: 128px; /* debe coincidir con ANCHO en se.js */
    overflow: hidden; z-index: 40; cursor: pointer; background: var(--bg);
    animation: minimapIn 400ms 300ms var(--focus-ease) both;
  }
  @keyframes minimapIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
  .minimap__track { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; pointer-events: none; }
  .minimap__track > * { transform-origin: 0 0; pointer-events: none; }
  .minimap__view {
    position: absolute; top: 0; left: 0; width: 100%;
    background: color-mix(in srgb, var(--red) 10%, transparent); border: 1px solid var(--red);
    cursor: grab; transition: background-color 140ms ease;
  }
  .minimap:hover .minimap__view { background: color-mix(in srgb, var(--red) 16%, transparent); }
  .minimap.is-dragging .minimap__view { cursor: grabbing; background: color-mix(in srgb, var(--red) 22%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .se-home .app, .se-home .left__inner, .se-home .left__rail { transition: none !important; }
  .se-home .app.is-focus .minimap { animation: none; }
}

/* ----------- MODO CLARO / OSCURO -----------
   Dos cuadrados de 8 px encima de la línea superior, a 64 px del borde
   derecho, solo en escritorio: el negro pone el modo oscuro y el blanco el
   claro. La elección se recuerda (rvm-theme) y manda sobre la hora. */
.theme-switch { display: none; }
@media (min-width: 900px) {
  .theme-switch {
    display: flex; gap: 6px; position: absolute; z-index: 50;
    top: calc(var(--frame-pad) - 18px); right: 64px;
  }
  .theme-switch__btn {
    width: 8px; height: 8px; padding: 0; margin: 0; border: 1px solid var(--ink); border-radius: 0;
    cursor: pointer; transition: transform 140ms ease;
  }
  .theme-switch__btn--dark { background: #111111; }
  .theme-switch__btn--light { background: #ffffff; }
  .theme-switch__btn:hover { transform: scale(1.25); }
  .theme-switch__btn:focus-visible { outline: 1px solid var(--red); outline-offset: 2px; }
}

/* igual que en la portada: el menú se aprieta en portátiles */
@media (min-width: 900px) and (max-width: 1439px) {
  .left .navtabs { gap: 4px 6px; flex-wrap: wrap; }
  .left .navtabs__sep { margin: 0; }
}

/* ----------- PIE: contacto, © y aviso legal, bajo la línea inferior -----------
   Igual que en la portada: fijo en escritorio, a 64 px de cada lado; en
   móvil, al final de la página. */
.pie {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px;
  margin: calc(var(--frame-pad) * -1 + 10px) var(--gutter) 0; padding-bottom: 24px;
  font-size: 11.5px; color: var(--muted);
}
.pie a { color: var(--muted); }
.pie a:hover { color: var(--red); }
.pie__contacto, .pie__legal { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pie__contacto a { color: var(--ink); }
.pie__legal { margin-left: auto; }
@media (min-width: 900px) {
  .pie {
    position: fixed; z-index: 50; left: 64px; right: 64px; margin: 0; padding: 0;
    top: calc(100vh - var(--frame-pad) + 10px);
    top: calc(100dvh - var(--frame-pad) + 10px);
  }
}

/* todo el pie con la misma letra: Inter light, mismo tamaño y color (como en la portada) */
.pie, .pie a { font-family: "Inter", var(--font); font-weight: 300; font-size: 12px; color: var(--ink); }
.pie a:hover { color: var(--red); }

/* en móvil, todo el pie alineado a la izquierda */
@media (max-width: 899px) {
  .pie { justify-content: flex-start; }
  .pie__legal { margin-left: 0; }
}

/* ----------- INDICADOR DE SCROLL (como en Work, en la portada) -----------
   Sin barras nativas: una línea de 1 px que recorre la columna y se ensancha
   a 8 px con el ratón (se puede arrastrar). Con un documento abierto la
   sustituye el minimapa. */
.se-home .right { scrollbar-width: none; -ms-overflow-style: none; }
.se-home .right::-webkit-scrollbar { display: none; }
.scroll-indicator {
  position: fixed; top: 0; left: 0; z-index: 70; width: 8px; height: 36.8px;
  opacity: 0; transition: opacity .3s ease; pointer-events: none; will-change: transform;
}
.scroll-indicator::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 100%; background: var(--ink); transition: width .25s ease, background-color .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .scroll-indicator { pointer-events: auto; cursor: grab; }
  .scroll-indicator:hover::after, .scroll-indicator.is-dragging::after { width: 8px; }
  .scroll-indicator.is-dragging { cursor: grabbing; }
  .scroll-indicator.is-visible { opacity: 1; }
}
.se-home .app.is-focus ~ .scroll-indicator, .se-home .app.is-focus .scroll-indicator { display: none; }
@media (max-width: 899px) { .scroll-indicator { display: none; } }
