/* Body: Inter (self-hosted, OFL). Titles: Courier Prime (self-hosted, OFL — see fonts/OFL-Courier-Prime.txt). */
@font-face{font-family:"Inter";src:url(fonts/inter-var.woff2) format("woff2");font-weight:300 600;font-display:swap}
@font-face{font-family:"Courier Prime";src:url(fonts/courier-prime-regular.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Courier Prime";src:url(fonts/courier-prime-bold.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}
:root{
  /* colour */
  --bg:#000; --fg:#fff; --muted:#9b9b9b; --faint:#767676; --line:#2e2e2e; --line-strong:#5a5a5a;
  /* typography */
  --font-body:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-title:"Courier Prime",ui-monospace,"Courier New",Courier,monospace;
  /* spacing scale: --space is THE gap between projects / stills / about+contact / footer, and the bottom padding.
     --nav-space is the gap above the navbar and between the navbar and the first section.
     Desktop (768+) is scaled to 88% of these base values (about 12% smaller). Phone keeps these sizes. */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px;
  --space:clamp(28px,4vw,48px);
  --nav-row:36px;
  /* Previous band was 3/4 of the original even-space band (using the 44px row), then 85% of that,
     then another 10% slimmer. 0.85 * 0.9 = 0.765. */
  --prev-band:calc(0.75 * (2 * var(--space) + 44px));
  --nav-space:calc((0.765 * var(--prev-band) - var(--nav-row)) / 2);
  /* layout: one shared content width. 70% on tablet/desktop (max 1130px, ~12% tighter than the old 80%/1280),
     85% on phone (unchanged). */
  --col:min(70vw,1130px);
  --arrow:44px;
  /* Type scale in rem. On desktop the root font-size is 88% (14.08px), so rem type is ~12% smaller.
     On phone the root stays 16px. Form fields stay 16px on phone so iOS will not zoom. */

  --fs-xs:0.875rem;    /* 14px — card type/count, copyright, form status */
  --fs-body:0.9375rem; /* 15px — About paragraphs; form fields on tablet/desktop */
  --fs-sm:1rem;        /* 16px — navbar, overlay (desktop/tablet), card title, button */
  --fs-md:1.25rem;     /* 20px — About / Contact section titles */
  --fs-lg:1.375rem;    /* 22px — “Thank you!” */
  --ease:cubic-bezier(.3,.7,.2,1); --dur:.45s;
}
@media (max-width:767px){:root{--col:85vw}}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--fg);font:400 var(--fs-sm)/1.5 var(--font-body);
  -webkit-font-smoothing:antialiased;overflow-x:hidden}
img{display:block;max-width:100%}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid #fff;outline-offset:2px}
.sr-only{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Even --space between stills, projects, about/contact and the footer (and below the footer).
   The navbar band uses the smaller --nav-space above and below the row only. */
/* The two carousels sit closer together than the other sections; half of --space keeps the rhythm. */
:root{--carousel-gap:calc(var(--space) * 0.5)}
.page,.stack{display:flex;flex-direction:column;gap:var(--space)}
#projects-carousel{margin-bottom:calc(var(--carousel-gap) - var(--space))}
.page{width:var(--col);margin:0 auto;padding:var(--nav-space) 0 var(--space)}
/* Navbar: name + role on the left, social icons on the right. Thin row, no dividers. */
.nav{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);min-width:0;
  margin-bottom:calc(var(--nav-space) - var(--space))}
.nav-left{display:flex;align-items:center;gap:var(--s3);min-width:0}
.nav-title{margin:0;display:flex;align-items:baseline;gap:0;min-width:0;
  font-family:var(--font-title);font-size:var(--fs-sm);font-weight:400;line-height:1.15;letter-spacing:0;text-transform:uppercase}
.nav-name,.nav-role{white-space:nowrap}
.nav-role .nt{text-transform:none}
/* Em dash sits on the subtitle, so if the role wraps it travels with it (never dangles after the name). Hidden when stacked. */
.nav-dash{display:inline;padding-inline:0.5em;pointer-events:none}
.nav-social{display:flex;align-items:center;flex:none}
.social{display:grid;place-items:center;width:40px;height:40px;color:#fff}
.social svg{width:18px;height:18px;display:block}
.social:hover{opacity:.7}

/* Shared chevron button (thin white chevrons). Positioning is scoped per carousel. */
.chev{width:var(--arrow);height:var(--arrow);display:grid;place-items:center;padding:0;background:none;border:0;color:#fff}
.chev svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 6px rgba(0,0,0,.7))}
.chev:hover svg{stroke-width:1.5}

