/* SnapGather — sistema de diseño "el salón a las dos de la mañana".
   Compartido por todas las páginas del sitio.

   Regla dura: el glow solo va en cosas que emiten luz (el logo, el panel del
   QR, el plan encendido, el botón primario). El texto NUNCA lleva glow: es lo
   que hacía ilegible la versión anterior. */

:root {
  /* El salón */
  --noche: #0a0714;
  --humo: #150f26;
  --humo-alto: #1d1533;
  --borde: #2c2049;
  --borde-vivo: #43307a;

  /* Las luces */
  --fucsia: #ff2d87;
  --fucsia-hondo: #c31663;
  --violeta: #8a5cff;
  --lima: #c4ff42;

  /* El flash: blanco cálido, no blanco puro. Sobre violeta-negro el #fff
     vibra; el cálido lee como flash de cámara con luz de tungsteno. */
  --flash: #fff4e6;
  --flash-2: rgba(255, 244, 230, .72);
  --flash-3: rgba(255, 244, 230, .5);

  --display: "Syne", "Trebuchet MS", sans-serif;
  --texto: "Archivo", system-ui, -apple-system, sans-serif;

  --ancho: 1180px;
  --r: 14px;
  --r-lg: 22px;
}

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

html {
  background: var(--noche);
  /* Le dice al navegador que pinte barras, inputs y selects nativos en oscuro */
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Saca el retardo de 300 ms del doble tap y el flash gris de Android */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 45, 135, .18);
}

body {
  margin: 0;
  background: var(--noche);
  color: var(--flash);
  font: 400 1rem/1.65 var(--texto);
  letter-spacing: .005em;
  overflow-x: hidden;
}

/* El resplandor difuso del ambiente. Fijo y detrás de todo: son las luces
   del salón, no un degradado decorativo por sección. */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw auto;
  height: 90vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46vw 42vh at 12% 0%, rgba(255, 45, 135, .17), transparent 70%),
    radial-gradient(40vw 40vh at 88% 12%, rgba(138, 92, 255, .15), transparent 70%);
}

img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Tipografía ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.025em;
}
h1, h2 { text-wrap: balance; }
h3, h4 { text-wrap: pretty; }

h1 { font-size: clamp(2.1rem, 3.5vw, 3.2rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.4rem); letter-spacing: -.015em; }
h4 { font-size: 1rem; font-weight: 700; letter-spacing: -.005em; }

p { margin: 0 0 1rem; max-width: 66ch; }
p:last-child { margin-bottom: 0; }

a { color: var(--flash); text-decoration-color: rgba(255, 45, 135, .55); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--fucsia); }

strong, b { font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.sr-only:focus {
  position: fixed; top: .75rem; left: .75rem; z-index: 100;
  width: auto; height: auto; clip-path: none;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--fucsia); color: #fff;
}

.wrap {
  width: min(100% - 2.5rem, var(--ancho));
  margin-inline: auto;
  /* Muescas y bordes redondeados en horizontal */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* La cabecera es sticky: sin esto el ancla deja el titulo debajo de la barra */
:target, [id] { scroll-margin-top: 5.5rem; }

/* ---------- Neón: la primitiva ---------- */

/* .neon es un tubo encendido. El glow sale del borde, no del texto. */
.neon {
  border: 1px solid var(--fucsia);
  box-shadow:
    0 0 0 1px rgba(255, 45, 135, .35),
    0 0 22px -4px rgba(255, 45, 135, .55),
    inset 0 0 26px -14px rgba(255, 45, 135, .7);
}
.neon-violeta {
  border-color: var(--violeta);
  box-shadow:
    0 0 0 1px rgba(138, 92, 255, .35),
    0 0 22px -4px rgba(138, 92, 255, .5),
    inset 0 0 26px -14px rgba(138, 92, 255, .7);
}
/* Un tubo apagado: misma forma, sin luz. Así se lee la jerarquía sin etiquetas. */
.neon-off { border: 1px solid var(--borde); box-shadow: none; }

/* ---------- Botones ---------- */

.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.4rem;
  border: 1px solid var(--borde-vivo);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--flash);
  font: 600 .95rem/1 var(--texto);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .22s ease, background-color .22s ease, border-color .22s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  border-color: transparent;
  background: linear-gradient(103deg, var(--fucsia), var(--violeta));
  color: #fff;
  box-shadow: 0 0 26px -8px rgba(255, 45, 135, .8);
}
.btn-primary:hover { box-shadow: 0 0 34px -6px rgba(255, 45, 135, .95); }

