:root {
  color-scheme: light;
  --bg-1: #eeeeec;
  --bg-2: #eaeae7;
  --bg-3: #e2e2df;
  --text: #151b2c;
  --muted: #5d6474;
  --faint: #a5abb6;
  --line: rgba(21, 27, 44, .12);
  --rail: rgba(21, 27, 44, .16);
  --tile: rgba(21, 27, 44, .06);
  --glyph-bg: #fff;
  --accent: #1c3461;
  --art: #1c3461;
  --art-opacity: .17;
  --grain: .34;
  --grain-mode: multiply;
}
/* Dark: follows the system unless the visitor picked light with the button */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-1: #19191a;
    --bg-2: #141415;
    --bg-3: #0f0f10;
    --text: #e6e8ee;
    --muted: #949aa8;
    --faint: #4c5467;
    --line: rgba(230, 232, 238, .09);
    --rail: rgba(230, 232, 238, .14);
    --tile: rgba(230, 232, 238, .07);
    --glyph-bg: rgba(230, 232, 238, .06);
    --accent: #9fb4e0;
    --art: #9fb4e0;
    --art-opacity: .11;
    --grain: .17;
    --grain-mode: screen;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-1: #19191a;
  --bg-2: #141415;
  --bg-3: #0f0f10;
  --text: #e6e8ee;
  --muted: #949aa8;
  --faint: #4c5467;
  --line: rgba(230, 232, 238, .09);
  --rail: rgba(230, 232, 238, .14);
  --tile: rgba(230, 232, 238, .07);
  --glyph-bg: rgba(230, 232, 238, .06);
  --accent: #9fb4e0;
  --art: #9fb4e0;
  --art-opacity: .11;
  --grain: .17;
  --grain-mode: screen;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-2); -webkit-text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 15%, var(--bg-1), var(--bg-2) 45%, var(--bg-3)) fixed;
  color: var(--text);
  font: 400 17px/1.75 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Concrete grain, generated rather than loaded. It sits under the content, so text, logos and photos stay crisp */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: var(--grain-mode);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--accent); color: var(--bg-2); }
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-color .15s ease;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Faint line drawing behind everything, used as a mask so it takes the theme's colour */
.bg-art { position: fixed; z-index: 0; pointer-events: none; background: var(--art); opacity: var(--art-opacity); -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain; }
.bg-art.yvr { -webkit-mask-image: url(/yvr.svg); mask-image: url(/yvr.svg); aspect-ratio: 4499 / 3620; right: -24vw; bottom: -22vh; width: max(86vw, 760px); }
.head, main, footer { position: relative; z-index: 1; }
main { flex: 1 0 auto; }

.wrap { width: 100%; max-width: 704px; margin: 0 auto; padding: 0 24px; }
.measure { max-width: 568px; }

.head { display: flex; align-items: center; gap: 24px; padding-top: 48px; }
.mark { flex: none; margin-right: auto; white-space: nowrap; font-size: 18px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.head nav { display: flex; gap: 24px; font-size: 15px; }
.head nav a { color: var(--muted); text-decoration: none; }
.head nav a:hover, .head nav a[aria-current="page"] { color: var(--text); }
.theme { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 -7px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; transition: color .15s ease; }
.theme:hover { color: var(--text); }
.theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }

.page { padding-top: 104px; padding-bottom: 96px; }

/* Logos: square files with their own margin, so every tile is treated the same */
.logo, .ilogo { background: #fff; box-shadow: 0 0 0 1px var(--line); object-fit: cover; }
.logo { width: 40px; height: 40px; border-radius: 8px; }
.ilogo { display: inline-block; width: 20px; height: 20px; margin: 0 6px 0 1px; border-radius: 4px; vertical-align: -4px; }
a:has(> .ilogo) { white-space: nowrap; }

/* Home */
.avatar { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 40px; border-radius: 50%; background: #1c3461; box-shadow: 0 0 0 1px var(--line); color: #fff; font-size: 25px; font-weight: 500; letter-spacing: .02em; }
h1 { margin-bottom: 28px; font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.021em; }
.prose p + p { margin-top: 22px; }

/* Experience */
.label { margin: 64px 0 6px; font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.label:first-child { margin-top: 0; }

/* Entries laid out like LinkedIn: logo, then name, details, roles */
.xp { --logo: 40px; --gap: 16px; list-style: none; }
.xp > li { display: grid; grid-template-columns: var(--logo) minmax(0, 1fr); column-gap: var(--gap); align-items: start; padding: 18px 0; }
.xp > li:first-child { padding-top: 10px; }
.xp > li + li { border-top: 1px solid var(--line); }
.xp .logo { margin-top: 3px; }
.xp h3 { font-size: 17px; font-weight: 600; line-height: 1.45; letter-spacing: -.011em; }
.xp h4 { font-size: 16px; font-weight: 500; line-height: 1.45; letter-spacing: -.008em; }
.org { font-size: 15px; line-height: 1.55; }
.meta { font-size: 15px; line-height: 1.55; color: var(--muted); font-variant-numeric: tabular-nums; }
.desc { margin-top: 6px; padding-left: 18px; list-style: disc; font-size: 15px; line-height: 1.65; color: var(--muted); }
p.desc { padding-left: 0; }
.desc li + li { margin-top: 3px; }
.desc li::marker { color: var(--faint); }
/* Roles at the same company, joined by a timeline under the logo */
.roles { list-style: none; margin-top: 16px; }
.roles > li { position: relative; }
.roles > li + li { margin-top: 20px; }
.roles > li::before, .roles > li:not(:last-child)::after { content: ""; position: absolute; left: calc(-1 * (var(--gap) + var(--logo) / 2)); transform: translateX(-50%); }
.roles > li::before { top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.roles > li:not(:last-child)::after { top: 21px; bottom: -22px; width: 1px; background: var(--rail); }
.glyph { display: grid; place-items: center; background: var(--glyph-bg); color: var(--muted); }
.glyph svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skills { margin-top: 10px; font-size: 15px; line-height: 1.75; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 72px; }
.card { position: relative; overflow: hidden; aspect-ratio: 3 / 2; border-radius: 4px; background: var(--tile); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 20, 38, 0) 40%, rgba(12, 20, 38, .68) 100%); }
.card figcaption { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 17px; line-height: 1.3; color: #fff; }
.card figcaption span + span { flex: none; font-size: 15px; letter-spacing: .03em; color: rgba(255, 255, 255, .78); }

/* Contact */
.kv { margin-top: 56px; border-top: 1px solid var(--line); }
.kv > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-size: 15px; font-weight: 500; color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.after-kv { margin-top: 28px; }
.lost p { max-width: 568px; }

.foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 20px 0 36px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot-links { display: flex; gap: 22px; }
.foot a { white-space: nowrap; }
.credit { flex-basis: 100%; margin-top: 10px; font-size: 12px; }

@media (max-width: 560px) {
  .head { padding-top: 32px; }
  .page { padding-top: 72px; padding-bottom: 72px; }
  h1 { font-size: 28px; }
  .head { gap: 14px; }
  .mark { font-size: 17px; }
  .head nav { gap: 14px; font-size: 14px; }
  .bg-art { opacity: calc(var(--art-opacity) * .75); }
  .bg-art.yvr { right: -96vw; bottom: -26vh; width: 210vw; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .xp { --logo: 36px; --gap: 14px; }
  .xp .logo { width: 36px; height: 36px; }
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
/* Theme switch cross-fade (started from site.js) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print {
  body::after, .bg-art, .theme, .cards { display: none; }
  .page { padding-top: 32px; }
}
