/* Asap (SIL Open Font License), self-hosted; variable weight 400-700 */
@font-face {
  font-family: "Asap";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/asap-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Asap";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/asap-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/asap-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/asap-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  /* content never hugs the edge, and stops growing on very wide screens */
  --gutter: max(5vw, calc((100vw - 1600px) / 2));
  --img-gap: clamp(14px, 2.4vw, 34px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Asap", Helvetica, Arial, sans-serif;
  color: #000;
  background: #fff;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---- menu ---- */
.menu {
  padding: clamp(1.2rem, 3.5vw, 3.5rem) var(--gutter) 0;
  min-height: clamp(64px, 8.7vw, 122px);
  text-align: right;
}
.menu nav a {
  display: inline-block;
  padding: .6rem 0 .6rem .9rem;   /* comfortable tap target */
  font-size: clamp(14px, 1vw, 15px);
  color: rgba(0, 0, 0, .6);
  text-decoration: none;
}
.menu nav a:hover, .menu nav a:focus-visible { color: #000; }

main { padding: 0 var(--gutter) clamp(3rem, 6vw, 6rem); }

/* ---- home ---- */
.site-title {
  font-weight: 500;
  font-size: clamp(1.75rem, 4.3vw, 60px);
  line-height: 1.3;
  margin: clamp(1.5rem, 6vw, 6rem) 0 clamp(1.5rem, 4.5vw, 4rem);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5vw 5.5%;
  align-items: start;
}
.tiles img { width: 100%; mix-blend-mode: multiply; }

/* ---- project pages ---- */
.project > p { margin: 0 0 var(--img-gap); }
.project img { width: 100%; }

.project-title {
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 48px);
  line-height: 1.4;
  margin: clamp(1.5rem, 5.5vw, 5.5rem) 0 clamp(1.5rem, 6vw, 85px) !important;
}
.project > p:not(.project-title):not(:has(img)) {
  font-size: clamp(1.1rem, 2.2vw, 30px);
  line-height: 1.6;
  margin: clamp(2rem, 6.4vw, 90px) 0 clamp(1rem, 5.7vw, 80px);
}

/* linked images = small "more projects" buttons, shown in a row */
.project > p:has(> a > img) {
  display: inline-block;
  vertical-align: top;
  margin: 0 clamp(16px, 4vw, 56px) var(--img-gap) 0;
}
.project > p:has(> a > img) img { width: clamp(84px, 9.3vw, 130px); }

/* layout: row -> small images side by side, centred (contact page) */
.layout-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 320px));
  justify-content: center;
  gap: clamp(1rem, 4.3vw, 60px);
  padding-top: clamp(1rem, 3vw, 43px);
}
.layout-row > p { margin: 0; }

.back { display: block; width: 50px; margin: clamp(2rem, 3vw, 3rem) auto 0; }
.back img { width: 50px; }

/* ---- breakpoints ---- */
@media (max-width: 620px) {
  .layout-row { grid-template-columns: minmax(0, 320px); }
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 5vw; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; gap: 1.5rem; }
  .menu nav a { font-size: 15px; padding-left: 1.1rem; }
}

/* ---- accessibility ---- */
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.menu nav a[aria-current="page"] { color: #000; }
a:focus-visible, .project img:focus-visible { outline: 3px solid #2ea3f2; outline-offset: 3px; }

/* ---- contact text under the images ---- */
.project-text { margin: clamp(2rem, 4vw, 3.5rem) auto 0; max-width: 40rem; text-align: center;
  font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.7; }
.project-text p { margin: 0; }
.project-text a { text-underline-offset: .2em; }

/* ---- lightbox ---- */
.project img { cursor: zoom-in; }
.project p:has(> a > img) img { cursor: pointer; }
#lightbox {
  border: 0; padding: 0; background: rgba(255, 255, 255, .97);
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  align-items: center; justify-content: center;
}
#lightbox[open] { display: flex; }
#lightbox::backdrop { background: rgba(255, 255, 255, .97); }
#lightbox > img { max-width: 92vw; max-height: 92dvh; width: auto; height: auto; object-fit: contain; cursor: zoom-out; }
#lightbox button {
  position: absolute; border: 0; background: none; cursor: pointer; color: #000;
  font: 300 2.6rem/1 "Asap", sans-serif; width: 3.2rem; height: 3.2rem; opacity: .6;
}
#lightbox button:hover, #lightbox button:focus-visible { opacity: 1; }
.lb-close { top: .6rem; right: .6rem; font-size: 2.4rem; }
.lb-prev { left: .4rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .4rem; top: 50%; transform: translateY(-50%); }
#lightbox.single .lb-prev, #lightbox.single .lb-next { display: none; }
body:has(#lightbox[open]) { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
