/* direction A · Index
   paper and ink. one grotesk at two weights, set big where it matters and small everywhere else.
   a twelve-column grid does the structure; a rule appears only where a list needs one. no boxes,
   no frames around pictures, no labels in capitals. the only colour is the work. */

:root {
  --paper: #eeede8;
  --ink: #121211;
  --ink-2: #6b6a64;
  --margin: 32px;
  --gutter: 24px;
  --gap: clamp(80px, 10vw, 152px);
}

body { background: var(--paper); color: var(--ink); font-size: 17px; line-height: 1.5; }

::selection { background: var(--ink); color: var(--paper); }

a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* a rule across the grid, inside the margins */
.project, .foot, .next {
  background: linear-gradient(var(--ink), var(--ink)) var(--margin) 0 / calc(100% - 2 * var(--margin)) 1px no-repeat;
}

/* ---- the top line ---- */

.top { padding-top: 24px; font-size: 15px; line-height: 20px; }
.top .name { grid-column: 1 / 4; font-weight: 500; }
.top .role { grid-column: 4 / 9; color: var(--ink-2); }
.top nav { grid-column: 9 / 13; display: flex; justify-content: flex-end; gap: 28px; }

/* ---- home: the sentence, big; its picture and its two word lists beside it ---- */

.hero {
  --h1: min(160px, calc((7 * (100vw - 328px) / 12 + 144px) / 6.3));
  margin-top: clamp(64px, 9vw, 136px);
  align-items: start;
}

.hero h1 {
  grid-column: 1 / 8;
  font-size: var(--h1);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

/* the leading is tighter than the letters are tall, so a slot's window is taller than its line
   (1.26em, Switzer's tallest and deepest letters with a little room) and shifted up by half the
   difference, which keeps its baseline on the line's; a little side room keeps the italic whole */
.hero .slot { font-style: italic; height: 1.26em; margin-block: -0.16em; padding-inline: 0.08em; margin-inline: -0.08em; }
.hero .reel > span { height: 1.26em; line-height: 1.26em; }

.hero .side {
  grid-column: 8 / 13;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gutter);
  row-gap: 36px;
  padding-top: calc(var(--h1) * 0.17);
}

.hero .bound { grid-column: 1 / -1; aspect-ratio: 16 / 10; place-items: start; }

.index { display: flex; flex-direction: column; align-items: flex-start; font-size: 15px; line-height: 24px; }
.index-head { color: var(--ink-2); margin-bottom: 6px; }
.index button { color: var(--ink-2); padding: 0 5px; margin-left: -5px; }
.index button:hover { color: var(--ink); }
.index button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---- home: the work as an index, one ruled row a project ---- */

.work { margin-top: clamp(96px, 12vw, 176px); }

.work-head { padding-bottom: 14px; font-size: 15px; line-height: 20px; }
.work-head h2 { grid-column: 1 / 7; font-weight: 500; }
.work-head p { grid-column: 7 / 13; text-align: right; color: var(--ink-2); }

/* the third row takes whatever height the picture adds, so the line stays under the name */
.project { padding-block: 20px 36px; align-items: start; grid-template-rows: auto auto 1fr; }
.project .meta { display: contents; }
.project .num { grid-column: 1 / 2; grid-row: 1; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; padding-top: 12px; }
.project h3 { grid-column: 2 / 7; grid-row: 1; font-size: 44px; line-height: 1.05; font-weight: 500; letter-spacing: -0.032em; }
.project .lede { grid-column: 2 / 7; grid-row: 2; margin-top: 14px; max-width: 30em; color: var(--ink-2); }
.project .kind { grid-column: 7 / 9; grid-row: 1 / span 3; font-size: 15px; line-height: 20px; padding-top: 12px; }
.project .kind span { display: block; color: var(--ink-2); }
.project .cover { grid-column: 9 / 13; grid-row: 1 / span 3; }
.project .cover img { aspect-ratio: 3 / 2; object-fit: cover; }
.project:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }

.projects::after {
  content: "";
  display: block;
  height: 1px;
  margin-inline: var(--margin);
  background: var(--ink);
}

