:root {
  --paper: #f4efe6;
  --ink: #1d1a15;
  --muted: #5f584d;
  --rule: #d8cfbf;
  --plate-edge: transparent;
  --serif: "Young Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15130f;
    --ink: #ede6d8;
    --muted: #a89f90;
    --rule: #34302a;
    --plate-edge: #3a362f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

main {
  max-width: 84rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

/* Projects: each one on its own coloured plate, set in a staggered rhythm. */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project {
  position: relative;
  margin: 0 0 4.5rem;
}

.project:last-child { margin-bottom: 0; }

.plate {
  background: var(--c);
  padding: 1.25rem 1.25rem 0;
  border-radius: 4px;
  outline: 1px solid var(--plate-edge);
  outline-offset: -1px;
  overflow: hidden;
  line-height: 0;
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px 3px 0 0;
  transition: transform 0.35s ease;
}

.plate-letter {
  display: block;
  padding: 2rem 0 3rem;
  color: var(--on-c);
  font-family: var(--serif);
  font-size: 6rem;
  line-height: 1;
}

.text { padding-top: 1.25rem; }

.meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 3px;
  background: var(--c);
  color: var(--on-c);
  outline: 1px solid var(--plate-edge);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1;
}

.num { font-variant-numeric: tabular-nums; }

.for::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1px;
  margin-right: 0.75rem;
  vertical-align: 0.3em;
  background: var(--rule);
}

.name {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.name a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c) 75%, var(--ink));
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

/* The whole project is one link: the name's link covers the plate as well. */
.name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
}

.name a:focus { outline: none; }
.name a:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: 8px;
}

.desc {
  max-width: 30rem;
  margin: 0 0 0.6rem;
}

.host {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.host::after { content: " \2197"; }

.project:hover .name a { text-decoration-thickness: 4px; }
.project:hover .plate img { transform: translateY(-6px); }

@media (prefers-reduced-motion: reduce) {
  .plate img { transition: none; }
  .project:hover .plate img { transform: none; }
}

.status {
  margin: 3rem 0;
  color: var(--muted);
}

/* Wider screens: an editorial layout, plates alternate side and size. */

@media (min-width: 48rem) {
  main { padding: 5rem 2.5rem 5rem; }
  .plate { padding: 2.25rem 2.25rem 0; }
  .project { margin-bottom: 6rem; }
}

@media (min-width: 64rem) {
  main { padding: 6rem 3.5rem 6rem; }

  .project {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 2rem;
    align-items: end;
    margin-bottom: 9rem;
  }

  .text { padding-top: 0; padding-bottom: 0.5rem; }
  .plate { padding: 3rem 3rem 0; }

  /* Three steps in the rhythm: wide left, right with text first, small and set in. */
  .project:nth-child(3n + 1) .plate { grid-column: 1 / 8; }
  .project:nth-child(3n + 1) .text { grid-column: 9 / 13; }

  .project:nth-child(3n + 2) .plate { grid-column: 6 / 13; grid-row: 1; }
  .project:nth-child(3n + 2) .text { grid-column: 1 / 5; grid-row: 1; align-self: center; }

  .project:nth-child(3n + 3) .plate { grid-column: 3 / 8; padding: 2.25rem 2.25rem 0; }
  .project:nth-child(3n + 3) .text { grid-column: 9 / 13; align-self: start; padding-top: 2rem; }
}
