/* LiquidGlass — vanilla adaptation. Loaded after styles.css. */

.glass {
  --lg-url: blur(0px);
  --lg-blur: 8px;
  --lg-sat: 1.8;
  --lg-bright: 1.06;
  --lg-contrast: 0.92;
  --lg-fill: rgba(183, 228, 198, 0.34);
  --lg-fg: #1A4331;
  --lg-edge-a: rgba(255, 255, 255, 0.95);
  --lg-edge-b: rgba(255, 255, 255, 0.16);
  --lg-edge-c: rgba(183, 228, 198, 0.75);
  --lg-shadow: 0 12px 32px -12px rgba(26, 67, 49, 0.28), 0 2px 6px -1px rgba(26, 67, 49, 0.1);
  --lg-spec-o: 0.9;
  --lg-mx: 50%;
  --lg-my: 50%;

  position: relative;
  isolation: isolate;
  border: 0;
  background: transparent;
  color: var(--lg-fg);
  border-radius: var(--lg-radius, 999px);
  box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright)) contrast(var(--lg-contrast));
  backdrop-filter: var(--lg-url) blur(var(--lg-blur)) saturate(var(--lg-sat)) brightness(var(--lg-bright)) contrast(var(--lg-contrast));
  transition: box-shadow 240ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.glass:not(.lg-refract) {
  --lg-blur: 16px;
  --lg-sat: 1.6;
}

.lg-svg {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.lg-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  border-radius: inherit;
  pointer-events: none;
}

.lg-fill {
  background: var(--lg-fill);
  box-shadow: inset 0 0 18px -6px rgba(255, 255, 255, 0.25);
}

.lg-dimmer {
  background: rgba(0, 0, 0, 0.35);
}

.lg-spec {
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: var(--lg-spec-o);
}

.lg-edge {
  padding: 1px;
  background: linear-gradient(140deg, var(--lg-edge-a), var(--lg-edge-b) 34%, var(--lg-edge-b) 62%, var(--lg-edge-c));
  -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);
}

.lg-glow {
  opacity: 0;
  background: radial-gradient(circle at var(--lg-mx) var(--lg-my), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.14) 38%, transparent 70%);
  mix-blend-mode: plus-lighter;
  transition: opacity 420ms ease;
}

.lg-interactive { cursor: pointer; }
.lg-interactive:hover .lg-glow { opacity: 0.3; }
.lg-interactive:active { transform: scale(0.97); }
.lg-interactive:active .lg-glow { opacity: 1; transition-duration: 120ms; }

.glass:focus-visible {
  outline: 2px solid #1A4331;
  outline-offset: 3px;
}

/* Header as a floating glass bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: 14px;
  background: transparent;
  border-bottom: 0;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  min-height: 64px;
  max-width: 1240px;
  padding-inline: clamp(14px, 2vw, 24px);
  border-radius: 999px;
}

.header-inner .brand { position: relative; z-index: 1; }
.header-inner .nav-desktop,
.header-inner .button,
.header-inner .menu-mobile { position: relative; z-index: 1; }

/* Glass buttons inherit the site button metrics but drop the solid fill */
.button.glass {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #1A4331;
  font-weight: 600;
}

.button.glass:hover {
  background: transparent;
  color: #1A4331;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -14px rgba(26, 67, 49, 0.34);
}

.button.glass:active { transform: scale(0.97); }

/* Contact button sits on the dark band, so it gets a deeper fill */
.contact .button.glass {
  --lg-fill: rgba(183, 228, 198, 0.42);
  --lg-fg: #1A4331;
  --lg-edge-a: rgba(255, 255, 255, 0.85);
  --lg-edge-c: rgba(183, 228, 198, 0.9);
}

/* Accessibility fallbacks */
@media (prefers-reduced-transparency: reduce) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none; }
  .lg-fill { background: #E6F3EA; }
  .contact .lg-fill { background: #B7E4C6; }
  .lg-spec { opacity: 0.25; }
  .lg-dimmer { display: none; }
}

@media (prefers-contrast: more) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none; }
  .lg-fill { background: #FFFFFF; }
  .contact .lg-fill { background: #B7E4C6; }
  .lg-spec, .lg-dimmer { display: none; }
  .lg-edge {
    -webkit-mask: none;
    mask: none;
    background: none;
    box-shadow: inset 0 0 0 1px rgba(26, 67, 49, 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .glass, .button.glass { transition: none; }
  .lg-interactive:active { transform: none; }
}

@media (max-width: 900px) {
  .header-inner { border-radius: 24px; }
  .site-header { padding-block: 10px; }
}
