:root {
  color-scheme: dark;
  font-family: Consolas, "Courier New", monospace;
  --oro: #e6a52e;
  --oro-claro: #ffd06a;
  --cian: #00d7f2;
  --panel: rgba(7, 10, 9, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (pointer: fine) {
  html.cursor-antorcha-activo,
  html.cursor-antorcha-activo * {
    cursor: none !important;
  }
  .cursor-antorcha {
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 32px;
    height: 48px;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50px, -50px, 0) rotate(-18deg);
    transform-origin: 50% 82%;
    transition: opacity 0.16s ease;
    filter: drop-shadow(0 0 5px #ff9d18);
  }
  .cursor-antorcha.visible {
    opacity: 1;
  }
  .cursor-antorcha__luz {
    position: absolute;
    top: -35px;
    left: -35px;
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: radial-gradient(
      circle,
      #ffc83d45 0,
      #ff7b171d 34%,
      transparent 70%
    );
    animation: luz-antorcha 1.2s ease-in-out infinite alternate;
  }
  .cursor-antorcha__llama,
  .cursor-antorcha__llama::after {
    position: absolute;
    content: "";
    border-radius: 70% 30% 65% 35%;
    transform: rotate(45deg);
  }
  .cursor-antorcha__llama {
    top: 1px;
    left: 8px;
    width: 18px;
    height: 22px;
    background: linear-gradient(135deg, #fff4a8 5%, #ffb21c 42%, #e7470b 80%);
    box-shadow:
      0 0 8px #ff9d18,
      0 0 18px #e84d08;
    animation: llama-antorcha 0.28s ease-in-out infinite alternate;
  }
  .cursor-antorcha__llama::after {
    top: 6px;
    left: 6px;
    width: 7px;
    height: 10px;
    background: #fffbd0;
  }
  .cursor-antorcha__copa {
    position: absolute;
    top: 20px;
    left: 7px;
    width: 20px;
    height: 7px;
    border: 1px solid #ffd06a;
    background: #5b3214;
    clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  }
  .cursor-antorcha__mango {
    position: absolute;
    top: 26px;
    left: 14px;
    width: 6px;
    height: 21px;
    border: 1px solid #9c621e;
    background: linear-gradient(90deg, #43230e, #ae6d26 50%, #3b1d0a);
  }
  .cursor-antorcha.sobre-enlace {
    filter: drop-shadow(0 0 7px #00d7f2);
  }
  .cursor-antorcha.sobre-enlace .cursor-antorcha__llama {
    transform: rotate(45deg) scale(1.18);
  }
}
@keyframes llama-antorcha {
  from {
    transform: rotate(41deg) scale(0.92, 1.08);
  }
  to {
    transform: rotate(49deg) scale(1.08, 0.94);
  }
}
@keyframes luz-antorcha {
  from {
    opacity: 0.55;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-antorcha__luz,
  .cursor-antorcha__llama {
    animation: none;
  }

}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: #f4ead8;
  background-color: #080806;
  background-image: url("../imagenes/1.1.0.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

/* Contenedor principal de la primera pantalla. */
.inicio {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 7rem clamp(1.5rem, 7vw, 7rem) 8.5rem;
  overflow: hidden;
}

.inicio::after {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background: url("../imagenes/1.1.1.png") center top/cover no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.inicio.antorcha-encendida::after {
  opacity: 1;
}
.activar-antorcha {
  position: absolute;
  z-index: 6;
  top: 25.5%;
  left: 46.7%;
  display: grid;
  place-items: center;
  width: 9rem;
  height: 9rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--oro-claro);
  background: radial-gradient(
    circle,
    #ffb42b26 0 18%,
    #040706b8 19% 43%,
    transparent 44%
  );
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 18px #e78618);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
.activar-antorcha::before,
.activar-antorcha::after {
  position: absolute;
  inset: 8px;
  border: 1px solid #e6a52e;
  border-radius: 50%;
  content: "";
}
.activar-antorcha::after {
  inset: 20px;
  border-color: var(--cian);
  border-style: dashed;
  animation: girar-indicador 5s linear infinite reverse;
}
.activar-antorcha__anillo {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--oro-claro);
  border-right-color: #9b6517;
  border-radius: 50%;
  animation: girar-indicador 3s linear infinite;
}
.activar-antorcha__centro {
  display: none;
  font-size: 1.8rem;
  text-shadow: 0 0 12px #ff9d18;
  animation: pulso-indicador 1s ease-in-out infinite alternate;
}
.activar-antorcha small {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  padding: 0;
  color: var(--cian);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 0.3rem rgba(0, 229, 240, 0.65);
  animation: pulso-luz-encender 1.35s ease-in-out infinite alternate;
  pointer-events: none;
}
.activar-antorcha:hover,
.activar-antorcha:focus-visible {
  filter: drop-shadow(0 0 25px #ffc13b);
  outline: 1px solid var(--cian);
  outline-offset: 5px;
}
.antorcha-encendida .activar-antorcha {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
  pointer-events: none;
}
.activar-antorcha[hidden] {
  display: none;
}
@keyframes girar-indicador {
  to {
    transform: rotate(1turn);
  }
}
@keyframes pulso-indicador {
  to {
    transform: scale(1.25);
    color: #fff3b0;
  }
}
@keyframes pulso-luz-encender {
  from {
    color: var(--cian);
    text-shadow:
      0 0 0.25rem rgba(0, 229, 240, 0.55),
      0 0 0.55rem rgba(0, 229, 240, 0.25);
  }
  to {
    color: #8ffaff;
    text-shadow:
      0 0 0.4rem rgba(143, 250, 255, 0.95),
      0 0 0.9rem rgba(0, 229, 240, 0.9),
      0 0 1.4rem rgba(0, 229, 240, 0.7);
  }
}

/* Sombra suave para mantener legible el contenido colocado a la izquierda. */
.inicio::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.42) 40%,
    rgba(0, 0, 0, 0.05) 68%,
    transparent 100%
  );
  pointer-events: none;
}

.inicio__contenido {
  z-index: 1;
  width: min(100%, 42rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

button,
a {
  font: inherit;
}

.barra-superior {
  position: absolute;
  z-index: 3;
  top: 1.25rem;
  left: clamp(1rem, 3vw, 3rem);
  right: clamp(1rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--oro-claro);
}

.insignia {
  display: grid;
  place-items: center;
  width: 4.2rem;
  aspect-ratio: 1;
  border: 2px solid var(--oro);
  outline: 1px solid #68440e;
  outline-offset: 4px;
  background: rgba(0, 0, 0, 0.82);
  font:
    700 1.5rem Georgia,
    serif;
}

.marca {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 1rem;
  border: 1px solid #795116;
  background: var(--panel);
}

.marca span,
.ubicacion small {
  margin-top: 0.25rem;
  color: var(--cian);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.controles {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.controles button,
.controles span {
  padding: 0.65rem 0.85rem;
  border: 1px solid #795116;
  color: #eee7d9;
  background: rgba(0, 0, 0, 0.8);
}

.controles b {
  color: var(--cian);
}
.antorcha-pendiente a {
  pointer-events: none;
  opacity: 0.42;
  filter: grayscale(0.7);
}
.antorcha-pendiente .acciones::after {
  display: block;
  flex-basis: 100%;
  margin-top: 0.55rem;
  padding: 0.3rem 0.65rem;
  border-left: 2px solid var(--oro);
  color: var(--oro-claro);
  background: #030706d9;
  content: "ENCIENDE LA ANTORCHA PARA CONTINUAR";
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}
.inicio a {
  transition:
    opacity 0.45s ease,
    filter 0.45s ease;
}
.controles .reiniciar-antorcha {
  color: var(--cian);
  border-color: #08778a;
}
.controles .reiniciar-antorcha:hover,
.controles .reiniciar-antorcha:focus-visible {
  color: #07100f;
  background: var(--cian);
  outline: none;
}

.etiqueta,
.disponible {
  display: table;
  margin: 0 0 0.5rem;
  padding: 0.32rem 0.8rem;
  border-left: 2px solid var(--cian);
  color: var(--cian);
  background: rgba(2, 8, 8, 0.82);
  font-weight: 700;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  color: #dca34d;
  font:
    900 clamp(3.8rem, 6.3vw, 7rem)/0.78 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  -webkit-text-stroke: 1px #4a2609;
  text-shadow:
    0 3px 0 #402108,
    0 7px 14px #000,
    2px 0 0 #f5d58d;
}

h1 span {
  font-size: 1.06em;
}

.profesion {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: fit-content;
  margin-top: 1.15rem;
  padding: 0.35rem 1rem;
  border-left: 3px solid var(--cian);
  background: var(--panel);
}

.profesion strong {
  color: var(--oro-claro);
  font-size: clamp(0.92rem, 1.35vw, 1.2rem);
}

.profesion span {
  color: #ddd5c9;
}

.descripcion {
  width: fit-content;
  margin: 0.85rem 0 0;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(230, 165, 46, 0.4);
  border-left-color: transparent;
  color: #d9d6d0;
  background: rgba(8, 12, 12, 0.88);
  font:
    1rem/1.45 Arial,
    sans-serif;
}

.disponible {
  margin-top: 0.35rem;
  border: 1px solid #9b650f;
  color: var(--oro-claro);
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.boton {
  display: flex;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.7rem 1.1rem;
  border: 2px solid #a66d13;
  color: #e9d4ae;
  background: rgba(7, 8, 7, 0.91);
  text-decoration: none;
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.65),
    0 4px 16px #000;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.boton:hover {
  transform: translateY(-2px);
  filter: brightness(1.13);
}
.boton strong {
  display: block;
  font-size: 1.05rem;
}
.boton small {
  display: block;
  margin-top: 0.25rem;
}
.boton__icono {
  margin-right: 0.8rem;
  font-size: 2.2rem;
}

.boton--principal {
  color: #211507;
  background: linear-gradient(#f3bf5a, #c78626);
}

.inicio.antorcha-encendida .boton--principal {
  animation: pulso-iniciar-expedicion 2s ease-in-out infinite;
}

@keyframes pulso-iniciar-expedicion {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 3px rgba(0, 0, 0, 0.65),
      0 4px 16px #000,
      0 0 0 rgba(243, 191, 90, 0);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 231, 174, 0.28),
      0 4px 16px #000,
      0 0 0.65rem rgba(243, 191, 90, 0.85),
      0 0 1.5rem rgba(0, 216, 232, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .activar-antorcha small {
    animation: none;
  }

  .inicio.antorcha-encendida .boton--principal {
    animation: none;
    box-shadow:
      inset 0 0 0 3px rgba(255, 231, 174, 0.2),
      0 4px 16px #000,
      0 0 0.75rem rgba(243, 191, 90, 0.6);
  }
}

.ubicacion {
  position: absolute;
  z-index: 2;
  top: 8rem;
  right: clamp(1.5rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 19rem;
  padding: 2rem;
  border: 2px solid #9d6819;
  clip-path: polygon(7% 0, 100% 0, 100% 88%, 92% 100%, 0 100%, 0 9%);
  background: rgba(8, 10, 8, 0.88);
  box-shadow: inset 0 0 25px #000;
  transform: rotate(-1deg);
}

.ubicacion strong {
  color: var(--oro-claro);
  font-size: 1.35rem;
}
.ubicacion span {
  font-size: 0.82rem;
  font-weight: 700;
}
.ruta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cian);
}
.ruta i {
  width: 70%;
  height: 2px;
  background: var(--cian);
}
.ruta b {
  font-size: 2.2rem;
}

.menu-inferior {
  position: absolute;
  z-index: 4;
  right: 9%;
  bottom: 1.2rem;
  left: 9%;
  display: grid;
  grid-template-columns: repeat(3, 1fr) 7rem repeat(3, 1fr);
  min-height: 5.6rem;
  border: 2px solid #8a5a16;
  clip-path: polygon(3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
  background: rgba(5, 7, 6, 0.94);
}

.menu-inferior a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border-right: 1px solid #5d411b;
  color: #f1c36d;
  text-decoration: none;
}

.menu-inferior a:hover {
  background: rgba(230, 165, 46, 0.12);
}
.menu-inferior a b {
  font-size: 1.65rem;
}
.menu-inferior a span {
  display: flex;
  flex-direction: column;
}
.menu-inferior small {
  margin-top: 0.3rem;
  color: #d4cbbb;
  font-size: 0.65rem;
}

.sello {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 7rem;
  height: 7rem;
  align-self: center;
  border: 5px double var(--oro);
  border-radius: 50%;
  color: var(--oro-claro);
  background: #050808;
  box-shadow:
    0 0 0 5px #062c32,
    0 0 0 7px var(--cian),
    0 0 22px #000;
  font:
    700 1.8rem Georgia,
    serif;
}

@media (max-width: 760px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background-color: #020403;
    background-image: url("../imagenes/inicio-movil-apagada.webp");
    background-attachment: scroll;
    background-position: center top;
    background-size: auto 100dvh;
  }

  .inicio {
    display: block;
    height: 100dvh;
    min-height: 100svh;
    padding: 0.75rem 0.85rem 5.25rem;
    overflow: hidden;
  }

  .inicio::after {
    position: fixed;
    background-image: url("../imagenes/inicio-movil-encendida.webp");
    background-position: center top;
    background-size: auto 100dvh;
  }

  .inicio::before {
    position: fixed;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(0, 0, 0, 0.76) 30%,
      rgba(0, 0, 0, 0.18) 61%,
      rgba(0, 0, 0, 0.34) 100%
    );
  }

  .activar-antorcha {
    position: fixed;
    top: 23.5dvh;
    left: 29.5%;
    width: 6rem;
    height: 6rem;
  }
  .activar-antorcha::before { inset: 6px; }
  .activar-antorcha::after { inset: 15px; }
  .activar-antorcha__centro { font-size: 1.35rem; }
  .activar-antorcha small {
    font-size: 0.55rem;
  }

  .barra-superior {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    align-items: flex-start;
    gap: 0.55rem;
  }
  .insignia {
    width: 3.15rem;
    flex: 0 0 3.15rem;
    font-size: 1.05rem;
  }
  .marca {
    display: none;
  }
  .controles {
    display: flex;
    min-width: 0;
    gap: 0.25rem;
    margin-left: auto;
  }
  .controles button {
    display: grid;
    width: 2.55rem;
    min-height: 2.55rem;
    padding: 0.3rem;
    place-items: center;
    font-size: 0.66rem;
  }
  .controles .control-sonido {
    font-size: 0;
  }
  .controles .control-sonido b { display: none; }
  .controles .control-sonido::before {
    content: "🔊";
    font-size: 1.05rem;
    line-height: 1;
  }
  .controles .control-sonido[aria-pressed="true"]::after {
    color: var(--cian);
    content: "ON";
    font-size: 0.48rem;
  }
  .controles .control-sonido[aria-pressed="true"] {
    border-color: var(--cian);
    animation: pulso-sonido-movil 1.65s ease-in-out infinite;
  }
  .controles .control-sonido[aria-pressed="false"]::after {
    color: #c58e54;
    content: "OFF";
    font-size: 0.48rem;
  }
  .controles .control-sonido[aria-pressed="false"]::before {
    content: "🔇";
  }
  .controles .reiniciar-antorcha {
    font-size: 0;
  }
  .controles .reiniciar-antorcha[hidden] { display: none; }
  .controles .reiniciar-antorcha::before {
    content: "↻";
    font-size: 1.05rem;
  }

  .inicio__contenido {
    position: absolute;
    right: 0.85rem;
    bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
    left: 0.85rem;
    width: auto;
    margin-top: 0;
  }
  .etiqueta,
  .disponible {
    margin-bottom: 0.35rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.58rem;
  }
  h1 {
    font-size: clamp(2.8rem, 14.5vw, 4.3rem);
    line-height: 0.8;
  }
  .profesion {
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.4rem 0.65rem;
  }
  .profesion strong { font-size: 0.8rem; }
  .profesion span { font-size: 0.64rem; }
  .descripcion {
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.38;
  }
  .descripcion br {
    display: none;
  }
  .disponible { margin-top: 0.3rem; }
  .acciones {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .boton {
    min-width: 0;
    width: 100%;
    min-height: 4.1rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.55rem 0.45rem;
    text-align: center;
  }
  .boton strong {
    font-size: 0.72rem;
    line-height: 1.18;
  }
  .boton small {
    margin-top: 0.1rem;
    font-size: 0.54rem;
    line-height: 1.15;
  }
  .boton__icono {
    display: none;
  }
  .boton--secundario {
    border-color: #8b641e;
    color: var(--oro-claro);
    background: linear-gradient(180deg, rgba(18, 24, 22, 0.96), rgba(4, 8, 8, 0.96));
  }
  .ubicacion {
    display: none;
  }

  .inicio .menu-global {
    position: fixed;
    right: 0.45rem;
    bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
    left: 0.45rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 3.8rem;
    clip-path: none;
  }
  .inicio .menu-global__ubicacion,
  .inicio .menu-global__atributos,
  .inicio .menu-global__sello {
    display: none;
  }
  .inicio .menu-global__item {
    gap: 0.2rem;
    padding: 0.35rem 0.2rem;
    text-align: center;
  }
  .inicio .menu-global__item > b { font-size: 1.05rem; }
  .inicio .menu-global__item > span { align-items: center; }
  .inicio .menu-global__item strong { font-size: 0.56rem; }
  .inicio .menu-global__item small,
  .inicio .menu-global__item em { display: none; }

  .hallazgo-global {
    min-width: 0;
    width: calc(100vw - 2rem);
    padding: 0.85rem 1rem;
  }

  .menu-inferior {
    position: fixed;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    grid-template-columns: repeat(3, 1fr);
    min-height: 4.5rem;
    clip-path: none;
  }

  .menu-inferior a:nth-of-type(n + 4),
  .sello {
    display: none;
  }
  .menu-inferior a {
    padding: 0.4rem;
    font-size: 0.7rem;
  }
  .menu-inferior a b {
    display: none;
  }
}

@keyframes pulso-sonido-movil {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 240, 0), 0 0 0.45rem rgba(0, 229, 240, 0.22);
  }
  50% {
    box-shadow: 0 0 0 0.22rem rgba(0, 229, 240, 0.12), 0 0 1rem rgba(0, 229, 240, 0.72);
  }
}

@media (max-width: 380px), (max-height: 700px) and (max-width: 760px) {
  .inicio__contenido {
    bottom: calc(4.65rem + env(safe-area-inset-bottom, 0px));
  }
  .etiqueta { font-size: 0.52rem; }
  h1 { font-size: clamp(2.55rem, 13.5vw, 3.5rem); }
  .descripcion { font-size: 0.72rem; }
  .boton { min-height: 3.45rem; }
}

@media (max-height: 600px) and (max-width: 760px) {
  .etiqueta,
  .descripcion,
  .disponible {
    display: none;
  }

  .profesion {
    margin-top: 0.45rem;
  }

  .acciones {
    margin-top: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
