/* =========================================================
   INTRO SECTION - CIELO + LUNA ANIMADA
========================================================= */

.intro-section {
  position: relative;
  overflow: hidden;

  width: 100%;
  max-width: 100%;

  min-height: 100vh;
  padding: 160px 5vw 120px;

  background-image: url("../img/intro/fondo.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  color: #ffffff;
  z-index: 1;
}

/* Capa suave para integrar colores sin tapar el fondo */
.intro-section::before {
  content: "";
  position: absolute;
  inset: 0;

  z-index: 1;
  pointer-events: none;

  background:
    linear-gradient(
      to bottom,
      rgba(214, 232, 247, 0.16) 0%,
      rgba(185, 203, 232, 0.1) 20%,
      rgba(146, 145, 211, 0.08) 38%,
      rgba(70, 108, 179, 0.07) 58%,
      rgba(8, 20, 52, 0.16) 100%
    );
}

/* Nube superior para unir hero-transition con intro */
.intro-section::after {
  content: "";
  position: absolute;

  left: 50%;
  top: -135px;

  width: 100%;
  max-width: 100%;
  height: 285px;

  transform: translateX(-50%);

  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;

  opacity: 0.95;

  z-index: 3;
  pointer-events: none;

  -webkit-mask-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.98) 45%,
      rgba(0, 0, 0, 0.72) 68%,
      rgba(0, 0, 0, 0.28) 86%,
      rgba(0, 0, 0, 0) 100%
    );

  mask-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.98) 45%,
      rgba(0, 0, 0, 0.72) 68%,
      rgba(0, 0, 0, 0.28) 86%,
      rgba(0, 0, 0, 0) 100%
    );
}

.intro-bg-overlay {
  position: absolute;
  inset: 0;

  z-index: 2;
  pointer-events: none;

  background:
    radial-gradient(circle at 68% 62%, rgba(255, 255, 255, 0.05), transparent 22%),
    radial-gradient(circle at 30% 35%, rgba(190, 150, 255, 0.05), transparent 18%),
    linear-gradient(
      to bottom,
      rgba(6, 15, 45, 0.02) 0%,
      rgba(7, 17, 50, 0.08) 45%,
      rgba(7, 17, 50, 0.18) 100%
    );
}

.intro-section .section-inner {
  position: relative;
  z-index: 5;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(46px, 7vw, 96px);
  align-items: center;
}

.intro-text {
  max-width: 720px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;
  padding: 0 17px;
  margin-bottom: 26px;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);

  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  color: rgba(255, 255, 255, 0.92);

  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.intro-section .section-title {
  max-width: 760px;

  color: #ffffff;

  font-size: clamp(2.55rem, 5.8vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
  font-weight: 900;

  margin: 0;

  text-shadow:
    0 12px 35px rgba(0, 0, 0, 0.35),
    0 0 55px rgba(179, 139, 255, 0.22);
}

.section-description {
  max-width: 650px;
  margin-top: 26px;

  color: rgba(255, 255, 255, 0.78);

  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.9;
  font-weight: 500;

  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.section-description + .section-description {
  margin-top: 18px;
}

/* =========================================================
   LUNA - ENTRA EN DIAGONAL DESDE ABAJO/DERECHA
========================================================= */

.intro-moon {
  position: absolute;

  top: 86px;
  left: 72px;

  width: clamp(82px, 8vw, 132px);
  height: auto;

  z-index: 50;

  opacity: 0;

  transform: translate(
    calc(100vw - 72px),
    calc(100vh - 86px)
  ) scale(0.72);

  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.24))
    drop-shadow(0 0 28px rgba(180, 170, 255, 0.18));

  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}

.intro-section.is-visible .intro-moon {
  animation: moonDiagonalRise 4.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes moonDiagonalRise {
  0% {
    opacity: 0;
    transform: translate(
      calc(100vw - 72px),
      calc(100vh - 86px)
    ) scale(0.72);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0.95;
    transform: translate(0, 0) scale(1);
  }
}

/* =========================================================
   CARD VISUAL
========================================================= */

.intro-visual {
  position: relative;

  min-height: 540px;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 4;
}

.glass-art-card {
  position: relative;

  width: min(100%, 470px);
  min-height: 540px;

  border-radius: 46px;
  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.28);

  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.42), transparent 24%),
    radial-gradient(circle at 72% 32%, rgba(187, 111, 255, 0.28), transparent 30%),
    radial-gradient(circle at 50% 76%, rgba(91, 132, 255, 0.22), transparent 34%),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.06)
    );

  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.glass-art-card::before {
  content: "";
  position: absolute;
  inset: 26px;

  z-index: 6;

  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);

  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.02)
    );

  pointer-events: none;
}

.glass-art-card::after {
  content: "";
  position: absolute;
  inset: 0;

  z-index: 7;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 1px,
      transparent 1px,
      transparent 10px
    );

  opacity: 0.14;
  pointer-events: none;
}

.glass-orb {
  position: absolute;
  border-radius: 999px;

  filter: blur(2px);

  pointer-events: none;
}

.orb-01 {
  width: 190px;
  height: 190px;

  top: 54px;
  right: 42px;

  background: rgba(216, 153, 255, 0.36);
  box-shadow: 0 0 80px rgba(216, 153, 255, 0.38);
}

