/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Monoton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/monoton-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --bg: #ffffff;
  --surface: #f4f4f3;
  --text: #151515;
  --muted: #6b6b6b;
  --line: #e4e4e2;
  --accent: #f95959;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-height: 76px;
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Always reserve the scrollbar's space so the layout doesn't shift between short and long pages. */
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .2s var(--ease);
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 16px;
}

.muted {
  color: var(--muted);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Solid background: backdrop-filter would make it the containing block of the fixed mobile menu. */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  color: var(--accent);
  font-family: "Monoton", sans-serif;
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.site-nav ul {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-size: 15px;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-toggle-lines,
.menu-toggle-lines::before {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform .3s var(--ease), top .3s var(--ease);
}

.menu-toggle-lines {
  top: 17px;
}

.menu-toggle-lines::before {
  content: "";
  left: 0;
  top: 8px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before {
  top: 0;
  transform: rotate(-90deg);
}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
  }

  .logo {
    font-size: 24px;
  }

  /* Without JS the menu stays visible as a plain list. */
  .js .menu-toggle {
    display: block;
  }

  .js .site-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    padding: 40px var(--gutter);
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), visibility .25s;
  }

  .js.menu-open .site-nav {
    opacity: 1;
    visibility: visible;
  }

  .js.menu-open body {
    overflow: hidden;
  }

  .js .site-nav ul {
    flex-direction: column;
    gap: 8px;
  }

  .js .site-nav a {
    font-size: 32px;
    font-weight: 300;
  }

  html:not(.js) .site-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 16px;
    gap: 12px;
  }
}

/* ---------- Main & footer ---------- */

main {
  padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 112px);
  min-height: 60vh;
}

.page-title {
  margin-bottom: clamp(32px, 5vw, 56px);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

.site-footer a {
  text-decoration: none;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.site-footer-copy {
  text-align: right;
}

@media (max-width: 760px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer-copy {
    text-align: left;
  }
}

/* ---------- Home ---------- */

.intro {
  max-width: 24ch;
  margin-bottom: clamp(48px, 8vw, 96px);
  font-size: clamp(26px, 4.2vw, 48px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card a {
  display: block;
  text-decoration: none;
}

.project-card-image {
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 3;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.project-card a:hover img {
  transform: scale(1.03);
}

.project-card-name {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 600;
}

.project-card-meta {
  color: var(--muted);
  font-size: 14px;
}

.cta {
  margin-top: clamp(64px, 10vw, 128px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 300;
  line-height: 1.35;
}

.cta a {
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Project detail ---------- */

.project-hero {
  margin: 0 0 clamp(40px, 6vw, 72px);
  background: var(--surface);
}

.project-hero img {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
}

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(32px, 6vw, 96px);
  margin-bottom: clamp(56px, 8vw, 104px);
}

.project-head h1 {
  margin-bottom: 28px;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 500;
}

.project-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 0;
  font-size: 14px;
}

.project-facts dt {
  color: var(--muted);
}

.project-facts dd {
  margin: 0;
}

.project-text {
  max-width: 68ch;
}

.project-text .perex {
  margin-bottom: 1.4em;
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 400;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .project-head {
    grid-template-columns: 1fr;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-item figure {
  margin: 0;
}

.gallery-item a {
  display: block;
  background: var(--surface);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: clamp(8px, 1.5vw, 20px);
  mix-blend-mode: multiply;
  transition: opacity .3s var(--ease);
}

.gallery-item a:hover img {
  opacity: .82;
}

.gallery-item figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: clamp(64px, 10vw, 120px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.project-nav a {
  text-decoration: none;
  font-weight: 600;
}

.project-nav span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.project-nav-next {
  text-align: right;
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(255 255 255 / .98);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgb(255 255 255 / .9);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: fade-in .2s var(--ease);
}

.lightbox-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  font-size: 14px;
}

.lightbox-title {
  font-weight: 600;
}

.lightbox-counter {
  margin-left: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lightbox-figure {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox-caption {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 12px var(--gutter) 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.lightbox button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: color .2s var(--ease);
}

.lightbox button:hover {
  color: var(--accent);
}

.lightbox svg {
  width: 26px;
  height: 26px;
}

.lightbox-prev,
.lightbox-next {
  grid-row: 2;
  align-self: center;
  justify-self: center;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-next {
  grid-column: 3;
}

@media (max-width: 640px) {
  .lightbox[open] {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .lightbox-prev,
  .lightbox-next {
    display: none !important;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* ---------- Services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 48px);
}

@media (max-width: 1000px) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .services {
    grid-template-columns: 1fr;
  }
}

.service {
  padding-top: 24px;
  border-top: 1px solid var(--text);
}

.service img {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
}

.service h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

.service ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.service li {
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}

.service li:last-child {
  border-bottom: 0;
}

/* ---------- About & contact ---------- */

.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}

@media (max-width: 860px) {
  .two-columns {
    grid-template-columns: 1fr;
  }
}

.cv-section + .cv-section {
  margin-top: 48px;
}

.cv-section h2 {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cv {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  margin: 0;
}

.cv dt,
.cv dd {
  margin: 0;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.cv dt {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cv dd small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 480px) {
  .cv {
    grid-template-columns: 1fr;
  }

  .cv dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

.portrait {
  background: var(--surface);
}

.contact-lead {
  margin-bottom: 40px;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 300;
  line-height: 1.35;
}

.contact-details {
  font-size: 17px;
  line-height: 1.8;
}

.contact-details a {
  color: var(--accent);
}

.contact-map {
  margin: 0;
}

.contact-map a {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.contact-map img {
  width: 100%;
  background: var(--surface);
  transition: transform .8s var(--ease);
}

.contact-map a:hover img {
  transform: scale(1.02);
}

/* The map is centred on the address, so the label sits just right of the centre marker. */
.contact-map-label {
  position: absolute;
  left: calc(50% + 28px);
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.contact-map-label small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.contact-map a:hover .contact-map-label small {
  color: var(--accent);
}


/* ---------- 404 ---------- */

.not-found {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 50vh;
  text-align: center;
}

.not-found img {
  width: 72px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.lightbox-figure:focus {
  outline: none;
}
