/* =====================================================================
   Arte Aurora · Galería pública de obras (usa los tokens de styles.css)
   ===================================================================== */

html { scroll-padding-top: calc(var(--head-h) + 12px); }
body.gal main { padding-bottom: 40px; }

/* ---------- Barra superior ---------- */
.gal-top .brand { flex: 0 1 auto; }
.gal-nav { display: flex; gap: 4px; margin-left: auto; padding: 4px; border-radius: 15px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 50%, transparent); }
.gal-nav a { text-decoration: none; font-size: .86rem; font-weight: 700; color: var(--muted); padding: 8px 14px; border-radius: 11px; transition: color .3s, background .3s; }
.gal-nav a:hover { color: var(--text); background: var(--surface-solid); }
.gal-top-actions { display: flex; align-items: center; gap: 8px; }
.gal-top-actions .btn { flex: none; }
@media (max-width: 860px) {
  .gal-nav { display: none; }
  .gal-top-actions { margin-left: auto; }
}
@media (max-width: 420px) { .gal-top-actions .btn span { display: none; } .gal-top-actions .btn { padding: 9px 11px; } }

/* ---------- Portada ---------- */
.g-hero {
  display: grid; gap: 30px; align-items: center; padding: 34px 4px 30px; min-height: min(78vh, 720px);
}
@media (min-width: 900px) { .g-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding-top: 20px; } }
.g-hero h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 5.6vw, 4.3rem); line-height: 1; letter-spacing: -1.4px; margin: 16px 0 0;
}
.g-hero h1 em, .g-head h2 em, .cta-card h2 em {
  font-style: italic; padding-right: .05em;
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent-3), var(--gold), var(--accent));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s linear infinite;
}
.g-hero p { color: var(--muted); font-size: 1.08rem; max-width: 52ch; margin: 16px 0 0; }
.g-hero-text > * { animation: fadeUp .9s var(--ease) both; }
.g-hero-text > :nth-child(2) { animation-delay: .08s; }
.g-hero-text > :nth-child(3) { animation-delay: .16s; }
.g-hero-text > :nth-child(4) { animation-delay: .24s; }
.g-hero-text > :nth-child(5) { animation-delay: .32s; }
.g-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.g-hero-cta .btn { flex: 0 0 auto; padding: 13px 20px; font-size: .95rem; }
.g-stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.g-stats div { display: flex; flex-direction: column; }
.g-stats strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -1px; line-height: 1;
  background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-stats span { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* Collage flotante */
.g-hero-art { position: relative; height: clamp(360px, 52vw, 560px); perspective: 1200px; }
.hp {
  position: absolute; margin: 0; overflow: hidden; border-radius: 26px; background: var(--surface-solid);
  border: 4px solid color-mix(in srgb, #fff 85%, transparent); box-shadow: var(--shadow-lg);
  transform: translate3d(var(--tx, 0), var(--ty, 0), 0) rotate(var(--r, 0deg));
  transition: transform .9s var(--ease);
  animation: heroIn 1.1s var(--spring) both;
}
.hp img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .9s var(--ease), transform 6s linear; }
.hp img.swap { opacity: 0; }
.hp:hover img { transform: scale(1.06); }
.hp1 { left: 2%; top: 6%; width: 46%; height: 62%; --r: -6deg; animation-delay: .15s; z-index: 2; }
.hp2 { right: 2%; top: 0; width: 42%; height: 50%; --r: 5deg; animation-delay: .3s; z-index: 1; }
.hp3 { left: 16%; bottom: 0; width: 40%; height: 40%; --r: 4deg; animation-delay: .45s; z-index: 3; }
.hp4 { right: 6%; bottom: 4%; width: 40%; height: 46%; --r: -4deg; animation-delay: .6s; z-index: 2; }
.hp-mark { position: absolute; left: 44%; top: 43%; width: 84px; border-radius: 20px; z-index: 4; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .45)); animation: float 5s ease-in-out infinite, heroIn 1s var(--spring) .8s both; }
@keyframes heroIn { from { opacity: 0; transform: translate3d(0, 60px, 0) rotate(0deg) scale(.85); } }

