/* GrantHand: accent only (name, section labels, margin notes, diagram labels). Never body text. */
@font-face { font-family: "GrantHand"; font-weight: 400; font-display: swap; src: url("/fonts/GrantHand-Regular.woff2") format("woff2"); }
@font-face { font-family: "GrantHand"; font-weight: 500; font-display: swap; src: url("/fonts/GrantHand-Medium.woff2") format("woff2"); }
@font-face { font-family: "GrantHand"; font-weight: 700; font-display: swap; src: url("/fonts/GrantHand-Bold.woff2") format("woff2"); }

:root {
  --bg: #fbfaf7;
  --ink: #1b1a18;
  --ink-2: #55524c;
  --ink-3: #77736b;
  --muted: #77736b;
  --rule: #e5e1d8;
  --underline: #cfcabf;
  --accent: #1f5c3a; /* forest green ink: the only colour, used for Grant's hand */

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "GrantHand", "Bradley Hand", "Segoe Print", cursive;

  --t-meta: 0.8125rem;  /* 13 */
  --t-small: 0.9375rem; /* 15 */
  --t-body: 1rem;       /* 16 */
  --t-lead: 1.375rem;   /* 22 */
  --t-label: 1.5rem;    /* 24, GrantHand runs small */
  --t-note: 1.25rem;    /* 20 */

  --col: 35rem;         /* 560px reading column */
  --gutter: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --ink: #ecebe6;
    --ink-2: #aeaaa1;
    --ink-3: #8a867d;
    --muted: #8a867d;
    --rule: #2b2a27;
    --underline: #4d4a44;
    --accent: #86cfa0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 120ms ease;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.page {
  max-width: calc(var(--col) + 3rem);
  margin: 0 auto;
  padding: 7rem 1.5rem 3.5rem;
}

/* Header: GrantHand name, plain lead, facts table */
.name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 4.25rem;
  line-height: 1;
  letter-spacing: 0.005em;
  margin-bottom: 1.5rem;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.42;
  letter-spacing: -0.016em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.lead b { font-weight: 500; color: var(--ink); }

