/* DIGITHRONEX · The Cut · glass, everyday tier (layered CSS).
   Hero glass (true refraction) is WebGL: see js/glass.js.
   Decision D8 (26 Sep 2026): glass carries the interface across the site, as in the benchmark's density,
   but always over footage or pictures so it has something to bend, and never glass on glass.
   Load after base.css. */

/* Media spill: glass near playing footage takes a faint tint from it, eased over 8 frames. */
@property --spill { syntax: "<color>"; inherits: true; initial-value: #0180FF; }
@property --tint-amt { syntax: "<percentage>"; inherits: true; initial-value: 4%; }
/* The key light's position on a glass object, registered so it can travel (lensIn, the pointer) */
@property --lx { syntax: "<percentage>"; inherits: true; initial-value: 18%; }
@property --ly { syntax: "<percentage>"; inherits: true; initial-value: -10%; }

/* Lens: optically clear, lit bevel, Fresnel edge, dispersion fringes, a trace of azure, one key light */
.glass {
  --glass-fill: color-mix(in srgb, var(--spill) var(--tint-amt), transparent);
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-control); color: #fff;
  background: var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-clear); backdrop-filter: var(--glass-clear);
  box-shadow: var(--glass-rim), var(--glass-disp), var(--glass-body), var(--glass-drop);
  transition: --spill calc(8 * var(--f)) linear, --tint-amt calc(8 * var(--f)) linear;
}
/* Fresnel: edges brighter than the middle */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(130% 150% at 50% 50%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .14) 100%);
  mix-blend-mode: screen;
}
/* Specular: the key light from the upper left; the scene moves it with the pointer */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(60% 80% at var(--lx, 18%) var(--ly, -10%), rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 2px);
  mix-blend-mode: screen;
  transition: background-position calc(8 * var(--f)) var(--ease-focus);
}

/* Panel: glass that carries type over footage. Darker body and a deeper blur keep text readable on any shot. */
.glass--panel {
  --glass-fill: color-mix(in srgb, var(--spill) 7%, rgba(14, 16, 20, .44));
  -webkit-backdrop-filter: blur(22px) saturate(1.35) brightness(.86); backdrop-filter: blur(22px) saturate(1.35) brightness(.86);
}
.glass--panel::after { opacity: .75; }

/* Frost: the studio's glass, over pictures only. Light, etched, with ink type. */
.glass--frost {
  --glass-fill: rgba(246, 247, 249, .58);
  color: var(--s-text);
  background: var(--glass-etch), var(--glass-sheen), var(--glass-fill);
  background-size: 160px 160px, auto, auto;
  -webkit-backdrop-filter: blur(24px) saturate(1.25) brightness(1.06); backdrop-filter: blur(24px) saturate(1.25) brightness(1.06);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), inset -1px -1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .38), var(--glass-disp), 0 24px 44px -26px rgba(11, 12, 14, .45);
}
.glass--frost::after { opacity: .6; }

/* Diffusion: a 26px frost with a fine static etch, for navigation over mixed content */
.glass--diffusion {
  background: var(--glass-etch), var(--glass-sheen), rgba(255, 255, 255, .08);
  background-size: 160px 160px, auto, auto;
  -webkit-backdrop-filter: blur(26px) saturate(1.2) brightness(1.08); backdrop-filter: blur(26px) saturate(1.2) brightness(1.08);
  box-shadow: var(--glass-rim), var(--glass-body), var(--glass-drop);
}
.glass--diffusion-light {
  color: var(--s-text);
  background: var(--glass-etch), linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 2px), rgba(241, 242, 244, .74);
  background-size: 160px 160px, auto, auto;
  -webkit-backdrop-filter: blur(26px) saturate(1.1); backdrop-filter: blur(26px) saturate(1.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 12px 30px -20px rgba(11, 12, 14, .35);
}
.glass--diffusion-light::after { opacity: .4; }

