/*!
 * Cineskill · WEB optical glass + guided selection lens (Claude · Opus 5.5), 2026-12-02.
 * Load AFTER web-plate.css. Pairs with web-optical.js. Scope: body[data-host=web][data-ui=projector] (Creature and Mounty).
 * Does not touch the plate flip (web-plate.css owns it) or the native window.
 *
 * Colourless optical glass with a compact lime signal on active controls.
 * Glass is read at its EDGE, not its face:
 *   interior    clear (1 % white, no blur): stills, headline and art behind stay sharp
 *   edge band   measurable thickness (plate 12 px, actions 7 px, tiles/cards 5 px, controls 4 px):
 *               darker transmission + slight blur = refraction confined to the edge, neutral (no tint)
 *   inner edge  1 px white edge-light: 16 % rest → 72 % selected
 *   bevel       1.5 px neutral specular, lit near the top-left light only; one lap of light on selection
 *   caustic     soft neutral light under the object, scaled by edge-light; black contact shadow
 * Anti-aliasing: no clip-path polygons, no rotated planes; every edge is a rounded border-radius painted by masks.
 */
@property --wo-glint { syntax: '<angle>'; inherits: false; initial-value: 300deg; }
@property --wo-light { syntax: '<number>'; inherits: true; initial-value: .16; }

body[data-host=web][data-ui=projector] {
  --wo-signal: #d2ff62;
  --wo-white: 255, 255, 255;
  --beam-rgb: 236, 238, 233;                 /* saucer beam becomes neutral light on web */
  --beam-core: rgba(255, 255, 255, .82);
}

/* ───────── the optical glass recipe ───────── */
body[data-host=web][data-ui=projector] #studio :is(#browser, #detail, .facets .facet, .tray .tile, #results .frame-card, .web-frame, .searchbox, .saucer-next, .copy-skill, .web-count, .topbar) {
  --wo-edge: 5px;
  position: relative;
  isolation: isolate;
  background-color: rgba(var(--wo-white), .012);
  background-image: none;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow:
    0 30px 52px -32px rgba(0, 0, 0, .95),
    0 18px 30px -24px rgba(var(--wo-white), calc(var(--wo-light) * .22));
  transition: --wo-light .12s ease-out, transform .22s var(--wp-settle);
}
/* The rail keeps its sticky behaviour (sticky is already a containing block for the glass layers). */
body[data-host=web][data-ui=projector] #studio :is(.topbar, #wo-none) { position: sticky; }
@media (max-width: 1099px) { body[data-host=web][data-ui=projector] #studio :is(.topbar, #wo-none) { position: relative; } }
body[data-host=web][data-ui=projector] #studio :is(#browser, #detail) { --wo-edge: 12px; }
body[data-host=web][data-ui=projector] #studio .facets .facet { --wo-edge: 7px; }
body[data-host=web][data-ui=projector] #studio :is(.searchbox, .saucer-next, .copy-skill, .web-count, .topbar) { --wo-edge: 4px; }

/* Edge volume: only this band refracts and darkens what lies behind it. */
body[data-host=web][data-ui=projector] #studio :is(#browser, #detail, .facets .facet, .tray .tile, #results .frame-card, .web-frame, .searchbox, .saucer-next, .copy-skill, .web-count, .topbar)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  top: 0; right: 0; bottom: 0; left: 0;
  width: auto; height: auto; margin: 0;
  pointer-events: none;
  border: 0;
  border-radius: inherit;
  padding: var(--wo-edge);
  transform: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: rgba(var(--wo-white), .018);
  -webkit-backdrop-filter: blur(3px) brightness(.6) contrast(1.12) saturate(.85);
  backdrop-filter: blur(3px) brightness(.6) contrast(1.12) saturate(.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
  outline: 1px solid rgba(var(--wo-white), var(--wo-light));
  outline-offset: calc(1px - var(--wo-edge));
}
/* Bevel specular: neutral light on a 1.5 px ring, near the light only. */
body[data-host=web][data-ui=projector] #studio :is(#browser, #detail, .facets .facet, .tray .tile, #results .frame-card, .web-frame, .searchbox, .saucer-next, .copy-skill, .web-count, .topbar)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  top: 0; right: 0; bottom: 0; left: 0;
  width: auto; height: auto;
  pointer-events: none;
  border: 0;
  border-radius: inherit;
  padding: 1.5px;
  clip-path: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: conic-gradient(from var(--wo-glint),
    rgba(var(--wo-white), 0) 0deg, rgba(var(--wo-white), .9) 20deg, rgba(var(--wo-white), .45) 38deg, rgba(var(--wo-white), 0) 66deg,
    rgba(var(--wo-white), 0) 172deg, rgba(var(--wo-white), .2) 198deg, rgba(var(--wo-white), 0) 226deg, rgba(var(--wo-white), 0) 360deg);
  transition: --wo-glint .26s cubic-bezier(.2, .8, .2, 1);
}
@media (hover: hover) {
  body[data-host=web][data-ui=projector] #studio :is(.facets .facet, .tray .tile, #results .frame-card, .web-frame):hover { --wo-light: .34; background-color: rgba(var(--wo-white), .03); }
  body[data-host=web][data-ui=projector] #studio :is(.facets .facet, .tray .tile, #results .frame-card, .web-frame):hover::after { --wo-glint: 326deg; }
}

