:root {
  color-scheme: light dark;
  --paper: #f7f4ee;
  --ink: #1e1c19;
  --muted: #6a645b;
  --line: #ddd7cb;
  --accent: #1f5c4d;
  --on-accent: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --ink: #ece7dd;
    --muted: #a39c90;
    --line: #34312c;
    --accent: #7fc8b4;
    --on-accent: #10201b;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--on-accent);
}
.skip:focus { top: 8px; }

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 32px 56px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 88px;
  align-items: start;
}

/* Intro column */
.intro { position: sticky; top: 72px; }

.photo {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 28px;
}

h1 {
  font: 400 2.75rem/1.08 var(--serif);
  letter-spacing: -0.01em;
}

.headline { margin-top: 18px; font-size: 1.125rem; line-height: 1.45; }
.place { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.button:hover { opacity: 0.88; }
.button.quiet { background: transparent; color: var(--accent); }

.social { display: flex; gap: 20px; margin-top: 20px; font-size: 0.9375rem; }

/* Content column */
section { padding: 36px 0; border-top: 1px solid var(--line); }
section:first-child { padding-top: 0; border-top: 0; }

h2 {
  margin-bottom: 20px;
  color: var(--muted);
  font: 600 0.8125rem/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead { font: 400 1.5rem/1.4 var(--serif); }

h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }

.entries > li {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 20px;
}
.entries > li + li { margin-top: 28px; }

.when {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.where { color: var(--muted); }

.entries ul { margin-top: 8px; }
.entries ul li { position: relative; padding-left: 16px; }
.entries ul li + li { margin-top: 4px; }
.entries ul li::before { content: "\2013"; position: absolute; left: 0; color: var(--muted); }

.projects li + li { margin-top: 18px; }
.projects p { color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.9375rem;
}

footer {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Tablet and phone */
@media (max-width: 860px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding: 40px 16px 40px;
  }
  .intro { position: static; }
  .photo { width: 104px; height: 104px; margin-bottom: 20px; }
  h1 { font-size: 2.5rem; }
  h1 br { display: none; }
  .lead { font-size: 1.3125rem; }
}

@media (max-width: 520px) {
  .entries > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .when { order: 0; }
}

/* Printing, and the CV PDF */
@media print {
  @page { margin: 16mm; }
  :root {
    --paper: #fff;
    --ink: #111;
    --muted: #555;
    --line: #ccc;
    --accent: #111;
    --on-accent: #fff;
  }
  html { font-size: 90%; }
  .page { display: block; max-width: none; padding: 0; }
  .intro { position: static; margin-bottom: 20px; }
  .photo, .links, .skip, footer { display: none; }
  h1 br { display: none; }
  h1 { font-size: 2rem; }
  .headline { margin-top: 6px; }
  section { padding: 14px 0; break-inside: avoid; }
  section:first-child { padding-top: 14px; border-top: 1px solid var(--line); }
  .lead { font-size: 1.125rem; }
  .entries > li + li { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
