@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 75% 100%; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 75% 100%; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Spline Sans Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/spline-sans-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bosque: #0c3b2e;
  --bosque-hondo: #072a20;
  --menta: #bfe8cf;
  --hueso: #f3efe2;
  --hueso-2: #e6e0cd;
  --tinta: #10251d;
  --tinta-2: #45574d;
  --naranja: #ff7a1a;
  --naranja-hondo: #d95c00;
  --rojo: #a3271c;
  --rojo-fondo: #f6ddd3;
  --titular: "Bricolage Grotesque", system-ui, sans-serif;
  --dato: "Spline Sans Mono", ui-monospace, monospace;
  --salida: cubic-bezier(.16, 1, .3, 1);
  --margen: clamp(16px, 2.2vw, 28px);
}

* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; background: var(--bosque-hondo); }
body {
  min-height: 100svh;
  font-family: var(--titular);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--hueso);
  background: var(--bosque);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: var(--naranja); color: var(--tinta); }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ── Mapa ─────────────────────────────────────────── */
.mapa { position: fixed; inset: 0; background:
  radial-gradient(120% 90% at 30% 55%, #11503d 0%, var(--bosque) 45%, var(--bosque-hondo) 100%); }
.mapa canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  /* Zona calma bajo el título: las curvas se apagan para que el nombre se lea. */
  -webkit-mask-image: radial-gradient(ellipse 34% 30% at 14% 15%, rgba(0,0,0,.14) 0, rgba(0,0,0,.2) 55%, #000 100%);
  mask-image: radial-gradient(ellipse 34% 30% at 14% 15%, rgba(0,0,0,.14) 0, rgba(0,0,0,.2) 55%, #000 100%); }
.marco { position: absolute; inset: var(--margen); border: 1px solid rgba(191, 232, 207, .55); pointer-events: none; }
.marco::before, .marco::after { content: ""; position: absolute; pointer-events: none; }
.marco::before { inset: -7px 0; background:
  repeating-linear-gradient(90deg, rgba(191,232,207,.55) 0 1px, transparent 1px 64px) top / 100% 7px no-repeat,
  repeating-linear-gradient(90deg, rgba(191,232,207,.55) 0 1px, transparent 1px 64px) bottom / 100% 7px no-repeat; }
.marco::after { inset: 0 -7px; background:
  repeating-linear-gradient(0deg, rgba(191,232,207,.55) 0 1px, transparent 1px 64px) left / 7px 100% no-repeat,
  repeating-linear-gradient(0deg, rgba(191,232,207,.55) 0 1px, transparent 1px 64px) right / 7px 100% no-repeat; }

.ruta { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ruta path { fill: none; stroke: var(--naranja); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round;
  opacity: 0; transition: opacity .9s var(--salida) .5s; }
[data-vista="menu"] .ruta path { opacity: .95; }

.cumbres { list-style: none; padding: 0; }
.cumbres li { position: absolute; display: flex; align-items: center; gap: 10px; translate: -9px -50%;
  font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; color: var(--hueso);
  opacity: 0; scale: .9; transition: opacity .7s var(--salida), scale .7s var(--salida); transition-delay: calc(var(--i) * 140ms + 350ms); }
.cumbres li::before { content: ""; width: 18px; height: 16px; flex: none; background: var(--naranja);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); transition: scale .35s var(--salida); }
.cumbres li span { padding: 2px 10px 3px; background: var(--bosque-hondo); border: 1px solid rgba(191,232,207,.4); }
.cumbres li.activa::before { scale: 1.5; }
.cumbres li.activa span { background: var(--naranja); color: var(--tinta); border-color: var(--naranja); }
[data-vista="menu"] .cumbres li { opacity: 1; scale: 1; }

/* ── Título sobre el mapa ─────────────────────────── */
.titulo { position: fixed; left: calc(var(--margen) + clamp(20px, 3vw, 44px)); top: calc(var(--margen) + clamp(20px, 3.4vw, 44px));
  max-width: min(36rem, 48vw); }
.titulo h1 { font-size: clamp(3.25rem, 8.4vw, 6rem); font-weight: 800; font-stretch: 84%; line-height: .9;
  letter-spacing: -.012em; text-wrap: balance; }
.titulo p { margin-top: 18px; font-size: clamp(1.0625rem, 1.5vw, 1.375rem); max-width: 22ch; color: var(--menta); text-wrap: balance; }

.pie-mapa { position: fixed; left: calc(var(--margen) + clamp(20px, 3vw, 44px)); bottom: calc(var(--margen) + 28px);
  display: flex; align-items: flex-end; gap: 22px; color: var(--menta); font-family: var(--dato); font-size: .8125rem;
  font-variant-numeric: tabular-nums; }
.norte text { font: 500 10px var(--dato); fill: currentColor; }
.escala { display: flex; width: 132px; height: 7px; border: 1px solid currentColor; }
.escala i { flex: 1; }
.escala i:nth-child(odd) { background: currentColor; }

/* ── Leyenda: el panel de trabajo ─────────────────── */
.leyenda { position: fixed; top: var(--margen); right: var(--margen); bottom: var(--margen);
  width: min(460px, 42vw); background: var(--hueso); color: var(--tinta); color-scheme: light;
  outline: 1px solid var(--tinta); outline-offset: -8px;
  box-shadow: 0 30px 60px -20px rgba(3, 20, 14, .65), 0 6px 14px rgba(3, 20, 14, .3);
  padding: clamp(32px, 4.2vh, 52px) clamp(28px, 3vw, 44px);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--tinta-2) transparent;
  display: flex; flex-direction: column; }
.vista { display: flex; flex-direction: column; flex: 1; animation: asoma .6s var(--salida) both; }
@keyframes asoma { from { opacity: .001; translate: 0 10px; filter: blur(3px); } }

.leyenda h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 800; font-stretch: 85%; line-height: 1; letter-spacing: -.025em; }
.entrada { margin-top: 10px; color: var(--tinta-2); max-width: 30ch; }

form { margin-top: clamp(22px, 3.4vh, 36px); display: flex; flex-direction: column; }
label { font-size: .9375rem; font-weight: 600; margin: 18px 0 7px; }
form > label:first-of-type { margin-top: 0; }
input { width: 100%; height: 54px; padding: 0 16px; font: inherit; font-size: 1.125rem; color: var(--tinta);
  background: #fffdf6; border: 1.5px solid var(--tinta); border-radius: 0; caret-color: var(--naranja-hondo);
  transition: box-shadow .25s var(--salida), background .25s; }
input:hover { background: #fff; }
input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--hueso), 0 0 0 6px var(--naranja); }
input::placeholder { color: #5f6d64; }
#codigo { font-family: var(--dato); font-size: 1.625rem; font-weight: 500; letter-spacing: .42em; font-variant-numeric: tabular-nums; height: 62px; }
.ayuda { margin-top: 7px; font-size: .875rem; color: var(--tinta-2); }

.con-boton { position: relative; }
.con-boton input { padding-right: 58px; }
.con-boton button { position: absolute; right: 4px; top: 4px; width: 46px; height: 46px; display: grid; place-items: center;
  background: none; border: 0; color: var(--tinta-2); cursor: pointer; }
.con-boton button:hover { color: var(--tinta); }
.con-boton button[aria-pressed="true"] .tacha { display: none; }

.entrar { margin-top: 26px; height: 62px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between;
  font: inherit; font-size: 1.25rem; font-weight: 700; color: var(--tinta); background: var(--naranja);
  border: 1.5px solid var(--tinta); cursor: pointer; transition: background .2s, translate .2s var(--salida); }
.entrar svg { transition: translate .35s var(--salida); }
.entrar:hover { background: #ff8d3a; }
.entrar:hover svg { translate: 6px 0; }
.entrar:active { translate: 0 1px; }
.entrar[aria-busy="true"] { cursor: progress; background: var(--hueso-2); }
.entrar[aria-busy="true"] svg { animation: avanza .9s var(--salida) infinite; }
@keyframes avanza { from { translate: -8px 0; opacity: .2; } to { translate: 8px 0; opacity: 1; } }
.entrar:disabled:not([aria-busy="true"]) { cursor: not-allowed; background: var(--hueso-2); color: var(--tinta-2); }

.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; margin-bottom: 18px;
  background: var(--rojo-fondo); color: var(--rojo); border: 1.5px solid var(--rojo); font-weight: 600; font-size: .9375rem; }
.aviso svg { flex: none; margin-top: 1px; }
.aviso.sacude { animation: sacude .45s var(--salida); }
@keyframes sacude { 20% { translate: -6px 0; } 45% { translate: 5px 0; } 70% { translate: -3px 0; } }

.nota { margin-top: auto; padding-top: 24px; font-size: .9375rem; color: var(--tinta-2); max-width: 34ch; }

/* ── Menú ─────────────────────────────────────────── */
.destinos { list-style: none; padding: 0; margin-top: clamp(20px, 3vh, 32px); border-top: 1.5px solid var(--tinta); }
.destinos li { border-bottom: 1.5px solid var(--tinta); }
.destinos a { display: grid; grid-template-columns: 22px 1fr 28px; align-items: center; column-gap: 14px;
  padding: 20px 10px 21px 6px; color: inherit; text-decoration: none; transition: background .25s var(--salida), padding .35s var(--salida); }
.destinos a::before { content: ""; width: 16px; height: 14px; background: var(--naranja-hondo); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.destinos b { display: block; font-size: clamp(1.625rem, 2.4vw, 2rem); font-weight: 800; font-stretch: 85%; line-height: 1.05; letter-spacing: -.02em; }
.destinos small { display: block; margin-top: 4px; font-size: .9375rem; color: var(--tinta-2); }
.destinos svg { transition: translate .35s var(--salida); }
.destinos a:hover, .destinos a:focus-visible { background: var(--naranja); padding-left: 14px; outline-offset: -3px; outline-color: var(--tinta); }
.destinos a:hover small, .destinos a:focus-visible small { color: var(--tinta); }
.destinos a:hover::before, .destinos a:focus-visible::before { background: var(--tinta); }
.destinos a:hover svg, .destinos a:focus-visible svg { translate: 5px 0; }
.vacio { margin-top: 24px; padding: 16px; border: 1.5px dashed var(--tinta-2); color: var(--tinta-2); }
.salir { margin-top: auto; align-self: flex-start; padding: 12px 0; font: inherit; font-weight: 600; color: var(--tinta);
  background: none; border: 0; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; cursor: pointer; }
.salir:hover { text-decoration-color: var(--naranja-hondo); text-decoration-thickness: 3px; }

/* ── Teléfono ─────────────────────────────────────── */
@media (max-width: 820px) {
  body { overflow: auto; }
  .mapa { position: absolute; inset: 0 0 auto 0; height: 250px; }
  .mapa canvas { -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.16) 0, rgba(0,0,0,.2) 46%, #000 62%); mask-image: linear-gradient(180deg, rgba(0,0,0,.16) 0, rgba(0,0,0,.2) 46%, #000 62%); }
  .cumbres li { font-size: .9375rem; gap: 7px; translate: -7px -50%; }
  .cumbres li::before { width: 14px; height: 12px; }
  .cumbres li span { padding: 1px 7px 2px; }
  .cumbres li::after { left: 7px; width: 120px; height: 120px; }
  .marco { inset: 12px 12px 0; border-bottom: 0; }
  .marco::before { inset: -7px 0 0; background-position: top; background-size: 100% 7px; }
  .titulo { position: relative; left: auto; top: auto; max-width: none; height: 250px; padding: 36px 32px 0; }
  .titulo h1 { font-size: 3.5rem; }
  .titulo p { margin-top: 12px; font-size: 1.0625rem; }
  .pie-mapa { display: none; }
  .leyenda { position: relative; inset: auto; width: auto; margin: 0 12px 12px; min-height: calc(100svh - 262px);
    padding: 26px 22px 24px; box-shadow: none; }
  form { margin-top: 18px; }
  label { margin-top: 14px; }
  .entrar { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
.leyenda h2:focus { outline: none; }

/* ── Pulido ───────────────────────────────────────── */
.mayus { color: var(--rojo); font-weight: 600; }
input[aria-invalid="true"] { border-color: var(--rojo); background: #fff8f4; }
.sin-js { position: fixed; inset: auto var(--margen) var(--margen); z-index: 2; padding: 14px 18px; background: var(--hueso); color: var(--tinta); border: 1.5px solid var(--tinta); }

/* Al entrar, cada cumbre emite un anillo de levantamiento, una sola vez. */
.cumbres li::after { content: ""; position: absolute; left: 9px; top: 50%; width: 220px; height: 220px; translate: -50% -50%;
  border: 1.5px solid var(--naranja); border-radius: 50%; opacity: 0; scale: .05; pointer-events: none; }
[data-vista="menu"] .cumbres li::after { animation: anillo 1.5s var(--salida) both; animation-delay: calc(var(--i) * 140ms + 300ms); }
@keyframes anillo { 0% { opacity: .9; scale: .05; } 100% { opacity: 0; scale: 1; } }

.destinos li { animation: asoma .6s var(--salida) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
.destinos a { min-height: 92px; }
@media (max-width: 820px) { .destinos a { min-height: 76px; } }

/* Aviso neutro (sesión vencida): informa, no acusa. */
.aviso.info { background: var(--hueso-2); color: var(--tinta); border-color: var(--tinta); }
/* Aviso dentro del menú (no se pudo cerrar la sesión): queda sobre «Cerrar sesión». */
.vista > .aviso { margin: 24px 0 0; }
.vista > .aviso + .salir { margin-top: 12px; }
.salir:disabled { cursor: progress; color: var(--tinta-2); }
/* El relleno automático del navegador conserva el papel y la tinta del campo. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--tinta); caret-color: var(--naranja-hondo);
  box-shadow: 0 0 0 1000px #fffdf6 inset; transition: background-color 9999s; }
input:-webkit-autofill:focus-visible { box-shadow: 0 0 0 1000px #fffdf6 inset, 0 0 0 3px var(--hueso), 0 0 0 6px var(--naranja); }

/* Ventanas bajas (portátil pequeño): el panel se compacta para que todo quepa dentro del filete. */
@media (min-width: 821px) and (max-height: 780px) {
  .leyenda { padding-top: 28px; padding-bottom: 26px; }
  form { margin-top: 16px; }
  label { margin: 12px 0 6px; }
  input { height: 48px; }
  #codigo { height: 54px; }
  .entrar { height: 54px; margin-top: 18px; }
  .nota { padding-top: 14px; font-size: .875rem; }
}

.nota a { color: var(--tinta); font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.nota a:hover { text-decoration-color: var(--naranja-hondo); text-decoration-thickness: 3px; }
