/* Full-screen phone navigation, shared across every page. */
.hx-mobile-nav{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:16px 5vw max(24px,env(safe-area-inset-bottom));border:0;border-radius:0!important;background:#f5f5f5;color:#111;box-sizing:border-box;overflow:auto;overscroll-behavior:contain}
.hx-mobile-nav::backdrop{background:#f5f5f5}
html.hx-menu-modal,html.hx-menu-modal body{overflow:hidden}
.hx-mobile-top{display:flex;justify-content:space-between;align-items:center;gap:16px}
.hx-mobile-nav .site-name,.hx-mobile-nav .site-name *{color:#111!important;font-family:'Funnel Display',sans-serif!important;text-decoration:none}
.hx-mobile-nav .site-first{display:block;font-size:23px;font-weight:700;line-height:1.1}
.hx-mobile-nav .site-role{display:block;font-size:9px;letter-spacing:2px;margin-top:4px}
.hx-mobile-nav .hx-mobile-close{width:48px;height:48px;flex:none;padding:0;border:1px solid #111;border-radius:var(--hx-r,6px)!important;color:#111;background:transparent;font:32px/1 'Inter Tight',sans-serif;cursor:pointer}
.hx-mobile-nav>nav{display:flex;flex-direction:column;justify-content:center;gap:14px;min-height:calc(100dvh - 150px);padding:32px 0;box-sizing:border-box}
.hx-mobile-nav>nav a{display:block;width:fit-content;color:#111!important;text-decoration:none;font:600 clamp(44px,12vw,72px)/1.1 'Funnel Display',sans-serif;letter-spacing:-.04em}
.hx-mobile-nav[open]>nav a{animation:hx-menu-enter .5s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--menu-delay)}
.hx-mobile-nav>nav a[aria-current=page]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:10px}
@keyframes hx-menu-enter{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@media(max-width:700px){html:root body header nav{display:none!important}html:root body header .hx-dots{display:block!important;flex:none;width:48px;height:48px;margin-left:auto;border:1px solid currentColor;border-radius:var(--hx-r,6px)!important;color:inherit;background:transparent;font:600 20px/1 'Inter Tight',sans-serif;letter-spacing:1px}}
@media(min-width:701px){html:root body header .hx-dots{display:none!important}}
@media(prefers-reduced-motion:reduce){.hx-mobile-nav[open]>nav a{animation:none}}
/* Portfolio stills share the existing click-to-enlarge viewer. */
.hx-image-open{position:relative;display:block;width:100%;padding:0;margin:0;border:0;background:transparent;border-radius:var(--hx-r,6px)!important;overflow:hidden;cursor:zoom-in;text-align:inherit;color:inherit}
.hx-image-open>img{display:block;width:100%;height:auto;border-radius:inherit}
.hx-image-plus{position:absolute;right:14px;bottom:14px;display:grid;place-items:center;width:44px;height:44px;background:#111c;color:#fff;border:1px solid #fff6;border-radius:var(--hx-r,6px);font:30px/1 'Inter Tight',sans-serif;opacity:0;transform:translateY(5px);transition:opacity .2s,transform .25s;pointer-events:none}
.hx-image-open:hover .hx-image-plus,.hx-image-open:focus-visible .hx-image-plus{opacity:1;transform:none}
@media(hover:none){.hx-image-plus{opacity:1;transform:none}}
.hx-image-open:focus-visible{outline:2px solid currentColor;outline-offset:4px}
html:root body .xf-zoom :is(.cf-x,.xf-nav){border-radius:var(--hx-r,6px)!important}

.hx-mobile-nav .site-name{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:0!important;min-width:0}.hx-mobile-nav .site-role{display:block!important;white-space:nowrap;font-size:9px!important;letter-spacing:2px!important}

/* One control gutter and stacking layer, independent of image proportions. */
html:root body .xf-zoom{--xf-edge:clamp(16px,5vw,60px)}
html:root body .xf-zoom :is(.cf-x,.xf-nav){position:absolute!important;z-index:3;width:46px!important;height:46px!important;display:grid;place-items:center;padding:0!important;line-height:1;box-sizing:border-box;transform:none!important}
html:root body .xf-zoom .cf-x{top:24px!important;right:var(--xf-edge)!important;left:auto!important;margin:0!important}
html:root body .xf-zoom .xf-nav{top:50%!important;margin-top:-23px!important}
html:root body .xf-zoom .xf-prev{left:var(--xf-edge)!important;right:auto!important}
html:root body .xf-zoom .xf-next{right:var(--xf-edge)!important;left:auto!important}
html:root body .xf-zoom>img{position:relative;z-index:1}

/* Media is contained inside the side controls; no artificial white image matte. */
html:root body .xf-zoom>.xf-media{position:relative;z-index:1;display:block;max-width:calc(100vw - 2 * (var(--xf-edge) + 62px));max-height:calc(100dvh - 120px);width:auto;height:auto;object-fit:contain;box-sizing:border-box;border:0!important;padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;border-radius:var(--hx-r,6px)!important;transition:opacity .25s ease}
html:root body .xf-zoom>video.xf-media{width:calc(100vw - 2 * (var(--xf-edge) + 62px))}
.hx-image-plus{display:none!important}
.hx-video-open{position:absolute;inset:0;z-index:2;display:block;border:0;padding:0;background:transparent;color:inherit;cursor:zoom-in;border-radius:var(--hx-r,6px)!important}
.hx-video-open.hx-video-has-controls{bottom:64px}
.hx-video-open:focus-visible{outline:2px solid currentColor;outline-offset:-4px}
.hx-cursor .hx-plus-icon{display:none!important}
.hx-cursor.hx-enlarge{width:52px;height:52px;background:#111;color:#fff}
.hx-cursor.hx-enlarge>svg{display:none!important}
.hx-cursor.hx-enlarge>.hx-plus-icon{display:block!important;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;transform:none;opacity:1}
@media(max-width:700px){
html:root body .xf-zoom>.xf-media{max-width:90vw;max-height:calc(100dvh - 180px)}
html:root body .xf-zoom>video.xf-media{width:90vw}
html:root body .xf-zoom .xf-nav{top:auto!important;bottom:max(20px,env(safe-area-inset-bottom));margin:0!important}
}

html:root body .xf-zoom>.xf-media{transform-origin:0 0;will-change:transform,clip-path}.xf-zoom{overflow:hidden}

/* Controls wait until the picture has settled, then appear in its clear margins. */
html:root body .xf-zoom.xf-opening :is(.cf-x,.xf-nav){opacity:0!important;pointer-events:none;transition:none!important}
html:root body .xf-zoom:not(.xf-opening) :is(.cf-x,.xf-nav){transition:opacity .3s ease!important}

/* Playback belongs below the media, never inside the video picture. */
.xf-playback{position:absolute;z-index:3;bottom:24px;left:50%;transform:translateX(-50%);display:flex;gap:12px;align-items:center;transition:opacity .3s ease}
.xf-playback[hidden]{display:none!important}
.xf-playback button{height:40px;min-width:40px;padding:0 12px;color:#fff;background:transparent;border:1px solid #fff5;border-radius:var(--hx-r,6px)!important;font:14px 'Inter Tight',sans-serif;cursor:pointer}
.xf-zoom.xf-opening .xf-playback,.xf-zoom:not(.in) .xf-playback{opacity:0;pointer-events:none}
@media(max-width:700px){.xf-playback{bottom:max(20px,env(safe-area-inset-bottom))}.xf-playback button{height:46px}}

/* No remembered dark mode or automatic white ring on return from enlargement. */
.theme-toggle{display:none!important}
html{color-scheme:light}
.hx-zoom-returned:focus{outline:none!important;box-shadow:none!important}

/* Home bio portrait -> About portrait. Only the incoming picture is drawn, cropped like both pages crop it,
   so it starts exactly on the Home picture and opens out: no double face, nothing spilling past the frame. */
html.hx-about-depart .hx-ab-pic img{transition:none!important}
/* About starts in its light colours: no one-second fade up from dark while the page is loading */
html:not(.hx-ready) body.about-page,html:not(.hx-ready) body.about-page *,html.hx-about-arrive body.about-page,html.hx-about-arrive body.about-page *{transition:none!important}
/* this class stays on for the visit, so the heading's entrance cannot replay after the move ends */
html.hx-about-landed body,html.hx-about-landed header,html.hx-about-landed .abx-photo-wrap,html.hx-about-landed .about-intro,html.hx-about-landed .about-intro *{animation:none!important}
html.hx-about-landed:root body :is(#hx#hx,.archive-heading>*,.archive-heading>div>*){animation:none!important}
/* the About page is already in place when it fades up: nothing assembles a second time */
html.hx-about-arrive .about-reveal{opacity:1!important;transform:none!important;transition:none!important}
html.hx-about-arrive .abx-photo{box-shadow:none!important;border-color:transparent!important}
.about-page .abx-photo{transition:box-shadow .5s ease,border-color .5s ease}
html.hx-about-arrive .abx-photo img{object-position:50% 30%!important;transition:none!important;animation:hxPicSettle .7s cubic-bezier(.45,0,.15,1) both}
/* shading and name label belong to About only, so they fade in as the picture opens */
html.hx-about-arrive .abx-photo::after,html.hx-about-arrive .abx-tag{animation:hxPicDetail .45s .3s ease both}
@keyframes hxPicSettle{from{transform:scale(var(--hx-from-scale,1))}to{transform:none}}
@keyframes hxPicDetail{from{opacity:0}to{opacity:1}}
html::view-transition-group(about-portrait){animation-duration:.7s;animation-timing-function:cubic-bezier(.45,0,.15,1);z-index:2}
html::view-transition-image-pair(about-portrait){isolation:auto;overflow:hidden;border-radius:6px}
html::view-transition-old(about-portrait),html::view-transition-new(about-portrait){height:100%;width:100%;object-fit:cover;object-position:50% 30%;mix-blend-mode:normal;animation:none}
html::view-transition-old(about-portrait){opacity:0}
html::view-transition-new(about-portrait){opacity:1}
/* the rest of the page: About fades in over Home, which stays solid underneath (no grey dip, no sliding) */
html.hx-about-arrive::view-transition-old(root){animation:none;opacity:1;mix-blend-mode:normal}
html.hx-about-arrive::view-transition-new(root){animation:hxPicDetail .4s ease both;mix-blend-mode:normal}
html.hx-about-arrive::view-transition-group(root){animation-duration:.4s}
@media(prefers-reduced-motion:reduce){html::view-transition-group(about-portrait),html.hx-about-arrive::view-transition-new(root),html.hx-about-arrive .abx-photo img,html.hx-about-arrive .abx-photo::after,html.hx-about-arrive .abx-tag{animation:none!important}}
.about-page[data-side="0"] .abx-photo img{object-position:50% 30%!important}
.about-page .abx-photo.hx-portrait-settled img{transform:none!important}

/* Set shared-picture state before About's first paint, not only at pagereveal. */
html.hx-about-arrive .abx-photo{view-transition-name:about-portrait}
