/* =========================================================
   Museo Etnográfico y Colonial «Juan de Garay»
   Versión con pestañas. Diseñada primero para celular (390 px,
   como la maqueta de Illustrator) y adaptada a computadora.
   ========================================================= */
:root {
  --brown: #522718;
  --gold: #E3B663;
  --blue: #86ACBA;
  --rust: #9E3F23;

  --font: "Lexend", system-ui, sans-serif;
  --font-display: "Lexend Deca", "Lexend", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --bar: 42px;
  --page: var(--blue);
}

body[data-tab="inicio"]    { --page: var(--blue); }
body[data-tab="museo"]     { --page: var(--brown); }
body[data-tab="tesoro"]    { --page: var(--rust); }
body[data-tab="sopa"]      { --page: var(--blue); }
body[data-tab="visitanos"] { --page: var(--brown); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--brown);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s ease;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ol { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* =========================================================
   BARRA DE PESTAÑAS
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar);
  display: flex;
  align-items: stretch;
  background: var(--gold);
  box-shadow: 0 6px 18px -12px rgba(30, 8, 2, .6);
}
.brand {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0 3px 0 8px;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform .5s var(--ease-out);
}
.brand:hover img { transform: rotate(-10deg) scale(1.06); }

.tabs {
  flex: 1;
  display: flex;
  justify-content: space-between;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 clamp(3px, 1.15vw, 26px);
  font-size: clamp(8.5px, 2.42vw, 16px);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--brown);
  transition: background-color .35s ease, color .35s ease;
}
.tab::after { /* subrayado al pasar el mouse */
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 8px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .35s var(--ease-out);
}
.tab:hover::after, .tab:focus-visible::after { transform: scaleX(1); }
/* la pestaña activa toma el color de su página, como en la maqueta */
.tab.is-active { background: var(--page); color: var(--gold); }
.tab.is-active::after { display: none; }
body[data-tab="inicio"] .tab.is-active,
body[data-tab="sopa"] .tab.is-active { color: var(--brown); }

/* =========================================================
   PANELES (una pestaña = un panel)
   ========================================================= */
.panel {
  min-height: calc(100svh - var(--bar));
  background: var(--page);
  overflow-x: clip;
}
.panel.is-entering { animation: panelIn .7s var(--ease-out) both; }

.col {
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Tipografía ---------- */
.title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: .02em;
}
.title-gold { color: var(--gold); }
.title-brown { color: var(--brown); }
.title-space { margin-top: 56px; }
.subtitle {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .03em;
  margin-top: 30px;
}
.subtitle-gold { color: var(--gold); }
.text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-top: 14px;
}
.text-gold { color: var(--gold); }
.text-brown { color: var(--brown); }
.text-center { text-align: center; }

.rule {
  border: 0;
  width: 82%;
  height: 3px;
  border-radius: 3px;
  margin: 28px 0 0;
}
.rule-gold { background: var(--gold); }
.rule-brown { background: var(--brown); }
.rule-end { margin-top: 52px; }
.rule + .title { margin-top: 44px; }

/* =========================================================
   INICIO
   ========================================================= */
.panel-inicio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 50px 12px 70px;
  overflow: hidden;
}
.gate-wrap {
  width: min(94vw, 365px, calc((100svh - var(--bar) - 190px) * .585));
  transform-origin: 66% 64%;
  transition: transform 1.1s cubic-bezier(.7, 0, .2, 1), opacity .9s ease .25s;
}
.gate { width: 100%; animation: gateIn 1.2s var(--ease-out) both; }
.btn-enter {
  display: inline-grid;
  place-items: center;
  min-width: 181px;
  height: 50px;
  padding: 0 26px;
  border-radius: 25px;
  background: var(--gold);
  color: var(--brown);
  font-size: 15.5px;
  font-weight: 400;
  text-decoration: none;
  box-shadow: 0 10px 22px -12px rgba(30, 8, 2, .7);
  animation: btnIn 1s var(--ease-out) .5s both, pulse 2.6s ease-in-out 1.6s infinite;
  transition: transform .3s var(--ease-out), background-color .3s;
}
.btn-enter:hover { transform: translateY(-3px) scale(1.04); }
.btn-enter:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
/* al tocar "entrar": la cámara atraviesa la puerta abierta */
.panel-inicio.is-leaving .gate-wrap { transform: scale(7); opacity: 0; }
.panel-inicio.is-leaving .btn-enter { opacity: 0; transition: opacity .3s; animation: none; }

