/* ======================================================================
   CRISTAL Y MOVIMIENTO · Cargar después de las otras hojas de estilo.
   1. Menú de cristal  2. Emblema  3. Tarjetas  4. Entradas  5. Accesibilidad
   Sin imágenes, videos ni bibliotecas adicionales. motion.js solo aporta
   coordenadas, sincroniza la cápsula del menú y detecta elementos visibles.
   ====================================================================== */
:root {
  --logo-blue: #161c50; /* Tono azul predominante del PNG original. */
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-speed: 380ms;
}

/* 1 · CRISTAL LÍQUIDO. Reflejos, transparencia y desenfoque del fondo.
 * El color base sigue siendo legible si el navegador no soporta backdrop-filter.
 * La cápsula .nav-lens es decorativa; aria-current sigue indicando la ruta real.
 */
.site-header {
  background: linear-gradient(120deg, #ffffffdb, #f2f4fcbd 55%, #ffffffd9);
  border-bottom: 1px solid #ffffffc7;
  box-shadow:
    0 5px 28px #161c5007,
    inset 0 -1px 0 #161c5008;
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
}
.header-inner {
  height: 76px;
}
.main-nav {
  position: relative;
  isolation: isolate;
  gap: 3px;
  padding: 5px;
  border: 1px solid #ffffffea;
  background: linear-gradient(135deg, #ffffffd9, #e5e9f3a8 45%, #ffffffc2);
  box-shadow:
    0 6px 20px #161c5010,
    0 1px 2px #161c5014,
    inset 0 1px 1px #fff,
    inset 0 -2px 5px #a2adcc22;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
.main-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    ellipse at var(--nav-light, 30%) 0%,
    #fff9,
    transparent 65%
  );
  box-shadow:
    inset 1px 1px 0 #fff9,
    inset -1px -1px 0 #fff7;
}
.main-nav a {
  z-index: 3;
  border-radius: 999px;
  padding: 10px 16px;
  line-height: 1.5;
  color: #4d5571;
  transition:
    color 0.2s,
    transform 0.25s var(--motion-ease);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--logo-blue);
}
.main-nav a[aria-current="page"] {
  background: #ffffffb0;
}
.main-nav[data-lens-ready] a[aria-current="page"] {
  background: transparent;
}
.main-nav a[aria-current="page"]::after {
  display: none;
}
.main-nav a:active {
  transform: scale(0.96);
}
.main-nav .nav-lens {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: var(--lens-width, 72px);
  height: var(--lens-height, 38px);
  transform: translate3d(var(--lens-x, 5px), var(--lens-y, 5px), 0);
  border: 1px solid #ffffffed;
  border-radius: 999px;
  background: linear-gradient(
    155deg,
    #ffffffed 3%,
    #ffffff80 40%,
    #dce3f4a8 100%
  );
  box-shadow:
    0 2px 8px #161c5015,
    inset 0 1px 2px #fff,
    inset 0 -1px 2px #8a9ac939;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 460ms cubic-bezier(0.22, 1.15, 0.36, 1),
    width 460ms var(--motion-ease),
    height 350ms var(--motion-ease),
    opacity 0.15s;
}
.main-nav[data-lens-ready] .nav-lens {
  opacity: 1;
}
.header-cta {
  background: var(--logo-blue);
  border-color: var(--logo-blue);
  color: #fff;
  box-shadow:
    0 5px 14px #161c5024,
    inset 0 1px 0 #ffffff26;
}
.header-cta:hover,
.header-cta:focus-visible {
  background: var(--logo-blue);
  border-color: var(--logo-blue);
  box-shadow:
    0 8px 22px #161c503b,
    inset 0 1px 0 #ffffff48;
  transform: translateY(-2px);
}
.header-cta:active {
  transform: translateY(0) scale(0.97);
}
.menu-toggle {
  border-color: #ffffffed;
  background: linear-gradient(145deg, #ffffffed, #e6eaf3b8);
  box-shadow:
    0 3px 12px #161c5010,
    inset 0 1px 0 white;
}
.menu-toggle span {
  transition: transform 0.25s var(--motion-ease);
}

/* 2 · EMBLEMA. El original se conserva; el halo y las órbitas son CSS.
 * El brillo sigue --spot-x/y. La inclinación se limita a ±3 grados en JS.
 * is-lit dura unos segundos al entrar en pantalla o pulsar; no hay bucle infinito.
 */
.about-art {
  --spot-x: 50%;
  --spot-y: 38%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --drift-x: 0px;
  --drift-y: 0px;
  isolation: isolate;
  border: 1px solid #ffffffc9;
  background:
    radial-gradient(ellipse at 30% 10%, #ffffffb8, transparent 60%), #edf0f8;
  box-shadow:
    0 8px 32px #161c5007,
    inset 0 1px 1px #fff;
  transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition:
    transform 0.45s var(--motion-ease),
    box-shadow 0.5s,
    border-color 0.5s;
}
.about-art::before,
.about-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.5s;
}
.about-art::before {
  opacity: 0;
  background: radial-gradient(
    circle 240px at var(--spot-x) var(--spot-y),
    #ffffffee 0%,
    #d5dcff98 35%,
    #eacfe950 60%,
    transparent 80%
  );
}
.about-art::after {
  background: linear-gradient(
    115deg,
    transparent 30%,
    #ffffff80 45%,
    transparent 60%
  );
  transform: translateX(-110%);
  opacity: 0;
}
.about-art:is(:hover, :focus-within, .is-lit) {
  border-color: #b9c3e9;
  box-shadow:
    0 18px 48px #161c5019,
    0 0 36px #bbc7ff25,
    inset 0 1px 1px white;
}
.about-art:is(:hover, :focus-within, .is-lit)::before {
  opacity: 1;
}
.about-art.is-lit::after {
  animation: light-sweep 1.9s var(--motion-ease) both;
}
.brand-art {
  transform: translateX(-50%) translate3d(var(--drift-x), var(--drift-y), 0);
  transition:
    transform 0.7s var(--motion-ease),
    filter 0.65s;
}
.about-art:is(:hover, :focus-within, .is-lit) .brand-art {
  transform: translateX(-50%)
    translate3d(var(--drift-x), calc(var(--drift-y) - 7px), 0) scale(1.035);
  filter: drop-shadow(0 13px 14px #161c501b);
}
.brand-art img {
  opacity: 1;
}
.orbit {
  transition: border-color 0.5s;
}
.orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: 14%;
  right: 14%;
  border-radius: 50%;
  background: var(--pink);
  box-shadow:
    0 0 0 5px #c91f520b,
    0 0 16px #c91f5230;
}
.orbit-two::after {
  width: 6px;
  height: 6px;
  background: var(--logo-blue);
  box-shadow: 0 0 0 5px #161c5008;
}
.about-art:is(:hover, .is-lit) .orbit {
  border-color: #8494c368;
}
.about-art.is-lit .orbit-one {
  animation: orbit-glide 4.4s var(--motion-ease) both;
}
.about-art.is-lit .orbit-two {
  animation: orbit-glide-reverse 4.4s var(--motion-ease) both;
}
.art-label {
  transition:
    transform 0.7s var(--motion-ease),
    box-shadow 0.5s,
    background 0.5s,
    border-color 0.5s;
}
.about-art:is(:hover, :focus-within, .is-lit) .art-label {
  background: #fffffffa;
  border-color: #c8d2ed;
  box-shadow: 0 7px 18px #161c5010;
}
.about-art:is(:hover, :focus-within, .is-lit) .art-label-one {
  transform: translate(-3px, -7px);
}
.about-art:is(:hover, :focus-within, .is-lit) .art-label-two {
  transform: translate(3px, -5px);
}
.about-art:is(:hover, :focus-within, .is-lit) .art-label-three {
  transform: translate(3px, 5px);
}
.brand-motion-trigger {
  position: absolute;
  z-index: 5;
  right: 15px;
  top: 15px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffffd9;
  border-radius: 50%;
  background: #ffffffa1;
  color: var(--pink);
  font-size: 20px;
  box-shadow: 0 3px 9px #161c5009;
  transition:
    transform 0.3s,
    background 0.3s;
}
.brand-motion-trigger:hover {
  transform: rotate(22deg) scale(1.08);
  background: white;
}
.brand-motion-trigger:active {
  transform: scale(0.9);
}
.about-art-bottom {
  z-index: 2;
}
@keyframes light-sweep {
  0% {
    transform: translateX(-110%);
    opacity: 0;
  }
  30% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(110%);
    opacity: 0;
  }
}
@keyframes orbit-glide {
  0% {
    transform: translateX(-50%) rotate(-26deg);
  }
  100% {
    transform: translateX(-50%) rotate(22deg);
  }
}
@keyframes orbit-glide-reverse {
  0% {
    transform: translateX(-50%) rotate(22deg);
  }
  100% {
    transform: translateX(-50%) rotate(-26deg);
  }
}

