/* WORK — multi-screen portfolio viewer (behaviour: assets/js/portfolio/viewer.js, data: portfolio/events.json).
   Desktop: event selector (8-column grid) on top; under it the stage (no frame, on the page background) + controls
   on the left and the info box on the right. The stage never changes size; the info box can grow downwards when its
   photos and clips are opened. Heading + selector + stage fit one screen under the header, so the event buttons
   and the play button are always visible together without scrolling to an exact spot.
   Phones: everything stacks and the page scrolls. */
.yk-pf{--side:clamp(370px,38vw,560px);--selh:58px;   /* --selh: selector height, measured by viewer.js */
  /* leaves room for the floating header, the section heading and the selector, so the whole section fits one screen */
  --stageh:clamp(240px,min(calc(100vh - 380px - var(--selh)),44vw),620px);
  --stageh:clamp(240px,min(calc(100svh - 380px - var(--selh)),44vw),620px);
  display:flex;flex-direction:column;gap:14px;scroll-margin-top:84px;}
.yk-pf-main{display:grid;grid-template-columns:minmax(0,1fr) var(--side);gap:clamp(16px,2vw,28px);align-items:start;}
.yk-pf [hidden]{display:none !important;}
.yk-pf .yk-mono{font-size:13px;}          /* the viewer's type runs ~13% larger than the site's small print */

/* ---------- stage + controls ---------- */
.yk-pf-screen{display:flex;flex-direction:column;height:var(--stageh);min-width:0;}
.yk-pf-stage{position:relative;flex:1;min-height:0;}
/* the playing <video> is a tiny, near-transparent element in the corner: counted as "on screen" by mobile browsers (so they keep it playing), but costs nothing to composite. The canvas shows the picture. */
.yk-pf-stage canvas{position:absolute;inset:0;z-index:1;width:100%;height:100%;}
.yk-pf-vids{position:absolute;left:0;bottom:0;z-index:0;width:16px;height:9px;overflow:hidden;opacity:0.01;pointer-events:none;}
.yk-pf-vids video{position:absolute;inset:0;width:100%;height:100%;}

/* screen label + size on hover / tap */
.yk-pf .yk-pf-tip{position:absolute;left:0;top:0;z-index:2;pointer-events:none;padding:6px 10px;white-space:nowrap;font-size:12px;color:var(--cream);background:rgba(10,10,10,0.88);border:1px solid var(--line2);}

/* loading / error */
.yk-pf-state{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:20px;text-align:center;pointer-events:none;animation:ykPfIn .3s .25s both;}
.yk-pf-state .yk-blob{width:30px;height:30px;animation-duration:3s;}
.yk-pf-state.yk-err{background:rgba(10,10,10,0.75);animation-delay:0s;}
.yk-pf-state.yk-err .yk-blob{display:none;}
.yk-pf-state.yk-err .yk-mono{color:var(--orange);max-width:420px;line-height:1.7;}
@keyframes ykPfIn{from{opacity:0}}