/* =========================================================
   MARCOS DORADOS
   ========================================================= */
.framed { position: relative; margin-top: 36px; }
.framed-photo {
  position: absolute;
  inset: 14% 16% 13% 16%;
  width: 68%;
  height: 73%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.framed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 12px 14px rgba(20, 6, 2, .45));
  pointer-events: none;
}
.framed-land { width: 209px; aspect-ratio: 209 / 166; }
.framed-land .framed-photo { inset: 14% 13% 13% 13%; width: 74%; height: 73%; }
.framed-port { width: 141px; aspect-ratio: 141 / 176; }
.framed-vitrina { width: 176px; aspect-ratio: 176 / 140; }
.framed:hover .framed-photo { transform: scale(1.06); }

/* =========================================================
   EL MUSEO
   ========================================================= */
.museo-brown { background: var(--brown); padding: 44px 0 40px; }
.museo-blue  { background: var(--blue);  padding: 70px 0 70px; }
.museo-blue .text + .text { margin-top: 16px; }

/* =========================================================
   BÚSQUEDA DEL TESORO
   ========================================================= */
.panel-tesoro { padding: 41px 0 80px; }
.video-frame {
  width: 100%;
  margin: 0 auto;
  border: 7px solid var(--gold);
  background: var(--rust);
}
/* ---------- Mapa animado: ¿Qué hay debajo? ---------- */
.map-anim {
  position: relative;
  aspect-ratio: 1080 / 1640;
  overflow: hidden;
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-title, .map-sub {
  fill: var(--gold);
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: .02em;
}
.map-title { font-size: 104px; }
.map-sub { font-size: 47px; letter-spacing: .04em; }
.map-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34 26 28 30 40 24;
}
.map-reveal { fill: none; stroke: #fff; stroke-width: 44; stroke-linecap: round; }
.map-obj {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 14px 12px rgba(40, 10, 0, .4));
}
.js .map-obj { opacity: 0; }
.map-obj.is-floating { animation: floatSoft 5.5s ease-in-out infinite; animation-delay: var(--fd, 0s); }
.js .map-anim .map-title,
.js .map-anim .map-sub { opacity: 0; }
.map-anim.is-playing .map-title,
.map-anim.is-playing .map-sub { animation: mapText .9s var(--ease-out) both; }
.map-anim.is-playing .map-title + .map-title { animation-delay: .12s; }
.map-anim.is-playing .map-sub { animation-delay: .3s; }
.map-replay-wrap { display: flex; justify-content: center; min-height: 34px; margin-top: 14px; }
.map-replay {
  border: 2px solid var(--gold);
  border-radius: 20px;
  background: rgba(82, 39, 24, .35);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  animation: btnIn .6s var(--ease-out) both;
  transition: background-color .3s, color .3s;
}
.map-replay:hover, .map-replay:focus-visible { background: var(--gold); color: var(--brown); outline: none; }

.cards-trail { position: relative; margin-top: 60px; padding: 30px 0 120px; }
.trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.trail-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* rayitas de distinto largo, como dibujadas a mano */
  stroke-dasharray: 18 24 9 21 27 25 12 24;
}
.trail-x-mark {
  fill: none;
  stroke: var(--gold);
  stroke-width: .62;
  stroke-linecap: round;
  animation: xPulse 2.4s ease-in-out infinite;
}

.card-grid {
  position: relative;
  display: grid;
  grid-template-columns: 277px;
  justify-content: center;
  gap: 38px;
}

/* ---------- Tarjetas que se dan vuelta ---------- */
.flip {
  perspective: 1400px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.flip-inner { /* las dos caras comparten celda: la tarjeta toma la altura de la más alta */
  display: grid;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3, 1.35, .45, 1);
}
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) {
  .flip:hover:not(.is-flipped) .flip-inner { transform: rotateY(-8deg) rotateX(4deg) translateY(-6px); }
}
.flip:focus-visible .face { box-shadow: 0 0 0 4px var(--brown); }
.flip-brown:focus-visible .face { box-shadow: 0 0 0 4px var(--gold); }

