:root {
  --bg: #faf7f2;
  --ink: #1c1a17;
  --muted: #5c564d;
  --faint: #8a8378;
  --rule: #e6e0d6;
  --teal: #0f6e6e;
  --teal-dark: #0a4f4f;
  --terracotta: #c2532e;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fast: 160ms;
  --reveal: 700ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --ink: #f1ece4;
    --muted: #b3aca0;
    --faint: #7d766b;
    --rule: #2c2823;
    --teal: #5fc4bd;
    --teal-dark: #8fdcd6;
    --terracotta: #e8825f;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 clamp(20px, 6vw, 96px) 72px;
  max-width: 1200px;
  margin-inline: auto;
}

a { color: var(--teal); text-decoration: none; transition: color var(--fast) var(--ease-out); }
a:hover { color: var(--teal-dark); }
::selection { background: color-mix(in oklab, var(--teal) 22%, transparent); }

a:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 2px; }

.label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  margin: 0;
}

.teal { color: var(--teal); }
.terracotta { color: var(--terracotta); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 40px;
}

.brand {
  font-family: var(--serif);
  font-size: clamp(19px, 1.2vw + 14px, 28px);
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
}

nav { display: flex; gap: clamp(14px, 3vw, 32px); font-size: 14px; white-space: nowrap; }
nav a { color: var(--muted); }
nav a:hover { color: var(--ink); }

.intro { padding: clamp(72px, 12vw, 128px) 0 clamp(56px, 8vw, 96px); max-width: 880px; }


h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
  text-wrap: pretty;
}

.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); margin: 0; max-width: 640px; text-wrap: pretty; }

.block {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
  margin-top: 64px;
}

.intro + .block { margin-top: 0; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 36px;
}

.projects h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 8px;
}

.projects h3 a { color: var(--ink); }

.arrow {
  vertical-align: 0;
  margin-left: 4px;
  transition: transform var(--fast) var(--ease-out);
}

.projects p { font-size: 15px; color: var(--muted); margin: 0 0 16px; text-wrap: pretty; }

.meta { font-size: 12px; font-weight: 500; }
.meta.teal a { color: var(--teal); }

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

.timeline li {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.timeline li:last-child { border-bottom: 0; }

.when { font-size: 13px; color: var(--faint); }
.where { font-weight: 500; }
.what { font-size: 15px; color: var(--muted); }

.links { display: flex; gap: 40px; font-size: 16px; }
.links a, nav a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: color var(--fast) var(--ease-out), background-size 240ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .projects article:hover h3 a { color: var(--teal); }
  .projects article:hover .arrow { transform: translate(2px, -2px); }
  .links a:hover, nav a:hover { background-size: 100% 1px; }
}

footer {
  margin-top: 96px;
  font-size: 13px;
  color: var(--faint);
}

@media (max-width: 720px) {
  .block { grid-template-columns: 1fr; gap: 20px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .links { flex-wrap: wrap; gap: 24px; }
}

/* Reveal: intro on load, sections on scroll. Everything is visible without JS. */
.intro > * { animation: rise var(--reveal) var(--ease-out) both; }
.intro > :nth-child(2) { animation-delay: 60ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

.js .block { opacity: 0; transform: translateY(14px); transition: opacity var(--reveal) var(--ease-out), transform var(--reveal) var(--ease-out); }
.js .block.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro > * { animation: fade 300ms ease-out both; }
  @keyframes fade { from { opacity: 0; } }
  .js .block { transform: none; transition: opacity 300ms ease-out; }
  .arrow, .links a, nav a { transition: none; }
}

.brand .short { display: none; }

@media (max-width: 400px) {
  .brand .full { display: none; }
  .brand .short { display: inline; }
}
