:root {
  --paper: #f6f7f4;
  --ink: #1d232b;
  --muted: #5f6872;
  --rule: #d8dcd6;
  --accent: #2f5d50;
  --accent-soft: #a9c3b8;
  --todo: #b4532a;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --measure: 34rem;
  --margin-col: 7.5rem;
  --gap: 2rem;

  color-scheme: light dark;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161a1f;
    --ink: #e4e7e1;
    --muted: #98a0a8;
    --rule: #2c333a;
    --accent: #8fc2ae;
    --accent-soft: #3d5a50;
    --todo: #e39a76;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: calc(var(--margin-col) + var(--gap) + var(--measure));
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 7rem) 1rem 5rem;
}

p { margin: 0 0 0.75em; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Masthead: the name is the one loud thing on the page */

.masthead {
  padding-left: calc(var(--margin-col) + var(--gap));
  margin-bottom: 4.5rem;
}

.name {
  margin: 0 0 1.25rem calc(-0.06em);
  font-size: clamp(3.25rem, 11vw, 6rem);
  font-weight: 350;
  font-variation-settings: "opsz" 72;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.intro {
  font-size: 1.3125rem;
  line-height: 1.5;
  max-width: 32rem;
  margin-bottom: 1.25rem;
}

.contact {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.print {
  font: inherit;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
}
.print:hover { color: var(--ink); text-decoration-color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .name, .intro, .contact, .print {
    animation: arrive 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  }
  .intro { animation-delay: 0.12s; }
  .contact, .print { animation-delay: 0.24s; }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(0.35rem); }
}

/* Sections: date sits in the margin, text in the measure */

.block + .block { margin-top: 3.5rem; }

h2 {
  margin: 0 0 1.5rem;
  padding-left: calc(var(--margin-col) + var(--gap));
  font-size: 1.75rem;
  font-weight: 400;
  font-style: italic;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.01em;
}

.entry {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, var(--measure));
  column-gap: var(--gap);
}
.entry + .entry { margin-top: 2rem; }

.when {
  margin: 0;
  padding-top: 0.15em;
  text-align: right;
  color: var(--muted);
  font-size: 1rem;
  font-variant-numeric: lining-nums tabular-nums;
}

h3 {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
}

.where {
  margin-bottom: 0.4em;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: inherit;
  font-style: italic;
}

/* Expandable project notes */

details { margin-top: 0.25rem; }

summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  cursor: pointer;
  color: var(--accent);
  font-size: 1rem;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  display: inline-block;
  width: 0.7em;
  font-variant-numeric: lining-nums;
  transition: transform 0.25s ease;
}
details[open] > summary::before { transform: rotate(45deg); }

details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete;
}
details[open]::details-content { block-size: auto; }

@media (prefers-reduced-motion: reduce) {
  details::details-content, summary::before { transition: none; }
}

.more {
  margin-top: 0.9rem;
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
  font-size: 1.0625rem;
}

.note { color: var(--muted); font-style: italic; font-size: 0.9375rem; }

/* The bus figure: real proportions from the project */

.bar { margin: 0 0 1.1rem; }

.bar-track {
  display: flex;
  height: 0.6rem;
  border-radius: 1px;
  overflow: hidden;
  gap: 2px;
}
.seg { flex: var(--w) 0 0; }
.seg-early { background: var(--muted); opacity: 0.45; }
.seg-on { background: var(--accent); }
.seg-late { background: var(--ink); }

.bar figcaption {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.bar b { color: var(--ink); font-weight: 600; }

/* Jobs outside data work: listed, not featured */

.minor { margin-top: 2rem; }

.minor-head {
  padding-left: calc(var(--margin-col) + var(--gap));
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
}

.entry-minor { color: var(--muted); font-size: 1rem; }
.entry-minor p { margin: 0; }
.entry-minor + .entry-minor { margin-top: 0.25rem; }

/* Skills */

.skills {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, var(--measure));
  column-gap: var(--gap);
  row-gap: 0.4rem;
  margin: 0;
}
.skills dt { text-align: right; color: var(--muted); font-size: 1rem; padding-top: 0.15em; }
.skills dd { margin: 0; }


/* Placeholders still waiting on real content */

.todo {
  color: var(--todo);
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

/* Narrow screens: date moves above the entry */

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .masthead, h2, .minor-head { padding-left: 0; }
  .entry, .skills { grid-template-columns: 1fr; }
  .when, .skills dt { text-align: left; padding-top: 0; }
  .skills dd + dt { margin-top: 0.5rem; }
  .intro { font-size: 1.1875rem; }
}

/* Print: one quiet page, ink only */

@media print {
  @page { size: A4; margin: 14mm 16mm; }

  :root {
    --paper: #fff; --ink: #000; --muted: #444; --rule: #bbb;
    --accent: #000; --accent-soft: #000;
    --margin-col: 5.5rem; --gap: 1.25rem; --measure: 100%;
  }

  body { font-size: 9.5pt; line-height: 1.35; }
  .page { max-width: none; padding: 0; }
  .masthead { margin-bottom: 1rem; }
  .name { font-size: 28pt; margin-bottom: 0.4rem; }
  .intro { font-size: 10.5pt; max-width: none; margin-bottom: 0.4rem; }
  .contact { font-size: 9.5pt; color: #000; }
  .print, details { display: none; }
  .entry h3, .entry .where { display: inline; }
  .entry h3 + .where { margin-left: 0.5em; }
  .entry .where + p { margin-top: 0.1em; }
  .entry p { margin-bottom: 0; }
  .block + .block { margin-top: 0.9rem; }
  h2 { font-size: 12pt; margin-bottom: 0.35rem; }
  .entry + .entry { margin-top: 0.45rem; }
  .skills { row-gap: 0.1rem; }
  .minor { margin-top: 0.5rem; }
  .minor-head { font-size: 9.5pt; margin-bottom: 0.1rem; }
  .entry-minor { font-size: 9.5pt; }
  .entry-minor + .entry-minor { margin-top: 0; }
  .entry { break-inside: avoid; }
  .when, .skills dt { font-size: 9.5pt; }
  h3 { font-size: 10.5pt; }
  .where { margin-bottom: 0.15em; }
  a { text-decoration: none; }
  * { animation: none !important; }
}