.face {
  grid-area: 1 / 1;
  position: relative;
  border-radius: 47px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 20px 30px -18px rgba(25, 6, 0, .7);
}
.flip-brown .face { background: var(--brown); }
.flip-gold .face { background: var(--gold); }
.face-front {
  aspect-ratio: 277 / 234;
  display: grid;
  place-items: center;
  transform: rotateY(0deg); /* capa 3D propia: evita el parpadeo al girar en Safari/Chrome del celular */
}
/* todo lo que se anima dentro de una cara también se oculta de espaldas */
.face *, .face::after {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* mientras la tarjeta está dada vuelta, la foto de atrás deja de flotar */
.flip.is-flipped .face-front .float-soft,
.flip.is-flipped .flip-hint { animation-play-state: paused; }
.face-front .obj { max-height: 82%; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .35)); }
.face-front::after { /* destello al pasar el mouse */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 240, 200, .2) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) {
  .flip:hover .face-front::after { transform: translateX(120%); }
}
.face-duo { display: block; }
.face-duo .obj-a { position: absolute; width: 58%; top: 14%; right: 10%; }
.face-duo .obj-b { position: absolute; width: 46%; top: 44%; left: 9%; }

.face-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 34px;
  text-align: justify;
  text-align-last: center;
}
.back-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.12;
  text-align: center;
  letter-spacing: .02em;
  margin: 0 -16px 10px;
}
.face-back p {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.face-back p + p { margin-top: 10px; }
.flip-brown .back-title { color: var(--blue); }
.flip-brown .face-back p { color: var(--gold); }
.flip-gold .back-title { color: var(--rust); }
.flip-gold .face-back p { color: var(--brown); }

/* indicador "tocá para girar" */
.flip-hint {
  position: absolute;
  right: 20px;
  bottom: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: .75;
  animation: hint 2.6s ease-in-out infinite;
  transition: transform .4s var(--ease-out);
}
.flip-hint::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E") center / 15px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.flip-brown .flip-hint { color: var(--gold); }
.flip-gold .flip-hint { color: var(--brown); }
@media (hover: hover) {
  .flip:hover .flip-hint { transform: rotate(200deg) scale(1.08); animation-play-state: paused; }
}

/* =========================================================
   SOPA DE LETRAS
   ========================================================= */
.panel-sopa { padding: 64px 0 90px; }
.kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-top: 22px;
}
.howto {
  list-style: none;
  padding: 0;
  margin-top: 26px;
  text-align: left;
  font-size: 11.6px;
  font-weight: 600;
  line-height: 1.3;
  counter-reset: paso;
}
.howto li { counter-increment: paso; }
.howto li::before { content: counter(paso) "- "; }

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 12px;
  margin: 34px -20px 0;
}
.pill {
  border: 0;
  cursor: pointer;
  padding: 7px 11px;
  border-radius: 20px;
  background: var(--gold);
  color: var(--brown);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 8px 16px -10px rgba(30, 8, 2, .6);
  transition: transform .3s var(--ease-out), background-color .3s, color .3s;
}
.pill:hover { transform: translateY(-3px); }
.pill:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }
.pill.is-done { background: var(--brown); color: var(--gold); }
.pill.is-done::after { content: " ✓"; }

/* ---------- Tarjeta de la sopa ---------- */
.puzzle {
  width: 325px;
  margin: 58px auto 0;
  perspective: 1600px;
}
.puzzle-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.3, 1.3, .45, 1);
}
.puzzle.is-flipped .puzzle-inner { transform: rotateY(180deg); }
.puzzle-face {
  grid-area: 1 / 1;
  background: var(--gold);
  border-radius: 40px;
  padding: 50px 26px 44px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 22px 34px -20px rgba(25, 6, 0, .6);
}
.puzzle-back { transform: rotateY(180deg); }
.puzzle-front { transform: rotateY(0deg); } /* capa 3D propia (Safari/Chrome del celular) */
.puzzle-face *, .puzzle-face svg * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* refuerzo: a mitad del giro, la cara que queda de espaldas se oculta del todo,
   así las letras de las dos grillas nunca se mezclan */
.puzzle-front, .puzzle-back { transition: visibility 0s linear .13s; } /* el giro pasa la mitad a los .13 s */
.puzzle.is-flipped .puzzle-front,
.puzzle:not(.is-flipped) .puzzle-back { visibility: hidden; }

