/* Horizontal page mode. Paired with hx.js, which adds html.hx only on wide mouse-driven screens.
   Without that class the wrappers below vanish from layout and the page is the normal vertical one. */
.hx-stage,.hx-track,.hx-panel,.hx-fit{display:contents}
.hx-hud,.hx-bg,.hx-spot,.hx-layer{display:none}

/* Site-wide dark theme with the dotted backdrop, on every page and every device.
   The dots and glows sit behind the content and move slower than the page as it scrolls. */
:root{--paper:#171717;--surface:#242424;--ink:#fafaf8;--muted:#bdbdbb;--line:#484848;--green:#242424;--accent:#e0392f;color-scheme:dark}
body{background:#171717;color:var(--ink)}
body::before{content:'';position:fixed;inset:-40px 0;z-index:-1;pointer-events:none;background-image:radial-gradient(rgba(250,250,248,.085) 1px,transparent 1.6px);background-size:34px 34px;transform:translate3d(0,var(--dy,0px),0)}
body::after{content:'';position:fixed;left:0;right:0;top:-30vh;height:320vh;z-index:-1;pointer-events:none;background:radial-gradient(95vw 50vh at 18% 16%,rgba(206,41,41,.17),transparent 70%),radial-gradient(95vw 46vh at 88% 45%,rgba(206,41,41,.12),transparent 70%),radial-gradient(95vw 50vh at 12% 76%,rgba(120,60,200,.09),transparent 70%);transform:translate3d(0,var(--gy,0px),0)}
.opening-band,.about-band,.contact-section,.work-section{background:transparent}
.inquiry-form .button{background:var(--signal);border-color:var(--signal);color:#fff}
html:not(.hx) .portrait-figure{translate:0 calc(var(--sy,0)*.1px)}
html:not(.hx) #opening-title{translate:0 calc(var(--sy,0)*-.05px)}
html.hx body::before,html.hx body::after{display:none}

html.hx{scroll-behavior:auto}
html.hx body{background:var(--night)}
html.hx .site-header,html.hx .has-scrolled .site-header{height:64px;transform:none}
html.hx .hx-stage{display:block;position:sticky;top:var(--hx-top,64px);height:calc(100vh - var(--hx-top,64px));overflow:clip;background:var(--night)}
html.hx .hx-track{display:flex;position:relative;z-index:1;width:max-content;height:100%;will-change:transform}

/* One continuous dark space: every panel shares it, so there is no edge between sections. */
html.hx .hx-panel{--paper:#171717;--surface:#242424;--ink:#fafaf8;--muted:#bdbdbb;--line:#484848;--green:#242424;--accent:#e0392f;display:grid;align-items:center;flex:none;position:relative;height:100%;padding:20px clamp(40px,5vw,96px) 88px;overflow:clip;background:none;color:var(--ink)}
html.hx .hx-fit{display:block;position:relative;z-index:1}
html.hx .hx-fit>*{margin:0;max-width:none;border-block:0}
html.hx.hx-dragging,html.hx.hx-dragging *{user-select:none}
html.hx.hx-dragging .hx-track a{pointer-events:none}
html.hx .hx-track img{-webkit-user-drag:none}

/* Backdrop: drifting dot grid and red glows that move slower than the content, plus a light under the cursor. */
html.hx .hx-bg{display:block;position:absolute;inset:0;z-index:0;overflow:clip;pointer-events:none;background-image:radial-gradient(rgba(250,250,248,.085) 1px,transparent 1.6px);background-size:34px 34px;background-position:calc(var(--bx,0)*-.35px) 0}
html.hx .hx-bg::before{content:'';position:absolute;top:-20%;bottom:-20%;left:0;width:700vw;translate:calc(var(--bx,0)*-.22px) 0;background:radial-gradient(34vw 62vh at 11% 62%,rgba(206,41,41,.2),transparent 70%),radial-gradient(30vw 54vh at 27% 28%,rgba(206,41,41,.13),transparent 70%),radial-gradient(36vw 60vh at 44% 70%,rgba(120,60,200,.1),transparent 70%),radial-gradient(30vw 56vh at 60% 30%,rgba(206,41,41,.16),transparent 70%),radial-gradient(34vw 60vh at 78% 66%,rgba(206,41,41,.12),transparent 70%)}
html.hx .hx-bg::after{content:'';position:absolute;inset:0;background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(224,57,47,.11),transparent 70%)}

/* Pieces fade, shrink and sink a little near the screen edges, so sections dissolve into each other. */
html.hx .reveal{opacity:1;transform:none;transition:none}
html.hx .hx-item{opacity:var(--o,1);scale:var(--s,1);translate:var(--tx,0px) var(--ty,0px)}

/* Depth layers */
html.hx .hx-layer{display:block;position:absolute;top:0;bottom:0;left:0;pointer-events:none;will-change:transform}
html.hx .hx-layer-fore{z-index:2}
.hx-shape{position:absolute;width:calc(var(--z,1)*var(--u,24px));aspect-ratio:1;rotate:var(--r,0deg);animation:hx-float 9s ease-in-out infinite alternate;animation-delay:calc(var(--z,1)*-4s)}
.hx-ring{border:1px solid currentColor;border-radius:50%}
.hx-diamond{border:1px solid currentColor}
.hx-dot{width:calc(var(--z,1)*5px);border-radius:50%;background:currentColor}
.hx-plus{background:linear-gradient(currentColor,currentColor) center/100% 1px no-repeat,linear-gradient(currentColor,currentColor) center/1px 100% no-repeat}
.hx-bar{width:calc(var(--z,1)*64px);height:1px;aspect-ratio:auto;background:currentColor}
.hx-layer-far{color:rgba(250,250,248,.2);--u:14px}
.hx-layer-mid{color:rgba(224,57,47,.55);--u:26px}
.hx-layer-fore{color:rgba(224,57,47,.2);--u:150px;filter:blur(2.5px)}
.hx-layer-fore .hx-ring{border-width:2px}
@keyframes hx-float{from{translate:0 -10px}to{translate:0 10px}}

/* Oversized outline word drifting behind each panel */
html.hx .hx-panel:not([data-hx=intro])::after{content:attr(data-label);position:absolute;left:3vw;bottom:70px;z-index:0;font:800 30vh/0.8 var(--sans);letter-spacing:-.05em;text-transform:uppercase;white-space:nowrap;color:transparent;-webkit-text-stroke:1px rgba(250,250,248,.07);translate:var(--par,0px) 0;pointer-events:none}

/* 01 Intro: the name slides away and the portrait drifts as the next section arrives */
html.hx [data-hx=intro]{display:block;width:100vw;padding:0}
html.hx [data-hx=intro] .hx-fit{height:100%;transform:none}
html.hx .opening-band{height:100%;background:none;border:0}
html.hx .hero-spot{display:none}
html.hx .hero-field{-webkit-mask-image:linear-gradient(90deg,#000 78%,transparent);mask-image:linear-gradient(90deg,#000 78%,transparent)}
html.hx .studio-opening{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;height:100%;width:auto;max-width:none;margin:0;padding:20px clamp(40px,5vw,96px) 88px;opacity:calc(1 - var(--hp,0)*1.15)}
html.hx .studio-opening h1{grid-row:auto;margin:8px 0 0;font-size:min(9.1vw,15vh);white-space:nowrap;translate:calc(var(--hp,0)*-22vw) 0}
html.hx .portrait-layout{min-height:0;height:100%;align-items:center;grid-template-rows:minmax(0,1fr)}
html.hx .portrait-layout>*{min-height:0}
html.hx .portrait-figure{height:100%;max-height:min(100%,540px);min-height:0;width:auto;aspect-ratio:452/533;justify-self:center;translate:calc(var(--hp,0)*16vw) 0;scale:calc(1 + var(--hp,0)*.14)}
html.hx .hero-portrait{height:100%;width:auto;max-width:none;object-fit:contain;margin-inline:auto}
html.hx .portrait-credentials-link{display:none}
html.hx .hero-bottom{margin:0;padding:10px 170px 0 0;align-items:center}
html.hx .hero-studio img{height:36px;width:auto}
html.hx .motion-ribbon{display:contents}
html.hx .ribbon-window{display:none}
html.hx .motion-toggle{position:absolute;right:clamp(40px,5vw,96px);bottom:94px}

/* 02 Credentials */
html.hx #certifications{width:min(1180px,84vw);padding:0}

/* 03 Work: one screen. Heading and filters on top, a large preview in the middle, every project as a thumbnail below. */
html.hx [data-hx=work]{width:100vw}
html.hx #work{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"head filters" "spot spot" "rail rail" "more more";align-items:center;gap:14px 24px;width:auto;padding:0}
html.hx #work .section-heading{grid-area:head;display:flex;align-items:baseline;gap:16px;margin:0}
html.hx #work .section-heading>div{display:flex;align-items:baseline;gap:16px}
html.hx #work .section-heading h2{font-size:30px;line-height:1.1;white-space:nowrap}
html.hx #work .section-heading p{display:none}
html.hx #work .filter-bar{grid-area:filters;display:flex;align-items:center;gap:16px;margin:0;border:0}
html.hx #work .filters{display:flex;gap:6px}
html.hx #work .filters button{padding:8px 12px;font-size:12px}
html.hx #work .project-count{display:none}
html.hx .rail-controls,html.hx .project-index{display:none}

html.hx .hx-spot{grid-area:spot;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:36px;padding:14px;border:1px solid var(--night-line);border-top:3px solid var(--signal);border-radius:var(--tile-radius);background:color-mix(in srgb,var(--night-raised) 72%,transparent);backdrop-filter:blur(6px)}
.hx-spot figure{position:relative;height:clamp(170px,30vh,300px);aspect-ratio:16/10;margin:0;overflow:hidden;background:#101010;border:1px solid var(--night-line);border-radius:4px;transform:perspective(900px) rotateY(calc(var(--fx,0)*4deg)) rotateX(calc(var(--fy,0)*-4deg));transition:transform .5s var(--ease)}
.hx-spot img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;scale:1.05;translate:calc(var(--fx,0)*-8px) calc(var(--fy,0)*-8px);transition:opacity .45s ease,translate .5s var(--ease)}
.hx-spot img.is-on{opacity:1;z-index:1}
.hx-spot-info{min-width:0;padding-right:10px}
.hx-spot-meta{display:flex;gap:14px;margin:0;font:10px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--night-muted)}
.hx-spot-meta b{flex:none;font-weight:400;white-space:nowrap;color:var(--signal)}
.hx-spot h3{margin:8px 0 0;font-size:clamp(24px,2.4vw,34px);font-weight:800;line-height:1.08;letter-spacing:-.04em}
.hx-spot-desc{margin:10px 0 0;max-width:520px;font-size:13px;line-height:1.6;color:var(--night-muted)}
.hx-spot-role{margin:10px 0 0;font-size:12px}
.hx-spot-stack{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0;padding:0;list-style:none}
.hx-spot-stack li{padding:3px 8px;border:1px solid var(--night-line);border-radius:99px;font:10px var(--mono);color:var(--night-muted)}
.hx-spot-open{display:inline-block;margin-top:14px;padding-bottom:4px;border-bottom:1px solid var(--signal);font-size:13px;font-weight:700}
.hx-spot-open:hover{color:var(--signal)}
.hx-spot-info.is-swap>*{animation:hx-swap-text .45s var(--ease) both}
.hx-spot-info.is-swap>:nth-child(2){animation-delay:.04s}
.hx-spot-info.is-swap>:nth-child(3){animation-delay:.08s}
.hx-spot-info.is-swap>:nth-child(n+4){animation-delay:.12s}
@keyframes hx-swap-text{from{opacity:0;translate:14px 0}}

html.hx #work .rail{grid-area:rail;display:grid;grid-auto-flow:row;grid-template-columns:repeat(10,minmax(0,1fr));gap:8px;overflow:visible;margin:0;padding:0;scroll-snap-type:none}
html.hx #work .rail .featured-case:nth-child(n){display:block;position:relative;flex:none;aspect-ratio:16/11;overflow:hidden;border:1px solid var(--night-line);border-radius:4px;background:#101010;animation:none;transition:border-color .25s,box-shadow .25s,filter .4s,transform .45s var(--ease)}
html.hx #work .rail .featured-case:nth-child(n)::before{position:absolute;top:4px;left:6px;z-index:3;padding:0;font:9px var(--mono);color:#fff;text-shadow:0 1px 4px #000}
html.hx #work .rail .featured-case:nth-child(n) .featured-image{position:absolute;inset:0;height:100%;aspect-ratio:auto;margin:0;padding:0;border:0;background:none;transform:none}
html.hx #work .rail .featured-image img{width:100%;height:100%;object-fit:cover;transform:none}
html.hx #work .rail .featured-image.portrait img{object-fit:contain}
html.hx #work .rail .glare{display:none}
html.hx #work .rail :is(.project-preview,.project-open,.featured-copy){display:none}
html.hx #work .rail .featured-case:hover{transform:scale(1.06);z-index:4;box-shadow:0 14px 30px -12px #000}
html.hx #work .rail .featured-case.is-active{border-color:var(--signal);box-shadow:0 0 0 1px var(--signal),0 14px 30px -14px rgba(224,57,47,.8)}
html.hx #work .rail:has(.featured-case:hover) .featured-case:not(:hover):not(.is-active){filter:brightness(.5) saturate(.6)}

html.hx #work .work-more{grid-area:more;display:flex;align-items:center;justify-content:flex-start;gap:24px;margin:0;padding:0;border:0}
html.hx #work .work-more h3{font:10px var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--night-muted)}
html.hx #work .work-more p{display:none}
html.hx .download-links{display:flex;gap:22px;margin:0;font-size:12px}
html.hx .download-links a{padding:0;border:0}

/* 04 Process */
html.hx [data-hx=process] .hx-fit{display:flex;align-items:center;gap:72px}
html.hx .concept-strip{display:block;width:380px;padding:32px}
html.hx .concept-strip .text-link{display:inline-flex;margin-top:20px}
html.hx .process-section{width:min(840px,62vw);padding:0}

/* 06 Contact and footer */
html.hx :is([data-hx=contact],[data-hx=demos-contact]) .hx-fit{display:flex;align-items:center;gap:80px}
html.hx #contact{width:min(1180px,86vw);padding:0;background:none;color:var(--ink)}
html.hx #contact .contact-grid{width:auto;max-width:none;margin:0;padding:0}
html.hx .site-footer{display:flex;flex-direction:column;align-items:flex-start;gap:26px;width:320px;padding:0;color:var(--ink)}
html.hx .footer-bottom{display:grid;gap:6px;width:auto;padding:0;border:0}
html.hx .social-dock{display:none}

/* Prototypes page */
html.hx .prototype-intro{display:block;width:min(560px,58vw);padding:0}
html.hx .prototype-intro h1{font-size:clamp(44px,5.4vw,78px);line-height:.98;margin:12px 0 22px}
html.hx .prototype-list{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,auto);grid-auto-columns:300px;gap:18px;width:max-content;padding:0}
html.hx .prototype-card{display:block;overflow:hidden;margin:0;padding:0;border:1px solid var(--night-line);border-radius:var(--tile-radius);background:var(--night-raised);transition:filter .4s,border-color .25s}
html.hx .prototype-visual{display:block;aspect-ratio:16/10;height:auto;min-height:0;margin:0;padding:0;border:0;overflow:hidden}
html.hx .prototype-visual img{width:100%;height:100%;object-fit:cover}
html.hx .prototype-copy{padding:12px 14px 14px}
html.hx .prototype-copy h2{margin:6px 0 2px;font-size:17px;line-height:1.2}
html.hx .prototype-copy>p:not(.prototype-type),html.hx .prototype-copy>.text-link{display:none}
html.hx .prototype-type{margin:0;font-size:12px;color:var(--night-muted)}
html.hx .prototype-list:hover .prototype-card:not(:hover){filter:brightness(.55) saturate(.6)}
html.hx .prototype-card:hover{border-color:var(--signal)}
html.hx .prototype-contact{width:420px;padding:0}

/* Chapter bar */
html.hx .hx-hud{display:flex;align-items:center;gap:6px;position:fixed;left:24px;right:184px;bottom:24px;z-index:40;height:48px;padding:0 16px 0 6px;overflow:hidden;background:color-mix(in srgb,var(--night) 86%,transparent);backdrop-filter:blur(12px);border:1px solid var(--night-line);border-radius:6px;color:var(--on-night)}
.hx-hud ol{display:flex;gap:2px;margin:0;padding:0;list-style:none}
.hx-hud button{display:flex;align-items:center;gap:8px;height:36px;padding:0 12px;border:0;border-radius:4px;background:none;color:var(--night-muted);font:600 12px var(--sans);transition:background .25s,color .25s}
.hx-hud button b{font:400 10px var(--mono);letter-spacing:.06em;transition:color .25s}
.hx-hud button:hover{color:var(--on-night)}
.hx-hud button.is-active{background:var(--night-raised);color:var(--on-night)}
.hx-hud button.is-active b{color:var(--signal)}
.hx-hud :focus-visible{outline-color:var(--signal);outline-offset:-2px}
.hx-hud-hint{margin-left:auto;font:10px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--night-muted);white-space:nowrap;transition:opacity .4s}
.hx-hud.is-used .hx-hud-hint{opacity:0}
.hx-hud-line{position:absolute;inset:auto 0 0;height:2px}
.hx-hud-line span{display:block;height:100%;background:var(--signal);transform-origin:left;transform:scaleX(var(--p,0))}
@media (max-width:1180px){.hx-hud button span{display:none}.hx-hud button.is-active span{display:inline}}

/* Housekeeping */
.motion-paused .hx-spot-info.is-swap>*{animation:none!important}
html.hx .inquiry-form .button{background:var(--signal);border-color:var(--signal);color:#fff}
html.hx .inquiry-form .button:hover{background:#fff;border-color:#fff;color:#171717}
html.hx .prototype-intro .section-number{display:block;position:static;margin:0 0 14px}
html.hx .prototype-intro h1{margin-top:0}

/* Front page carries the About content: compact columns that fit beside the portrait */
html.hx .portrait-intro,html.hx .portrait-note{padding:0}
html.hx .portrait-intro h2{margin:10px 0}
html.hx .portrait-intro p{line-height:1.55}
html.hx .hero-edu{margin-top:8px}
html.hx .hero-also{display:none}
html.hx .hero-tools{margin:14px 0 4px}
html.hx .portrait-intro .opening-contact{margin-top:8px}
html.hx .portrait-specialty{font-size:clamp(22px,2.2vw,30px)}
html.hx .portrait-specialty>span{font-size:.9em;margin-left:10px}
html.hx .hero-exp-title{margin-top:14px}
html.hx .hero-exp{margin:6px 0 14px}
html.hx .hero-exp li{padding:5px 0}
@media (max-height:740px){html.hx .hero-edu,html.hx .hero-exp-title{display:none}html.hx .portrait-specialty{font-size:20px}html.hx .hero-exp li{padding:3px 0}html.hx .portrait-note .button{padding-block:10px}}

/* Hero glow may spill into the next section instead of being cut at the panel edge */
html.hx [data-hx=intro],html.hx .opening-band{overflow:visible}
/* Documents row under the project strip */
html.hx #work .work-more>div{display:flex;align-items:center;gap:22px;width:auto}
html.hx #work .download-links{display:flex;flex-direction:row;flex-wrap:nowrap;gap:22px;width:auto;margin:0;font-size:12px}
html.hx #work .download-links a{display:inline-flex;gap:6px;width:auto;min-width:0;padding:0;border:0}

/* Usability pass */
/* The chapter bar already covers Work and About on the horizontal homepage, so the header keeps only what the bar lacks. */
html.hx:has([data-hx=intro]) #main-navigation a:is([href="/#work"],[href="/#about"]){display:none}
/* Calmer motion: no large blurred foreground shapes */
html.hx .hx-layer-fore{display:none}
/* First screen: one call to action, quieter supporting detail */
html.hx .portrait-intro .opening-contact{display:none}
html.hx .hero-tools li{color:var(--night-muted);background:none}
html.hx .hero-tools li:hover{color:var(--on-night)}
html.hx .hero-exp li{grid-template-columns:minmax(0,1fr);gap:0}
/* Scroll cue in the right margin of the first screen */
html.hx [data-hx=intro]::after{content:'Scroll →';position:absolute;right:18px;top:46%;z-index:3;writing-mode:vertical-rl;font:10px var(--mono);letter-spacing:.22em;text-transform:uppercase;color:var(--on-night);opacity:calc(.8 - var(--hp,0)*4);animation:hx-cue 1.8s ease-in-out infinite;pointer-events:none}
@keyframes hx-cue{50%{translate:0 10px}}
.motion-paused [data-hx=intro]::after{animation:none}
/* Project strip: every thumbnail carries its name */
html.hx #work .rail .featured-copy{display:block;position:absolute;inset:auto 0 0;z-index:3;margin:0;padding:16px 6px 4px;border:0;background:linear-gradient(transparent,rgba(0,0,0,.88));pointer-events:none}
html.hx #work .rail .featured-copy>:not(h3),html.hx #work .rail .featured-copy h3 span{display:none}
html.hx #work .rail .featured-copy h3{margin:0;overflow:hidden;font:600 10px/1.3 var(--sans);letter-spacing:0;white-space:nowrap;text-overflow:ellipsis;color:#fff}
html.hx #work .rail .featured-copy h3 a{color:inherit;text-decoration:none}
/* Small red labels: lighter red keeps them readable on the dark background */
.hx-spot-meta b,.hx-hud button.is-active b{color:color-mix(in srgb,var(--signal) 62%,#fff)}

/* Each of these sections fills the screen, so the next one never peeks in from the right */
html.hx :is([data-hx=credentials],[data-hx=process],[data-hx=contact]){min-width:100vw;justify-items:center}
/* Credentials: large badges on top of each card instead of small ones beside the text */
html.hx #certifications{width:min(1320px,88vw);gap:34px}
html.hx .certification-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
html.hx .certification-list li{display:flex;flex-direction:column;align-items:center;gap:18px;padding:30px 22px 26px;text-align:center}
html.hx .credential-art{flex-wrap:nowrap;gap:10px;width:100%;height:clamp(130px,22vh,200px);min-height:0}
html.hx .credential-art img{width:auto;height:100%;max-width:100%}
html.hx .credential-art img:not(:only-of-type){width:calc((100% - 20px)/3);max-width:150px;height:auto;max-height:78%}
html.hx .credential-art img:only-of-type{width:auto;height:100%;max-width:100%;max-height:none}
html.hx .certification-list h3{font-size:19px;margin-bottom:8px}
html.hx .certification-list p{font-size:12px}
