*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f7f4ee;
  --raised: #efe9df;
  --ink: #1f1b16;
  --secondary: #5e554a;
  --muted: #7b7266;
  --line: rgba(31, 27, 22, .08);
  --accent: #8a3b2e;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --fast: 160ms;
  --enter: 480ms;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--bg); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 128px 24px 64px;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* Intro */

h1 {
  font: 500 56px/1.08 var(--sans);
  letter-spacing: -0.03em;
  margin: 0 0 24px -0.05em; /* the large D's side bearing pushes it right of the text below */
}

.note { text-wrap: pretty; }
.links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 16px; }
.links a { font-weight: 500; }

.links a, footer a { position: relative; }
.links a::after, footer a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--fast) var(--ease);
}
.links a:hover::after, footer a:hover::after { transform: scaleX(1); transform-origin: left; }

.walk { font-size: 13px; color: var(--muted); transition: color var(--fast) var(--ease); }
.walk:hover { color: var(--ink); }

.arrow { display: inline-block; transition: transform var(--fast) var(--ease); }
.walk:hover .arrow { transform: translateX(4px); }
.projects a:hover .arrow { transform: translate(2px, -2px); }

/* Sections */

section {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 0 24px;
  margin-top: 96px;
}

h2 { margin: 0; font: 400 14px/1.6 var(--sans); color: var(--muted); }

ul { list-style: none; margin: 0; padding: 0; }

.rows li + li { margin-top: 24px; }
.row-main { display: flex; align-items: baseline; gap: 8px; }
.title { font-weight: 500; }
.when { order: 2; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Dotted leader from title to year, as on a menu */
.row-main::after {
  content: "";
  order: 1; flex: 1; min-width: 24px; height: 2px;
  background: radial-gradient(circle, var(--muted) .75px, transparent 1px) left center / 6px 2px repeat-x;
  opacity: .5;
}
.row-main:not(:has(.when))::after { content: none; }
.role { margin: 4px 0 0; }
.note { margin: 4px 0 0; color: var(--secondary); }

.projects li + li { margin-top: 8px; }
.projects li { margin: 0 -16px; padding: 12px 16px; }
.projects a {
  display: block;
  margin: -12px -16px; padding: 12px 16px;
  border-radius: 12px;
  transition: background-color var(--fast) var(--ease);
}
.projects a:hover { background: var(--raised); }
.projects .arrow { color: var(--muted); font-weight: 400; }

.plain li + li { margin-top: 4px; }
.plain .for { color: var(--muted); margin-left: 4px; transition: color var(--fast) var(--ease); }
.plain a:hover .for { color: var(--ink); }
.plain a:hover .arrow { transform: translate(2px, -2px); }

footer {
  display: flex; justify-content: space-between;
  margin-top: 128px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* Motion: hidden only when JS can reveal it */

.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--enter) var(--ease), transform var(--enter) var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.shown { opacity: 1; transform: none; }

@media (max-width: 560px) {
  main { padding-top: 64px; }
  h1 { font-size: 36px; }
  section { grid-template-columns: 1fr; margin-top: 64px; }
  h2 { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Resume page */

.resume { max-width: 864px; padding-top: 48px; }

.bar {
  display: flex; justify-content: space-between;
  margin-bottom: 24px;
  font-size: 14px; color: var(--muted);
}
.bar a { transition: color var(--fast) var(--ease); }
.bar a:hover { color: var(--ink); }
.bar a:first-child:hover .arrow { transform: translateX(-4px); }
.bar a + a:hover .arrow { transform: translate(2px, -2px); }

.pages { display: grid; gap: 24px; }
.pages:empty::before, .sheet {
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(31, 27, 22, .06);
}
.pages:empty::before { content: ""; aspect-ratio: 8.5 / 11; background: #fdfbf7; }
.sheet {
  position: relative; overflow: hidden;
  background: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--enter) var(--ease), transform var(--enter) var(--ease);
}
.sheet.shown { opacity: 1; transform: none; }
.sheet canvas { display: block; width: 100%; height: 100%; }
.sheet a { position: absolute; border-radius: 2px; transition: background-color var(--fast) var(--ease); }
.sheet a:hover { background: rgba(138, 59, 46, .08); }

.blog { padding-top: 48px; }
.blog .bar { margin-bottom: 96px; }

.fallback { color: var(--secondary); }
.fallback a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .resume { padding: 24px 16px 48px; }
  .pages { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { opacity: 1; transform: none; transition: none; }
}
