/* Encabezado y pie comunes de todo qritico.app fuera de la landing (guías, funciones, beta y páginas legales).
   Mismas clases y medidas que la barra y el pie de la landing (r8.css, navegacion.css, recorrido.css, secciones.css): si cambian allá, cambian aquí.
   El HTML sale de herramientas/landing/sitio_marco.py (hosting) y de server/lib/web/sitio_marco.g.dart (servidor). Sin JavaScript: los menús son <details>.
   Noche por omisión; con html[data-modo="dia"] (modo.js, o el tema del sistema si no hay script) la barra y el pie pasan a papel. */
@font-face { font-family: "Qritico Display"; src: url("/landing/ont.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Qritico Texto"; src: url("/landing/sofia_400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Qritico Texto"; src: url("/landing/sofia_600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Qritico Maquina"; src: url("/landing/r8/recursos/special_elite.woff") format("woff"); font-display: swap; }

.barra, .pie-sitio, .barra *, .pie-sitio * { box-sizing: border-box; }
.barra, .pie-sitio {
  --tinta: #0A0A0B; --papel: #EFECE5; --papel-luz: #F4F2EE;
  --display: "Qritico Display", Georgia, serif; --texto: "Qritico Texto", "Arial Narrow", sans-serif; --maquina: "Qritico Maquina", "Courier New", monospace;
  --llega: cubic-bezier(.16, 1, .3, 1); --s2: 1px 2px 1px #00000080, 12px 18px 26px #00000075;
  --margen: clamp(16px, 2.8vw, 40px); --alto: 76px;
}

/* ---------- Encabezado ---------- */
.barra { position: sticky; top: 0; z-index: 40; height: var(--alto); display: flex; align-items: center; gap: clamp(14px, 1.7vw, 28px); padding: 0 var(--margen); background: #0A0A0B; color: #F4F1EA; box-shadow: 0 1px 0 #F4F1EA24; font: 600 18px/1 var(--texto); letter-spacing: normal; }
.barra a { color: inherit; }
.barra li, .barra p, .pie-sitio li, .pie-sitio p { color: inherit; }
.marca { display: flex; align-items: center; gap: 12px; font: 400 32px/1 var(--display); text-decoration: none; color: inherit; }
.marca img { width: 58px; height: 58px; display: block; }
.barra-nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 28px); margin: 0; margin-inline-start: 4px; padding: 0; font: 600 18px/1 var(--texto); }
.barra-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; white-space: nowrap; opacity: .86; transition: opacity .12s; }
.barra-nav [aria-current] { opacity: 1; }
.barra-nav [aria-current]::after { content: ""; position: absolute; inset-inline: 0; bottom: 7px; height: 2px; background: currentColor; }
@media (hover: hover) and (pointer: fine) { .barra-nav a:hover { opacity: 1; } }
.barra :focus-visible, .pie-sitio :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.barra .tecla { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; background: var(--papel); color: var(--tinta); font: 600 18px/1.12 var(--texto); text-decoration: none; white-space: nowrap; margin-inline-start: auto; transition: transform .12s var(--llega); }
@media (hover: hover) and (pointer: fine) { .barra .tecla:hover { transform: translateY(-1px); } }
.barra .tecla:active { transform: translateY(2px); }
.cta-corto { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Idioma (computadora): un menú que se abre con <details> */
.idioma-menu { position: relative; margin-inline-start: 10px; }
.idioma-menu > summary, .menu-sitio > summary { list-style: none; cursor: pointer; }
.idioma-menu > summary::-webkit-details-marker, .menu-sitio > summary::-webkit-details-marker { display: none; }
.idioma { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; font: 600 17px/1 var(--texto); }
.idioma svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.idioma .flecha { width: 16px; height: 16px; transition: transform .2s var(--llega); }
details[open] > .idioma .flecha { transform: rotate(180deg); }
.idiomas { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 50; min-width: 210px; margin: 0; padding: 6px; list-style: none; background: var(--papel); color: var(--tinta); box-shadow: var(--s2); border-radius: 4px; }
.idiomas a { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 3px; text-decoration: none; font: 600 17px/1 var(--texto); color: inherit; }
.idiomas a[aria-current="true"] { background: var(--tinta); color: var(--papel-luz); }

/* Menú de tableta y teléfono: un botón de tres rayas que abre una hoja de papel */
.menu-sitio { display: none; position: relative; }
.ajustes-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; }
.aj-icono { display: grid; width: 22px; gap: 5px; }
.aj-icono i { display: block; height: 2px; background: currentColor; transition: transform .24s var(--llega), opacity .2s; }
.menu-sitio[open] .aj-icono i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-sitio[open] .aj-icono i:nth-child(2) { opacity: 0; }
.menu-sitio[open] .aj-icono i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.barra-fin { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 45; display: flex; flex-direction: column; width: min(340px, calc(100vw - 20px)); padding: 12px 22px 16px; background: var(--papel); color: var(--tinta); box-shadow: var(--s2); border-radius: 2px; font: 600 18px/1 var(--texto); max-height: calc(100svh - var(--alto) - 8px); overflow-y: auto; }
.menu-secciones { display: flex; flex-direction: column; padding-bottom: 8px; }
.menu-secciones a { display: flex; align-items: center; min-height: 54px; font: 400 26px/1.1 var(--display); text-decoration: none; }
.menu-secciones [aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.barra-fin .interruptor { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 54px; margin: 0; padding: 0; border: 0; border-top: 1px solid #0A0A0B26; background: none; color: inherit; font: 600 18px/1 var(--texto); text-align: start; cursor: pointer; }
.barra-fin .interruptor[hidden] { display: none; }
.barra-fin .interruptor .etq { margin-inline-end: auto; }
.palanca { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px currentColor; }
.palanca::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: currentColor; transition: transform .24s var(--llega); }
[aria-pressed="true"] > .palanca::after { transform: translateX(14px); }
.barra-fin .idioma-lista { margin-top: 8px; border-top: 1px solid #0A0A0B26; }
.barra-fin .idioma-lista > summary { list-style: none; cursor: pointer; }
.barra-fin .idioma-lista > summary::-webkit-details-marker { display: none; }
.barra-fin .idioma-lista .idioma { width: 100%; min-height: 54px; padding: 0; }
.barra-fin .idioma-et { margin-inline-end: auto; }
.barra-fin .idiomas { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; margin: 0 0 4px; padding: 0; background: none; box-shadow: none; max-height: 260px; overflow-y: auto; }
.barra-fin .idiomas a { min-height: 44px; padding: 0 8px; font-size: 17px; line-height: 1.15; }

@media (max-width: 1239px) {
  .barra { --alto: 64px; gap: 12px; height: var(--alto); }
  .barra-nav, .barra > .idioma-menu { display: none; }
  .menu-sitio { display: block; }
  .marca { gap: 8px; }
  .marca img { width: 44px; height: 44px; }
}
@media (max-width: 600px) {
  .barra { --alto: 60px; }
  .marca { font-size: clamp(14px, calc((100vw - 272px) / 3.4), 26px); }
  .barra .tecla { font: 600 16px/1 var(--texto); padding: 0 14px; }
  .cta-largo { display: none; }
  .cta-corto { display: inline; }
  .barra-fin { inset-inline-end: -6px; }
}

/* ---------- Pie ---------- */
.pie-sitio { position: relative; background: #0A0A0B; color: #EFECE5; padding: 64px var(--margen) 28px; font: 400 18px/1.45 var(--texto); letter-spacing: normal; text-align: start; }
.pie-sitio a { color: inherit; }
.pie-sitio ul { list-style: none; margin: 0; padding: 0; }
.pie-rejilla { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.pie-sitio h2 { font: 400 clamp(38px, 5vw, 72px)/1.04 var(--display); max-width: 13em; text-wrap: balance; margin: 0; padding: 0; border: 0; letter-spacing: normal; color: inherit; }
.pie-llamado > p { margin: 14px 0 0; font-size: 21px; max-width: 28em; color: inherit; }
.pie-sitio .acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 20px; }
.pie-sitio .tecla { display: inline-flex; align-items: center; min-height: 54px; padding: 0 26px; border-radius: 8px; background: var(--papel); color: var(--tinta); font: 600 21px/1.12 var(--texto); text-decoration: none; box-shadow: 0 3px 0 #f4f1ea73; }
.pie-sitio .play { display: inline-flex; align-items: center; gap: 12px; font: 400 14px/1.1 var(--maquina); color: #F4F1EAb8; text-decoration: none; }
.pie-sitio .play img { width: 182px; height: 54px; display: block; }
.pie-columnas { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 20px 44px; }
.pie-columnas > div { display: flex; flex-direction: column; }
.pie-columnas a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 19px; }
@media (hover: hover) and (pointer: fine) { .pie-columnas a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.pie-titulo { font: 400 15px/1.2 var(--maquina); color: #F4F1EAb8; margin: 0 0 4px; }
.pie-idiomas { margin-top: 28px; padding-top: 20px; border-top: 1px solid #F4F1EA24; }
.pie-idiomas .pie-titulo { margin-bottom: 2px; }
.pie-idiomas > div { display: flex; flex-wrap: wrap; column-gap: 26px; }
.pie-idiomas a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 18px; }
.pie-idiomas a[aria-current="true"] { text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .pie-idiomas a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.pie-legal { margin-top: 36px; font: 400 16px/1.4 var(--texto); color: #F4F1EAc4; }
.pie-legal p { margin: 0 0 8px; color: inherit; }
.pie-contacto { margin-top: 14px; }
.pie-contacto a { text-underline-offset: 3px; }
@media (max-width: 860px) {
  .pie-sitio { padding-top: 48px; }
  .pie-rejilla { grid-template-columns: minmax(0, 1fr); }
  .pie-columnas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pie-sitio .play img { width: 150px; height: 44px; }
  .pie-sitio .tecla { font-size: 20px; padding: 0 20px; }
}

/* ---------- Día (como la barra sólida de la landing en modo día) ---------- */
html[data-modo="dia"] .barra { background: #EFECE5; color: #0A0A0B; box-shadow: 0 1px 0 #0A0A0B24; }
html[data-modo="dia"] .barra .marca img { filter: brightness(0); }
html[data-modo="dia"] .barra .tecla { background: #0A0A0B; color: #F4F2EE; }
html[data-modo="dia"] .barra-fin, html[data-modo="dia"] .idiomas { background: #F4F2EE; }
html[data-modo="dia"] .pie-sitio { background: #EFECE5; color: #0A0A0B; box-shadow: 0 -1px 0 #0A0A0B24; }
html[data-modo="dia"] .pie-sitio .tecla { background: #0A0A0B; color: #F4F2EE; box-shadow: 0 3px 0 #0A0A0B99; }
html[data-modo="dia"] .pie-sitio .play, html[data-modo="dia"] .pie-titulo, html[data-modo="dia"] .pie-legal { color: #0A0A0Bd1; }
html[data-modo="dia"] .pie-idiomas { border-top-color: #0A0A0B33; }
@media (prefers-color-scheme: light) {
  html:not([data-modo]) .barra { background: #EFECE5; color: #0A0A0B; box-shadow: 0 1px 0 #0A0A0B24; }
  html:not([data-modo]) .barra .marca img { filter: brightness(0); }
  html:not([data-modo]) .barra .tecla { background: #0A0A0B; color: #F4F2EE; }
  html:not([data-modo]) .barra-fin, html:not([data-modo]) .idiomas { background: #F4F2EE; }
  html:not([data-modo]) .pie-sitio { background: #EFECE5; color: #0A0A0B; box-shadow: 0 -1px 0 #0A0A0B24; }
  html:not([data-modo]) .pie-sitio .tecla { background: #0A0A0B; color: #F4F2EE; box-shadow: 0 3px 0 #0A0A0B99; }
  html:not([data-modo]) .pie-sitio .play, html:not([data-modo]) .pie-titulo, html:not([data-modo]) .pie-legal { color: #0A0A0Bd1; }
  html:not([data-modo]) .pie-idiomas { border-top-color: #0A0A0B33; }
}
@media (prefers-reduced-motion: reduce) { .barra .tecla, .aj-icono i, .idioma .flecha, .palanca::after { transition: none; } }
