@font-face{font-family:"Aileron";font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/aileron-regular.woff2) format("woff2")}
@font-face{font-family:"Aileron";font-weight:200;font-style:normal;font-display:swap;src:url(../fonts/aileron-ultra-light.woff2) format("woff2")}
@font-face{font-family:"Aileron";font-weight:300;font-style:normal;font-display:swap;src:url(../fonts/aileron-light.woff2) format("woff2")}
@font-face{font-family:"Aileron";font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/aileron-bold.woff2) format("woff2")}
:root{--bg:#2f4bff;--fg:#fff;--pad:clamp(16px,2.2vw,32px);box-sizing:border-box}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg)}
body{color:var(--fg);font-family:"Aileron","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:clamp(.875rem,1.9vh,1.25rem);line-height:1.25;letter-spacing:-.005em;text-transform:uppercase;font-weight:700}
a{color:inherit;text-decoration:none;opacity:.75;transition:opacity .25s ease}
a:hover,a:focus-visible{opacity:1}
.logo{opacity:1}
a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.page{position:relative;min-height:100vh;min-height:100svh;padding:calc(var(--pad) + env(safe-area-inset-top,0px)) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:clamp(40px,10vh,100px)}
.logo{position:absolute;top:calc(var(--pad) + env(safe-area-inset-top,0px));right:var(--pad);width:min(312px,38vw);aspect-ratio:623.62/257.95;display:block;background-color:currentColor;-webkit-mask:url(../img/boxed-in-logo.svg) center/contain no-repeat;mask:url(../img/boxed-in-logo.svg) center/contain no-repeat}
.back{display:inline-block;width:max-content;font-weight:400}
.ul span{position:relative;display:inline-block;padding-bottom:3px}
.ul span:after{content:"";position:absolute;left:0;bottom:0;height:1.5px;width:100%;background:currentColor;transform:scaleX(.25);transform-origin:left;transition:transform .45s ease}
.ul:hover span:after,.ul:focus-visible span:after{transform:scaleX(1)}
.project-title{margin:0;max-width:12ch;font-size:clamp(2rem,8vw,6rem);line-height:.98;font-weight:700;letter-spacing:-.045em}
@media(max-width:900px){.page{gap:28px}.logo{position:static;order:-1;width:min(312px,70vw)}.project-title{margin-top:clamp(24px,8vh,80px)}}
@media(max-width:623px){.logo{width:min(312px,100%);align-self:center}}
@media(prefers-reduced-motion:reduce){a,.ul span:after{transition:none}}

/* ---- Project page content (filled in from projects.js) ---- */
#project-body{display:flex;flex-direction:column;gap:clamp(32px,6vh,64px)}
.desc{max-width:46ch;font-weight:300;text-transform:none;font-size:1.2em;line-height:1.9}
@media(min-width:624px){.desc{text-align:justify}}
.desc p{margin:0 0 1em}
.desc p:last-child{margin-bottom:0}
.desc a{text-decoration:underline}
.details{margin:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:16px 24px;max-width:900px}
.details div{display:grid;gap:2px}
.details dt{opacity:1;font-weight:700}
.details dd{margin:0;opacity:.75}
.details dd a{opacity:1}
.details dd a:hover,.details dd a:focus-visible{text-decoration:underline}
/* Gallery grid: two columns, max 860px wide, left aligned. Every cell has a fixed shape that repeats in threes:
   1st = landscape (16:9), 2nd and 3rd = squares. A photo is cropped to its cell (the original is never changed);
   a text block can sit in any cell and takes that cell's shape. */
.gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));--gallery-gap:clamp(24px,4vw,56px);gap:var(--gallery-gap);width:100%;max-width:860px;align-self:flex-start}
.gallery figure{margin:0;aspect-ratio:1/1;overflow:hidden}
.gallery figure:nth-child(3n+1){grid-column:1/-1;aspect-ratio:16/9}
.gallery figure a{display:block;height:100%;opacity:1;cursor:zoom-in}
.gallery img{display:block;width:100%;height:100%;object-fit:cover;opacity:1;transition:opacity .6s ease}
.gallery img.loading{opacity:0}
.gallery .ph{background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;opacity:.8}
.gallery .ph:first-child::after{content:"coming soon"}
.gallery figure.txt{container-type:inline-size;overflow:visible;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}
.gallery .txt h2{margin:0 0 .6em;font-size:clamp(10px,3.9cqw,16px);font-weight:700}
/* Thin text uses Aileron Light (weight 300, declared at the top of this file). */
.gallery .txt p{margin:0 0 1em;max-width:34ch;font-weight:300;text-transform:none;font-size:clamp(10px,4.4cqw,17.6px);line-height:1.4}
.gallery .txt p:last-child{margin-bottom:0}
.pager{display:flex;justify-content:space-between;gap:24px;margin-top:clamp(16px,4vh,48px)}
.pager a{display:grid;gap:2px;padding:4px 0}
.pager .next{text-align:right;margin-left:auto}
.pager small{font-size:.8em;font-weight:400;opacity:.8}
@media(max-width:623px){.gallery{--gallery-gap:16px}}