/* stills-carousel — MUST stay 1.85:1 */
.stills{width:100%}
.stage{position:relative;width:100%;aspect-ratio:1.85 / 1;overflow:hidden;background:#000;outline-offset:3px;touch-action:pan-y}
.still-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity var(--dur) ease}
.still-img.is-current{opacity:1}
.stage::after{content:"";position:absolute;inset:0 0 auto 0;height:28%;background:linear-gradient(#000a,#0000);pointer-events:none;z-index:1}
.stage-caption{position:absolute;z-index:2;top:var(--s4);left:var(--s4);margin:0;font-family:var(--font-title);font-size:var(--fs-sm);font-weight:400;line-height:1.3;text-shadow:0 1px 8px #000}
.stage .chev{position:absolute;top:50%;transform:translateY(-50%);z-index:3}
.stage .chev-prev{left:var(--s2)} .stage .chev-next{right:var(--s2)}

/* projects-carousel: the cards viewport spans the full stills width and runs under the arrows.
   A CSS mask fades side cards to transparent (on black, that reads as a fade to black). Arrows sit on top. */
.projects{position:relative;width:100%}
.projects .chev{position:absolute;z-index:4;top:0;margin-top:calc((var(--thumb-h, 120px) - var(--arrow)) / 2);background:none}
.projects .chev-prev{left:0}
.projects .chev-next{right:0}
/* Tight uniform gaps (8px desktop, 6px phone). Cards grow to fill the content width.
   5 cards on desktop (7 would shrink them below the current ~179px at 1440), 3 on phone
   (odd, so the selected card stays centred). Side cards peek and fade under the arrows. */
.proj-viewport{display:grid;justify-items:center;align-items:stretch;overflow:hidden;overflow:clip;container-type:inline-size;
  --visible:5; --gap:8px;
  --cw:calc((100cqw - (var(--visible) - 1) * var(--gap)) / var(--visible));
  --fade:calc(var(--arrow) + var(--s3));
  touch-action:pan-y;padding:2px 0;min-width:0;width:100%;
  -webkit-mask-image:linear-gradient(to right, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  mask-image:linear-gradient(to right, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-size:100% 100%;mask-size:100% 100%}
.proj-status{grid-area:1/1;margin:0;color:var(--muted);font-size:var(--fs-xs)}
.card{grid-area:1/1;width:var(--cw);display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;
  appearance:none;-webkit-appearance:none;text-align:left;padding:0 0 6px;background:#000;border:1px solid var(--line);border-radius:0;
  transform:translateX(calc(var(--d,0) * (var(--cw) + var(--gap))));
  transition:transform var(--dur) var(--ease),visibility 0s,border-color .2s}
.card.far{visibility:hidden;transition:transform var(--dur) var(--ease),visibility 0s var(--dur)}
.card:hover{border-color:var(--line-strong)}
.card:focus-visible{outline-offset:-3px}
.thumb{position:relative;display:block;width:100%;aspect-ratio:1.85 / 1;overflow:hidden;margin-bottom:6px;background:#000;flex:none;line-height:0}
.thumb img{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;vertical-align:top}
.sel{position:absolute;inset:0;display:grid;place-items:center;background:rgba(255,255,255,.5);opacity:0;transition:opacity .3s ease}
.sel svg{width:24px;height:24px;fill:none;stroke:#000;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.card[aria-current="true"] .sel{opacity:1}
.card-title,.card-type,.card-count{display:block;padding:0 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.card-title{font-family:var(--font-title);font-size:11px;color:var(--fg);font-weight:400;line-height:1.25} /* floor: 80% of 13px would be under 11px */
.card-type,.card-count{font-size:10px;color:var(--muted);line-height:1.35} /* floor: 80% of 11px would be under 10px */

/* About + Contact: same format (small uppercase label, body directly under it). The single vertical line sits BETWEEN them. */
.info{display:grid;grid-template-columns:1fr 1fr;width:100%}
.panel{min-width:0}
.about{padding-right:var(--space)}
.contact{padding-left:var(--space);border-left:1px solid var(--line)}
.label{margin:0 0 var(--s4);font-family:var(--font-title);font-size:var(--fs-md);font-weight:400;letter-spacing:.06em;text-transform:uppercase;color:var(--fg);line-height:1.3}
.about .body p{margin:0 0 var(--s4);font-size:var(--fs-body);line-height:1.8;color:var(--muted)}
.about .body p:last-child{margin-bottom:0}
.form{display:grid;grid-template-columns:1fr 1fr;gap:var(--s3)}
.field-full,.form-status{grid-column:1/-1}
input,textarea{width:100%;background:#000;border:1px solid var(--line);border-radius:0;padding:0 var(--s3);min-height:44px;font-size:var(--fs-body);color:var(--fg);transition:border-color .2s}
textarea{padding:var(--s3);min-height:220px;resize:vertical;line-height:1.6}
input::placeholder,textarea::placeholder{color:var(--faint);opacity:1}
input:hover,textarea:hover{border-color:var(--line-strong)}
input:focus-visible,textarea:focus-visible{outline:none;border-color:#fff;box-shadow:0 0 0 1px #fff}
.send{grid-column:1/-1;justify-self:center;width:auto;padding:0 1.25rem;min-height:44px;background:#000;border:1px solid var(--line-strong);border-radius:0;font-family:var(--font-body);font-size:max(var(--fs-sm),16px);font-weight:500;letter-spacing:.04em;transition:background .2s,color .2s,border-color .2s}
.send:hover{background:#fff;color:#000;border-color:#fff}
.form-status{margin:0;min-height:1.5em;font-size:var(--fs-xs);color:var(--muted)}
.form-status.is-ok{color:#fff}
.form-status.is-err{color:#e8a0a0}
.send[disabled]{opacity:.5;cursor:default}
/* spam trap: off-screen, never visible to people */
.hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

/* Footer: no divider, same content width */
.foot{text-align:center;width:100%}
.thanks{margin:0 0 var(--s2);font-family:var(--font-title);font-size:var(--fs-lg);font-weight:400;line-height:1.3}
.copy{margin:0;font-size:var(--fs-xs);color:var(--muted)}

/* Phone <768: type, navbar, spacing and content width stay as they were. Cards are the 80% size
   from above (3 visible, odd, centred). About/Contact stacked with a horizontal line between.
   Navbar: the role shrinks slightly so name + role + icons fit; dash hides when stacked. */
@media (max-width:767px){
  .nav{gap:var(--s2)}
  .nav-left{gap:var(--s2);flex:1;min-width:0}
  .nav-title{flex-wrap:wrap;gap:2px 0;letter-spacing:0;align-items:baseline}
  /* Subtitle stays visible on its own line: name + three icons cannot share one 85vw row at 16px. */
  .nav-role{font-size:0.75rem;letter-spacing:0;flex-basis:100%}
  .nav-dash{display:none}
  .social{width:36px;height:36px}
  .social svg{width:16px;height:16px}
  .proj-viewport{--visible:3;--gap:6px;--fade:calc(var(--arrow) + var(--s3))}
  .card:not([aria-current="true"]){opacity:.55}
  .info{grid-template-columns:1fr}
  .about{padding-right:0;padding-bottom:var(--space)}
  .contact{padding-left:0;border-left:0;border-top:1px solid var(--line);padding-top:var(--space)}
  .label{text-align:center}
  .form{grid-template-columns:1fr}
  textarea{min-height:180px}
  .stage-caption{top:var(--s3);left:var(--s3);font-size:var(--fs-body)} /* match About body, phone only */
  input,textarea{font-size:16px} /* iOS will zoom if fields are under 16px */
}
/* Desktop / tablet: scale the whole UI by 12% (type, spacing, navbar, icons, arrows, form, footer). */
@media (min-width:768px){
  html{font-size:88%} /* 14.08px: rem type drops ~12% */
  :root{
    --s1:3.52px; --s2:7.04px; --s3:10.56px; --s4:14.08px;
    --space:clamp(24.64px,3.52vw,42.24px);
    --nav-row:31.68px;
    --prev-band:calc(0.75 * (2 * var(--space) + 38.72px));
    --arrow:38.72px;
  }
  .social{width:31.68px;height:31.68px}
  .social svg{width:14.26px;height:14.26px}
  .chev svg{width:24.64px;height:24.64px}
  .sel svg{width:29px;height:29px}
  input,textarea{min-height:38.72px}
  textarea{min-height:193.6px}
  .send{min-height:38.72px;font-size:var(--fs-sm);padding:0 1.1rem}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}