.yk-pf-bigplay{position:absolute;left:50%;top:50%;z-index:3;width:72px;height:72px;margin:-36px 0 0 -36px;border:none;border-radius:50%;background:var(--orange);color:#0A0A0A;display:grid;place-items:center;box-shadow:0 0 40px var(--glow);transition:background .25s,transform .25s;}
.yk-pf-bigplay svg{width:28px;height:28px;fill:currentColor;margin-left:3px;}
.yk-pf-bigplay:hover{background:var(--yolk);transform:scale(1.06);}

/* control bar */
.yk-pf-bar{display:flex;align-items:center;gap:14px;height:58px;padding-top:12px;border-top:1px solid var(--line);}
.yk-pf-btn{flex-shrink:0;width:42px;height:42px;border-radius:50%;border:1px solid var(--line2);background:none;color:var(--white);display:grid;place-items:center;transition:background .2s,color .2s,border-color .2s;}
.yk-pf-btn svg{width:18px;height:18px;fill:currentColor;}
.yk-pf-btn .yk-i-line{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;}
.yk-pf-btn .yk-i-on,.yk-pf-btn.yk-on .yk-i-off{display:none;}
.yk-pf-btn.yk-on .yk-i-on{display:inline;}
.yk-pf-btn:hover{background:var(--orange);border-color:var(--orange);color:#0A0A0A;}
.yk-pf-btn[data-act="play"]{background:var(--orange);border-color:var(--orange);color:#0A0A0A;}
.yk-pf-btn[data-act="play"]:hover{background:var(--yolk);border-color:var(--yolk);}
.yk-pf-time{min-width:34px;font-variant-numeric:tabular-nums;letter-spacing:0.04em;}
.yk-pf .yk-pf-hint{white-space:nowrap;font-size:12px;}

.yk-pf-seek{--p:0%;flex:1;min-width:60px;height:22px;background:none;-webkit-appearance:none;appearance:none;}
.yk-pf-seek::-webkit-slider-runnable-track{height:2px;background:linear-gradient(to right,var(--orange) var(--p),var(--line2) var(--p));}
.yk-pf-seek::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:12px;margin-top:-5px;border:none;border-radius:1px;background:var(--orange);transform:rotate(45deg);}
.yk-pf-seek::-moz-range-track{height:2px;background:var(--line2);}
.yk-pf-seek::-moz-range-progress{height:2px;background:var(--orange);}
.yk-pf-seek::-moz-range-thumb{width:10px;height:10px;border:none;border-radius:1px;background:var(--orange);transform:rotate(45deg);}

/* visual switch (only when an event has more than one), styled like the language switch */
.yk-pf-visuals{display:flex;flex-shrink:0;padding:3px;border:1px solid var(--line2);border-radius:30px;}
.yk-pf-visuals button{font-family:var(--mono);font-size:12px;letter-spacing:0.08em;text-transform:uppercase;padding:5px 10px;border:none;border-radius:30px;background:none;color:var(--grey);transition:color .2s,background .2s;}
.yk-pf-visuals button:hover{color:var(--white);}
.yk-pf-visuals button[aria-pressed="true"]{background:var(--line2);color:var(--white);}

/* ---------- event selector: 8 per row ---------- */
.yk-pf-events{position:relative;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;}
.yk-pf-ev{--c:10px;position:relative;flex:0 0 auto;height:58px;min-width:0;padding:0;border:none;background:var(--line2);text-align:left;color:var(--grey2);
  clip-path:polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,var(--c) 100%,0 calc(100% - var(--c)));transition:background .25s,color .25s;}
.yk-pf-ev::before,.yk-pf-ev img,.yk-pf-ev::after{position:absolute;inset:1px;width:calc(100% - 2px);height:calc(100% - 2px);clip-path:polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,var(--c) 100%,0 calc(100% - var(--c)));}
.yk-pf-ev::before{content:'';background:var(--card);}
.yk-pf-ev img{object-fit:cover;filter:saturate(.7) brightness(.45);transition:filter .3s;}
.yk-pf-ev::after{content:'';background:linear-gradient(90deg,rgba(10,10,10,0.85),rgba(10,10,10,0.25));}
.yk-pf-ev-txt{position:relative;z-index:2;display:flex;flex-direction:column;justify-content:center;gap:2px;height:100%;padding:0 12px;}
.yk-pf-ev-title{font-family:var(--display);font-size:14.5px;line-height:1.15;letter-spacing:-0.01em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.yk-pf-ev-tag{font-family:var(--mono);font-size:10px;letter-spacing:0.14em;text-transform:uppercase;color:var(--orange);}
.yk-pf-ev:hover{background:rgba(255,153,32,0.55);color:var(--white);}
.yk-pf-ev:hover img{filter:saturate(.9) brightness(.6);}
.yk-pf-ev[aria-pressed="true"]{background:var(--orange);color:var(--white);}
.yk-pf-ev[aria-pressed="true"] img{filter:none brightness(.7);}

/* info box: as tall as the stage, scrolls inside if needed; with the gallery open it grows downwards instead */
.yk-pf-info{--cut:16px;display:flex;height:var(--stageh);}
.yk-pf-info.yk-open{height:auto;min-height:var(--stageh);}
.yk-pf-info.yk-open > .yk-in{overflow:visible;}
.yk-pf-info:hover{background:var(--line2);}
.yk-pf-info > .yk-in{flex:1;min-height:0;height:auto;overflow-y:auto;overscroll-behavior:contain;padding:20px 24px;scrollbar-width:thin;scrollbar-color:var(--line2) transparent;transition:opacity .22s ease;}
.yk-pf-info > .yk-in.yk-out{opacity:0;}
.yk-pf-info-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 20px;}
.yk-pf-part{grid-column:1 / -1;min-width:0;}
.yk-pf-half{grid-column:auto;}                          /* tech used + what we did share a row */
.yk-pf-part > .yk-label{display:block;font-size:12px;margin-bottom:8px;}
.yk-pf-name h3{font-size:clamp(24px,2vw,29px);line-height:1.05;}
.yk-pf-tag{display:inline-block;margin-bottom:8px;padding:2px 7px;font-family:var(--mono);font-size:12px;letter-spacing:0.14em;text-transform:uppercase;color:var(--orange);border:1px solid var(--orange);}
.yk-pf-org{margin-top:6px;font-size:15.5px;line-height:1.45;}
.yk-pf-vt{display:block;margin-top:10px;color:var(--orange);}
.yk-pf-stats{display:flex;gap:22px;padding-bottom:8px;border-bottom:1px solid var(--line2);}
.yk-pf-stats b{display:block;font-family:var(--display);font-weight:500;font-size:20.5px;line-height:1.15;color:var(--white);white-space:nowrap;}
.yk-pf-stats .yk-mono{font-size:11.5px;}
.yk-pf-scr li{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 12px;padding:5px 0;border-bottom:1px solid var(--line);font-size:14px;}
.yk-pf-scr b{font-weight:500;color:var(--white);}
.yk-pf-scr .yk-mono{font-size:11.5px;letter-spacing:0.03em;white-space:nowrap;}
.yk-pf-part .yk-list{margin-top:0;}
.yk-pf .yk-list{gap:6px;}
.yk-pf .yk-pill{font-size:12px;padding:4px 9px;white-space:normal;}
.yk-pf-did li{position:relative;padding-left:14px;margin-bottom:5px;font-size:14.5px;line-height:1.4;color:var(--grey2);}
.yk-pf-did li::before{content:'';position:absolute;left:1px;top:.55em;width:5px;height:5px;background:var(--orange);transform:rotate(45deg);}