/* ---------- Cinta de estilos ---------- */
.ticker {
  position: relative; overflow: hidden; margin: 10px -18px 0; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 40%, transparent);
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { display: inline-flex; align-items: center; gap: 18px; padding-right: 18px; font-family: var(--display); font-style: italic; font-size: 1.5rem; font-weight: 500; white-space: nowrap; color: var(--text-2); }
.ticker-track span img { width: 30px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.g-section { padding: 70px 0 10px; }
.g-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.g-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -1.2px; line-height: 1.02; margin: 14px 0 0; }
.g-head p { color: var(--muted); margin: 10px 0 0; }

/* Filtros */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.chip {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: .85rem; font-weight: 700;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s var(--spring), background .35s, color .35s, border-color .35s, box-shadow .35s;
}
.chip b { font-size: .7rem; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--muted); transition: inherit; }
.chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.chip.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 22px -12px var(--accent-2); }
.chip.active b { background: rgba(255, 255, 255, .25); color: #fff; }
@media (max-width: 600px) {
  .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -14px 22px; padding: 2px 14px 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* Mosaico */
.masonry { display: flex; gap: 16px; align-items: flex-start; }
.mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 600px) { .masonry, .mcol { gap: 10px; } }
.tile-obra {
  position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 20px; overflow: hidden; background: var(--surface-solid);
  box-shadow: var(--shadow); isolation: isolate;
  opacity: 0; transform: translateY(30px) scale(.97);
  transition: opacity .7s var(--ease), transform .7s var(--ease), box-shadow .4s;
  transition-delay: var(--d, 0ms);
}
@media (max-width: 600px) { .tile-obra { border-radius: 14px; } }
.tile-obra.in { opacity: 1; transform: none; }
.tile-obra.gone { display: none; }
.tile-obra img {
  width: 100%; height: auto; display: block; aspect-ratio: var(--ar); object-fit: cover;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 18%, var(--surface-solid)), color-mix(in srgb, var(--accent-3) 18%, var(--surface-solid)));
  transition: transform .9s var(--ease), filter .6s var(--ease), opacity .6s;
}
.tile-obra img:not(.ok) { opacity: .0; }
.tile-obra::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(3, 10, 16, .82));
  opacity: 0; transition: opacity .45s var(--ease);
}
.tile-obra .cap {
  position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; text-align: left; color: #fff;
  transform: translateY(14px); opacity: 0; transition: transform .5s var(--ease), opacity .4s;
}
.tile-obra .cap small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #ffc2b8; }
.tile-obra .cap b { display: block; font-size: .95rem; line-height: 1.2; }
.tile-obra .zoom {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: #0a1b22; transform: scale(.4); opacity: 0; transition: transform .45s var(--spring), opacity .3s;
}
@media (hover: hover) {
  .tile-obra:hover { box-shadow: var(--shadow-lg); }
  .tile-obra:hover img { transform: scale(1.07); filter: saturate(1.12); }
  .tile-obra:hover::after, .tile-obra:hover .cap { opacity: 1; }
  .tile-obra:hover .cap { transform: none; }
  .tile-obra:hover .zoom { transform: none; opacity: 1; }
}
@media (hover: none) {
  .tile-obra::after { opacity: .9; background: linear-gradient(180deg, transparent 62%, rgba(3, 10, 16, .78)); }
  .tile-obra .cap { opacity: 1; transform: none; left: 10px; right: 10px; bottom: 8px; }
  .tile-obra .cap small { font-size: .58rem; }
  .tile-obra .cap b { font-size: .78rem; }
}

