/* Layout: quiet white page, one blue accent, Hanken Grotesk throughout.
   Experience pages use a sticky sidebar listing every role. */
:root {
  --bg: #FFFFFF;
  --surface: #F6F8FB;
  --ink: #111A2B;
  --muted: #5B6677;
  --line: #E3E8EF;
  --accent: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF0FD;
  --chart: #2450D8;
  --shadow: 0 1px 2px rgba(17, 26, 43, .05), 0 6px 20px rgba(17, 26, 43, .06);
  --font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1220;
    --surface: #131B2C;
    --ink: #E9EEF6;
    --muted: #9AA5B7;
    --line: #233049;
    --accent: #7FA2FF;
    --accent-ink: #0C1220;
    --accent-soft: #1A2744;
    --chart: #6A8BFA;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1220;
  --surface: #131B2C;
  --ink: #E9EEF6;
  --muted: #9AA5B7;
  --line: #233049;
  --accent: #7FA2FF;
  --accent-ink: #0C1220;
  --accent-soft: #1A2744;
  --chart: #6A8BFA;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: .9688rem; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.theme-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; margin-left: 6px; }
.theme-btn svg { width: 16px; height: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .9688rem; border: 1px solid var(--line); color: var(--ink); background: var(--bg); }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }

/* Sections */
.section { padding-block: clamp(44px, 6vw, 80px); }
.section + .section { border-top: 1px solid var(--line); }
.section > .wrap > h2 { margin-bottom: 24px; }
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.hero-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.hero img.portrait { width: clamp(120px, 16vw, 176px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.hero .title { font-size: 1.1875rem; color: var(--muted); margin-top: 8px; }
.hero .line { font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.4; margin-top: 18px; max-width: 40ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Featured work */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.feature { position: relative; display: grid; gap: 12px; color: var(--ink); text-decoration: none; }
.feature .thumb { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.feature .thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .25s ease; }
.feature:hover .thumb img { transform: scale(1.03); }
.feature .where { font-size: .875rem; color: var(--muted); }
.feature h3 { font-size: 1.25rem; }
.feature:hover h3 { color: var(--accent); }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 22px 20px 22px 0; display: grid; gap: 4px; color: var(--ink); text-decoration: none; min-width: 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9688rem; line-height: 1.4; }
a.stat:hover b { color: var(--accent); }

/* Strengths */
.strengths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 32px; margin-top: 32px; list-style: none; }
.strengths li { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.strengths li b { font-weight: 600; }
.strengths li a { font-size: .9688rem; text-decoration: none; }
.strengths li a:hover { text-decoration: underline; }

/* Experience list (home + experience page) */
.xp-list { list-style: none; border-top: 1px solid var(--line); }
.xp-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.xp-row h3 { font-size: 1.1875rem; }
.xp-row h3 a { color: var(--ink); text-decoration: none; }
.xp-row h3 a::after { content: ""; position: absolute; inset: 0; }
.xp-row:hover h3 a { color: var(--accent); }
.xp-row .role { color: var(--muted); }
.xp-row .dates { color: var(--muted); font-size: .9375rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xp-row .sub { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; list-style: none; font-size: .9375rem; }
.xp-row .sub a { position: relative; z-index: 1; }
.xp-row .tags { grid-column: 2 / -1; margin-top: 8px; }
.xp-group { margin-top: 36px; }
.xp-group:first-of-type { margin-top: 0; }
.xp-group > h2 { font-size: 1rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: 0; }
.xp-row[hidden] { display: none !important; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tag { font-size: .8125rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; position: relative; z-index: 1; }
a.tag:hover { color: var(--accent); background: var(--accent-soft); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-btn { font: inherit; font-size: .9375rem; font-weight: 500; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 16px; }
.filter-btn:hover { border-color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Years chart */
.scroll-x { position: relative; overflow-x: auto; }
table.years { border-collapse: collapse; width: 100%; min-width: 720px; font-size: .9375rem; }
.years th, .years td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.years thead th { font-weight: 500; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.years tbody th { text-align: left; font-weight: 600; white-space: nowrap; padding-left: 0; }
.years tbody th a { color: var(--ink); text-decoration: none; }
.years tbody th a:hover { color: var(--accent); }
.years td.on span { display: block; height: 12px; border-radius: 3px; background: var(--chart); }
.years td.part span { display: block; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--chart) 40%, transparent); }
.years td.tot { font-weight: 700; font-variant-numeric: tabular-nums; }
.years tr:last-child th, .years tr:last-child td { border-bottom: 0; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.about .bio { font-size: 1.1875rem; line-height: 1.6; display: grid; gap: 1em; max-width: 60ch; }
.facts { display: grid; gap: 22px; }
.facts h3 { font-size: .9375rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.facts ul { list-style: none; display: grid; gap: 4px; }
.certs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }

/* Experience detail layout */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-block: 40px 64px; align-items: start; }
.sidebar { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); }
.sidebar h2 { font-size: .875rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: 0; }
.sidebar ul { list-style: none; display: grid; gap: 2px; }
.sidebar ul + h2 { margin-top: 22px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .9688rem; line-height: 1.35; }
.sidebar a:hover { background: var(--surface); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .child a { padding-left: 26px; font-size: .9375rem; }
.side-select { display: none; }
.content { min-width: 0; display: grid; gap: clamp(40px, 5vw, 60px); }
.content > section { display: grid; gap: 18px; scroll-margin-top: 90px; }
.page-head { display: grid; gap: 8px; }
.page-head .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bullets { padding-left: 1.2em; display: grid; gap: 8px; max-width: 70ch; }
.bullets li::marker { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; align-content: start; background: var(--bg); }
a.card { color: var(--ink); text-decoration: none; }
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card .kicker { font-size: .875rem; color: var(--muted); }
.card p { color: var(--muted); font-size: .9688rem; }
.card .go { color: var(--accent); font-weight: 600; font-size: .9375rem; margin-top: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.kv { display: grid; gap: 0; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.steps { list-style: none; display: grid; border-left: 2px solid var(--line); margin-left: 5px; }
.steps li { position: relative; padding: 0 0 22px 22px; display: grid; gap: 2px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--chart); }
.steps li.pending::before { border-style: dashed; }
.steps .when { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps p { color: var(--muted); max-width: 62ch; }

.clubs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.clubs li { border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-weight: 500; }

/* Media */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.gallery.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
figure { margin: 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
figure .frame { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
figure .frame img, figure .frame video { width: 100%; height: auto; }
figure button.zoom { all: unset; cursor: zoom-in; display: block; width: 100%; }
figure button.zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
figcaption { font-size: .9375rem; color: var(--muted); line-height: 1.45; }
figcaption b { color: var(--ink); font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; margin-left: 4px; }
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.covers a { text-decoration: none; color: var(--ink); display: grid; gap: 6px; }
.covers a:hover .frame { border-color: var(--accent); }
.covers .frame img { aspect-ratio: 16 / 9; object-fit: cover; }
.covers span { font-weight: 600; }
.covers small { color: var(--muted); font-size: .875rem; }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(5, 9, 16, .86); }
dialog.lightbox img { max-height: 88vh; width: auto; margin: 0 auto; border-radius: 6px; }
dialog.lightbox p { color: #E9EEF6; text-align: center; padding: 10px; font-size: .9375rem; }
dialog.lightbox .close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: #fff; color: #111A2B; border: 0; border-radius: 8px; padding: 8px 14px; font: 600 .9375rem var(--font); cursor: pointer; }

/* Charts */
.chart { display: grid; gap: 8px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-family: var(--font); font-size: 12px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--chart); pointer-events: none; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { fill: var(--ink); }
.chart .hit:focus { outline: none; }
.chart .peak { fill: var(--ink); font-family: var(--font); font-size: 12px; font-weight: 600; }
.chart-tip { min-height: 1.5em; font-size: .9375rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); }
.pager a span { font-size: .875rem; color: var(--muted); }
.pager a b { font-weight: 600; font-size: 1.0625rem; }
.pager a:hover b { color: var(--accent); }
.pager .next { text-align: right; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px; background: var(--surface); }
.footer-grid { display: flex; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; align-items: flex-start; }
.contact { display: grid; gap: 10px; }
.contact-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact-row .k { color: var(--muted); width: 76px; font-size: .9375rem; }
.contact-row .v { user-select: all; font-weight: 500; }
.copy-btn { font: 600 .8125rem var(--font); border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.fine { color: var(--muted); font-size: .875rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .sidebar { position: static; }
  .sidebar nav { display: none; }
  .side-select { display: grid; gap: 6px; }
  .side-select label { font-size: .875rem; color: var(--muted); font-weight: 600; }
  .side-select select { font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
  .about, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat + .stat { padding: 18px 0; border-left: 0; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .xp-row { grid-template-columns: auto minmax(0, 1fr); }
  .xp-row .dates { grid-column: 2; }
  .certs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
  .gallery:not(.wide) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .site-header .wrap { gap: 8px; }
  .nav a { padding: 6px 7px; font-size: .9063rem; }
  .theme-btn { margin-left: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
.logo-tile { background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; width: fit-content; max-width: 100%; }
.logo-tile img { height: 36px; width: auto; }
.video-embed { position: relative; width: 100%; max-width: 640px; aspect-ratio: 560 / 314; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Logos: wide tiles so full logos (icon + wordmark) always fit */
.logo { flex: none; display: flex; align-items: center; justify-content: center; width: 132px; height: 52px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #FFFFFF; overflow: hidden; }
.logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.logo.mono { background: #EEF2F8; color: #1F355E; font-weight: 700; font-size: .8125rem; letter-spacing: .02em; }
.logo.lg { width: 200px; height: 76px; padding: 12px 18px; border-radius: 12px; margin-bottom: 8px; }
.logo.lg.mono { font-size: 1.125rem; }
@media (max-width: 640px) { .logo { width: 96px; height: 44px; padding: 6px 8px; } .logo.lg { width: 160px; height: 64px; } }
.content .stat b { font-size: clamp(1.625rem, 2.6vw, 2.25rem); }
.stat b { overflow-wrap: anywhere; }
/* Beyond Work: uniform photo tiles */
.photos figure .frame img { aspect-ratio: 4 / 5; object-fit: cover; }
.photos figure.wide .frame img { aspect-ratio: 8 / 5; object-position: center 15%; }
@media (min-width: 641px) { .photos figure.wide { grid-column: span 2; } }
