@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap");

/*
  Type: IBM Plex Sans throughout, headings at 600 weight and tight tracking.
  IBM Plex Mono reserved for dates, labels and the footer — nothing else.
  Colour: ink expressed as alpha over a warm ground, so light and dark stay
  in the same relationship. Dark is not the light palette inverted: it carries
  more chroma, and the muted tiers are tuned separately.
*/
:root {
  color-scheme: light dark;

  --ink-rgb: 31 28 24;
  --ground: #f7f4ee;
  --accent: #a3461f;
  --accent-quiet: #b0693f;
  --focus: #3d5afe;

  --ink: rgb(var(--ink-rgb) / 1);
  --ink-mid: rgb(var(--ink-rgb) / .64);
  --ink-dim: rgb(var(--ink-rgb) / .44);
  --rule: rgb(var(--ink-rgb) / .14);
  --rule-strong: rgb(var(--ink-rgb) / .30);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* five steps, largest ≈2.2rem — restraint reads senior */
  --s-1: calc(.12vw + .84rem);
  --s0:  calc(.18vw + 1.02rem);
  --s1:  calc(.22vw + 1.16rem);
  --s2:  calc(.28vw + 1.36rem);
  --s3:  calc(.36vw + 1.72rem);

  --measure: 38rem;
  --measure-wide: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink-rgb: 238 236 233;
    --ground: #1c1815;          /* warm charcoal — more chroma than the light ground */
    --accent: #f0956a;
    --accent-quiet: #c97b57;
    --focus: #8c9eff;
    --ink-mid: rgb(var(--ink-rgb) / .72);   /* not mirrored: white-on-dark loses contrast */
    --ink-dim: rgb(var(--ink-rgb) / .40);
    --rule: rgb(var(--ink-rgb) / .18);
    --rule-strong: rgb(var(--ink-rgb) / .34);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--s0)/1.68 var(--sans);
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--ground); }
.wrap { max-width: var(--measure-wide); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding: 2.25rem 0 0;
  margin-bottom: 4.5rem;
}
.brand {
  font: 600 var(--s1)/1 var(--sans);
  letter-spacing: -.015em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--accent); }
nav { display: flex; gap: 1.5rem; }
nav a {
  font: 400 var(--s-1)/1 var(--mono);
  letter-spacing: .01em;
  color: var(--ink-dim);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color .15s;
}
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }

/* Headings — never much bigger than the text; weight and tracking carry them */
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -.022em; }
h1 { font-size: var(--s3); line-height: 1.14; margin: 0 0 1.25rem; }
h2 { font-size: var(--s2); line-height: 1.2; margin: 4rem 0 1rem; }
h3 { font-size: var(--s1); line-height: 1.3; margin: 0; }

p { margin: 0 0 1.15rem; max-width: var(--measure); }
.eyebrow {
  font: 400 var(--s-1)/1 var(--mono);
  letter-spacing: .02em;
  text-transform: none;
  color: var(--ink-dim);
  margin: 0 0 1rem;
}
/* .lede sits in the same voice as the paragraphs around it — size and colour match */
.lede { font-size: var(--s0); line-height: 1.68; color: var(--ink); max-width: var(--measure); }
.muted { color: var(--ink-mid); }

/* Links: underline that doesn't skip descenders, colour shifts on hover */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-dim);
  text-decoration-thickness: .09em;
  text-decoration-skip-ink: none;
  text-underline-offset: 3px;
  transition: text-decoration-color .15s, color .15s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }

/* Links row — quiet, mono, no buttons */
.links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2.5rem; }
.btn {
  font: 400 var(--s-1)/1 var(--mono);
  color: var(--ink-mid);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule-strong);
  transition: color .15s, border-color .15s;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }

/* Work list — baselines aligned, tabular mono dates, hairlines */
.timeline { list-style: none; padding: 0; margin: 2.5rem 0 0; border-bottom: 1px solid var(--rule); }
.timeline li {
  display: grid;
  grid-template-columns: 8.5rem 1.5rem 1fr;   /* date · mark · entry */
  align-items: first baseline;
  column-gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.timeline .when { grid-column: 1; }
/* The mark sits outside the text column, so the company name and the role
   below it share one left edge. Rows without a logo leave the cell empty. */
.timeline .logo {
  grid-column: 2;
  align-self: start;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: .1rem;
  object-fit: contain;
  border-radius: 4px;
}
.timeline li > div:last-child { grid-column: 3; }
.timeline .when {
  font: 400 var(--s-1)/1.5 var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  color: var(--ink-dim);
}
.timeline h3 { font-size: var(--s1); }
.timeline .role {
  font: italic 400 var(--s-1)/1.5 var(--sans);
  color: var(--accent-quiet);
  margin: .15rem 0 .6rem;
}
.timeline p { color: var(--ink-mid); }
.timeline p:last-child { margin: 0; }

/* Projects — entries in the same hand as the work list, not cards */
.cards { display: block; margin-top: 2.5rem; border-bottom: 1px solid var(--rule); }
.card {
  display: block;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  background: none;
  color: var(--ink);
  text-decoration: none;
}
a.card:hover h3 { color: var(--accent); }
.card h3 { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .4rem; }
.card p { color: var(--ink-mid); margin: 0; }
.card .more {
  font: 400 var(--s-1)/1 var(--mono);
  color: var(--ink-dim);
  margin-top: .9rem;
}
a.card:hover .more { color: var(--accent); }
.badge {
  font: 400 var(--s-1)/1 var(--mono);
  letter-spacing: .01em;
  text-transform: lowercase;
  color: var(--accent-quiet);
  background: none;
  padding: 0;
}
.badge::before { content: "("; }
.badge::after { content: ")"; }

footer {
  margin-top: 7rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule-strong);
  font: 400 var(--s-1)/1.6 var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-dim);
}

@media (max-width: 600px) {
  .site { margin-bottom: 3rem; }
  nav { gap: 1.25rem; }
  .timeline li { grid-template-columns: 1.5rem 1fr; row-gap: .3rem; }
  .timeline .when { grid-column: 1 / -1; margin-bottom: .2rem; }
  .timeline .logo { grid-column: 1; margin-top: .15rem; }
  .timeline li > div:last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
