/* ==========================================================================
   Avanzza · Vidrio líquido (material compartido por las 5 páginas)
   Base para todos los navegadores: tinte, desenfoque, brillo especular y
   borde de luz con un toque teal. En Chromium, liquid-glass.js añade la
   refracción del canto (el borde dobla lo que hay detrás, como una lente).
   Regla: solo donde hay algo detrás que refractar.
   ========================================================================== */

:root,
[data-theme="light"] {
  --lg-tint: rgba(255, 255, 255, 0.34);
  --lg-tint-strong: rgba(251, 249, 247, 0.64);
  --lg-spec: rgba(255, 255, 255, 0.82);
  --lg-rim-a: rgba(255, 255, 255, 0.95);
  --lg-rim-b: rgba(255, 255, 255, 0.1);
  --lg-rim-c: rgba(19, 149, 149, 0.34);
  --lg-shadow: 0 16px 36px -18px rgba(29, 28, 27, 0.38), 0 2px 6px -2px rgba(29, 28, 27, 0.12);
  --lg-solid: #fbfaf8;
  --lg-lens: rgba(19, 149, 149, 0.12);
}
[data-theme="dark"] {
  --lg-tint: rgba(18, 20, 22, 0.3);
  --lg-tint-strong: rgba(12, 13, 14, 0.58);
  --lg-spec: rgba(255, 255, 255, 0.16);
  --lg-rim-a: rgba(255, 255, 255, 0.42);
  --lg-rim-b: rgba(255, 255, 255, 0.05);
  --lg-rim-c: rgba(60, 196, 192, 0.4);
  --lg-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.85), 0 2px 8px -2px rgba(0, 0, 0, 0.45);
  --lg-solid: #121314;
  --lg-lens: rgba(60, 196, 192, 0.1);
}

/* Fixed night glass for surfaces that are always dark (night cards, aurora). */
.lg--night {
  --lg-tint: rgba(6, 18, 18, 0.32);
  --lg-tint-strong: rgba(6, 20, 20, 0.5);
  --lg-spec: rgba(255, 255, 255, 0.2);
  --lg-rim-a: rgba(255, 255, 255, 0.5);
  --lg-rim-b: rgba(255, 255, 255, 0.06);
  --lg-rim-c: rgba(60, 196, 192, 0.45);
  --lg-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.8), 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --lg-solid: #0b1414;
}

/* --------------------------------------------------------------------------
   Material
   -------------------------------------------------------------------------- */
.lg {
  --lg-blur: 14px;
  --lg-sat: 170%;
  isolation: isolate;
  background-color: var(--lg-tint);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: var(--lg-refract, blur(0px)) blur(var(--lg-blur)) saturate(var(--lg-sat));
  box-shadow: var(--lg-shadow);
}
.lg::before,
.lg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
/* Specular highlight: light caught on the top-left of the glass. */
.lg::before {
  z-index: -1;
  background: radial-gradient(120% 90% at 16% -20%, var(--lg-spec), transparent 46%);
}
/* Rim: white on top, a teal glint at the bottom edge. */
.lg::after {
  padding: 1px;
  background: linear-gradient(150deg, var(--lg-rim-a), var(--lg-rim-b) 36%, var(--lg-rim-c) 72%, var(--lg-rim-a));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* Variants */
.lg--chip { --lg-blur: 12px; background-color: var(--lg-tint-strong); }
.lg--card { --lg-blur: 18px; background-color: var(--lg-tint-strong); }
.lg--tray { --lg-blur: 18px; background-color: var(--lg-tint); }
/* Lens: sits on top of text, so it bends the edges but never blurs. */
.lg--lens {
  --lg-blur: 0px;
  --lg-sat: 125%;
  background-color: var(--lg-lens);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Navigation pill: clear at the top of the page, glass once it floats. */
.lg--nav { --lg-blur: 18px; background-color: var(--lg-tint-strong); }
.lg--nav::before,
.lg--nav::after { transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.site-header:not([data-state="scrolled"]) .lg--nav {
  background-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header:not([data-state="scrolled"]) .lg--nav::before,
.site-header:not([data-state="scrolled"]) .lg--nav::after { opacity: 0; }

/* --------------------------------------------------------------------------
   Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
  .lg {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: var(--lg-solid);
  }
  .lg--lens { background-color: var(--lg-lens); }
  .lg::before { display: none; }
}

@media (forced-colors: active) {
  .lg { border: 1px solid CanvasText; }
  .lg::before,
  .lg::after { display: none; }
}