/* ---------- Proceso ---------- */
.steps { position: relative; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pstep {
  position: relative; overflow: hidden; padding: 24px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), var(--glass-hi);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: transform .45s var(--spring), border-color .3s;
}
.pstep:hover { transform: translateY(-6px); border-color: var(--accent); }
.pstep i { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 24px -12px var(--accent-2); }
.pstep i .i { width: 24px; height: 24px; }
.pstep .n { position: absolute; top: 14px; right: 18px; font-family: var(--display); font-style: italic; font-size: 3rem; font-weight: 600; opacity: .12; }
.pstep h3 { margin: 16px 0 6px; font-size: 1.08rem; }
.pstep p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Contacto ---------- */
.cta-card {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: clamp(36px, 6vw, 64px) 22px; border-radius: 30px; color: #fff;
  background: linear-gradient(115deg, #7c3aed, #b07ce8 38%, #ff7a6b 72%, #7c3aed); background-size: 300% 100%;
  animation: flow 14s linear infinite;
  box-shadow: 0 40px 80px -40px rgba(124, 58, 237, .85);
}
.cta-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background:
    radial-gradient(circle at 12% 80%, rgba(255,255,255,.35) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 22%, rgba(255,255,255,.3) 0 3px, transparent 4px),
    radial-gradient(circle at 72% 78%, rgba(255,255,255,.25) 0 6px, transparent 7px),
    radial-gradient(circle at 28% 18%, rgba(255,255,255,.25) 0 3px, transparent 4px),
    radial-gradient(60% 80% at 50% 120%, rgba(255,255,255,.25), transparent);
  animation: bubbles 7s ease-in-out infinite alternate;
}
.cta-mark { width: 150px; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .3)); }
.cta-card h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 4.6vw, 3rem); letter-spacing: -1px; line-height: 1.05; margin: 14px auto 0; max-width: 20ch; }
.cta-card h2 em { background: linear-gradient(100deg, #fff, #ffe0da, #f3e2ff, #fff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; }
.cta-card p { max-width: 50ch; margin: 14px auto 0; opacity: .92; }
.btn.big { flex: none; margin-top: 26px; padding: 16px 28px; font-size: 1.05rem; border-radius: 16px; box-shadow: 0 18px 34px -14px rgba(0, 0, 0, .5); }
.cta-phone { display: block; margin-top: 14px; font-weight: 700; letter-spacing: .5px; opacity: .9; }

.g-foot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 46px 16px 110px; color: var(--muted); font-size: .8rem; }
.g-foot .lk { height: 130px; width: auto; filter: drop-shadow(0 10px 24px rgba(201, 150, 60, .25)); }
.g-foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.g-foot a:hover { color: var(--text, inherit); }
/* Logotipo según el tema: claro sobre fondo oscuro y viceversa */
.lk-light { display: none; }
:root[data-theme="light"] .lk-dark { display: none; }
:root[data-theme="light"] .lk-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .lk-dark { display: none; }
  :root:not([data-theme="dark"]) .lk-light { display: block; }
}

/* Botón flotante de WhatsApp */
.wa-fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 50;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 16px 30px -10px rgba(18, 140, 126, .8);
  transition: transform .4s var(--spring);
  animation: popIn .6s var(--spring) 1s both;
}
.wa-fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: waPulse 2.4s ease-out infinite; }
.wa-fab .i { width: 28px; height: 28px; }
.wa-fab:hover { transform: scale(1.08) rotate(-8deg); }
@keyframes waPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Visor de obras ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: auto 1fr auto;
  background: rgba(2, 8, 12, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff;
  animation: fadeIn .3s var(--ease);
}
.viewer.closing { animation: fadeOut .28s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.v-top, .v-bottom { display: flex; align-items: center; gap: 12px; padding: 14px max(16px, env(safe-area-inset-left)); }
.v-top { justify-content: space-between; }
.v-count { font-weight: 800; font-size: .85rem; letter-spacing: 1px; opacity: .8; }
.v-actions { display: flex; gap: 8px; }
.viewer .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }
.v-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; touch-action: pan-y; overflow: hidden; }
@media (max-width: 600px) { .v-stage { padding: 0 8px; } }
.v-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  user-select: none; -webkit-user-drag: none; will-change: transform;
}
.v-nav {
  position: absolute; top: 50%; z-index: 2; width: 50px; height: 50px; margin-top: -25px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: #fff;
  transition: transform .35s var(--spring), background .3s;
}
.v-nav:hover { background: rgba(255, 255, 255, .22); transform: scale(1.08); }
.v-nav.prev { left: 10px; } .v-nav.next { right: 10px; }
@media (max-width: 600px) { .v-nav { display: none; } }
.v-bottom { justify-content: space-between; flex-wrap: wrap; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.v-info { min-width: 0; }
.v-cat { font-size: .7rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #ffc2b8; }
.v-info h3 { margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: 1.4rem; letter-spacing: -.3px; }
.v-bottom .btn { flex: none; padding: 13px 20px; font-size: .95rem; }
@media (max-width: 600px) { .v-bottom .btn { flex: 1 1 100%; } }

/* En la galería el aviso va abajo siempre */
@media (max-width: 979px) { body.gal .toast { bottom: calc(96px + env(safe-area-inset-bottom)) !important; } }

@media (prefers-reduced-motion: reduce) {
  .tile-obra { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
}
