/* Hanken Grotesk (OFL), self-hosted variable font */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/hanken-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f7f9;
  --ink: #121a24;
  --ink-2: #3a4757;
  --ink-3: #566373;
  --rule: #dce1e8;
  --accent: #1d3f7a;
  --accent-ink: #ffffff;
  --accent-soft: #e2e8f3;
  --select: #c9d6ee;

  --rail: 9.5rem;
  --gap: 2.75rem;
  --measure: 40rem;

  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141c;
    --ink: #e8edf3;
    --ink-2: #b6c0cc;
    --ink-3: #8f9bab;
    --rule: #222c39;
    --accent: #9db8ff;
    --accent-ink: #0e141c;
    --accent-soft: #19253d;
    --select: #2a3d63;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141c;
  --ink: #e8edf3;
  --ink-2: #b6c0cc;
  --ink-3: #8f9bab;
  --rule: #222c39;
  --accent: #9db8ff;
  --accent-ink: #0e141c;
  --accent-soft: #19253d;
  --select: #2a3d63;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--rule) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out);
}

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

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
p, li, dd { text-wrap: pretty; }
ul, ol { padding: 0; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 160ms var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.875rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 1rem; }

.icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Layout: rail + column ---------- */

.page {
  position: relative;
  max-width: calc(var(--rail) + var(--gap) + var(--measure));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 5rem) 1.5rem 3rem;
}

.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
}
.rail { grid-column: 1; }
.col { grid-column: 2; min-width: 0; }

/* ---------- Masthead ---------- */

.masthead { align-items: start; }

.mark {
  display: block;
  margin-left: auto;
  margin-top: 0.85rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3.5px var(--bg);
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.125rem);
  line-height: 1.05;
  font-weight: 680;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.roles {
  margin-top: 0.75rem;
  font-size: 1.1875rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.open {
  margin-top: 0.25rem;
  color: var(--ink-2);
  font-size: 1rem;
}

.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 560;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.25rem 0;
}
.links a .icon { color: var(--accent); }
.links a:hover { color: var(--accent); }

/* ---------- Sections ---------- */

