/*
  GLASS + CHROME
  A small reusable set: frosted panels, a chrome edge, chrome text.
  Tune per project with the variables below.
*/
:root {
  --glass-tint: rgba(240, 230, 228, 0.10);
  --glass-tint-2: rgba(240, 230, 228, 0.03);
  --glass-line: rgba(240, 230, 228, 0.16);
  --glass-blur: 18px;
  --glass-radius: 22px;
  --glass-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.65);
  --chrome-1: #ffffff;
  --chrome-2: #c0c0c0;
  --chrome-3: #7d8484;
}

/* Frosted glass: tint + glossy top sheen + real blur of what is behind */
.glass,
.glass-lite {
  position: relative;
  border-radius: var(--glass-radius);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 38%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(140deg, var(--glass-tint), var(--glass-tint-2));
  border: 1px solid var(--glass-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 24px rgba(255, 255, 255, 0.03),
    var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}

/* Same look with a softer blur, for long lists of cards */
.glass-lite { --glass-blur: 14px; }

/* Weaker phones: keep the look, drop the blur on long lists */
.perf-lite .glass-lite {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(150deg, rgba(53, 86, 84, 0.78), rgba(16, 37, 39, 0.7));
}

/* Chrome edge: a thin metallic border that catches light */
.glass-edge { border-color: transparent; }
.glass-edge::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, 0.70) 0%,
    rgba(255, 255, 255, 0.08) 28%,
    rgba(192, 192, 192, 0.05) 55%,
    rgba(255, 255, 255, 0.45) 82%,
    rgba(255, 255, 255, 0.10) 100%);
  -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;
  pointer-events: none;
}

/* Chrome text with a slow light sweep */
.chrome-text {
  background:
    linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%) 0 0 / 260% 100% no-repeat,
    linear-gradient(180deg, #ffffff 0%, #e4e6e6 34%, #8b9393 50%, #f2f2f2 64%, #a7adad 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--chrome-2);
  animation: chrome-sweep 6s ease-in-out infinite;
}
@keyframes chrome-sweep {
  0%, 15% { background-position: 160% 0, 0 0; }
  55%, 100% { background-position: -60% 0, 0 0; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: linear-gradient(140deg, rgba(53, 86, 84, 0.92), rgba(16, 37, 39, 0.94)); }
}

@media (prefers-reduced-motion: reduce) {
  .chrome-text { animation: none; }
}