/* "Photos and clips": a dropdown at the bottom of the info box */
.yk-pf-galbtn{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 18px;border:1px solid var(--line2);border-radius:30px;background:none;color:var(--white);font-family:var(--mono);font-size:13px;letter-spacing:0.1em;text-transform:uppercase;transition:background .2s,color .2s,border-color .2s;}
.yk-pf-galn{display:flex;align-items:center;gap:10px;}
.yk-pf-galn b{font-weight:500;color:var(--orange);}
.yk-pf-galn i{width:7px;height:7px;margin-top:-4px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);transition:transform .3s,margin .3s;}
.yk-pf-galbtn[aria-expanded="true"] .yk-pf-galn i{transform:rotate(-135deg);margin-top:4px;}
.yk-pf-galbtn:hover{background:var(--orange);border-color:var(--orange);color:#0A0A0A;}
.yk-pf-galbtn:hover b{color:#0A0A0A;}
.yk-pf-galpanel{display:grid;grid-template-rows:0fr;transition:grid-template-rows .4s cubic-bezier(.2,.8,.2,1);}
.yk-pf-galbtn[aria-expanded="true"] + .yk-pf-galpanel{grid-template-rows:1fr;}
.yk-pf-galpanel > div{min-height:0;overflow:hidden;}
.yk-pf-galbtn[aria-expanded="false"] + .yk-pf-galpanel > div{visibility:hidden;transition:visibility 0s .4s;}
.yk-pf-galgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px;padding-top:12px;}
.yk-pf-thumb{--c:8px;position:relative;aspect-ratio:16/10;padding:1px;border:none;overflow:hidden;background:var(--line2);
  clip-path:polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,var(--c) 100%,0 calc(100% - var(--c)));transition:background .25s;}