/* ---- Photo viewer (click a photo to see it large) ---- */
.lb{position:fixed;inset:0;z-index:10;display:none;align-items:center;justify-content:center;background:rgba(10,10,10,.92);opacity:0;transition:opacity .25s ease;touch-action:pan-y}
.lb.open{display:flex}
.lb.show{opacity:1}
.lb img{max-width:calc(100vw - 32px);max-height:calc(100vh - 96px);max-height:calc(100svh - 96px);width:auto;height:auto;object-fit:contain;transition:opacity .25s ease}
.lb img.swap{opacity:0}
.lb button{position:absolute;background:none;border:0;color:#fff;font:inherit;text-transform:uppercase;font-weight:700;letter-spacing:-.005em;padding:16px;cursor:pointer;opacity:.6;transition:opacity .25s ease}
.lb button:hover,.lb button:focus-visible{opacity:1}
.lb button:focus-visible{outline:2px solid #fff;outline-offset:-4px}
.lb .x{top:0;right:0}
.lb .p{left:0;top:50%;transform:translateY(-50%)}
.lb .n{right:0;top:50%;transform:translateY(-50%)}
.lb .c{position:absolute;left:0;bottom:0;padding:16px;opacity:.6;font-weight:400}
@media(prefers-reduced-motion:reduce){.lb,.lb img{transition:none}}

/* Drawings (SVG): shown whole inside their cell, in the text colour. Black becomes the text colour, white the page colour. */
.gallery figure.drw{container-type:inline-size;overflow:visible;display:flex;align-items:center;justify-content:center}
.gallery .drw svg{display:block;width:100%;height:100%;overflow:visible}
.gallery .drw svg *{vector-effect:non-scaling-stroke}
.gallery .drw text{font-weight:400;text-transform:none}
/* Legend at the bottom of a text block: small, ultra light. Numbers match the numbers drawn in the neighbouring drawing. */
.gallery .legend{margin:0;padding:0 0 0 1.4em;font-weight:200;text-transform:none;font-size:clamp(8px,2.9cqw,12px);line-height:1.3}
.gallery .legend li{margin:0 0 .25em}
@container (max-width:150px){.gallery .txt p{display:none}.gallery .txt h2{margin-bottom:.8em}}
@container (max-width:230px){.gallery .drw text{font-size:78px}}

/* ---- Tidy layout: projects with layout:"tidy" in projects.js. Same grid; each text block sits beside its drawing,
   the key has numbered badges, wide drawings run the full width with a caption, and phones get one column. ---- */
.gallery.tidy{align-items:start}
.gallery.tidy .txt{gap:1.4em}
.gallery.tidy .txt h2{margin:0 0 .55em;font-size:clamp(13px,4.2cqw,17px)}
.gallery.tidy .txt p{font-size:clamp(14px,4.5cqw,18px)}
.gallery.tidy .legend{list-style:none;counter-reset:k;margin:0;padding:0;font-weight:300;font-size:clamp(12.5px,3.5cqw,14.5px);line-height:1.25}
.gallery.tidy .legend li{counter-increment:k;display:grid;grid-template-columns:1.9em minmax(0,1fr);gap:.75em;align-items:center;margin:0 0 .4em;break-inside:avoid}
.gallery.tidy .legend li::before{content:counter(k);display:grid;place-items:center;width:1.9em;height:1.9em;border:1.3px solid currentColor;border-radius:50%;font-size:.82em;font-weight:400;line-height:1}
.gallery.tidy .drw .dw{position:relative;display:flex;flex-direction:column;width:100%}
.gallery.tidy .drw svg{height:auto;max-height:100cqw;cursor:zoom-in}
.gallery.tidy figure.drw.wide{display:block;aspect-ratio:auto}
.gallery.tidy .drw.wide svg{max-height:none}
.gallery.tidy .drw figcaption{display:flex;gap:1.2em;align-items:baseline;margin-top:14px;font-size:14px}
.gallery.tidy .drw figcaption b{white-space:nowrap}
.gallery.tidy .drw figcaption span{font-weight:300;text-transform:none;font-size:15px;line-height:1.35}
.enl{align-self:flex-end;margin-top:8px;font:inherit;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:inherit;background:none;border:1px solid color-mix(in srgb,currentColor 55%,transparent);padding:5px 9px;opacity:.8;cursor:pointer;transition:opacity .2s}
.enl:hover,.enl:focus-visible{opacity:1}
@media(max-width:623px){
  .gallery.tidy{grid-template-columns:minmax(0,1fr);--gallery-gap:26px}
  .gallery.tidy figure.txt,.gallery.tidy figure.drw{aspect-ratio:auto}
  .gallery.tidy .legend{columns:2;column-gap:20px}
  .gallery.tidy .drw svg{max-height:none}
  .gallery.tidy .drw figcaption{flex-direction:column;gap:4px}
}

/* ---- Drawing viewer (the enlarge button on a tidy page): the drawing full screen, in the page colour ---- */
.dz{position:fixed;inset:0;z-index:40;background:var(--bg);color:var(--fg);display:none;flex-direction:column}
.dz.open{display:flex}
.dz header{display:flex;justify-content:space-between;align-items:center;padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px;font-size:13px}
.dz header span{opacity:.8;font-weight:400}
.dz header button{font:inherit;font-weight:700;color:inherit;background:none;border:1px solid color-mix(in srgb,currentColor 55%,transparent);padding:7px 12px;text-transform:uppercase;cursor:pointer}
.dz .sc{flex:1;overflow:auto;padding:8px 16px calc(24px + env(safe-area-inset-bottom,0px));-webkit-overflow-scrolling:touch}
.dz .sc svg{display:block;width:max(920px,100%);max-width:1800px;height:auto;overflow:visible;margin:0 auto}
.dz .sc svg *{vector-effect:non-scaling-stroke}
.dz .sc text{font-weight:400;text-transform:none}
.dz .hintm{font-size:12px;opacity:.6;padding:0 16px 8px}
@media(min-width:960px){.dz .hintm{display:none}}
@media(prefers-reduced-motion:reduce){.enl{transition:none}}