.grid {
  --cell: 22px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, var(--cell));
  grid-auto-rows: calc(var(--cell) * .78);
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.grid-solution { touch-action: auto; }
.cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: calc(var(--cell) * .6);
  font-weight: 700;
  color: var(--brown);
  cursor: pointer;
  transition: color .2s, transform .2s;
}
.grid-solution .cell { cursor: default; }
.cell.is-active { color: var(--rust); transform: scale(1.15); }
.marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.mark {
  fill: rgba(158, 63, 35, .2);
  stroke: var(--rust);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: markIn .45s var(--ease-out) both;
}
.mark-live { fill: rgba(134, 172, 186, .45); stroke: var(--blue); stroke-dasharray: 4 3; animation: none; }
.mark-solution { fill: none; stroke: var(--blue); stroke-width: 2; animation: none; }

.puzzle-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 22px auto 0;
}
.puzzle-count { font-size: 13px; font-weight: 600; }
.puzzle-count.is-complete { font-weight: 800; animation: pop .6s var(--ease-out); }
.btn-flip {
  border: 2px solid var(--brown);
  background: transparent;
  cursor: pointer;
  padding: 9px 20px 9px 42px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  transition: background-color .3s, color .3s, transform .3s var(--ease-out);
}
.btn-flip::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .5s var(--ease-out);
}
.btn-flip:hover { background: var(--brown); color: var(--gold); }
.btn-flip:hover::before { transform: rotate(200deg); }
.btn-flip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.card-grid-sopa { margin-top: 80px; }
.flip.is-highlight .face { animation: glowCard 1.4s ease; }

/* =========================================================
   VISITANOS
   ========================================================= */
.panel-visitanos { padding: 44px 0 90px; color: var(--gold); }
.col-visit { max-width: 350px; padding: 0 4px; }
.visit-lead { color: var(--blue); font-size: 12px; font-weight: 700; }
.visit-blocks {
  width: 100%;
  display: grid;
  gap: 26px;
  margin-top: 40px;
  text-align: left;
}
.visit-title { font-size: 14.5px; font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
.visit-blocks p { font-size: 11px; font-weight: 600; line-height: 1.4; }
.visit-blocks p + p { margin-top: 10px; }
.visit-invite { margin-top: 44px; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.visit-blocks a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .4s var(--ease-out); }
.visit-blocks a:hover, .visit-blocks a:focus-visible { background-size: 100% 1.5px; }
.logo-gob { width: 175px; margin-top: 44px; align-self: flex-start; }

/* =========================================================
   ANIMACIONES
   ========================================================= */
@keyframes panelIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes gateIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes mapText { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes btnIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 22px -12px rgba(30, 8, 2, .7), 0 0 0 0 rgba(227, 182, 99, .6); }
  60% { box-shadow: 0 10px 22px -12px rgba(30, 8, 2, .7), 0 0 0 14px rgba(227, 182, 99, 0); }
}
@keyframes float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: 0 -8px; rotate: .6deg; }
}
@keyframes floatAlt {
  0%, 100% { translate: 0 -5px; rotate: .4deg; }
  50% { translate: 0 4px; rotate: -.5deg; }
}
@keyframes floatSoft {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: 0 -7px; rotate: -1.5deg; }
}
@keyframes xPulse { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.18) rotate(8deg); } }
@keyframes hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 182, 99, .45); }
  60% { box-shadow: 0 0 0 10px rgba(227, 182, 99, 0); }
}
@keyframes markIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes glowCard {
  0%, 100% { box-shadow: 0 20px 30px -18px rgba(25, 6, 0, .7); }
  35% { box-shadow: 0 0 0 6px var(--brown), 0 20px 30px -18px rgba(25, 6, 0, .7); }
}

.float { animation: float 6.5s ease-in-out infinite; }
.float-alt { animation-name: floatAlt; animation-duration: 7.5s; }
.float-soft { animation: floatSoft 5.5s ease-in-out infinite; animation-delay: var(--fd, 0s); }

