/* Portfolio Reels 1.40 — single-source layout
   Desktop: centered player + card-attached rail.
   Mobile: full viewport reel + fixed chrome.
   State rules own their selectors; no cascade patches. */
html,body{margin:0;background:#0f1111;color:#fff;overflow:hidden}
button,a{font:inherit}

/* Feed shell */
.portfolio-reels{position:fixed;inset:0;z-index:1200;display:none;overflow:hidden;background:#101212;color:#fff}
.portfolio-reels.is-open{display:block}
.portfolio-reels:before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 46%,rgba(255,255,255,.025),transparent 62%)}
.portfolio-reels-scroller{position:relative;height:100dvh;padding:18vh 0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scroll-snap-type:y mandatory;scrollbar-width:none}
.portfolio-reels-scroller::-webkit-scrollbar{display:none}

/* Card + centered player */
.portfolio-reel-card[hidden]{display:none}
.portfolio-reel-card{position:relative;width:min(1100px,calc(100vw - 358px),calc(64vh * var(--reel-aspect, 1.777778)));height:64vh;margin:0 auto 34px;scroll-snap-align:center;scroll-snap-stop:always;opacity:.42;transition:opacity .18s ease;contain:layout style;overflow:visible}
.portfolio-reel-card.is-near{opacity:.7}
.portfolio-reel-card.is-active{opacity:1}
.portfolio-reel-media{position:relative;width:100%;height:100%;overflow:hidden;border-radius:3px;background:#090909;box-shadow:0 18px 54px rgba(0,0,0,.38)}
.portfolio-reel-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#090909;border-radius:inherit}
/* Subtle reel-entry veil: fade only on activation, without animating the video surface. */
.portfolio-reel-media:after{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;background:#090909;opacity:0}
.portfolio-reel-card.is-active .portfolio-reel-media:after{animation:portfolio-reel-reveal .32s ease-out both}
@keyframes portfolio-reel-reveal{from{opacity:.72}to{opacity:0}}
@media(prefers-reduced-motion:reduce){.portfolio-reel-card.is-active .portfolio-reel-media:after{animation:none}}
.portfolio-reel-media:before{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(180deg,rgba(0,0,0,.14),transparent 20%,transparent 62%,rgba(0,0,0,.7))}

/* Copy */
.portfolio-reel-copy{position:absolute;z-index:4;left:22px;right:22px;bottom:28px;pointer-events:none;text-shadow:0 2px 16px rgba(0,0,0,.45)}
.portfolio-reel-copy h2{margin:0 0 5px;font-family:Impact,"Arial Narrow",sans-serif;font-size:clamp(22px,2vw,31px);font-weight:400;line-height:1;text-transform:uppercase}
.portfolio-reel-copy p{margin:0;font-size:11px;line-height:1.35;color:rgba(255,255,255,.82)}

/* Shared control appearance */
.portfolio-reel-player-controls{position:absolute;z-index:8;left:18px;right:18px;top:18px;display:flex;gap:8px;align-items:center;pointer-events:none}
.portfolio-reel-player-controls button,.portfolio-reel-actions button,.portfolio-reels-nav button{width:42px;height:42px;padding:0;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(12,12,12,.64);color:#fff;cursor:pointer;pointer-events:auto}
.portfolio-reel-player-controls button svg,.portfolio-reel-actions button svg,.portfolio-reels-nav button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.portfolio-reel-full{margin-left:auto}
/* Desktop: playback controls appear on hover or keyboard focus only. */
@media (hover:hover) and (min-width:801px){
 .portfolio-reel-player-controls{opacity:0;transition:opacity .16s ease}
 .portfolio-reel-card.is-active .portfolio-reel-media:hover .portfolio-reel-player-controls,
 .portfolio-reel-card.is-active .portfolio-reel-player-controls:focus-within{opacity:1}
}
.portfolio-reel-card:not(.is-active) .portfolio-reel-player-controls{opacity:0;pointer-events:none}
.portfolio-reel-play .icon-play,.portfolio-reel-sound .icon-sound,.portfolio-reel-full .icon-collapse{display:none}
.portfolio-reel-card.is-paused .portfolio-reel-play .icon-pause{display:none}
.portfolio-reel-card.is-paused .portfolio-reel-play .icon-play,.portfolio-reel-card.is-sound .portfolio-reel-sound .icon-sound{display:block}
.portfolio-reel-card.is-sound .portfolio-reel-sound .icon-muted{display:none}
.portfolio-reel-favorite.is-saved svg{fill:#fff}
.portfolio-reel-info[aria-pressed="true"]{background:#fff;color:#0b0b0b}

/* Desktop action rail: attached to its card, never separately centered or delayed. */
.portfolio-reel-actions{position:absolute;z-index:24;left:calc(100% + 12px);bottom:18px;width:44px;display:flex;flex-direction:column;align-items:center;gap:10px}
.portfolio-reel-actions button{appearance:none;-webkit-appearance:none;flex:0 0 42px}

/* Timeline: 4px visible track at the bottom, 20px invisible hit area. */
.portfolio-reel-progress{position:absolute;z-index:10;left:0;right:0;bottom:0;width:100%;height:20px;margin:0;padding:0;border:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;--progress:0%;touch-action:pan-x}
.portfolio-reel-card:not(.is-active) .portfolio-reel-progress{opacity:0;pointer-events:none}
.portfolio-reel-progress::-webkit-slider-runnable-track{height:4px;border:0;border-radius:0;background:linear-gradient(to right,rgba(255,255,255,.62) 0 var(--progress),rgba(255,255,255,.16) var(--progress) 100%);transform:translateY(8px)}
.portfolio-reel-progress::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:0;height:0;margin:0;border:0;background:transparent;box-shadow:none}
.portfolio-reel-progress::-moz-range-track{height:4px;border:0;border-radius:0;background:rgba(255,255,255,.16);transform:translateY(8px)}
.portfolio-reel-progress::-moz-range-progress{height:4px;border:0;border-radius:0;background:rgba(255,255,255,.62)}
.portfolio-reel-progress::-moz-range-thumb{width:0;height:0;border:0;background:transparent;box-shadow:none}

/* Desktop: timeline stays unobtrusive until hover, focus or active scrubbing. */
@media (hover:hover) and (min-width:801px){
 .portfolio-reel-progress{opacity:0;transition:opacity .16s ease}
 .portfolio-reel-card.is-active .portfolio-reel-media:hover .portfolio-reel-progress,
 .portfolio-reel-card.is-active .portfolio-reel-progress:hover,
 .portfolio-reel-card.is-active .portfolio-reel-progress:focus,
 .portfolio-reel-card.is-active .portfolio-reel-progress:active{opacity:1}
}

/* Tap feedback */
.portfolio-reel-tap-feedback{position:absolute;z-index:9;left:50%;top:50%;width:64px;height:64px;transform:translate(-50%,-50%) scale(.86);display:grid;place-items:center;border-radius:50%;background:rgba(8,8,8,.46);opacity:0;pointer-events:none;transition:opacity .14s ease,transform .18s ease}
.portfolio-reel-tap-feedback span{display:none}
.portfolio-reel-tap-feedback svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8}
.portfolio-reel-card.show-play-feedback .portfolio-reel-tap-feedback,.portfolio-reel-card.show-pause-feedback .portfolio-reel-tap-feedback{opacity:1;transform:translate(-50%,-50%) scale(1)}
.portfolio-reel-card.show-play-feedback .tap-play,.portfolio-reel-card.show-pause-feedback .tap-pause{display:grid}

/* Desktop feed navigation */
.portfolio-reels-nav{position:fixed;z-index:20;right:28px;top:50%;transform:translateY(-50%);display:grid;gap:10px}
.portfolio-reels-nav button{background:transparent;backdrop-filter:none}

/* Info drawer */
.portfolio-reel-info-drawer{position:absolute;z-index:30;left:0;right:0;bottom:0;max-height:58%;padding:58px 26px 28px;overflow:auto;background:linear-gradient(180deg,rgba(8,8,8,0),rgba(8,8,8,.96) 24%,rgba(8,8,8,.985));color:#fff;transform:translateY(102%);opacity:0;pointer-events:none;transition:transform .34s cubic-bezier(.22,.8,.25,1),opacity .2s ease}
.portfolio-reel-card.is-info-open .portfolio-reel-info-drawer{transform:translateY(0);opacity:1;pointer-events:auto}
.portfolio-reel-info-title{margin:0 44px 14px 0;font-family:Impact,"Arial Narrow",sans-serif;font-size:clamp(24px,2.2vw,34px);font-weight:400;line-height:1;text-transform:uppercase}
.portfolio-reel-info-copy{font-size:13px;line-height:1.65;color:rgba(255,255,255,.78)}
.portfolio-reel-info-close{position:absolute;right:18px;top:28px;width:38px;height:38px;padding:0;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(28,28,28,.88);color:#fff;cursor:pointer}
.portfolio-reel-info-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}
.portfolio-reel-info-meta{display:flex;flex-wrap:wrap;gap:10px 18px;padding-top:12px;border-top:1px solid rgba(255,255,255,.14);font-size:12px;color:rgba(255,255,255,.85)}

/* Desktop fullscreen: only the active reel fills the viewport. */
.portfolio-reels:fullscreen,.portfolio-reels:-webkit-full-screen{width:100vw;height:100dvh;background:#000}
.portfolio-reels:fullscreen .portfolio-reels-scroller,.portfolio-reels:-webkit-full-screen .portfolio-reels-scroller{height:100dvh;padding:0;overflow:hidden}
.portfolio-reels:fullscreen .portfolio-reel-card,.portfolio-reels:-webkit-full-screen .portfolio-reel-card{display:none}
.portfolio-reels:fullscreen .portfolio-reel-card.is-active,.portfolio-reels:-webkit-full-screen .portfolio-reel-card.is-active{display:block;position:absolute;inset:0;width:100vw;height:100dvh;margin:0;opacity:1}
.portfolio-reels:fullscreen .portfolio-reel-media,.portfolio-reels:-webkit-full-screen .portfolio-reel-media{position:absolute;inset:0;width:100vw;height:100dvh;border-radius:0;box-shadow:none}
.portfolio-reels:fullscreen .portfolio-reel-actions,.portfolio-reels:-webkit-full-screen .portfolio-reel-actions{left:auto;right:18px;bottom:72px}
.portfolio-reels:fullscreen .portfolio-reels-nav,.portfolio-reels:-webkit-full-screen .portfolio-reels-nav{right:18px}
.portfolio-reels:fullscreen .portfolio-reel-full .icon-expand,.portfolio-reels:-webkit-full-screen .portfolio-reel-full .icon-expand{display:none}
.portfolio-reels:fullscreen .portfolio-reel-full .icon-collapse,.portfolio-reels:-webkit-full-screen .portfolio-reel-full .icon-collapse{display:block}

/* Mobile: one viewport reel. Fixed UI belongs to the viewport, not the moving card. */
@media(max-width:800px){
 html,body{width:100%;height:100%;background:#000;overscroll-behavior:none}
 body.portfolio-videos-page{margin:0;overflow:hidden;background:#000}
 body.portfolio-videos-page .portfolio-reels{width:100vw;height:100dvh;background:#000}
 body.portfolio-videos-page .portfolio-reels:before{display:none}
 body.portfolio-videos-page .portfolio-reels-scroller{position:absolute;inset:0;width:100%;height:100dvh;padding:0;margin:0;overflow-x:hidden;overflow-y:auto;scroll-snap-type:y mandatory;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
 body.portfolio-videos-page .portfolio-reel-card{contain:none;position:relative;width:100vw;min-width:100vw;height:100dvh;min-height:100dvh;margin:0;padding:0;opacity:1;scroll-snap-align:start;scroll-snap-stop:always;background:#000}
 body.portfolio-videos-page .portfolio-reel-media{position:absolute;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;box-shadow:none;background:#000}
 body.portfolio-videos-page .portfolio-reel-video{width:100%;height:100%;object-fit:cover;object-position:center;border-radius:0}
 body.portfolio-videos-page .portfolio-reel-media:before{background:linear-gradient(180deg,rgba(0,0,0,.22),transparent 18%,transparent 58%,rgba(0,0,0,.12) 70%,rgba(0,0,0,.78))}
 body.portfolio-videos-page .portfolio-reels-nav{display:none}

 /* Back + fullscreen */
 body.portfolio-videos-page .portfolio-reel-player-controls{position:static;width:0;height:0;display:block;overflow:visible}
 body.portfolio-videos-page .portfolio-reel-play{display:none}
 body.portfolio-videos-page .portfolio-reel-full{position:fixed;z-index:85;right:12px;top:calc(env(safe-area-inset-top,0px) + 12px);margin:0}

 /* Right stack: only the active card contributes controls. */
 body.portfolio-videos-page .portfolio-reel-card:not(.is-active)>.portfolio-reel-actions{display:none}
 body.portfolio-videos-page .portfolio-reel-actions{position:fixed;z-index:44;left:auto;right:12px;top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 88px);width:44px;display:flex;flex-direction:column;gap:10px;align-items:center}
 body.portfolio-videos-page .portfolio-reel-sound{position:fixed;z-index:45;right:12px;top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 34px);margin:0}
 body.portfolio-videos-page .portfolio-reel-player-controls button,body.portfolio-videos-page .portfolio-reel-actions button{width:44px;height:44px;min-width:44px;flex:0 0 44px;border:1px solid rgba(255,255,255,.07);background:rgba(8,8,8,.46)}

 body.portfolio-videos-page .portfolio-reel-copy{z-index:35;left:16px;right:72px;bottom:calc(env(safe-area-inset-bottom,0px) + 28px)}
 body.portfolio-videos-page .portfolio-reel-copy h2{font-size:25px}
 body.portfolio-videos-page .portfolio-reel-copy p{font-size:11px}
 body.portfolio-videos-page .portfolio-reel-progress{z-index:50;bottom:0;height:20px}
 body.portfolio-videos-page .portfolio-reel-info-drawer{z-index:70;max-height:64dvh;padding:58px 18px calc(env(safe-area-inset-bottom,0px) + 24px);border-radius:22px 22px 0 0;background:linear-gradient(180deg,rgba(12,12,12,.9),rgba(5,5,5,.99) 22%)}

 /* Mobile fullscreen intentionally reuses the exact same fixed composition. */
 html:fullscreen body.portfolio-videos-page .portfolio-reel-full .icon-expand,html:-webkit-full-screen body.portfolio-videos-page .portfolio-reel-full .icon-expand{display:none}
 html:fullscreen body.portfolio-videos-page .portfolio-reel-full .icon-collapse,html:-webkit-full-screen body.portfolio-videos-page .portfolio-reel-full .icon-collapse{display:block}
}

@media(prefers-reduced-motion:reduce){.portfolio-reel-card,.portfolio-reel-info-drawer{transition:none}}

/* Fullscreen: activity-driven controls, like a cinematic video player. */
@media (hover:hover) and (min-width:801px){
 .portfolio-reels.is-feed-fullscreen .portfolio-reel-card.is-active .portfolio-reel-player-controls,
 .portfolio-reels.is-feed-fullscreen .portfolio-reel-card.is-active .portfolio-reel-progress,
 .portfolio-reels.is-feed-fullscreen .portfolio-reel-card.is-active .portfolio-reel-actions,
 .portfolio-reels.is-feed-fullscreen .portfolio-reels-nav{opacity:0;pointer-events:none;transition:opacity .16s ease}
 .portfolio-reels.is-feed-fullscreen.is-fullscreen-controls-visible .portfolio-reel-card.is-active .portfolio-reel-player-controls,
 .portfolio-reels.is-feed-fullscreen.is-fullscreen-controls-visible .portfolio-reel-card.is-active .portfolio-reel-progress,
 .portfolio-reels.is-feed-fullscreen.is-fullscreen-controls-visible .portfolio-reel-card.is-active .portfolio-reel-actions,
 .portfolio-reels.is-feed-fullscreen.is-fullscreen-controls-visible .portfolio-reels-nav{opacity:1;pointer-events:auto}
}

/* Mobile reels: toggle the existing global navigation, never duplicate it. */
.portfolio-reels-menu-toggle{display:none}
@media(max-width:800px){
 body.portfolio-videos-page .portfolio-global-rail{z-index:1300;bottom:10px;opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,8px) scale(.96);transition:opacity .18s ease,transform .18s ease,visibility .18s}
 body.portfolio-videos-page.portfolio-reels-nav-open .portfolio-global-rail{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0) scale(1)}
 body.portfolio-videos-page .portfolio-reels-menu-toggle{position:fixed;z-index:111;display:grid;place-items:center;right:12px;bottom:calc(env(safe-area-inset-bottom,0px) + 34px);width:44px;height:44px;border:1px solid rgba(255,255,255,.07);border-radius:50%;background:rgba(8,8,8,.46);color:#fff;cursor:pointer;padding:0}
 body.portfolio-videos-page .portfolio-reels-menu-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 body.portfolio-videos-page .portfolio-reels-menu-toggle .portfolio-reels-menu-close{display:none}
 body.portfolio-videos-page.portfolio-reels-nav-open .portfolio-reels-menu-toggle .portfolio-reels-menu-grid{display:none}
 body.portfolio-videos-page.portfolio-reels-nav-open .portfolio-reels-menu-toggle .portfolio-reels-menu-close{display:block}
 body.portfolio-videos-page .portfolio-reel-actions{bottom:calc(env(safe-area-inset-bottom,0px) + 142px)}
 body.portfolio-videos-page .portfolio-reel-sound{right:12px;bottom:calc(env(safe-area-inset-bottom,0px) + 88px)}
}
@media(max-width:800px) and (prefers-reduced-motion:reduce){body.portfolio-videos-page .portfolio-global-rail{transition:none}}