/* The transparent plate and travelling lens keep their neutral reflections. */
body[data-host=web][data-ui=projector] #studio :is(.facets .facet[aria-expanded=true], .tray .tile[aria-pressed=true], .ref-rail button[aria-pressed=true]) { --wo-light: .72; }
body[data-host=web][data-ui=projector] #studio :is(.facets .facet[aria-expanded=true], .tray .tile[aria-pressed=true])::after { animation: wo-lap .7s cubic-bezier(.3, .7, .2, 1) 1; }
@keyframes wo-lap { from { --wo-glint: 300deg; } to { --wo-glint: 660deg; } }
body[data-host=web][data-ui=projector] #studio .tray .tile[aria-pressed=true] { border: 0; box-shadow: 0 30px 52px -32px rgba(0,0,0,.95), 0 18px 30px -24px rgba(var(--wo-white), .16); }
/* A dot persists for every applied filter; the underlined label follows one current action. */
body[data-host=web][data-ui=projector] #studio .facets .facet:is(.has-selection,[data-wo-filtered]) span::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; vertical-align: 2px;
  border-radius: 50%; background: var(--wo-signal); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5);
}
body[data-host=web][data-ui=projector] #studio :is(.light-option[aria-pressed=true], .media-mode button[aria-pressed=true]) {
  background-color: rgba(var(--wo-white), .1); color: #fff; border-color: rgba(var(--wo-white), .55); box-shadow: inset 0 1px 0 rgba(var(--wo-white), .4);
}
body[data-host=web][data-ui=projector] #studio .ref-rail button[aria-pressed=true] { border-color: rgba(var(--wo-white), .7); box-shadow: inset 0 0 0 1px rgba(var(--wo-white), .7); }
body[data-host=web][data-ui=projector] #studio .ref-rail .ref-slot { background: rgba(var(--wo-white), .92); color: #111; }
body[data-host=web][data-ui=projector] #studio :focus-visible { outline: 2px solid rgba(var(--wo-white), .92); outline-offset: 3px; }
body[data-host=web][data-ui=projector] #studio .searchbox:focus-within { outline: 2px solid rgba(var(--wo-white), .92); outline-offset: 3px; --wo-light: .6; }
body[data-host=web][data-ui=projector] #studio .searchbox #query:is(:focus, :focus-visible) { outline: none; box-shadow: none; }
/* Readable neutral labels on clear glass. */
body[data-host=web][data-ui=projector] #studio :is(.facets .facet span, .tray .tile span, .frame-name, .web-frame strong, .saucer-next, .copy-skill, .web-count) { color: #f4f5f2; text-shadow: 0 1px 2px rgba(0, 0, 0, .65); }
body[data-host=web][data-ui=projector] #studio .facets .facet[data-wo-current]:enabled span,
body[data-host=web][data-ui=projector] #studio .tray .tile[aria-pressed=true]:enabled span {
  color:var(--wo-signal);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.28em;
}
body[data-host=web][data-ui=projector] #studio .tray .tile[aria-pressed=true]:enabled {
  box-shadow:inset 0 -2px 0 var(--wo-signal),0 18px 38px -28px rgba(0,0,0,.85);
}
body[data-host=web][data-ui=projector] #studio :is(.light-option[aria-pressed=true],.chip):enabled {
  color:var(--wo-signal);background:rgba(255,255,255,.055);border-color:#d2ff626e;
}
body[data-host=web][data-ui=projector] #studio .hue-dot[aria-pressed=true]:enabled {
  outline:2px solid var(--wo-signal);outline-offset:2px;
}
body[data-host=web][data-ui=projector] #studio .ref-rail button[aria-pressed=true]:enabled {
  border-color:var(--wo-signal);box-shadow:0 0 0 1px var(--wo-signal);
}
body[data-host=web][data-ui=projector] #studio .ref-rail button[aria-pressed=true]:enabled .ref-slot {
  background:var(--wo-signal);color:#172006;
}
body[data-host=web][data-ui=projector] #studio #detail .handoff .media-mode button[aria-pressed=true]:enabled {
  color:var(--wo-signal);
}
body[data-host=web][data-ui=projector] #studio #detail .handoff .media-mode:has([aria-pressed=true]:enabled)::before {
  border-color:#d2ff6273;
}
body[data-host=web][data-ui=projector] #studio :is(button:enabled,select,a[href]):focus-visible,
body[data-host=web][data-ui=projector] #studio .searchbox:focus-within {
  outline:2px solid var(--wo-signal);outline-offset:3px;
}
@media(hover:hover) {
  body[data-host=web][data-ui=projector] #studio :is(.tray .tile,.web-frame,#results .frame-card):enabled:hover :is(span,strong) {
    color:var(--wo-signal);
  }
  body[data-host=web][data-ui=projector] #studio :is(.saucer-back,.saucer-next,.copy-skill,.clip-toggle,.light-option,.saucer-pages button,.saucer-axis-pages button):enabled:hover,
  body[data-host=web][data-ui=projector] #studio #detail .handoff .media-mode button:enabled:hover {
    color:var(--wo-signal);
  }
}
/* The plate's old offset sheet is replaced by real edge thickness. */
body[data-host=web][data-ui=projector] #studio :is(#browser, #detail) { box-shadow: 0 40px 70px -40px rgba(0,0,0,.95), 0 24px 40px -30px rgba(var(--wo-white), calc(var(--wo-light) * .2)); }
/* The projected beam is light, not character art: neutral on web. The character artwork itself is never filtered. */
body[data-host=web][data-ui=projector] #studio .saucer-beam { filter: grayscale(1) brightness(1.08); }
/* Neutral landing sheets under the hero (no tint, no rotation). */
body[data-host=web][data-ui=projector] #studio #idle::before,
body[data-host=web][data-ui=projector] #studio #idle::after { border-color: rgba(var(--wo-white), .16); background-color: rgba(var(--wo-white), .02); box-shadow: inset 0 1px 0 rgba(var(--wo-white), .38); }

