/* "The lights go out": the home page's scroll scene. A warm room, the power cuts, a torch finds the cupboard, Bornal
   has the answer. Plain CSS and a little JavaScript (lights.js), nothing loaded from elsewhere. */
.lights{position:relative;background:#0B120E;color:#F2F4EC;font-family:Figtree,'Helvetica Neue',sans-serif}
.lights-track{height:380vh}
.lights-stage{position:sticky;top:var(--hh,0px);height:calc(100vh - var(--hh,0px));overflow:hidden;--sh:calc(100vh - var(--hh,0px));
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
@supports (height:100svh){.lights-stage{height:calc(100lvh - var(--hh,0px));--sh:calc(100svh - var(--hh,0px))}}
.lights-room,.lights-room *,.lights-dark,.lights-moon,.lights-labels{pointer-events:none}
/* the room: one photo of the whole wall (assets/room.webp: the cupboard, a sash window in the rain, a pendant light),
   its edges fading into the wall's own colours, which carry on either side of it. The items, the window and the
   light are spots over the photo (the torch labels and the window's light use them). */
.lights-room{position:absolute;inset:0;background:#302e1c}
.lights-cupboard{position:absolute;left:62%;bottom:calc(100% - var(--sh));transform:translateX(-50%);height:var(--sh);aspect-ratio:1080/1168;transform-origin:0 0;transition:opacity .5s,transform 1.15s cubic-bezier(.45,0,.2,1)}
.lights.zoom .lights-cupboard{transform:translateX(-50%) var(--zt,scale(1))}
.lights-cupboard:before{content:"";position:absolute;top:0;bottom:0;left:-300%;right:-300%;z-index:-1;background:linear-gradient(180deg,#32301d 0%,#32301d 10%,#34311f 20%,#35321f 30%,#383521 40%,#363420 50%,#3c3823 60%,#3d3b24 70%,#3e3924 80%,#3d3924 90%,#363420 100%)}
.lights-photo{position:absolute;inset:0;background:url(/assets/room-2160.webp) center/100% 100% no-repeat;
  background-image:-webkit-image-set(url(/assets/room-2160.webp) 1x,url(/assets/room-4k.webp) 2x);background-image:image-set(url(/assets/room-2160.webp) 1x,url(/assets/room-4k.webp) 2x);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent),linear-gradient(180deg,transparent,#000 11%,#000 97%,transparent);-webkit-mask-composite:source-in;
  mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent),linear-gradient(180deg,transparent,#000 11%,#000 97%,transparent);mask-composite:intersect;transition:filter .4s}
.lights.off .lights-photo{filter:brightness(.72) saturate(.8)}
/* the ceiling light switched off: the same photo with the bulb and the shade's inside unlit, shown whenever the power is
   out (and flickering with the dark when it goes) */
.lights-lampoff{position:absolute;left:38%;top:20%;width:22%;height:20%;opacity:0;pointer-events:none;
  background:url(/assets/room-lamp-off-2160.webp) center/100% 100% no-repeat;
  background-image:-webkit-image-set(url(/assets/room-lamp-off-2160.webp) 1x,url(/assets/room-lamp-off-4k.webp) 2x);background-image:image-set(url(/assets/room-lamp-off-2160.webp) 1x,url(/assets/room-lamp-off-4k.webp) 2x);transition:filter .4s}
.lights.off .lights-lampoff{opacity:1;filter:brightness(.72) saturate(.8)}
.lights.flicker .lights-lampoff{animation:lFlicker .9s steps(1) both}
/* the lamp's light falling off across the whole wall, photo and extension alike, so the photo has no edge to see */
.lights-room:before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(ellipse 34% 62% at 62% 40%,rgba(255,214,150,.10),transparent 70%),radial-gradient(ellipse 42% 75% at 62% 48%,transparent 45%,rgba(22,18,9,.55) 100%)}
@media (max-width:820px){.lights-room:before{background:radial-gradient(ellipse 70% 52% at 50% 64%,transparent 50%,rgba(22,18,9,.5) 100%)}}
.lights .it{position:absolute}
/* rain running down the photo's window glass */
.lights-glass{position:absolute;left:10.6%;top:8.2%;width:77.4%;height:82.1%;overflow:hidden;
  /* rain only on the four panes, not over the frame and glazing bars (owner, 24 Nov 2026); panes from Ad B's PANES, as in window_flash.py */
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M1.08 .91h42.64v45.2H1.08zM56.93 .91H99v45.2H56.93zM1.08 49.47h42.64v49.57H1.08zM56.93 49.47H99v49.57H56.93z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M1.08 .91h42.64v45.2H1.08zM56.93 .91H99v45.2H56.93zM1.08 49.47h42.64v49.57H1.08zM56.93 49.47H99v49.57H56.93z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat}
.lights-rain{position:absolute;inset:-20% 0 0;opacity:.45;mix-blend-mode:screen;filter:blur(.4px);background-image:repeating-linear-gradient(100deg,transparent 0 11px,rgba(214,226,250,.32) 11px 12px,transparent 12px 23px),repeating-linear-gradient(96deg,transparent 0 17px,rgba(214,226,250,.18) 17px 18px,transparent 18px 29px);animation:lRain .55s linear infinite}
@keyframes lRain{to{transform:translateY(20%)}}
/* the dark, with a hole where the torch points */
/* the dark: a deep night blue over the room, with a hole where the torch points and a softer one at the window,
   where the street lights and the sky still give a little light */
.lights-dark{position:absolute;inset:0;pointer-events:none;opacity:var(--off,0);background:rgba(6,11,26,.955);
  -webkit-mask-image:radial-gradient(circle var(--r,1px) at var(--x,50%) var(--y,60%),rgba(0,0,0,.04) 0,rgba(0,0,0,.22) 55%,#000 100%),radial-gradient(ellipse calc(var(--ww,100px) * .95) calc(var(--wh,130px) * .85) at var(--wx,85%) var(--wy,30%),rgba(0,0,0,.45) 0,rgba(0,0,0,.7) 60%,#000 100%);
  -webkit-mask-composite:source-in;
  mask-image:radial-gradient(circle var(--r,1px) at var(--x,50%) var(--y,60%),rgba(0,0,0,.04) 0,rgba(0,0,0,.22) 55%,#000 100%),radial-gradient(ellipse calc(var(--ww,100px) * .95) calc(var(--wh,130px) * .85) at var(--wx,85%) var(--wy,30%),rgba(0,0,0,.45) 0,rgba(0,0,0,.7) 60%,#000 100%);
  mask-composite:intersect}
.lights:not(.torch) .lights-dark{background:rgba(6,11,26,.965);-webkit-mask-image:radial-gradient(ellipse calc(var(--ww,100px) * .95) calc(var(--wh,130px) * .85) at var(--wx,85%) var(--wy,30%),rgba(0,0,0,.45) 0,rgba(0,0,0,.7) 60%,#000 100%);mask-image:radial-gradient(ellipse calc(var(--ww,100px) * .95) calc(var(--wh,130px) * .85) at var(--wx,85%) var(--wy,30%),rgba(0,0,0,.45) 0,rgba(0,0,0,.7) 60%,#000 100%)}
.lights.answer .lights-dark{background:rgba(6,11,26,.965)}
/* the ending: a warm glow behind the app, added on top of the dark (not a gap in it) */
.lights-moon:before{content:"";position:absolute;inset:0;opacity:0;transition:opacity .6s;background:radial-gradient(520px 420px at 76% 50%,rgba(231,169,58,.16),transparent 70%)}
.lights.answer .lights-moon:before{opacity:1}
/* cold light from the window falling into the room; lightning when the power goes */
.lights-moon{position:absolute;inset:0;pointer-events:none;opacity:var(--off,0);mix-blend-mode:screen;
  background:radial-gradient(ellipse calc(var(--ww,100px) * 2.4) calc(var(--wh,130px) * 2.6) at var(--wx,85%) calc(var(--wy,30%) + var(--wh,130px) * .9),rgba(96,128,190,.12),transparent 70%),
    radial-gradient(ellipse calc(var(--ww,100px) * 1.2) calc(var(--wh,130px) * .9) at var(--wx,85%) var(--wy,30%),rgba(140,170,220,.22),transparent 72%)}
.lights-moon:after{content:"";position:absolute;inset:0;opacity:0;background:radial-gradient(ellipse calc(var(--ww,100px) * 1.25) calc(var(--wh,130px) * 1.15) at var(--wx,85%) var(--wy,30%),rgba(196,214,252,.55),rgba(150,180,240,.16) 60%,transparent 85%),radial-gradient(ellipse calc(var(--ww,100px) * 3.4) calc(var(--wh,130px) * 3) at var(--wx,85%) var(--wy,30%),rgba(120,150,220,.3),transparent 70%)}
.lights.bolt .lights-moon:after{animation:lSky .8s linear both}
/* lightning outside the window as the power goes (as in the ad): above the dark, moving with the room. The sky behind the
   roofs flashes blue-white, twice, then a faint third; a distant bolt drops behind the roofs on the two strikes. */
.lights-fx{pointer-events:none;mix-blend-mode:screen}
.lights-fx:before{display:none}
.lights-flash{position:absolute}
.lights-sky,.lights-strike{position:absolute;inset:0;opacity:0;background:url(/assets/window-sky.webp) center/100% 100% no-repeat}
.lights-strike{background-image:url(/assets/window-bolt.webp)}
.lights.bolt .lights-sky{animation:lSky .8s linear both}
.lights.bolt .lights-strike{animation:lStrike .8s steps(1) both}
@keyframes lSky{0%{opacity:1}6%{opacity:.85}11%{opacity:.12}17.5%{opacity:.95}25%{opacity:.55}37.5%{opacity:.1}57.5%,77.5%{opacity:0}82.5%{opacity:.35}92.5%,100%{opacity:0}}
@keyframes lStrike{0%{opacity:1}9%{opacity:0}16%{opacity:1}28%,100%{opacity:0}}
.lights.flicker .lights-dark{animation:lFlicker .9s steps(1) both}
@keyframes lFlicker{0%{opacity:.85}12%{opacity:.1}22%{opacity:.9}30%{opacity:.25}44%{opacity:1}58%{opacity:.4}70%,100%{opacity:1}}
/* labels that appear in the beam */
.lights-label{position:absolute;left:0;top:0;padding:6px 10px;border-radius:10px;background:rgba(19,33,26,.9);border:1px solid rgba(231,169,58,.5);color:#F2F4EC;font-size:13px;font-weight:600;white-space:nowrap;opacity:0;transition:opacity .25s;pointer-events:none}
.lights-label b{color:#E7A93A;font-weight:700}
.lights-label.on{opacity:1}
/* the words */
.lights-copy{position:absolute;left:6%;top:28%;width:min(440px,36vw);z-index:3}
.lights-line{position:absolute;left:0;top:0;width:100%;opacity:0;transform:translateY(16px);transition:opacity .5s,transform .5s;pointer-events:none}
.lights-line.on{opacity:1;transform:none;pointer-events:auto}
.lights-line small{display:block;font-weight:800;font-size:13px;letter-spacing:.12em;text-transform:uppercase;color:#F2C66B;margin-bottom:10px}
.lights.off .lights-line small{color:#E7A93A}
.lights-line h2{font-family:'Young Serif',Georgia,serif;font-weight:400;font-size:clamp(2rem,4.4vw,3.4rem);line-height:1.05;margin:0 0 12px;color:#FBF6EA;text-shadow:0 2px 18px rgba(30,24,10,.35)}
.lights.off .lights-line h2{color:#F2F4EC}
.lights-line p{margin:0;font-size:1.08rem;line-height:1.55;color:#EDE6D3}
.lights.off .lights-line p{color:#C9D4C5}
.lights-hint{display:inline-flex;align-items:center;gap:8px;margin-top:14px;font-size:14px;color:#E7A93A}
.lights-hint:before{content:"";width:10px;height:10px;border-radius:50%;background:#E7A93A;box-shadow:0 0 0 0 rgba(231,169,58,.6);animation:lPing 1.6s infinite}
@keyframes lPing{70%{box-shadow:0 0 0 10px rgba(231,169,58,0)}100%{box-shadow:0 0 0 0 rgba(231,169,58,0)}}
/* the answer: the phone */
.lights-phone{position:absolute;right:12%;top:50%;width:min(270px,58vw);transform:translate(40px,-50%) rotate(4deg);opacity:0;transition:opacity .6s,transform .7s cubic-bezier(.2,.8,.2,1);z-index:4;
  border-radius:40px;padding:9px;background:#0B110D;box-shadow:0 40px 80px -20px rgba(0,0,0,.8),inset 0 0 0 2px #34473B}
.lights-phone img{display:block;width:100%;height:auto;border-radius:31px;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
/* the phone is a picture only: touches go through to the room (a long press in the dark used to pick up the hidden image) */
.lights-phone{pointer-events:none}
.lights.answer .lights-phone{opacity:1;transform:translate(0,-50%) rotate(3deg)}
.lights.answer .lights-cupboard{opacity:.3}
.lights-cta{display:inline-flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:20px}
.lights-cta a.go{background:#E7A93A;color:#1E1406;font-weight:700;padding:12px 18px;border-radius:12px;text-decoration:none}
.lights-cta a.go:hover{background:#F2C66B}
.lights-sound{position:absolute;right:86px;bottom:calc(100% - var(--sh) + 16px);z-index:5;display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:13px;color:#A7B6A8;border:1px solid rgba(167,182,168,.35);padding:6px 10px;border-radius:999px;background:rgba(11,18,14,.4);cursor:pointer}
.lights-sound[hidden]{display:none}
.lights:not(.off) .lights-sound{color:#FBF6EA;border-color:rgba(251,246,234,.4);background:rgba(40,34,20,.3)}
.lights-sound .w{display:none}.lights-sound[aria-pressed=true] .w{display:inline}.lights-sound[aria-pressed=true] .x{display:none}
.lights-skip{position:absolute;right:18px;bottom:calc(100% - var(--sh) + 16px);z-index:5;font-size:13px;color:#A7B6A8;text-decoration:none;border:1px solid rgba(167,182,168,.35);padding:6px 10px;border-radius:999px;background:rgba(11,18,14,.4)}
.lights:not(.off) .lights-skip{color:#FBF6EA;border-color:rgba(251,246,234,.4);background:rgba(40,34,20,.3)}
.lights-progress{position:absolute;left:0;top:0;height:3px;background:#E7A93A;width:calc(var(--p,0)*100%);z-index:6}
/* phones: words on top, cupboard below them; at the end the app peeks up under the words, never over them */
@media (max-width:820px){
  .lights-track{height:320vh}
  .lights-copy{left:6%;right:6%;width:auto;top:22px;transform:none}
  .lights-line h2{font-size:clamp(1.7rem,7.4vw,2.3rem)}
  .lights-line p{font-size:1rem}
  /* the light stays below the words: the photo is only as tall as leaves its lamp (23% down) clear of them */
  .lights-cupboard{left:50%;height:min(calc((var(--sh) - var(--ch,250px) - 10px) / .77),calc(100vw * 1168 / 1080))}
  .lights-sound{right:84px;padding:7px 9px}.lights-sound span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .lights-phone{right:50%;top:var(--pt,55%);bottom:auto;width:var(--pw,min(230px,60vw));transform:translate(50%,40px) rotate(2deg)}
  .lights.answer .lights-phone{transform:translate(50%,0) rotate(2deg)}
  .lights-moon:before{background:radial-gradient(360px 320px at 50% 78%,rgba(231,169,58,.16),transparent 70%)}
  .lights.answer .lights-cupboard{opacity:.12}
}
/* frozen for checking (?lights=…) */
.lights.still *,.lights.still *:before,.lights.still *:after{transition:none !important}
.lights.still .lights-track{height:auto}.lights.still .lights-stage{position:relative;height:100vh}
/* calm version: no pinning, no flicker, the end state */
@media (prefers-reduced-motion:reduce){
  .lights-track{height:auto}.lights-stage{position:relative;height:auto;min-height:100vh}
  .lights-rain,.lights-hint:before{animation:none}.lights-line,.lights-phone,.lights-label{transition:none}
}
