/* ==========================================================
   david hose — site styles
   Colors and sizes live in the :root block below, so a change
   there updates the whole site.
   ========================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #141414;
  --muted: #74726d;
  --line: #e7e5e1;
  --tile: #f6f5f3;
  --paper: #ffffff;
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

p a, .text a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: clamp(20px, 3vw, 32px);
  padding-bottom: clamp(20px, 3vw, 32px);
  margin-bottom: clamp(40px, 7vw, 96px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 100vmax rgba(255, 255, 255, 0.94);  /* stretch the white bar edge to edge */
  clip-path: inset(0 -100vmax);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.brand-tag { font-size: 14px; color: var(--muted); }

.nav { display: flex; gap: clamp(18px, 3vw, 36px); font-size: 15px; }
.nav a { color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Page intro ---------- */

.intro { margin-bottom: clamp(40px, 6vw, 72px); max-width: 640px; }
.intro h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.intro p { color: var(--muted); margin: 12px 0 0; }

/* ---------- Project grid (Work + Fun) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 88px) clamp(24px, 3vw, 48px);
}

.card { display: block; }
.card-media {
  aspect-ratio: 4 / 3;
  background: var(--tile);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply; /* lets white artwork backgrounds blend into the tile */
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.card-media.photo img { object-fit: cover; }
.card:hover .card-media img { transform: scale(1.03); }
.card-title { margin: 18px 0 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.card-meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Project page ---------- */

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  margin-bottom: clamp(56px, 8vw, 112px);
}
.project-head h1 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 28px; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.text h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.text h2:not(:first-child) { margin-top: 32px; }
.text p { margin: 0 0 14px; max-width: 62ch; }

.figures {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 7vw, 104px);
  max-width: 760px;          /* every project image shows at this same width */
  margin: 0 auto;
}
.figures figure { margin: 0; }
.figures img { width: 100%; }
.figures figcaption { margin: 16px auto 0; font-size: 14px; color: var(--muted); max-width: 60ch; text-align: center; }

.crumb { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.crumb:hover { color: var(--ink); }

/* Photo sets: two columns of photos instead of one long stack */
.figures.photos { display: block; max-width: none; columns: 2; column-gap: clamp(16px, 2vw, 28px); }
.figures.photos figure { break-inside: avoid; margin-bottom: clamp(16px, 2vw, 28px); }

/* ---------- Prev / next ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  margin-top: clamp(80px, 10vw, 144px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.pager .prev, .pager .next { display: flex; flex-direction: column; gap: 2px; }
.pager .next { text-align: right; align-items: flex-end; }
.pager img { width: 160px; aspect-ratio: 4 / 3; object-fit: contain; margin-bottom: 10px; }
.pager span { color: var(--muted); font-size: 13px; }
.pager strong { font-weight: 500; }
.pager a:hover strong, .pager .all:hover { text-decoration: underline; text-underline-offset: 3px; }
.pager .all { font-size: 14px; padding-bottom: 2px; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: start;
}
.about img { width: 100%; max-width: 392px; border-radius: 2px; }
.about h1 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 28px; }
.about p { margin: 0 0 18px; max-width: 60ch; }
.about p:first-of-type { font-size: 20px; line-height: 1.5; }
.about strong { font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(96px, 12vw, 176px);
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer nav { display: flex; gap: 24px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .project-head, .about { grid-template-columns: 1fr; }
  .figures.photos { columns: 1; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .all { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .pager img { width: 100%; }
}

/* ---------- About: contact ---------- */
.about .contact { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.about .contact h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.about .contact p { margin: 0 0 6px; font-size: 17px; }
.about .contact a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
