/* =========================================================
   Aarde: one layout system for every page.
   All sizes come from these tokens.
   ========================================================= */
:root {
  --ink: #111;
  --muted: #6e6e6e;
  --line: #e3e3e3;
  --bg: #fff;

  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --fs-label: clamp(0.72rem, 0.68rem + 0.15vw, 0.8rem);   /* small caps labels */
  --fs-small: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);    /* captions, footer */
  --fs-body:  clamp(1rem, 0.94rem + 0.25vw, 1.15rem);     /* paragraphs */
  --fs-lede:  clamp(1.45rem, 1.1rem + 1.4vw, 2.6rem);     /* intro statements */
  --fs-title: clamp(2.1rem, 1.5rem + 2.6vw, 4.2rem);      /* project titles */

  --gutter: clamp(1.25rem, 3.2vw, 4rem);
  --max: 1680px;
  --col-gap: clamp(1.25rem, 2.4vw, 2.75rem);
  --space-s: clamp(1rem, 1.6vw, 1.75rem);
  --space-m: clamp(2rem, 4vw, 4rem);
  --space-l: clamp(3.5rem, 7vw, 8rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; scrollbar-gutter: stable; }   /* same width on every page: no sideways jump */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
figure { margin: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.label {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.label a:hover { color: var(--ink); }
.muted { color: var(--muted); }
.lede { font-size: var(--fs-lede); font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--ink); color: var(--bg); z-index: 100; }
.skip:focus { left: var(--gutter); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.plain { list-style: none; margin: 0; padding: 0; }
.prose-link, .project-text a, .profile-info a, .project-meta a, .site-footer a, .arrow {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.2s;
}
.project-text a:hover, .profile-info a:hover, .project-meta a:hover, .site-footer a:hover, .arrow:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(4.25rem, 7vw, 6.5rem);
}
.logo img { height: clamp(1.5rem, 2.3vw, 2.25rem); width: auto; }
.site-nav { display: flex; gap: clamp(1.25rem, 2.4vw, 2.5rem); font-size: var(--fs-small); }
.site-nav a { padding-block: 0.25rem; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- Home ---------- */
.projects { padding-top: var(--space-m); }

.project-grid {
  list-style: none;
  margin: 0 0 var(--space-l);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-m) var(--col-gap);
}
.tile { display: block; }
.tile-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
}
/* Hover: the shape fills with pixels from its centre outwards, then the lines fade away (see site.js) */
.plan-box { position: absolute; inset: 6%; display: block; }
.plan-box > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.plan { transition: opacity 0.18s ease; }
.fill { opacity: 0; transition: opacity 0.18s ease; }
/* Pixel state: hover on desktop; on phones every tile while the page is scrolling (.is-scrolling, set by site.js) */
.is-scrolling .tile .fill.is-ready, .tile:focus-visible .fill.is-ready { opacity: 1; }
.is-scrolling .tile .fill.is-ready + .plan, .tile:focus-visible .fill.is-ready + .plan { opacity: 0; }
@media (hover: hover) {
  .tile:hover .fill.is-ready { opacity: 1; }
  .tile:hover .fill.is-ready + .plan { opacity: 0; }
}
.tile-cap {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  column-gap: 0.4em;
  margin-top: 0.9rem;
  font-size: var(--fs-small);
  line-height: 1.35;
}
.tile-cap .num { color: var(--muted); grid-row: span 2; font-variant-numeric: tabular-nums; }
.tile-title { font-weight: 500; }
.tile-loc { color: var(--muted); }
.tile-coords, .coords { color: var(--muted); font-size: var(--fs-label); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
/* Neighbourhood, switching to coordinates on hover */
.tile-place { display: grid; }
.tile-place > * { grid-area: 1 / 1; transition: opacity 0.18s ease; }
.tile-coords { opacity: 0; font-size: inherit; align-self: center; white-space: nowrap; }
.is-scrolling .tile .tile-loc, .tile:focus-visible .tile-loc { opacity: 0; }
.is-scrolling .tile .tile-coords, .tile:focus-visible .tile-coords { opacity: 1; }
@media (hover: hover) {
  .tile:hover .tile-loc { opacity: 0; }
  .tile:hover .tile-coords { opacity: 1; }
}
.tile { -webkit-tap-highlight-color: transparent; }
.is-forthcoming .plan { opacity: 0.55; }
.is-forthcoming:hover .plan { opacity: 1; }

/* ---------- Project ---------- */
/* Top: title and details on the left, write-up on the right */
.project-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gap);
  row-gap: var(--space-m);
  padding-block: var(--space-m) var(--space-l);
}
.project-id { grid-column: 1 / span 4; }
.project-id h1 { font-size: var(--fs-title); line-height: 1.05; letter-spacing: -0.02em; margin: 0.6rem 0 var(--space-m); }
.project-meta { margin: 0; }
.project-meta > div { padding-block: 0.9rem; border-top: 1px solid var(--line); }
.project-meta > div:last-child { border-bottom: 1px solid var(--line); }
.project-meta dt { margin-bottom: 0.3rem; }
.project-meta dd { margin: 0; font-size: var(--fs-small); line-height: 1.5; }
.project-text { grid-column: 6 / span 7; max-width: 64ch; padding-top: calc(var(--fs-label) * 1.65 + 0.6rem); }
.project-text p + p { margin-top: 1.1em; }