.yk-pf-thumb::before{content:'';position:absolute;inset:1px;background:radial-gradient(circle at 70% 35%,rgba(255,153,32,0.35),transparent 55%),#0c0a08;}
.yk-pf-thumb img{position:relative;width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.2,.8,.2,1);}
.yk-pf-thumb:hover{background:var(--orange);}
.yk-pf-thumb:hover img{transform:scale(1.06);}
.yk-pf-badge{position:absolute;left:6px;bottom:6px;padding:2px 5px;font-family:var(--mono);font-size:10px;letter-spacing:0.12em;text-transform:uppercase;color:#0A0A0A;background:var(--orange);}

/* no data / failed */
.yk-pf-empty .yk-pf-main{grid-template-columns:1fr;}
.yk-pf-empty .yk-pf-screen{height:280px;}
.yk-pf-empty .yk-pf-bar,.yk-pf-empty .yk-pf-events,.yk-pf-empty .yk-pf-info{display:none;}
.yk-pf-noscript{padding:40px 0;text-align:center;}

.yk-work-more{display:flex;justify-content:center;margin-top:56px;}

/* ---------- fullscreen (stage + controls only) ---------- */
.yk-pf-screen:fullscreen{width:100%;height:100%;padding:24px 28px;background:var(--bg);}
.yk-pf-screen:fullscreen .yk-pf-stage{flex:1;aspect-ratio:auto;}
.yk-pf-screen:-webkit-full-screen{width:100%;height:100%;padding:24px 28px;background:var(--bg);}
.yk-pf-screen:-webkit-full-screen .yk-pf-stage{flex:1;aspect-ratio:auto;}
/* the custom cursor lives outside the fullscreen element, so bring the normal one back there */
.yk-fine .yk-pf-screen:fullscreen,.yk-fine .yk-pf-screen:fullscreen *{cursor:default;}
.yk-fine .yk-pf-screen:fullscreen button,.yk-fine .yk-pf-screen:fullscreen input{cursor:pointer;}
.yk-fine .yk-pf-screen:-webkit-full-screen,.yk-fine .yk-pf-screen:-webkit-full-screen *{cursor:default;}

/* ---------- gallery viewer (lightbox) ---------- */
html.yk-pf-lock{overflow:hidden;}
.yk-pf-lb{position:fixed;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;padding:72px 84px 88px;background:rgba(10,10,10,0.95);}
.yk-pf-lb[hidden]{display:none;}
.yk-pf-lb-media{width:100%;height:100%;display:flex;align-items:center;justify-content:center;}
.yk-pf-lb-media img,.yk-pf-lb-media video{max-width:100%;max-height:100%;object-fit:contain;background:#000;}
.yk-pf-lb-bar{position:absolute;left:0;right:0;bottom:30px;display:flex;justify-content:center;align-items:baseline;gap:18px;padding:0 84px;text-align:center;}
.yk-pf-lb-n{color:var(--orange);}
.yk-pf-lb-cap{font-size:14px;color:var(--grey2);}
.yk-pf-lb-btn{position:absolute;width:48px;height:48px;border:1px solid var(--line2);border-radius:50%;background:rgba(10,10,10,0.6);color:var(--white);font-size:17px;display:grid;place-items:center;transition:background .2s,color .2s,border-color .2s;}
.yk-pf-lb-btn:hover{background:var(--orange);border-color:var(--orange);color:#0A0A0A;}
.yk-pf-lb-prev{left:18px;top:50%;margin-top:-24px;}
.yk-pf-lb-next{right:18px;top:50%;margin-top:-24px;}
.yk-pf-lb-close{right:18px;top:18px;}

/* ---------- narrower desktops ---------- */
@media(max-width:1280px){.yk-pf-hint{display:none;}}
@media(max-width:1100px){.yk-pf-events{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(pointer:coarse){.yk-pf-hint{display:none;}}

/* ---------- phones: stack, fixed stage aspect, page scrolls ---------- */
@media(max-width:860px){
  .yk-pf-main{display:flex;flex-direction:column;align-items:stretch;gap:14px;}
  .yk-pf-screen{height:auto;}
  .yk-pf-stage{flex:none;aspect-ratio:16/10;}
  .yk-pf-bar{flex-wrap:wrap;gap:10px;height:auto;}
  .yk-pf-time[data-t="dur"]{display:none;}
  .yk-pf-visuals{order:9;}
  .yk-pf-events{display:flex;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;}
  .yk-pf-ev{width:min(200px,62vw);}
  .yk-pf-ev-title{font-size:15.5px;}
  .yk-pf-info,.yk-pf-info.yk-open{height:auto;min-height:0;}
  .yk-pf-info > .yk-in{overflow:visible;padding:18px;}
  .yk-pf-lb{padding:64px 12px 120px;}
  .yk-pf-lb-bar{bottom:84px;padding:0 16px;}
  .yk-pf-lb-prev,.yk-pf-lb-next{top:auto;bottom:18px;margin:0;}
  .yk-pf-lb-prev{left:calc(50% - 58px);}
  .yk-pf-lb-next{right:calc(50% - 58px);}
  .yk-pf-lb-close{right:12px;top:12px;}
}
