/* Shared styles: type-specimen system (paper, ink, flat primaries, hairline rules). */
:root {
  /* page tokens: swap in dark mode */
  --bg: #ece4d1;
  --fg: #14120f;
  /* fixed colours: filled cells keep these in both modes */
  --cream: #ece4d1;
  --black: #14120f;
  --red: #bd2f19;
  --blue: #1f3a8a;
  --sans: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gap: clamp(1rem, 2.4vw, 2rem);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14120f; --fg: #ece4d1; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 1rem/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }

.sheet { max-width: 90rem; margin: 0 auto; padding: 0 var(--gap); }

/* running head and foot */
.head, .foot, .chart-head {
  font: 600 .72rem/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gap);
  padding: .9rem 0;
  border-bottom: 3px solid var(--fg);
}
.head nav { display: flex; gap: 1.25rem; }
.head a, .foot a, .chart-head a { text-decoration: none; }
.head a:hover, .foot a:hover, .chart-head a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-top: var(--gap);
  padding: 1rem 0 1.75rem;
  border-top: 3px solid var(--fg);
}

/* section label */
.chart-head { margin: 0; padding: 1.1rem 0 .9rem; }

/* glyph chart (home) */
.chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--fg);
  border-left: 1px solid var(--fg);
  margin: 0;
  padding: 0;
  list-style: none;
}
.chart > li { display: contents; }
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(13rem, 24vw, 19rem);
  padding: 1rem 1.1rem 1.1rem;
  border-right: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  color: inherit;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.cell .glyph { font: 800 clamp(5.5rem, 12vw, 10.5rem)/.8 var(--sans); letter-spacing: -.06em; margin: 1.5rem 0 1.25rem -.04em; }
.cell .label { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; flex-wrap: wrap; border-top: 1px solid currentColor; padding-top: .6rem; }
.cell .title { font: 700 1.1rem/1.15 var(--sans); }
.cell .tag { font: 500 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.red { background: var(--red); color: var(--cream); }
.blue { background: var(--blue); color: var(--cream); }
a.cell:hover, a.row:hover .gl { background: var(--bg); color: var(--fg); }
a.cell.plain:hover, a.row:hover .gl.plain { background: var(--fg); color: var(--bg); }
/* arrow is decorative: the empty alt text keeps screen readers from reading it */
a.cell::after { content: "\2192"; content: "\2192" / ""; position: absolute; top: .85rem; right: 1rem; font: 700 1.1rem var(--sans); }

/* inner pages */
.title-block { padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--fg); }
.back { display: inline-block; margin-bottom: 1.25rem; font: 600 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }
.big { margin: 0; font: 800 clamp(3.4rem, 12vw, 10rem)/.86 var(--sans); letter-spacing: -.055em; }
.lede { max-width: 30rem; margin: 1.25rem 0 0; font: 400 1.05rem/1.4 var(--serif); }

/* project rows (/projects/) */
.rows { margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--fg); }
.row {
  display: grid;
  grid-template-columns: clamp(6rem, 14vw, 11rem) minmax(0, 1fr) auto;
  align-items: stretch;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
}
.row .gl {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 0 1rem;
  border-right: 1px solid var(--fg);
  font: 800 clamp(4rem, 9vw, 7.5rem)/.8 var(--sans);
  letter-spacing: -.06em;
  transition: background-color .15s, color .15s;
}
.row .body { padding: 1.1rem var(--gap); align-self: center; }
.row .nm { font: 700 clamp(1.2rem, 2.4vw, 1.7rem)/1.1 var(--sans); }
.row .ds { margin: .35rem 0 0; max-width: 36rem; font: 400 .98rem/1.4 var(--serif); }
.row .meta { padding: 1.1rem 0 1.1rem var(--gap); align-self: start; text-align: right; font: 500 .7rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
a.row:hover .nm { text-decoration: underline; text-underline-offset: 4px; }

/* single project page */
.gh {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.5rem;
  padding: .75rem 1.1rem;
  border: 1px solid var(--fg);
  font: 600 .75rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.gh svg { flex: none; width: 1.1rem; height: 1.1rem; fill: currentColor; }
.gh:hover { background: var(--fg); color: var(--bg); }
.gh:active { transform: translateY(1px); }
.shot { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--gap); margin: var(--gap) 0 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--fg); }
.shot figcaption { align-self: end; max-width: 22rem; font: 400 1rem/1.4 var(--serif); }
.proj { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); padding: var(--gap) 0 0; }
.proj .plate-g {
  display: flex;
  align-items: flex-end;
  min-height: clamp(14rem, 32vw, 26rem);
  padding: 1rem 1.25rem;
  border: 1px solid var(--fg);
  font: 800 clamp(9rem, 26vw, 22rem)/.72 var(--sans);
  letter-spacing: -.06em;
}
.proj .notes { align-self: end; max-width: 34rem; }
.proj .notes dl { margin: 0; border-top: 3px solid var(--fg); }
.proj .notes .kv { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--fg); }
.proj .notes dt { font: 600 .72rem/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.proj .notes dd { margin: 0; font: 400 1rem/1.4 var(--serif); }

@media (max-width: 860px) {
  /* three tiles: the first spans the row, the other two sit beneath it */
  .chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart > li:first-child > .cell { grid-column: 1 / -1; }
  .row { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .row .gl { grid-row: 1 / span 2; }
  .row .meta { grid-column: 2; padding: 0 var(--gap) 1rem; text-align: left; }
  .shot, .proj { grid-template-columns: 1fr; }
  .proj .notes .kv { grid-template-columns: 5.5rem 1fr; }
}
@media (prefers-reduced-motion: reduce) { .cell, .row .gl, .gh { transition: none; } .gh:active { transform: none; } }
