/* Websign · Liquid Glass
   Ein Glasstück aus vier Ebenen: Brechung, Tönung, Lichtkante, Schatten.
   Die Brechung (liquid-glass.js) gibt es nur in Chromium; überall sonst greift der Milchglas-Fallback.
   --glass-tint: 0 = ultraklar, 1 = durchgefärbt. */

.lg {
  --glass-tint: 0.12;
  --light-angle: 315deg;
  --glow-x: 22%;
  --glow-y: 0%;
  --lg-tint-rgb: 255, 255, 255;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 9999px;
  font-size: 14px; line-height: 18px; font-weight: 500; letter-spacing: 0; white-space: nowrap;
  color: #f5f5f7; text-decoration: none; text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.42), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.lg:hover { text-decoration: none; }
.lg--xl { min-height: 68px; padding: 0 40px; font-size: 21px; line-height: 25px; }

.lg--nav { min-height: 32px; padding: 0 16px; font-size: 12px; line-height: 16px; box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.3); }

/* Auf hellen Flächen: dunkle Schrift, feine dunkle Kontur, damit die Kapsel sichtbar bleibt */
[data-theme="light"] .lg, .lg--light {
  --glass-tint: 0.5; color: rgba(0, 0, 0, 0.85); text-shadow: none;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 6px 16px -6px rgba(0, 0, 0, 0.18), 0 2px 6px -2px rgba(0, 0, 0, 0.1);
}

/* Ebenen: liegen hinter dem Text, übernehmen den Radius */
.lg::before, .lg::after, .lg__refract, .lg__rim { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }

/* 1 + 2 · Brechung und Tönung. Ohne JavaScript sitzt beides auf ::before (Fallback-Stil). */
.lg::before {
  z-index: -3;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
}
.lg.is-refracting::before { display: none; }
.lg__refract {
  z-index: -3;
  background: rgba(var(--lg-tint-rgb), calc(0.04 + 0.68 * var(--glass-tint)));
  transition: background-color 0.15s cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* 3 · Lichtkante: Ring, der zur Lichtquelle hin am hellsten ist, plus Glanzfleck und Innenschatten */
.lg__rim {
  z-index: -1; padding: 1.5px;
  background: conic-gradient(from var(--light-angle), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.08) 25%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.08) 75%, rgba(255, 255, 255, 0.8));
  -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 exclude, linear-gradient(#000 0 0);
  opacity: 0.85; transition: opacity 0.15s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.lg::after {
  z-index: -2;
  background: radial-gradient(120% 80% at var(--glow-x) var(--glow-y), rgba(255, 255, 255, 0.22), transparent 55%);
  mix-blend-mode: screen; mix-blend-mode: plus-lighter;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px rgba(255, 255, 255, 0.12),
    inset 1.5px 1.5px 6px -2px rgba(255, 255, 255, 0.35),
    inset -6px -8px 14px -10px rgba(0, 0, 0, 0.18);
  transition: opacity 0.15s cubic-bezier(0.28, 0.11, 0.32, 1);
  opacity: 0.9;
}

/* Zustände */
.lg:hover { --glass-tint: 0.09; }
.lg:hover .lg__rim, .lg:hover::after { opacity: 1; }
.lg:active { transform: scale(0.96); transition-duration: 0.12s; transition-timing-function: cubic-bezier(0.28, 0.11, 0.32, 1); }
.lg:active::after { opacity: 1; filter: brightness(1.35); }
.lg:focus-visible { outline: 2px solid var(--focus, #9eb1d2); outline-offset: 4px; }

/* Fallback (Safari, Firefox): Milchglas mit Lichtkante, ohne Brechung */
.lg-fallback .lg__refract {
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
}

@media (prefers-reduced-transparency: reduce) {
  .lg { --glass-tint: 1; }
  .lg__refract, .lg::before { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #3a3a3d; }
}
@media (prefers-contrast: more) {
  .lg { --glass-tint: 0.85; border: 1px solid #fff; }
  .lg--light { border-color: rgba(0, 0, 0, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
  .lg, .lg:active { transition: none; transform: none; }
}
@media (forced-colors: active) {
  .lg { border: 1px solid ButtonText; }
  .lg::before, .lg::after, .lg__refract, .lg__rim { display: none; }
}