.facts {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem 1rem;
  font-size: var(--t-small);
  line-height: 1.5;
}
.facts dt {
  font-size: 0.75rem;
  line-height: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts dd { margin: 0; color: var(--ink); }
.facts .contact a + a { margin-left: 1rem; }

/* Sections */
.sec { margin-top: 5rem; }
.label {
  font-family: var(--hand);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: 1;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}

/* Work */
.row-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.row-h h3, .row-h h4 { font-size: var(--t-body); font-weight: 500; letter-spacing: -0.006em; }
.row-h h4 { font-size: var(--t-small); }
.when { flex: none; font-size: var(--t-meta); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Favorite prompts */
.prompts li { padding: 0.875rem 0; border-top: 1px solid var(--rule); }
.prompts li:last-child { border-bottom: 1px solid var(--rule); }
.prompts .p-t { font-weight: 500; }
.prompts .p-d { margin-top: 0.125rem; font-size: var(--t-small); color: var(--ink-2); }

/* Elsewhere */
.links { display: grid; grid-template-columns: 6rem 1fr; row-gap: 0.625rem; font-size: var(--t-small); }
.links dt { color: var(--ink-3); }
.links dd { margin: 0; }

/* Margin notes, in Grant's hand */
.note {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 0.5rem;
  font-family: var(--hand);
  font-weight: 400;
  font-size: var(--t-note);
  line-height: 1.1;
  color: var(--accent);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}

.foot {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: var(--t-meta);
  color: var(--ink-3);
}

/* Wide screens: labels hang in the left margin, notes in the right. */
@media (min-width: 1120px) {
  .page { padding-top: 8rem; }
  .sec, .has-note { position: relative; }
  .label {
    position: absolute;
    right: calc(100% + var(--gutter));
    top: -0.1rem;
    margin: 0;
    text-align: right;
    white-space: nowrap;
  }
  .note {
    position: absolute;
    left: calc(100% + var(--gutter));
    top: -0.1rem;
    white-space: nowrap;
    margin: 0;
  }
  .note::before { content: "\2190\00a0"; }
    width: 52rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
  }
}

@media (max-width: 520px) {
  .page { padding: 4.25rem 1.25rem 2.5rem; }
  .name { font-size: 3.25rem; margin-bottom: 1.25rem; }
  .lead { font-size: 1.1875rem; line-height: 1.45; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { margin-top: 0.875rem; line-height: 1.25rem; }
  .facts dt:first-child { margin-top: 0; }
  .sec { margin-top: 4rem; }
  .label { margin-bottom: 1.25rem; }
  .links { grid-template-columns: 5rem 1fr; }
}
/* Work blocks: one line, a diagram, marked-up numbers */
.employer { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 0.625rem; border-bottom: 2px solid var(--ink); }
.employer h3 { font-size: var(--t-body); font-weight: 500; }
.wb { padding: 1.75rem 0; border-bottom: 1px solid var(--rule); }
.wb h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.012em; }
.wline { margin-top: 0.25rem; font-size: var(--t-body); color: var(--ink-2); text-wrap: pretty; }
.wgrid { margin-top: 1rem; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.dia svg { display: block; width: 100%; height: auto; overflow: visible; }
.dia .s { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dia .f { fill: var(--accent); }
.dia text { font-family: var(--hand); font-weight: 500; font-size: 17px; fill: var(--ink); }
@media (min-width: 1120px) { .wb .note { top: 1.75rem; } }
.dia text.g { fill: var(--accent); }
.facts2 li { font-size: var(--t-small); line-height: 1.45; color: var(--ink); }
.facts2 li + li { margin-top: 0.75rem; }
.circ, .und { position: relative; display: inline-block; font-weight: 600; }
.circ::after { content: ""; position: absolute; inset: -0.2em -0.5em -0.15em -0.5em; border: 1.5px solid var(--accent); border-radius: 50% 46% 54% 48% / 58% 50% 46% 54%; transform: rotate(-3deg); pointer-events: none; }
.circ { margin: 0 0.45em 0 0.5em; }
li > .circ:first-child { margin-left: 0.5em; }
.und::after { content: ""; position: absolute; left: -0.1em; right: -0.15em; bottom: -0.12em; height: 2px; background: var(--accent); border-radius: 2px; transform: rotate(-1.2deg); }
.cs-link { display: inline-block; margin-top: 1rem; font-size: var(--t-meta); color: var(--accent); }
.earlier { margin-top: 1.75rem; }
.earlier p { font-size: var(--t-small); color: var(--ink-2); display: flex; justify-content: space-between; gap: 1rem; }
.earlier p + p { margin-top: 0.5rem; }
.plist li { display: grid; grid-template-columns: 4.5rem 9rem minmax(0, 1fr) auto; column-gap: 1rem; padding: 0.625rem 0; border-top: 1px solid var(--rule); font-size: var(--t-small); align-items: center; }
.plist li:last-child { border-bottom: 1px solid var(--rule); }
.plist .pn { font-weight: 500; }
.plist .pd { color: var(--ink-2); }
.th { width: 4.5rem; height: auto; aspect-ratio: 16 / 10; border-radius: 4px; border: 1px solid var(--rule); object-fit: cover; object-position: top; display: block; background: var(--rule); }
.th.none { border-style: dashed; border-color: var(--underline); background: none; display: grid; place-items: center; font-family: var(--hand); font-size: 1rem; color: var(--ink-3); }
.sub { margin: 2rem 0 0.75rem; font-family: var(--hand); font-weight: 500; font-size: 1.25rem; color: var(--accent); }
@media (max-width: 520px) {
  .wgrid { grid-template-columns: 1fr; gap: 1rem; }
  .dia { max-width: 19rem; }
  .plist li { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
  .plist .pd { grid-column: 2 / -1; grid-row: 2; }
  .earlier p { flex-direction: column; gap: 0; }
}

.title-role { font-weight: 400; color: var(--ink-2); }

/* Case studies and 404 */
.back { font-size: var(--t-small); color: var(--ink-2); }
.kicker { margin-top: 3rem; font-family: var(--hand); font-weight: 500; font-size: var(--t-label); color: var(--accent); line-height: 1; }
.cs-title { margin-top: 0.75rem; font-size: 2.25rem; line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
.cs-lead { margin-top: 1.25rem; }
.cs-dia { margin-top: 2.5rem; max-width: 30rem; }
.cs p { color: var(--ink-2); text-wrap: pretty; }
.cs ul li { position: relative; padding-left: 1rem; color: var(--ink-2); line-height: 1.6; }
.cs ul li + li { margin-top: 0.5rem; }
.cs ul li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.375rem; height: 1px; background: var(--ink-3); }
blockquote { margin: 0; padding-left: 1rem; border-left: 2px solid var(--accent); font-size: var(--t-lead); line-height: 1.4; color: var(--ink); }
blockquote cite { display: block; margin-top: 0.375rem; font-size: var(--t-small); font-style: normal; color: var(--ink-3); }
.next { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--t-small); }
@media (max-width: 520px) { .cs-title { font-size: 1.75rem; } }