.btn-ghost { background: rgba(255, 244, 230, .04); }
.btn-ghost:hover { border-color: var(--fucsia); background: rgba(255, 45, 135, .1); }

.btn-lg { padding: 1rem 1.9rem; font-size: 1.02rem; }
.btn-sm { padding: .5rem 1rem; font-size: .87rem; }

/* ---------- Formularios ---------- */

input, select, textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: rgba(10, 7, 20, .72);
  color: var(--flash);
  font: 400 1rem/1.4 var(--texto);
}
input::placeholder, textarea::placeholder { color: rgba(255, 244, 230, .34); }
/* Se saca el anillo nativo solo cuando el foco viene del mouse: el de teclado
   lo pone la regla :focus-visible de abajo. */
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--fucsia);
  box-shadow: 0 0 0 3px rgba(255, 45, 135, .22);
}
select { background-color: rgba(10, 7, 20, .72); color: var(--flash); }
select option { background-color: var(--humo); color: var(--flash); }
label { font-weight: 500; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--lima);
  outline-offset: 3px;
}

/* ---------- Superficies ---------- */

.panel {
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  background:
    linear-gradient(168deg, rgba(255, 244, 230, .045), rgba(255, 244, 230, 0) 58%),
    var(--humo);
}

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease, backdrop-filter .3s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--borde);
  background: rgba(10, 7, 20, .82);
  backdrop-filter: blur(14px) saturate(150%);
}

.nav { display: flex; align-items: center; gap: 1rem; padding: .95rem 0; }

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 800; font-size: 1.14rem;
  letter-spacing: -.03em;
  color: var(--flash); text-decoration: none;
  margin-right: auto;
}
.marca { width: 30px; height: 30px; flex: 0 0 auto; }

.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) {
  font-size: .95rem; font-weight: 500;
  color: var(--flash-2); text-decoration: none;
}
.nav-links a:not(.btn):hover { color: var(--flash); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: grid; gap: 5px; place-content: center;
    width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--borde); border-radius: 12px;
    background: var(--humo); cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--flash); }
  .nav-links {
    position: absolute; inset: 100% .75rem auto;
    flex-direction: column; align-items: stretch; gap: .35rem;
    padding: .8rem;
    border: 1px solid var(--borde); border-radius: var(--r-lg);
    background: rgba(15, 10, 32, .97);
    backdrop-filter: blur(16px);
  }
  .nav-links a:not(.btn) { padding: .7rem .8rem; border-radius: 10px; }
  .nav-links .btn { justify-content: center; margin-top: .3rem; }
}

/* ---------- Pie ---------- */

.site-footer {
  border-top: 1px solid var(--borde);
  padding: 3.2rem 0 2rem;
  color: var(--flash-2);
  font-size: .93rem;
}
.footer-grid {
  display: grid; gap: 2.2rem;
  grid-template-columns: 1.6fr 1fr 1fr;
}
.site-footer h4 { margin-bottom: .8rem; color: var(--flash); }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.site-footer a { color: var(--flash-2); text-decoration: none; }
.site-footer a:hover { color: var(--fucsia); }
.footer-about .brand { margin: 0 0 .8rem; }
.footer-base {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.6rem; padding-top: 1.3rem;
  border-top: 1px solid var(--borde);
  color: var(--flash-3); font-size: .87rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ---------- Movimiento ---------- */

/* El único momento no pedido por el usuario: al cargar, el neón prende como
   un tubo real — dos parpadeos rápidos y queda. Pasa una sola vez. */
@keyframes prender {
  0%   { opacity: .12; }
  8%   { opacity: .9; }
  14%  { opacity: .2; }
  22%  { opacity: 1; }
  28%  { opacity: .45; }
  36%, 100% { opacity: 1; }
}
.prende { animation: prender 1.1s steps(1, end) both; }

@keyframes flash-pop {
  0%   { opacity: 0; }
  12%  { opacity: .92; }
  100% { opacity: 0; }
}
/* El flash de la cámara: respuesta a una acción de la persona. */
.flash-layer {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 45%, #fff, rgba(255, 244, 230, .2) 55%, transparent 72%);
}
.flash-layer.is-on { animation: flash-pop .5s ease-out; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