/* Images: rows of one or two, every image in a row the same height, never cropped */
.gallery { display: grid; gap: var(--col-gap); padding-bottom: var(--space-l); }
.g-row { display: flex; gap: var(--col-gap); }
.g-row figure { flex: var(--ar) 1 0; min-width: 0; }
.g-row img, .g-row video { display: block; width: 100%; height: auto; background: #f2f2f0; }
.g-embed { position: relative; aspect-ratio: var(--ar); }
.g-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.project-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: var(--col-gap);
  padding-block: var(--space-m);
  border-top: 1px solid var(--line);
  margin-bottom: var(--space-m);
}
.project-nav a { display: grid; gap: 0.3rem; font-size: var(--fs-body); }
.project-nav a span:last-child { transition: opacity 0.2s; }
.project-nav a:hover span:last-child { opacity: 0.6; }
.pn-next { text-align: right; }
.pn-all { text-align: center; }

/* ---------- Profile ---------- */
.profile-head { padding-block: var(--space-m) var(--space-m); }
.profile-head .lede { max-width: 30ch; margin-top: 0.8rem; }
.profile-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gap);
  padding-bottom: var(--space-l);
}
.profile-text { grid-column: 6 / span 7; max-width: 64ch; }
.profile-text p + p { margin-top: 1.1em; }
.profile-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-m) var(--col-gap);
  padding-block: var(--space-m) var(--space-l);
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
}
.profile-info .label { margin-bottom: 0.7rem; }
.profile-info .spaced { margin-top: var(--space-s); }
.profile-info li + li { margin-top: 0.2rem; }

/* ---------- 404 ---------- */
.notfound { padding-block: var(--space-l); min-height: 50vh; }
.notfound .lede { margin: 0.8rem 0 1.5rem; }

/* ---------- Footer: one small copyright line ---------- */

.site-footer { padding-block: 1.25rem 1.5rem; text-align: center; font-size: 0.68rem; letter-spacing: 0.03em; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .project-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(3, 1fr); }
  .project-id, .project-text, .profile-text { grid-column: 1 / -1; }
  .project-text { padding-top: 0; }
  .profile-info { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .g-row { flex-direction: column; }
  .project-nav { grid-template-columns: 1fr 1fr; }
  .pn-all { display: none !important; }
}
@media (max-width: 420px) {
  .tile-coords { font-size: 0.78rem; letter-spacing: 0; }
  .profile-info { grid-template-columns: 1fr; }
}

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

/* ---------- Project pages: the mouse pointer itself changes by screen zone (desktop only, see site.js) ----------
   Thin line icons: forward arrow for next, back arrow for previous, exit for home. */
html.cz-next, html.cz-next * { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2264%22%20height%3D%2264%22%20viewBox%3D%220%200%2064%2064%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M58%2026%20L46%2014%20M58%2026%20L46%2038%20M58%2026%20H23%20A11.8%2011.8%200%200%200%2023%2049.6%22%20stroke%3D%22%23fff%22%20stroke-width%3D%226%22%20stroke-opacity%3D%220.9%22/%3E%3Cpath%20d%3D%22M58%2026%20L46%2014%20M58%2026%20L46%2038%20M58%2026%20H23%20A11.8%2011.8%200%200%200%2023%2049.6%22%20stroke%3D%22%23111%22%20stroke-width%3D%222.2%22/%3E%3C/svg%3E") 58 26, e-resize !important; }
html.cz-prev, html.cz-prev * { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2264%22%20height%3D%2264%22%20viewBox%3D%220%200%2064%2064%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%2026%20L18%2014%20M6%2026%20L18%2038%20M6%2026%20H41%20A11.8%2011.8%200%200%201%2041%2049.6%22%20stroke%3D%22%23fff%22%20stroke-width%3D%226%22%20stroke-opacity%3D%220.9%22/%3E%3Cpath%20d%3D%22M6%2026%20L18%2014%20M6%2026%20L18%2038%20M6%2026%20H41%20A11.8%2011.8%200%200%201%2041%2049.6%22%20stroke%3D%22%23111%22%20stroke-width%3D%222.2%22/%3E%3C/svg%3E") 6 26, w-resize !important; }
html.cz-home, html.cz-home * { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2264%22%20height%3D%2264%22%20viewBox%3D%220%200%2064%2064%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M18%2020.6%20V5.4%20H48%20V58.6%20H18%20V43.4%20M33%2032%20H4%20M4%2032%20L11%2025%20M4%2032%20L11%2039%22%20stroke%3D%22%23fff%22%20stroke-width%3D%226%22%20stroke-opacity%3D%220.9%22/%3E%3Cpath%20d%3D%22M18%2020.6%20V5.4%20H48%20V58.6%20H18%20V43.4%20M33%2032%20H4%20M4%2032%20L11%2025%20M4%2032%20L11%2039%22%20stroke%3D%22%23111%22%20stroke-width%3D%222.2%22/%3E%3C/svg%3E") 32 32, n-resize !important; }
