/* Werk. Left: the five capabilities, one stays lit and a moving head on the goalpost truss points at it. Right: the HBA goalpost stage.
   werk.js adds .is-hover on desktop with a mouse (list absolutely positioned, the lit item follows hover and focus and stays put).
   Without it (phones, touch, short windows) the list is plain flow with every description showing and no moving head. */
.werk{--pad:clamp(28px,6vh,64px);--fs:clamp(28px,9.4vw,58px);position:relative}
/* on an ultrawide screen the list and the stage stay together in a 2000px frame, like contact */
.werk-view{position:relative;overflow:clip;padding:calc(var(--pad) * 2) max(var(--gutter),calc((100% - 2000px) / 2 + var(--gutter))) 0}
.werk-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);gap:clamp(32px,5vw,88px);align-items:stretch}
.werk-main{position:relative;display:flex;flex-direction:column;justify-content:center;gap:clamp(18px,3.4vh,36px)}
.werk-list{position:relative}
.caps{position:relative;list-style:none;margin:0;padding:0}
.cap{position:relative}
.cap-name{width:fit-content;margin:0;font-family:var(--serif);font-weight:500;font-size:var(--fs);line-height:.98;letter-spacing:-.025em;color:var(--open-white);transform-origin:0 0}
.cap-line{margin:0;max-width:44ch;font-size:var(--fs-small);line-height:1.45;letter-spacing:.01em;color:var(--muted)}

/* where the moving head lands: a soft pool of light behind the list (normal blend: the view is its own stacking context) */
.werk-pool{position:absolute;pointer-events:none;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,226,186,.34),rgba(255,226,186,.25) 20%,rgba(255,226,186,.15) 40%,rgba(255,226,186,.07) 60%,rgba(255,226,186,.02) 80%,transparent 100%)}

/* flow layout: phones, touch and short windows. Nothing hides behind hover, so every line shows. */
.werk:not(.is-hover) .cap{padding:clamp(20px,5vw,30px) 0}
.werk:not(.is-hover) .cap-line{margin-top:10px}
.werk:not(.is-hover) .werk-pool{left:-30%;top:-6%;width:160%;height:112%}

/* hover layout: desktop with a mouse. The list fills the window; the first item is lit, the lit item follows the pointer and keeps its place when the pointer leaves. */
/* a portrait screen gets a view no taller than 0.8 x its width, so list and stage do not float in empty floor */
.werk.is-hover .werk-view{height:100vh;height:min(100svh,80vw);min-height:600px;padding-top:var(--pad);padding-bottom:0}
.werk.is-hover .werk-grid{height:100%}
.werk.is-hover .werk-pool{left:0;top:0;width:400px;height:400px;margin:-200px 0 0 -200px;transform:scale(0);will-change:transform}
.werk.is-hover .cap{position:absolute;left:0;top:0;width:100%;will-change:transform;outline:none}
.werk.is-hover .cap-name{will-change:transform,filter;filter:brightness(.49);color:color-mix(in srgb,var(--amber) calc(var(--lit,0) * 46%),var(--open-white))}
.werk.is-hover .cap-line{position:absolute;left:0;top:0;max-width:min(52ch,100%);font-size:clamp(var(--fs-small),calc(var(--fs) * .19),22px);opacity:0;will-change:transform,opacity}
.werk.is-hover .cap:focus-visible .cap-name{outline:2px solid var(--amber);outline-offset:8px;border-radius:2px}

/* The goalpost stage. One unit scales the whole set: --h is Arlo's height, --p one pixel of the 1440 x 900 reference set (h = 671),
   --r one render pixel of the truss and lamp sprites. Tiles, truss, lamps, wall and photo all follow --h, so every screen shows the same proportions;
   a stage wider than the set centres it. The stage is a size container (cqh and cqw measure the stage itself). */