.block { margin-top: clamp(3.5rem, 7vw, 5rem); }
/* first section sits closer to the masthead: name, lead and proof share one screen */
main > .block:first-child { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

.head { align-items: center; margin-bottom: 1.25rem; }
.head .rule { height: 1px; background: var(--rule); }

h2 {
  text-align: right;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.005em;
  color: var(--ink);
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 640;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
h3 .ext { color: var(--accent); width: 1.1em; height: 1.1em; }

.lede { font-size: 1.1875rem; line-height: 1.55; color: var(--ink); max-width: 36em; }

.entry + .entry { margin-top: 2rem; }

.when {
  text-align: right;
  font-size: 0.875rem;
  line-height: 1.6;
  padding-top: 0.12rem;
  color: var(--ink-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dur {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-3);
}
.meta { color: var(--ink-2); margin-top: 0.15rem; }
.meta .loc { white-space: nowrap; }
abbr[title] { text-decoration: none; }
.note { color: var(--ink-2); margin-top: 0.4rem; font-size: 1rem; }
.note + .note { margin-top: 0.25rem; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.points {
  list-style: none;
  margin-top: 0.6rem;
  color: var(--ink-2);
}
.points li {
  position: relative;
  padding-left: 1.1rem;
}
.points li + li { margin-top: 0.35rem; }
.points li::before {
  content: "\2013";
  position: absolute;
  left: 0.1rem;
  top: 0;
  color: var(--ink-3);
}

/* lead project: its proof reads at full ink; in roles, the lead (quantified) bullet does */
.entry.featured .points { color: var(--ink); }
.stop .points li:first-child { color: var(--ink); }

.live {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  vertical-align: 0.15em;
}

/* ---------- Experience as a route ---------- */

.route { list-style: none; }

.stop { position: relative; }
.stop + .stop { margin-top: 2.25rem; }

/* station marker sits in the gutter between rail and column */
.stop::after {
  content: "";
  position: absolute;
  left: calc(var(--rail) + var(--gap) / 2 - 0.4375rem);
  top: 0.3rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
  z-index: 1;
}
/* track to the next stop */
.stop:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) + var(--gap) / 2 - 1.5px);
  top: 0.75rem;
  bottom: -2.25rem;
  width: 3px;
  background: var(--accent);
  transform-origin: top;
}
/* only the present is filled: the line arrives at today */
.stop.now::after { background: var(--accent); }
.stop.now h3 a { display: inline; }

.now-label {
  display: block;
  color: var(--accent);
  font-weight: 650;
}

.route.is-waiting .stop:not(:last-child)::before { transform: scaleY(0); }
.route.is-drawing .stop:not(:last-child)::before {
  transition: transform 1100ms var(--ease-out);
}
.route.is-drawing .stop::before { transition-delay: calc(var(--i, 0) * 220ms); }

/* ---------- Skills ---------- */

.skills .row + .row { margin-top: 0.875rem; }
.skills dt {
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  padding-top: 0.05rem;
}
.skills dd { color: var(--ink-2); }

/* ---------- Contact + footer ---------- */

.cta {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.cta + .meta { margin-top: 0.6rem; }

.foot {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-3);
}


.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* source order is heading first, date second; the grid puts the date back in the rail */
.entry > .col, .entry > .rail { grid-row: 1; }

.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.title-line .live { margin-left: 0; vertical-align: baseline; }

/* inline links get a taller hit area without moving the text */
.meta a, .note a, .cta a { padding-block: 0.3rem; }

.cta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink-3) 85%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 560;
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.is-done { color: var(--accent); border-color: var(--accent); }
.copy .icon-check { display: none; }
.copy.is-done .icon-check { display: block; }
.copy.is-done .icon:not(.icon-check) { display: none; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  position: absolute;
  top: 1.125rem;
  right: 1.5rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 240ms var(--ease-out);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon { width: 1.2rem; height: 1.2rem; grid-area: 1 / 1; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Narrow screens: rail folds into the column ---------- */

@media (max-width: 47.5rem) {
  :root { --gap: 0rem; }
  .page { padding: 4.5rem 1.25rem 2.5rem; }
  .theme-toggle { right: 1.25rem; }
  .links { gap: 0.5rem 1rem; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .rail, .col { grid-column: 1; }

  .masthead .rail { order: 0; }
  .mark { margin: 0 0 1.25rem; }

  .head { grid-template-columns: auto minmax(0, 1fr); column-gap: 0.875rem; }
  .head .rail { grid-column: 1; text-align: left; }
  .head .col { grid-column: 2; }

  .when { text-align: left; padding: 0; margin-bottom: 0.15rem; }
  .dur { display: inline; font-size: inherit; }
  .dur::before { content: "· "; }
  .now-label { display: inline; }
  .meta .loc { display: block; }
  .meta .sep { display: none; }
  .entry > .rail { grid-row: 1; }
  .entry > .col { grid-row: 2; }
  .row > .rail:empty { display: none; }

  .skills dt { text-align: left; }
  .skills .row + .row { margin-top: 1rem; }

  .route .stop { padding-left: 1.75rem; }
  .stop::after { left: 0; top: 0.2rem; }
  .stop:not(:last-child)::before { left: calc(0.4375rem - 1.5px); top: 0.65rem; }

  .foot .rail { display: none; }
}

@media print {
  :root:root:root {
    --bg: #ffffff; --ink: #121a24; --ink-2: #3a4757; --ink-3: #566373;
    --rule: #dce1e8; --accent: #1d3f7a; --accent-ink: #ffffff; --accent-soft: #e2e8f3;
    color-scheme: light;
  }
  .theme-toggle, .skip { display: none; }
  body { background: #fff; color: var(--ink); }
  .page { padding-top: 0; }
  .stop:not(:last-child)::before { transform: none !important; }
}