/* ---- case: the name, the line, the facts ---- */

.title { margin-top: clamp(64px, 9vw, 136px); align-items: start; }

.title h1 {
  --t: min(232px, calc((8 * (100vw - 328px) / 12 + 168px) / 4));
  grid-column: 1 / 9;
  grid-row: 1;
  font-size: var(--t);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.05em;
}

.title .lede {
  grid-column: 1 / 8;
  grid-row: 2;
  margin-top: 40px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.facts { grid-column: 9 / 13; grid-row: 1 / span 2; font-size: 15px; line-height: 20px; padding-top: 18px; }
.facts div { padding: 10px 0 12px; border-top: 1px solid var(--ink); }
.facts dt { font-size: 13px; color: var(--ink-2); }

/* ---- case: the text, then the pictures, numbered ---- */

.text { margin-top: var(--gap); }
.prose { grid-column: 4 / 10; font-size: 20px; line-height: 1.5; letter-spacing: -0.005em; }
.prose p + p { margin-top: 0.9em; }

.fig { margin-top: var(--gap); }
.fig .media { grid-column: 1 / -1; grid-row: 1; }
.fig.full .media { margin-inline: calc(-1 * var(--margin)); }
.fig figcaption { display: contents; font-size: 14px; line-height: 20px; }
.fig .n { grid-column: 1 / 2; grid-row: 2; margin-top: 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.fig figcaption p { grid-column: 2 / 7; grid-row: 2; margin-top: 14px; font-size: 14px; color: var(--ink-2); }

.next { margin-top: clamp(96px, 12vw, 176px); padding-top: 20px; align-items: baseline; }
.next-label { grid-column: 1 / 4; font-size: 15px; color: var(--ink-2); }
.next-name { grid-column: 4 / 13; font-size: clamp(56px, 8vw, 128px); font-weight: 500; line-height: 1; letter-spacing: -0.045em; }
.next:hover { text-decoration: none; }
.next:hover .next-name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.1em; }

/* ---- foot ---- */

.foot { margin-top: clamp(96px, 12vw, 176px); padding-block: 16px 32px; font-size: 15px; line-height: 20px; }
.foot .copy { grid-column: 1 / 5; }
.foot nav { grid-column: 5 / 13; display: flex; justify-content: flex-end; gap: 28px; }

/* ---- below a laptop: one column ---- */

@media (max-width: 900px) {
  :root { --margin: 20px; --gutter: 16px; }

  .top .name { grid-column: 1 / 7; }
  .top .role { display: none; }
  .top nav { grid-column: 7 / 13; gap: 20px; }

  .hero { --h1: calc((100vw - 40px) / 6.3); }
  .hero h1 { grid-column: 1 / -1; }
  .hero .side { grid-column: 1 / -1; margin-top: 32px; padding-top: 0; }

  .project { padding-block: 16px 32px; grid-template-rows: none; }
  .project .cover { grid-column: 1 / -1; grid-row: 1; margin-bottom: 16px; }
  .project .num { grid-column: 1 / 2; grid-row: 2; padding-top: 8px; }
  .project h3 { grid-column: 2 / -1; grid-row: 2; font-size: 30px; }
  .project .lede { grid-column: 2 / -1; grid-row: 3; margin-top: 10px; }
  .project .kind { grid-column: 2 / -1; grid-row: 4; padding-top: 12px; }

  .title h1 { --t: calc((100vw - 40px) / 4); grid-column: 1 / -1; }
  .title .lede { grid-column: 1 / -1; margin-top: 28px; }
  .facts { grid-column: 1 / -1; grid-row: 3; padding-top: 32px; }

  .prose { grid-column: 1 / -1; font-size: 18px; }
  .fig .n { grid-column: 1 / 2; }
  .fig figcaption p { grid-column: 2 / -1; }

  .next-label { grid-column: 1 / -1; }
  .next-name { grid-column: 1 / -1; margin-top: 8px; }

  .foot .copy { grid-column: 1 / -1; }
  .foot nav { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
}

/* a phone keeps the sentence and its picture; the word lists stay for wider screens */
@media (max-width: 640px) {
  .index { display: none; }
}