/* 3 · RESPUESTAS DE TARJETAS. Hover, teclado y touch-lit comparten el efecto.
 * Solo elementos interactivos llevan cursor de botón; los textos siguen normales.
 */
:is(
  .access-item,
  .context-card,
  .resource-links > a,
  .principles > div,
  .path-steps > li,
  .referral-list article,
  .contact-row,
  .study summary
) {
  transition:
    transform var(--motion-speed) var(--motion-ease),
    box-shadow var(--motion-speed),
    background 0.3s,
    border-color 0.3s;
}
.access-item {
  padding-inline: 18px;
  border-radius: 12px;
}
.access-item:is(:hover, :focus-visible, .touch-lit),
.resource-links > a:is(:hover, :focus-visible, .touch-lit) {
  transform: translateY(-6px);
  background: linear-gradient(135deg, #ffffff, #f0f3fc);
  box-shadow: 0 12px 28px #161c5010;
  border-color: #aab6df;
}
.resource-links > a {
  border-radius: 10px;
  padding-left: 16px;
  padding-right: 38px;
}
.resource-links .icon {
  right: 12px;
}
.context-card:is(:hover, :focus-within, .touch-lit) {
  transform: translateY(-5px);
  border-color: #aebce6;
  box-shadow: 0 15px 32px #161c5012;
}
.principles > div,
.path-steps > li {
  border-radius: 9px;
}
.principles > div:is(:hover, .touch-lit),
.path-steps > li:is(:hover, .touch-lit) {
  transform: translateY(-4px);
  background: #f2f4fc;
  box-shadow: 0 0 0 12px #f2f4fc;
}
.referral-list article:is(:hover, .touch-lit) {
  transform: translateX(4px);
  border-color: #9baad5;
}
.study summary:is(:hover, :focus-visible, .touch-lit) {
  background: linear-gradient(110deg, #f1f4fd, #fff9);
  box-shadow: inset 3px 0 0 var(--logo-blue);
  transform: translateX(3px);
}
.study[open] .study-body {
  animation: detail-in 0.35s var(--motion-ease) both;
}
.contact-row:is(:hover, :focus-visible, .touch-lit) {
  transform: translateX(4px);
  border-color: #a0afd6;
}
.contact-icon {
  transition:
    transform 0.35s var(--motion-ease),
    box-shadow 0.35s;
}
.contact-row:is(:hover, :focus-visible, .touch-lit) .contact-icon {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 5px 16px #161c5012;
}
.text-link .icon,
.button .icon,
.specialty-strip .icon {
  transition: transform 0.3s var(--motion-ease);
}
.text-link:is(:hover, :focus-visible) .icon,
.button:is(:hover, :focus-visible) .icon {
  transform: translateX(3px);
}
.specialty-strip a {
  transition:
    background 0.3s,
    color 0.3s;
}
.specialty-strip a:is(:hover, :focus-visible) {
  background: #e9eefb80;
  color: var(--pink);
}
.specialty-strip a:is(:hover, :focus-visible) .icon {
  transform: translate(2px, -2px);
}
.hero-photo img {
  transition: transform 1.1s var(--motion-ease);
}
.hero-visual:hover .hero-photo img {
  transform: scale(1.035);
}
.photo-label {
  transition:
    transform 0.6s var(--motion-ease),
    box-shadow 0.6s;
}
.hero-visual:hover .photo-label {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px #161c5018;
}
.button:active {
  transform: translateY(0) scale(0.98);
}

/* 4 · ENTRADAS. Solo se ocultan mientras el observador está activo.
 * translate es independiente del transform de hover: las animaciones no compiten.
 */
html[data-motion="on"] .reveal {
  transition:
    opacity 0.65s var(--motion-ease) var(--reveal-delay, 0ms),
    translate 0.65s var(--motion-ease) var(--reveal-delay, 0ms),
    transform var(--motion-speed) var(--motion-ease),
    box-shadow var(--motion-speed),
    background 0.3s,
    border-color 0.3s;
}
html[data-motion="on"] .reveal:not(.is-shown) {
  opacity: 0;
  translate: 0 18px;
}
html[data-motion="on"] .reveal.is-shown {
  opacity: 1;
  translate: 0 0;
}
.image-corner,
.prevention-spark {
  transition: transform 0.6s var(--motion-ease);
}
.hero-visual:hover .image-corner,
.prevention-intro:hover .prevention-spark {
  transform: rotate(45deg) scale(1.08);
}
@keyframes detail-in {
  from {
    opacity: 0.2;
    translate: 0 -5px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes menu-unfold {
  from {
    opacity: 0;
    translate: 0 -8px;
    scale: 0.98;
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@media (max-width: 1050px) and (min-width: 901px) {
  .main-nav a {
    padding-inline: 12px;
  }
}
@media (max-width: 900px) {
  .header-inner {
    height: 72px;
  }
  .js .main-nav {
    border: 1px solid #ffffffec;
    border-radius: 24px;
    background: linear-gradient(135deg, #fffffff0, #e8edf8e0);
    box-shadow:
      0 15px 40px #161c5025,
      inset 0 1px 0 white,
      inset 0 -1px 1px #a4b2d73b;
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
  }
  .js .main-nav.is-open {
    animation: menu-unfold 0.3s var(--motion-ease) both;
  }
  .js .main-nav a {
    border-radius: 15px;
    padding: 12px 16px;
  }
  .js .main-nav a[aria-current="page"] {
    background: #ffffff9e;
    color: var(--logo-blue);
  }
  .js .main-nav[data-lens-ready] a[aria-current="page"] {
    background: transparent;
  }
  .main-nav .nav-lens {
    border-radius: 15px;
  }
}
@media (max-width: 760px) {
  .access-item {
    padding-left: 15px;
    padding-right: 42px;
  }
  .access-item > .icon {
    right: 15px;
  }
  .brand-motion-trigger {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}
/* 5 · ACCESIBILIDAD. Sin ocultar contenido si falta JS o se reduce el movimiento.
 * Se conservan cambios de color y foco, evitando inclinaciones/desplazamientos.
 */
html:not([data-motion="on"]) .brand-motion-trigger {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    translate: none !important;
  }
  .about-art,
  .access-item,
  .context-card,
  .resource-links > a,
  .principles > div,
  .path-steps > li,
  .referral-list article,
  .contact-row,
  .contact-icon,
  .study summary,
  .header-cta,
  .hero-photo img,
  .photo-label,
  .art-label,
  .image-corner,
  .prevention-spark {
    transform: none !important;
  }
  .brand-art {
    transform: translateX(-50%) !important;
  }
  .main-nav .nav-lens {
    transition: none;
  }
}
@media print {
  .reveal {
    opacity: 1 !important;
    translate: none !important;
  }
  .brand-motion-trigger,
  .nav-lens {
    display: none;
  }
}
