/* Liquid Glass
   .glass            frosted base, rim light, specular sheen (all browsers)
   .glass--refract   adds the liquid bend of the backdrop (Chromium only;
                     crystal.js sets html.can-refract when it's supported) */

.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 1px var(--rim),
    inset 0 -1px 1px var(--rim-low),
    inset 0 0 0 1px var(--hair),
    0 14px 40px var(--shadow);
  transition: background-color .7s ease, box-shadow .7s ease;
}

.can-refract .glass--refract {
  backdrop-filter: url(#cnRefract) blur(7px) saturate(185%) brightness(1.04);
}

/* gradient rim: bright at the top-left and bottom-right corners, clear in between */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(135deg, var(--rim) 0%, transparent 32%, transparent 68%, var(--rim) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* specular sheen from above */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 18% -10%, var(--sheen), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Buttons ---------- */
.btn {
  font: var(--w-medium) .8rem/1 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
  min-height: 48px;
  padding: 0 1.6rem;
  border: 0;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease-out), background-color .7s ease, box-shadow .3s ease;
}
.btn:active { transform: scale(.97); }

.btn--solid {
  background: var(--btn);
  color: var(--btn-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    inset 0 -1px 0 rgba(0, 0, 0, .12),
    0 10px 26px var(--shadow);
}
.btn--solid:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.btn.glass { border-radius: var(--radius-pill); }

/* ---------- Focus ---------- */
:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