.orb-02 {
  width: 250px;
  height: 250px;

  left: -70px;
  bottom: -54px;

  background: rgba(87, 136, 255, 0.26);
  box-shadow: 0 0 90px rgba(87, 136, 255, 0.28);
}

.glass-content {
  position: absolute;
  inset: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 34px;

  z-index: 8;
}

.glass-content span {
  font-family: "Playfair Display", serif;

  color: rgba(255, 255, 255, 0.88);

  font-size: clamp(4.8rem, 9vw, 8.2rem);
  line-height: 1;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.08em;

  text-shadow:
    0 12px 34px rgba(0, 0, 0, 0.26),
    0 22px 80px rgba(189, 115, 184, 0.28);
}

/* =========================================================
   INTRO ART GALLERY - ESCRITORIO
   Consume obras desde /galeria/backend/api/list_public.php
========================================================= */

.intro-art-gallery {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.intro-art-image-wrap {
  position: absolute;
  inset: 0;

  z-index: 1;

  border-radius: inherit;
  overflow: hidden;
}

.intro-art-image {
  width: 100%;
  height: 100%;

  display: none;

  object-fit: cover;
  object-position: center;

  opacity: 0;
  transform: scale(1.02);

  filter:
    saturate(1.06)
    contrast(1.04)
    brightness(0.9);
}

.intro-art-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;

  z-index: 2;

  background:
    radial-gradient(circle at center, rgba(40, 38, 106, 0.04), rgba(15, 19, 56, 0.28)),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(38, 28, 96, 0.30));

  pointer-events: none;
}

.intro-art-placeholder {
  position: relative;
  z-index: 8;

  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-art-placeholder span {
  color: rgba(255, 255, 255, 0.92);

  font-family: "Playfair Display", serif;
  font-size: clamp(5rem, 8vw, 8rem);
  font-style: italic;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;

  text-shadow:
    0 15px 55px rgba(24, 19, 70, 0.35),
    0 0 40px rgba(255, 255, 255, 0.14);
}

.intro-art-meta {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 24px;

  z-index: 9;

  display: flex;
  flex-direction: column;
  gap: 4px;

  opacity: 0;
  transform: translateY(14px);

  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.intro-art-gallery.gallery-loaded .intro-art-meta,
.intro-art-gallery.gallery-fallback .intro-art-meta {
  opacity: 1;
  transform: translateY(0);
}

.intro-art-label {
  color: rgba(255, 255, 255, 0.94);

  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;

  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.intro-art-subtitle {
  color: rgba(255, 255, 255, 0.78);

  font-size: 0.78rem;
  font-weight: 700;

  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

/* Mantener los orbes por encima de la imagen */
.intro-art-gallery .glass-orb {
  z-index: 5;
  pointer-events: none;
}

/* Mantener el contenido y brillos por encima de la imagen */
.intro-art-gallery .glass-content {
  pointer-events: none;
}

/* Cuando carga imagen, ocultamos el texto "Arte" */
.intro-art-gallery.gallery-loaded .intro-art-placeholder {
  display: none;
}

/* Cuando falla la galería, vuelve a mostrar "Arte" */
.intro-art-gallery.gallery-fallback .intro-art-placeholder {
  display: flex;
}
/* =========================================================
   MODAL GALERÍA DE ARTE - ESCRITORIO
========================================================= */

.intro-art-gallery {
  cursor: pointer;
}

.intro-art-gallery:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 6px;
}

.art-gallery-modal {
  position: fixed;
  inset: 0;

  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.art-gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.art-gallery-modal-backdrop {
  position: absolute;
  inset: 0;

  background:
    radial-gradient(circle at 50% 40%, rgba(173, 132, 255, 0.24), transparent 36%),
    rgba(9, 14, 42, 0.72);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.art-gallery-modal-card {
  position: relative;
  z-index: 2;

  width: min(100%, 520px);
  padding: 38px;

  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);

  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(
      145deg,
      rgba(75, 85, 156, 0.88),
      rgba(32, 37, 94, 0.92)
    );

  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);

  color: #ffffff;

  transform: translateY(24px) scale(0.94);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.art-gallery-modal.is-open .art-gallery-modal-card {
  transform: translateY(0) scale(1);
}

.art-gallery-modal-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 32px;
  padding: 0 13px;
  margin-bottom: 18px;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);

  background: rgba(255, 255, 255, 0.12);

  color: rgba(255, 255, 255, 0.86);

  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.art-gallery-modal-card h3 {
  margin: 0;

  color: #ffffff;

  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.art-gallery-modal-card p {
  margin: 18px 0 0;

  color: rgba(255, 255, 255, 0.76);

  font-size: 1rem;
  line-height: 1.65;
  font-weight: 500;
}

.art-gallery-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.art-gallery-modal-btn {
  min-height: 50px;
  padding: 0 20px;

  border: 0;
  border-radius: 999px;

  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 900;

  cursor: pointer;

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.art-gallery-modal-btn:hover {
  transform: translateY(-2px);
}

.art-gallery-modal-btn.primary {
  flex: 1;

  background: #ffffff;
  color: #17325c;

  box-shadow: 0 18px 44px rgba(255, 255, 255, 0.14);
}

.art-gallery-modal-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);

  border: 1px solid rgba(255, 255, 255, 0.18);
}