body { isolation: isolate; }

.site-grid {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.site-grid::before, .site-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: var(--fx-grid-x, 0px) var(--fx-grid-y, 0px);
}
.site-grid::before {
  --grid-ink: rgb(198 185 255 / .052);
  mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / .35) 40%, rgb(0 0 0 / .45) 68%, #000);
}
.site-grid::after {
  --grid-ink: rgb(240 146 203 / .30);
  background-image:
    radial-gradient(circle 250px at var(--fx-x, 50%) var(--fx-y, 50%), rgb(205 52 143 / .10), transparent),
    linear-gradient(var(--grid-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  background-position: 0 0, var(--fx-grid-x, 0px) var(--fx-grid-y, 0px), var(--fx-grid-x, 0px) var(--fx-grid-y, 0px);
  mask-image: radial-gradient(circle 310px at var(--fx-x, 50%) var(--fx-y, 50%), #000 6%, rgb(0 0 0 / .7) 40%, transparent 100%);
  opacity: var(--fx-grid-visible, 0);
  transition: opacity 200ms ease;
}

.hero::after { background-position: var(--fx-grid-x, 0px) var(--fx-grid-y, 0px); }

[data-fx-glass] { position: relative; }
.glass-light {
  --fx-glass-radius: 178px;
  position: absolute;
  z-index: 2;
  inset: -1px;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  opacity: calc(var(--fx-light, 0) * var(--fx-glass-strength, 1));
  transition: opacity 175ms ease;
}
.glass-light::before, .glass-light::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.glass-light::before {
  background: radial-gradient(circle var(--fx-glass-radius) at var(--fx-local-x, 50%) var(--fx-local-y, 50%), rgb(255 231 249 / .125), rgb(198 185 255 / .048) 48%, transparent 100%);
}
.glass-light::after {
  box-shadow: inset 0 0 0 1px rgb(240 146 203 / .23);
}
@supports (mask-composite: exclude) {
  .glass-light::after {
    padding: 1px;
    background: radial-gradient(circle var(--fx-glass-radius) at var(--fx-local-x, 50%) var(--fx-local-y, 50%), rgb(255 244 252 / .92), rgb(240 146 203 / .65) 24%, rgb(198 185 255 / .29) 54%, transparent 100%);
    box-shadow: none;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
}
:is(.hero, .method, .contact) > .glass-light {
  --fx-glass-radius: 240px;
  --fx-glass-strength: .63;
}
.button > .glass-light { --fx-glass-radius: 95px; --fx-glass-strength: .8; }
.button:focus-visible > .glass-light { opacity: max(.4, var(--fx-light, 0)); }
.form-field :is(input, select):hover { border-color: var(--color-focus); }
@supports (backdrop-filter: blur(12px)) {
  :is(.diagnostic, .contact-form)[data-fx-glass] {
    background-color: rgb(14 12 22 / .57);
    backdrop-filter: blur(12px) saturate(1.2);
  }
}

@media (hover: hover) and (pointer: fine) {
  :is(.button, .diag-tabs button, .menu-toggle, .dialog-close):hover:not(:disabled) {
    border-color: rgb(240 146 203 / .78);
    box-shadow: 0 0 0 1px rgb(240 146 203 / .22), 0 0 19px rgb(205 52 143 / .43), 0 7px 27px rgb(205 52 143 / .28);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :where(.problem-card, .service-card, .team-card, .steps li, .diagnostic, .contact-form, .ebook):hover {
    position: relative;
    z-index: 1;
    scale: var(--fx-hover-scale, 1.025);
  }
  :where(.diagnostic, .contact-form, .ebook) { --fx-hover-scale: 1.012; }
  :where(.diag-tabs button, .menu-toggle, .dialog-close) {
    transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: hero-appear 640ms cubic-bezier(.22,.65,.3,1) both; }
  @keyframes hero-appear {
    from { opacity: .58; transform: translateY(9px); filter: blur(5px); }
    to { opacity: 1; transform: none; filter: none; }
  }
  [data-fx-reveal] {
    opacity: var(--fx-content-opacity, 1);
    filter: var(--fx-content-filter, none);
    transition: opacity 155ms ease-out, filter 180ms ease-out, scale 270ms cubic-bezier(.2,.65,.25,1);
  }
  [data-fx-reveal]:focus-within {
    opacity: 1;
    filter: none;
    transition-property: scale;
    transition-duration: 270ms;
    transition-timing-function: cubic-bezier(.2,.65,.25,1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-grid::after, .glass-light { display: none; }
  .site-grid::before, .hero::after { background-position: 0 0; }
}