/* Aparición al hacer scroll (solo si hay JS) */
.js [data-reveal] {
  opacity: 0;
  transition: opacity .8s var(--ease-out) var(--d, 0s), transform 1s var(--ease-out) var(--d, 0s);
}
.js [data-reveal="up"]   { transform: translateY(30px); }
.js [data-reveal="zoom"] { transform: scale(.9); }
.js [data-reveal="rule"] { transform: scaleX(0); opacity: 1; transition-duration: 1.1s; }
.js [data-reveal].in     { opacity: 1; transform: none; }
.js .trail > *   { opacity: 0; transition: opacity 1s ease; }
.js .cards-trail.in .trail > * { opacity: 1; }

/* =========================================================
   COMPUTADORA
   ========================================================= */
@media (min-width: 760px) {
  :root { --bar: 72px; }
  .brand { padding: 0 18px 0 28px; }
  .brand img { width: 56px; height: 56px; }
  .tabs { justify-content: center; gap: 4px; }
  .tab { font-size: clamp(14px, 1.25vw, 16px); padding: 0 clamp(8px, 1.6vw, 22px); }
  .btn-enter { min-width: 230px; height: 60px; border-radius: 30px; font-size: 19px; }
  .gate-wrap { width: min(365px, calc((100svh - var(--bar) - 210px) * .585)); }

  .col { max-width: 640px; }
  .title { font-size: 40px; }
  .subtitle { font-size: 26px; margin-top: 48px; }
  .text { font-size: 18px; line-height: 1.45; margin-top: 20px; }
  .title-space { margin-top: 110px; }
  .rule { height: 4px; margin-top: 54px; }
  .rule-end { margin-top: 90px; }
  .rule + .title { margin-top: 80px; }

  .framed { margin-top: 56px; }
  .framed-land { width: 440px; }
  .framed-port { width: 280px; }
  .framed-vitrina { width: 420px; }

  .museo-brown { padding: 80px 0 70px; }
  .museo-blue { padding: 110px 0 100px; }

  .panel-tesoro { padding: 64px 24px 110px; }
  .video-frame { max-width: 520px; border-width: 10px; }
  .map-replay { font-size: 14px; padding: 8px 20px; }
  .cards-trail { max-width: 1120px; margin: 90px auto 0; padding: 50px 0 150px; }
  .card-grid { grid-template-columns: repeat(2, 400px); gap: 64px 90px; }
  .face { border-radius: 64px; }
  .face-back { padding: 40px 54px; }
  .back-title { font-size: 26px; margin: 0 -20px 16px; }
  .face-back p { font-size: 15px; }
  .face-back p + p { margin-top: 14px; }
  .flip-hint { width: 38px; height: 38px; right: 28px; bottom: 22px; }
  .flip-hint::before { -webkit-mask-size: 19px; mask-size: 19px; }
  .trail-path { stroke-width: 10; }
  .trail-x-mark { stroke-width: .66; }

  .panel-sopa { padding: 90px 24px 120px; }
  .kicker { font-size: 18px; margin-top: 26px; }
  .howto { font-size: 17px; margin-top: 34px; }
  .pills { gap: 18px 22px; margin: 44px auto 0; max-width: 520px; }
  .pill { font-size: 15px; padding: 10px 20px; border-radius: 24px; }
  .puzzle { width: 560px; margin-top: 70px; }
  .puzzle-face { border-radius: 64px; padding: 70px 40px 64px; }
  .grid { --cell: 36px; }
  .puzzle-count { font-size: 16px; }
  .btn-flip { font-size: 15px; }
  .card-grid-sopa { margin-top: 110px; }

  .panel-visitanos { padding: 80px 24px 120px; }
  .col-visit { max-width: 720px; }
  .visit-lead { font-size: 19px; }
  .visit-blocks { grid-template-columns: 1fr 1fr; gap: 40px 56px; margin-top: 64px; }
  .visit-title { font-size: 22px; margin-bottom: 10px; }
  .visit-blocks p { font-size: 16px; }
  .visit-invite { font-size: 19px; margin-top: 64px; }
  .logo-gob { width: 300px; margin-top: 72px; align-self: center; }
}

@media (min-width: 760px) and (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 320px); gap: 50px 48px; }
  .back-title { font-size: 21px; }
  .face-back { padding: 30px 38px; }
  .face-back p { font-size: 13px; }
}

/* Respetar a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js [data-reveal], .js .trail > * { opacity: 1; transform: none; }
}
