/* ---------- Tokens ---------- */
:root {
  --bg: #f5f4f0;
  --ink: #111111;
  --muted: #8a8984;
  --rule: #e2e0da;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, p, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
.muted { color: var(--muted); }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Photos: greyscale until hovered ---------- */
.photo { overflow: hidden; background: var(--rule); }
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1);
  transition: filter .9s var(--ease), transform 1.2s var(--ease);
}
.photo:hover img { filter: grayscale(0); transform: scale(1.02); }

/* ---------- Intro ---------- */
.intro {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
  padding: clamp(72px, 16vh, 160px) 0 clamp(64px, 12vh, 120px);
}
.intro h1 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.intro__photo { width: 132px; aspect-ratio: 3 / 4; flex-shrink: 0; }

.inline-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 20px; }
.inline-links a {
  position: relative;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s var(--ease);
}
.inline-links a:hover { background-size: 100% 1px; }

/* ---------- Blocks ---------- */
.block {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.block__label {
  font-family: var(--mono);
  font-size: 11px; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

/* ---------- Lists ---------- */
.item > a, .item > div {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  padding: 0 0 14px;
}
.item:last-child > a, .item:last-child > div { padding-bottom: 0; }
.item__title { font-weight: 500; }
.item__meta { color: var(--muted); text-align: right; }
.arrow {
  display: inline-block; margin-left: 4px;
  opacity: 0; transform: translate(-4px, 2px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

/* detail line that unfolds on hover / focus */
.item__more {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr;
  color: var(--muted);
  transition: grid-template-rows .5s var(--ease), opacity .5s var(--ease), margin .5s var(--ease);
  opacity: 0;
}
.item__more > span { overflow: hidden; max-width: 34em; }

.list:not(.list--static) .item { cursor: default; outline: none; }
.list .item { transition: opacity .4s var(--ease); }

@media (hover: hover) {
  .list:not(.list--static):hover .item:not(:hover) { opacity: .35; }
}
.item:hover .item__more,
.item:focus-within .item__more,
.item:focus .item__more { grid-template-rows: 1fr; opacity: 1; margin-top: 4px; }
.item:hover .arrow, .item:focus-within .arrow { opacity: 1; transform: none; }

/* on touch screens there's no hover, so just show the detail */
@media (hover: none) {
  .item__more { grid-template-rows: 1fr; opacity: 1; margin-top: 2px; }
  .item > a, .item > div { padding-bottom: 20px; }
  .arrow { opacity: 1; transform: none; }
}

/* ---------- Project preview, shown under the section label ---------- */
.preview {
  width: 120px; margin-top: 20px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.preview.is-on { opacity: 1; transform: none; }
@media (hover: none), (pointer: coarse), (max-width: 600px) { .preview { display: none; } }

/* ---------- Elsewhere ---------- */
/* 2fr / 1fr with 16:10 and 4:5 images gives equal heights */
.elsewhere__photos { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 16px; }
.elsewhere__photos .photo { aspect-ratio: 4 / 5; }
.elsewhere__photos .photo--wide { aspect-ratio: 16 / 10; }
.elsewhere p { max-width: 34em; }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between;
  padding-top: 40px; padding-bottom: 48px;
  margin-top: 40px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }
/* keep the list dimming responsive once revealed */
.js .item.reveal.is-in { transition: opacity .4s var(--ease), transform .9s var(--ease); transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .item__more, .photo img, .arrow { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .page { padding: 0 16px; }
  .intro { flex-direction: column-reverse; align-items: flex-start; padding-top: 56px; }
  .intro__photo { width: 104px; }
  .block { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .item > a, .item > div { grid-template-columns: 1fr; }
  .item__meta { text-align: left; }
  .elsewhere__photos { grid-template-columns: 1fr; }
  .elsewhere__photos .photo:not(.photo--wide) { width: 60%; }
}
