/* The video stays mounted while the scene and portfolio transition together. */
video#sea{transform:scale(1);transform-origin:center;transition:transform 1.5s cubic-bezier(.22,.61,.36,1),filter 1.5s}
.ocean-angle{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;object-position:left center;opacity:0;transform:scale(1.08) translateX(4%);transition:opacity 1.5s ease,transform 1.5s cubic-bezier(.22,.61,.36,1);pointer-events:none}
.logo{color:inherit;text-decoration:none}
.back-home{display:none}
.hero{transition:opacity .4s,transform .6s,visibility .6s}
.showcase{position:fixed;inset:95px 0 55px;z-index:2;overflow-y:auto;overscroll-behavior:contain;padding:0 6vw 30px;opacity:0;visibility:hidden;transform:translateX(32px);transition:opacity .6s .35s,transform .8s .25s,visibility .8s;scrollbar-width:thin;scrollbar-color:#ffffff40 transparent}
.showcase{display:flex;flex-direction:column;padding-bottom:0;overflow:hidden}
.showcase-heading,.screen-filters,.gallery-footer{flex-shrink:0}
.screen-gallery{flex:1;min-height:0;width:min(930px,100%);align-items:stretch}
.screen-card{min-height:0;display:flex;flex-direction:column}
.screen-card button{flex:1;min-height:0;display:flex;justify-content:center}
.screen-card img{height:100%!important;max-width:100%;width:auto;max-height:100%;object-fit:contain}
.screen-card figcaption{flex-shrink:0}
.gallery-footer{width:min(930px,100%);margin-top:14px;padding-top:12px;padding-bottom:4px}
.screen-thumbnails img{height:54px}
.gallery-controls{bottom:4px}
body.works-open video#sea{transform:scale(1.12) translateX(-6%);filter:brightness(.8)}
body.works-open .ocean-angle{opacity:1;transform:scale(1) translateX(0)}
.shade{transition:background-color 1.2s}
body.works-open .shade{background-color:rgba(4,24,43,.30)}
body.works-open .hero{opacity:0;visibility:hidden;transform:translateX(-45px);pointer-events:none}
body.works-open .showcase{opacity:1;visibility:visible;transform:none}
body.works-open .back-home{display:inline-block;padding-left:24px;border-left:1px solid #ffffff40}
body.works-open #projects-nav{opacity:1;border-bottom:2px solid #a4e5d9;padding-bottom:9px}
.showcase-heading{text-align:center;text-shadow:0 2px 20px #061b2d60}
.showcase-heading h1{font-family:'Songti SC','STSong','Noto Serif SC',serif;font-size:clamp(32px,3.3vw,48px);font-weight:400;line-height:1.35;outline:none}
.showcase-heading p{margin-top:12px;font-size:14px;color:#e0e9ee}
.screen-filters{display:flex;justify-content:center;gap:24px;margin:26px 0 22px}
.screen-filters button{border:0;border-bottom:2px solid transparent;background:none;color:#dbe5ed;font-size:13px;padding:8px 14px}
.screen-filters button[aria-pressed=true]{color:#a6eadc;border-color:#a6eadc}
.screen-gallery{max-width:930px;margin:0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;align-items:start}
.screen-card{margin:0;min-width:0;text-align:center}
.screen-card button{border:0;background:none;display:block;width:100%;border-radius:7px}
.screen-card img{width:100%;height:clamp(310px,50vh,540px);object-fit:contain;display:block;filter:drop-shadow(0 12px 18px #04192b35);transition:transform .25s}
.screen-card button:hover img{transform:translateY(-4px)}
.screen-card figcaption{font-size:14px;margin-top:12px;text-shadow:0 1px 8px #00182c}
.gallery-footer{max-width:930px;margin:20px auto 0;border-top:1px solid #ffffff25;padding-top:16px;position:relative;display:flex;align-items:center;justify-content:space-between;gap:20px}
.screen-thumbnails{display:flex;gap:18px;flex-wrap:wrap;margin:0 auto}
.screen-thumbnails button{background:none;border:0;color:#e0e9ee;display:grid;justify-items:center;gap:7px;font-size:11px}
.screen-thumbnails img{width:38px;height:75px;object-fit:contain;transition:transform .2s}
.screen-thumbnails button:hover img{transform:translateY(-3px)}
.gallery-controls{position:absolute;right:0;bottom:0;display:flex;align-items:center;gap:14px;font-size:12px;color:#e1eaf0}
.zoom-hint{color:#cad8e3;font-size:11px;margin-right:12px}
.gallery-controls button{background:none;border:0;padding:8px;display:flex}
.gallery-controls img{width:16px;height:16px;filter:invert(1)}
#gallery-prev img{transform:rotate(180deg)}
.gallery-controls button:disabled{opacity:.3;cursor:default}
.screen-lightbox{position:fixed;inset:0;width:min(560px,94vw);height:92dvh;max-height:100%;margin:auto;border:1px solid #ffffff30;border-radius:12px;background:#0d263c;color:white;padding:0}
.screen-lightbox::backdrop{background:#031424c9;backdrop-filter:blur(8px)}
.screen-lightbox[open]{display:flex;flex-direction:column}
.lightbox-header{position:static;flex:none;padding:16px 20px;display:flex;justify-content:space-between;align-items:center}
.lightbox-header h2{font-size:16px;font-weight:500}
.lightbox-header button,.lightbox-footer button{background:none;border:0;color:#fff;padding:8px;font-size:13px}
.lightbox-scroll{overflow:auto;min-height:0;flex:1;text-align:center;padding:0 20px}
.lightbox-scroll img{display:block;width:100%;height:auto;margin:auto}
.lightbox-footer{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;font-size:12px;flex:none}
@media(min-width:1200px){.project-preview{width:650px}.project-item span{white-space:normal;line-height:1.5}}
@media(max-width:700px){.showcase{inset:90px 0 58px;padding:10px 6vw 24px}.showcase-heading h1{font-size:30px}.showcase-heading p{font-size:12px}.screen-filters{gap:10px;margin:18px 0}.screen-filters button{padding:8px 12px}.screen-gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:20px;padding:0 10px 15px}.screen-card{flex:0 0 86%;scroll-snap-align:center}.screen-card img{height:52vh;max-height:520px}.gallery-footer{flex-direction:column;gap:20px}.gallery-controls{width:100%;justify-content:center}.screen-thumbnails{justify-content:center}.back-home{margin-left:12px!important;padding-left:12px!important}body.works-open nav a:not(#projects-nav):not(.back-home){display:none}.project-item span{white-space:normal}.ocean-angle{object-position:62% center}.screen-lightbox{height:94dvh}}
@media(max-width:700px){.gallery-controls{position:static}.gallery-footer{padding-bottom:12px}}
@media(max-width:700px){.showcase{padding-bottom:8px}.showcase-heading h1{font-size:26px}.showcase-heading p{margin-top:8px}.screen-filters{margin:12px 0}.screen-gallery{padding-bottom:6px;align-items:stretch}.screen-card{height:100%;flex:0 0 86%}.screen-card button{width:100%}.screen-card img{width:100%;max-height:none}.screen-card figcaption{margin-top:8px}.gallery-footer{gap:10px;margin-top:8px;padding-top:8px;padding-bottom:0}.screen-thumbnails img{height:40px;width:24px}.screen-thumbnails button{gap:4px;font-size:10px}.gallery-controls{gap:10px}.gallery-controls button{padding:4px}}
@media(max-height:650px) and (min-width:701px){.showcase{top:78px;bottom:48px}.showcase-heading h1{font-size:30px}.showcase-heading p{margin-top:6px;font-size:12px}.screen-filters{margin:10px 0}.screen-thumbnails img{height:34px}.gallery-footer{margin-top:8px;padding-top:6px}.screen-card figcaption{margin-top:6px;font-size:12px}}
.screen-gallery{align-items:stretch;min-height:0}
.screen-card{display:flex;flex-direction:column;min-height:0}
.screen-card button{position:relative;display:block;flex:1;min-height:0}
.screen-card img{position:absolute;inset:0;width:100%;height:100%!important;object-fit:contain}
.gallery-footer{flex-shrink:0;padding-bottom:4px}
.screen-thumbnails img{height:54px}
@media(max-width:700px){.screen-thumbnails img{height:40px}.gallery-footer{padding-bottom:0}}
@media(max-height:650px) and (min-width:701px){.screen-thumbnails img{height:34px}}
@media(prefers-reduced-motion:reduce){video#sea,.ocean-angle,.showcase,.hero,.shade{transition:none!important}.ocean-angle{transform:none}body.works-open video#sea{transform:none}}
/* Direction-aware transitions: leaving the works page clears the gallery first, then the hero returns. */
.showcase{transition:opacity .3s ease,transform .4s ease,visibility 0s linear .4s}
body.works-open .showcase{transition:opacity .6s ease .35s,transform .8s cubic-bezier(.22,.61,.36,1) .25s,visibility 0s}
.hero{transition:opacity .7s ease .55s,transform .9s cubic-bezier(.22,.61,.36,1) .5s,visibility 0s linear .5s}
body.works-open .hero{transition:opacity .3s ease,transform .4s ease,visibility 0s linear .4s}
.ocean-angle{transition:opacity 1.3s ease .1s,transform 1.5s cubic-bezier(.22,.61,.36,1)}
@media(prefers-reduced-motion:reduce){.showcase,.hero,.ocean-angle{transition:none!important}}
/* Return: works scene dims and fades quickly, home video settles, then hero text appears. */
video#sea{transition:transform .9s cubic-bezier(.22,.61,.36,1),filter .9s}
body.works-open video#sea{transition:transform 1.5s cubic-bezier(.22,.61,.36,1),filter 1.5s}
.ocean-angle{transition:opacity .55s ease,transform .9s ease,filter .55s ease;filter:brightness(.55) blur(6px)}
body.works-open .ocean-angle{filter:none;transition:opacity 1.3s ease .1s,transform 1.5s cubic-bezier(.22,.61,.36,1),filter 1.3s ease}
.hero{transition:opacity .6s ease .8s,transform .8s cubic-bezier(.22,.61,.36,1) .75s,visibility 0s linear .75s}
@media(prefers-reduced-motion:reduce){video#sea,.ocean-angle,.hero{transition:none!important}}