/* ND: neutral density for type over footage, in stops. Keeps title-safe text readable on any shot. */
.glass--nd1, .glass--nd2, .glass--nd3 {
  --glass-fill: rgba(11, 12, 14, .06);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .32), inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 -12px 20px -14px rgba(0, 0, 0, .5), var(--glass-drop);
}
.glass--nd1 { -webkit-backdrop-filter: blur(16px) brightness(.5) saturate(1.1); backdrop-filter: blur(16px) brightness(.5) saturate(1.1); }
.glass--nd2 { -webkit-backdrop-filter: blur(16px) brightness(.25) saturate(1.1); backdrop-filter: blur(16px) brightness(.25) saturate(1.1); }
.glass--nd3 { -webkit-backdrop-filter: blur(16px) brightness(.125) saturate(1.1); backdrop-filter: blur(16px) brightness(.125) saturate(1.1); }
.glass--nd1::after, .glass--nd2::after, .glass--nd3::after { opacity: .5; }

/* The brand cut on a glass object's top-right corner, with its polished edge catching a line of light */
.glass--cut {
  --c: var(--cut-m); --c-h: calc(var(--c) * var(--angle-tan));
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c-h), 100% 100%, 0 100%);
  background:
    linear-gradient(to top right, transparent calc(50% - .75px), rgba(255, 255, 255, .78) calc(50% - .75px), rgba(255, 255, 255, .78) calc(50% + .75px), transparent calc(50% + .75px)) right top / var(--c) var(--c-h) no-repeat,
    var(--glass-sheen), var(--glass-fill);
}
.glass--frost.glass--cut {
  background:
    linear-gradient(to top right, transparent calc(50% - .75px), rgba(1, 88, 207, .8) calc(50% - .75px), rgba(1, 88, 207, .8) calc(50% + .75px), transparent calc(50% + .75px)) right top / var(--c) var(--c-h) no-repeat,
    var(--glass-etch), var(--glass-sheen), var(--glass-fill);
  background-size: var(--c) var(--c-h), 160px 160px, auto, auto;
}
.glass--cut-l { --c: var(--cut-l); }
.glass--cut-s { --c: var(--cut-s); }

/* Spill on: the tint moves toward the footage's color (10–18%) */
.glass.is-spilling { --tint-amt: 14%; }

/* Liquid: only the scrub playhead, the cut handle and the primary action pressed over media */
.glass--liquid { transition: transform calc(12 * var(--f)) var(--ease-spring), --spill calc(8 * var(--f)) linear, --tint-amt calc(8 * var(--f)) linear; }
.glass--liquid:active, .glass--liquid.is-pressed { transform: scale(1.06, .94); }

/* The primary action over footage becomes lens glass; its cut edge stays in signal */
.primary--glass { color: #fff; }
.primary--glass .fill {
  background: var(--glass-sheen), color-mix(in srgb, var(--spill) 6%, transparent);
  -webkit-backdrop-filter: var(--glass-clear); backdrop-filter: var(--glass-clear);
  box-shadow: var(--glass-rim), var(--glass-disp), var(--glass-body);
  transition: transform calc(12 * var(--f)) var(--ease-spring);
}
.primary--glass:active .fill { transform: scale(1.06, .94); }

/* The cursor label beside the native cursor over media */
.cursor-label {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; padding: 8px 11px;
  font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11px; letter-spacing: .02em; white-space: nowrap;
  opacity: 0; transition: opacity calc(4 * var(--f)) var(--ease-snap);
  --glass-fill: rgba(14, 16, 20, .28);
}
.cursor-label.is-on { opacity: 1; }

/* Without backdrop filters, glass becomes a quiet solid so type stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass--cut, .primary--glass .fill { --glass-fill: rgba(18, 20, 24, .8); }
  .glass--frost { --glass-fill: rgba(246, 247, 249, .94); }
  .glass--diffusion { background: var(--glass-sheen), rgba(18, 20, 24, .9); }
  .glass--diffusion-light { background: rgba(241, 242, 244, .94); }
  .glass--nd1 { --glass-fill: rgba(11, 12, 14, .5); }
  .glass--nd2 { --glass-fill: rgba(11, 12, 14, .72); }
  .glass--nd3 { --glass-fill: rgba(11, 12, 14, .86); }
}