.werk-stage{--h:min(79.3cqh,146cqw);--p:calc(var(--h) / 671);--r:calc(var(--p) * .19);--base:calc(58 * var(--p));position:relative;overflow:hidden;isolation:isolate;container-type:size;height:78vh;height:78svh;min-height:480px}
.werk.is-hover .werk-stage{height:100%;min-height:0;overflow:visible;overflow-y:clip}
.set{position:absolute;left:0;right:0;margin-inline:auto;top:calc(50% - 423 * var(--p));width:calc(459 * var(--p));height:calc(846 * var(--p))}
.backdrop{position:absolute;left:calc(14 * var(--p));right:calc(80 * var(--p));top:calc(62.7 * var(--p));bottom:var(--base);z-index:1;
 
  box-shadow:inset 0 calc(-9 * var(--p)) 0 #0c0b0a,inset 0 calc(-10 * var(--p)) 0 rgba(255,255,255,.08),inset 0 calc(-30 * var(--p)) calc(18 * var(--p)) calc(-16 * var(--p)) rgba(0,0,0,.65)}
.backdrop::before{content:"";position:absolute;left:0;right:0;top:0;height:calc(9 * var(--p));background:linear-gradient(180deg,#24211e,#0c0b0a);box-shadow:0 calc(2 * var(--p)) calc(5 * var(--p)) rgba(0,0,0,.6)}
.backdrop::after{content:"";position:absolute;left:0;right:0;top:calc(-7 * var(--p));height:calc(9 * var(--p));background:repeating-linear-gradient(90deg,transparent 0 calc(54 * var(--p)),#0a0908 calc(54 * var(--p)) calc(58 * var(--p)))}
.tower{position:absolute;right:0;top:0;bottom:var(--base);width:calc(400 * var(--r));background:url('../img/rig/truss-v.webp') center top/100% auto repeat-y;z-index:3}
.tower::after{content:"";position:absolute;left:-16%;right:-16%;bottom:calc(-4 * var(--p));height:calc(7 * var(--p));border-radius:1px;background:linear-gradient(180deg,#5a5d62,#26282b 55%,#101112);box-shadow:0 calc(3 * var(--p)) calc(7 * var(--p)) rgba(0,0,0,.75)}
/* the wall and the tower stand on a strip of floor: a dark line where they meet it and a soft penumbra, lit by the pool */
.seat{position:absolute;left:calc(14 * var(--p));right:0;bottom:0;height:var(--base);z-index:1;pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.5) calc(6 * var(--p)),transparent calc(30 * var(--p))),radial-gradient(ellipse 60% 100% at 50% 0,rgba(0,0,0,.7),rgba(0,0,0,.28) 55%,transparent 100%)}
/* the rig sprites of base.css, rescaled to --r */
.werk-stage .truss{height:calc(400 * var(--r))}
.werk-stage .rig{height:calc(400 * var(--r))}
.werk-stage .rig--goal{left:0;right:calc(200 * var(--r));top:calc(40 * var(--r))}
.werk-stage .par{top:calc(273.64 * var(--r))}
.werk-stage .par .can{left:calc(-280 * var(--r));top:calc(-81.33 * var(--r));width:calc(560 * var(--r))}
.werk-stage .par .beam{left:calc((var(--lx) - 3200) * var(--r));top:calc((var(--ly) - 200) * var(--r));width:calc(6400 * var(--r))}
.werk-stage .par .glow{left:calc(var(--lx) * var(--r));top:calc(var(--ly) * var(--r));width:calc(420 * var(--r));height:calc(240 * var(--r))}
/* the beams live in their own layer so they can fade out before the clipped edge of the stage, sideways and downwards */
.beams{position:absolute;z-index:4;left:0;right:calc(200 * var(--r));top:calc(40 * var(--r));bottom:0;pointer-events:none;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 14%,#000 86%,transparent 100%),linear-gradient(180deg,#000 22%,transparent 74%);
  -webkit-mask-composite:source-in;
  mask-image:linear-gradient(90deg,transparent 0,#000 14%,#000 86%,transparent 100%),linear-gradient(180deg,#000 22%,transparent 74%);
  mask-composite:intersect}
/* the real wall: the photo itself, with its own light. No cutout, no added glow */
.backdrop{background:linear-gradient(90deg,rgba(0,0,0,.25),transparent 20%,transparent 80%,rgba(0,0,0,.3)),linear-gradient(180deg,transparent 60%,rgba(0,0,0,.55)),url('../img/backdrop-photo.webp') center top/cover no-repeat,#131417}
/* the cut ends at the shins: a pool of shadow round where the feet would be swallows the crop */

/* The moving head, hung at the left end of the truss. werk.js turns .lamp-head about the end of the yoke arm (the sprite's pivot is
   at 280, 316.9 of 560 x 640 render px) and lays .lamp-beam from the lens to the lit name: an apex-down cone, scaled uniformly so its angle never changes. */
.werk:not(.is-hover) .lamp{display:none}
.lamp{position:absolute;left:calc(180 * var(--r));top:calc(273.64 * var(--r));width:0;height:0}
.lamp-head,.lamp-yoke{position:absolute;left:calc(-280 * var(--r));top:calc(-81.33 * var(--r));width:calc(560 * var(--r));height:calc(640 * var(--r))}
.lamp-head{transform-origin:50% 49.52%;will-change:transform}
.lamp-can{position:absolute;inset:0;width:100%;height:100%}
.lamp-glow{position:absolute;left:calc(280 * var(--r));top:calc(457.72 * var(--r));width:calc(420 * var(--r));height:calc(240 * var(--r));transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(closest-side,rgba(255,236,200,.85),rgba(255,176,90,.35) 45%,transparent)}
.lamp-beam{position:absolute;left:-177px;top:0;width:354px;height:1000px;transform-origin:50% 0;transform:scale(0);pointer-events:none;will-change:transform;
  background:conic-gradient(from 170deg at 50% 0,rgba(255,228,182,0) 0deg,rgba(255,228,182,.05) 2deg,rgba(255,228,182,.14) 4deg,rgba(255,228,182,.24) 6deg,rgba(255,228,182,.31) 8deg,rgba(255,228,182,.34) 10deg,rgba(255,228,182,.31) 12deg,rgba(255,228,182,.24) 14deg,rgba(255,228,182,.14) 16deg,rgba(255,228,182,.05) 18deg,rgba(255,228,182,0) 20deg);
  -webkit-mask-image:linear-gradient(180deg,#000,#000 12%,rgba(0,0,0,.74) 45%,rgba(0,0,0,.62) 82%,transparent 100%);
  mask-image:linear-gradient(180deg,#000,#000 12%,rgba(0,0,0,.74) 45%,rgba(0,0,0,.62) 82%,transparent 100%)}

@media (max-width:899px),(max-height:599px){
  .werk-view{padding-top:calc(var(--pad) * 1.6)}
  .werk-grid{grid-template-columns:1fr;gap:clamp(36px,9vw,64px)}
}

/* print: see base.css */
@media print{
  .werk-view,.werk-grid,.werk-main,.werk-list,.caps{display:block!important;position:static!important;height:auto!important;min-height:0!important;padding:0!important;overflow:visible!important}
  .cap{position:static!important;width:auto!important;height:auto!important;margin:0!important;padding:0 0 7pt!important;break-inside:avoid!important;outline:0!important}
  .cap-name{width:auto!important;font-family:var(--sans)!important;font-weight:600!important;font-size:11pt!important;line-height:1.3!important;letter-spacing:0!important}
  .cap-line{position:static!important;max-width:none!important;margin:1pt 0 0!important;font-size:10.5pt!important;line-height:1.45!important}
  .cutwrap,.werk-stage,.werk-pool{display:none!important}
}
