:root {
  --bg: #fff;
  --ink: #111;
  --muted: #8c8c8c;
  --pad: clamp(20px, 3.5vw, 44px);
  --side: 220px;
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e0e; --ink: #ececec; --muted: #7a7a7a; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--muted); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; transition: color .2s; }
button:hover { color: var(--muted); }

/* ---------- side menu ---------- */
.side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--side);
  padding: var(--pad);
}
.side .name { display: block; font-weight: 400; margin-bottom: 40px; }
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side nav a.on { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

main {
  margin-left: var(--side);
  min-height: 100vh;
  padding: var(--pad);
}

img { display: block; max-width: 100%; height: auto; }
.cap { color: var(--muted); margin: 0; }
.cap b { color: var(--ink); font-weight: 400; }

/* ---------- home ---------- */
.home { max-width: 760px; }
.home .line { font-size: 18px; line-height: 1.5; max-width: 36ch; margin: 8vh 0 6vh; }
.home figure { margin: 0; }
.home img { max-height: 70vh; width: auto; }
.home figcaption { margin-top: 14px; }

/* ---------- work list ---------- */
.list { max-width: 980px; }
.piece { margin: 0 0 12vh; }
.piece:last-child { margin-bottom: 0; }
/* Photos in a row share one height: each grows in proportion to its aspect ratio */
.row { display: flex; gap: 12px; align-items: flex-start; }
.row img { flex: var(--r, 1) 1 0; min-width: 0; width: 100%; height: auto; }
/* A lone image shouldn't be taller than the screen */
.row img:only-child { flex: none; width: auto; max-width: 100%; max-height: 80vh; }
.piece figcaption { margin-top: 16px; }
.piece figcaption b { display: block; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  max-width: 980px;
}
.about .portrait { width: 100%; }
.about p { margin: 0 0 1.2em; max-width: 52ch; }
.contact { list-style: none; padding: 0; margin: 2.4em 0 0; }
.contact li { display: flex; gap: 16px; }
.contact span { width: 80px; color: var(--muted); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .side {
    position: static;
    width: auto;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0;
  }
  .side .name { margin: 0; }
  .side nav { flex-direction: row; gap: 20px; }
  main { margin-left: 0; min-height: 0; }
  .about { grid-template-columns: 1fr; }
  .about .portrait { max-width: 320px; }
}
