@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  /* Phase-space palette: dark ink on cool plate paper, one ultramarine accent (Cherenkov blue,
     the glow of particles outrunning light in water). --flag* names are kept so the essay
     figure re-skins with the rest of the site. */
  --paper: #eef0f3;
  --ink: #141a33;
  --ink-2: #4b526e;
  --line: #c5cad8;
  --dust: #b0b6c9;
  --flag: #3a36e0;
  --flag-wash: rgba(58, 54, 224, 0.1);
  --flag-text: #3a36e0;
  --measure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1020;
    --ink: #e6e8f2;
    --ink-2: #9ba2bf;
    --line: #2a3050;
    --dust: #333a5e;
    --flag: #8b8cff;
    --flag-wash: rgba(139, 140, 255, 0.14);
    --flag-text: #a3a4ff;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); }
body {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--flag); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--flag-text); }
a:focus-visible { outline: 2px solid var(--flag); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }

/* Hero: name set wide and heavy, the phase portrait beside it */
header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 2.5rem;
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--line);
}
h1 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.role {
  margin-top: 1.25rem;
  font-size: 1.25rem;
  line-height: 1.4;
  max-width: 26rem;
  color: var(--ink-2);
}
.links { margin-top: 1.5rem; font-weight: 600; }
.orbits { margin: 0; }
.orbits-frame {
  position: relative; aspect-ratio: 5 / 4;
  /* The map is a window onto an endless torus, so its edges dissolve rather than crop. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
  mask-composite: intersect;
}
.orbits-frame img, .orbits-live, .orbits-live canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.orbits-live { cursor: crosshair; touch-action: manipulation; }
.orbits.live picture { visibility: hidden; }
/* The hint keeps its space without JS so the caption never changes height when the script starts. */
.orbits:not(.live) .orbits-hint { visibility: hidden; }
.orbits figcaption {
  margin-top: 0.75rem; max-width: 34rem;
  color: var(--ink-2); font-size: 0.875rem; line-height: 1.45;
}

/* Body: dates in the margin, content in a readable measure */
section { padding: 3rem 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
h2 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 1.75rem;
}
.entry {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, var(--measure));
  gap: 0 2rem;
  margin-bottom: 2.25rem;
}
.entry:last-child { margin-bottom: 0; }
.when { color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 0.1rem; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.35; }
.org { color: var(--ink-2); font-weight: 400; }
.entry p { margin-top: 0.4rem; max-width: var(--measure); }
ul { list-style: none; margin-top: 0.6rem; }
li { position: relative; padding-left: 1.1rem; margin-top: 0.45rem; max-width: var(--measure); }
li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.6em;
  width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--flag);
}
.lede { font-size: 1.1875rem; max-width: 44rem; }
/* Experience is a sequence, so it gets an axis: one point per role, the current one in the accent. */
.timeline .entry { position: relative; }
.timeline .entry::before {
  content: ""; position: absolute; left: 0.22rem; top: 0.95em; bottom: -2.25rem;
  border-left: 1px solid var(--line);
}
.timeline .entry:last-child::before { display: none; }
.timeline .when { position: relative; padding-left: 1.25rem; }
.timeline .when::before {
  content: ""; position: absolute; left: 0; top: 0.42em;
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  border: 1.5px solid var(--ink-2); background: var(--paper);
}
.timeline .entry:first-of-type .when::before { border-color: var(--flag); background: var(--flag); }
.skills { display: grid; grid-template-columns: 9.5rem minmax(0, var(--measure)); gap: 0.6rem 2rem; }
.skills dt { color: var(--ink-2); }
footer { padding: 2.5rem 0 3.5rem; color: var(--ink-2); }

@media print {
  :root { --paper: #fff; --ink: #000; --ink-2: #333; --line: #bbb; --flag: #000; --flag-text: #000; }
  body { font-size: 10.5pt; line-height: 1.4; }
  header { grid-template-columns: 1fr; padding: 0 0 1rem; }
  .orbits { display: none; }
  h1 { font-size: 30pt; }
  section { padding: 1rem 0; break-inside: auto; }
  .entry { break-inside: avoid; margin-bottom: 1rem; }
  a { text-decoration: none; }
  .links a::after, footer a::after { content: " (" attr(href) ")"; }
  h2 { break-after: avoid; }
  /* Browsers drop backgrounds in print, so the filled points are drawn as thick borders. */
  li::before { background: none; width: 0; height: 0; border: 0.1875rem solid var(--ink); }
  .timeline .entry::before { bottom: -1rem; }
  .timeline .entry:first-of-type .when::before { border-width: 0.25rem; }
}
@media (max-width: 760px) {
  header { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 1.5rem; }
  .entry, .skills { grid-template-columns: 1fr; }
  .when { margin-bottom: 0.15rem; }
  .skills dd { margin-bottom: 0.6rem; }
  .role { font-size: 1.125rem; }
  .timeline .entry { padding-left: 1.25rem; }
  .timeline .when { padding-left: 0; }
  .timeline .when::before { left: -1.25rem; }
}
/* Footer note for people who read source */
footer code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.875em; overflow-wrap: anywhere; }
footer p + p { margin-top: 0.5rem; }

/* Essay page */
.top { padding: 2rem 0 0; font-weight: 600; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; text-decoration-color: var(--flag); }
article { max-width: var(--measure); padding: 2.5rem 0 3rem; border-bottom: 1px solid var(--line); }
article h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); line-height: 1; }
article .byline { color: var(--ink-2); margin-top: 1rem; }
article h2 { margin: 2.75rem 0 1rem; }
article p { margin-top: 1rem; }
article ul { margin-top: 1rem; }
article li { margin-top: 0.6rem; }
article code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
@media print { .top { display: none; } }


/* Essay figure (flow.js): a canvas that runs the full width of the page column; on phones it goes
   edge to edge. It exists only when the script runs, so without JS (and in print) there is no figure. */
.flow { margin: 2.25rem 0 0.5rem; }
.flow:not(.live) { display: none; }
.flow figcaption { color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.wrap:has(> article) { container-type: inline-size; }
.flow.live { display: block; width: 100%; width: 100cqw; }
.flow-canvas { display: block; width: 100%; touch-action: pan-y; cursor: pointer; opacity: 0; transition: opacity 0.9s ease; }
.flow-canvas.on { opacity: 1; }
.flow.live figcaption { margin-top: 0.75rem; max-width: var(--measure); }
@media (prefers-reduced-motion: reduce) { .flow-canvas { transition: none; } }
@media (max-width: 760px) {
  .flow.live { width: calc(100cqw + 3rem); margin-left: -1.5rem; margin-right: -1.5rem; }
  .flow.live figcaption { margin: 0.75rem 1.5rem 0; }
}
@media print { .flow { display: none; } }