/* ───────── guided selection lens (built by web-optical.js) ───────── */
body[data-host=web][data-ui=projector] #studio .facets { position: relative; }
.wo-track, .wo-lens, .wo-spec, .wo-shadow { display: none; }
body[data-host=web][data-ui=projector][data-stage=menu] #studio .wo-track { display: block; position: absolute; inset: 0; z-index: 4; overflow: visible; pointer-events: none; }
body[data-host=web][data-ui=projector][data-stage=menu] #studio :is(.wo-lens, .wo-spec, .wo-shadow) { display: block; position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; will-change: transform; }
.wo-track .wo-groove { fill: none; stroke: rgba(0, 0, 0, .7); stroke-width: 6; }
.wo-track .wo-groove-lip { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1; transform: translate(0, 1.5px); }
.wo-track .wo-trail { fill: none; stroke: rgba(255, 255, 255, .62); stroke-width: 2; stroke-linecap: round; opacity: 0; }
/* The lens: a clear 30 × 16 pill that magnifies and brightens what is under it; thickness shows at its rim. */
.wo-lens {
  width: 30px; height: 16px; margin: -8px 0 0 -15px; border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: brightness(1.32) contrast(1.12) blur(.4px);
  backdrop-filter: brightness(1.32) contrast(1.12) blur(.4px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .42),
    inset 0 -2.5px 2px rgba(0, 0, 0, .38),
    inset 0 2px 1.5px rgba(255, 255, 255, .28);
}
.wo-spec {   /* world-fixed highlight: always toward the top-left light, never rotates with the lens */
  width: 9px; height: 4px; margin: -2px 0 0 -4.5px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); filter: blur(.6px);
}
.wo-shadow {
  width: 30px; height: 12px; margin: -6px 0 0 -15px; border-radius: 50%;
  background: rgba(0, 0, 0, .62); filter: blur(4px);
}
@media (forced-colors: active) {
  body[data-host=web][data-ui=projector] #studio :is(.wo-lens, .wo-spec, .wo-shadow, .wo-track) { display: none !important; }
  body[data-host=web][data-ui=projector] { --wo-signal: Highlight; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-host=web][data-ui=projector] #studio :is(#browser, #detail, .facets .facet, .tray .tile, #results .frame-card, .web-frame)::after { animation: none !important; transition: none !important; --wo-glint: 300deg; }
}
