.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Space Grotesk, SIL Open Font License 1.1 (fonts/OFL.txt) */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin-ext.woff2) format("woff2");
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin.woff2) format("woff2");
  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;
}

:root {
  --heading: #14223a;
  --ink: #1b2230;
  --text-2: #333c4d;
  --muted: #5b6577;
  --line: #e3e7ee;
  --line-2: #d5dbe5;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --surface: #ffffff;
  --accent: #2f6fb3;
  --accent-soft: #e8f0f9;
  --pill: #d6e4f5;
  --header-bg: rgba(255,255,255,.92);
  --btn-bg: #14223a;
  --btn-bg-hover: #1e3152;
  --btn-fg: #ffffff;
  --band: #14223a;
  --band-text: #dfe6f2;
  --band-muted: #b8c4d8;
  --band-line: #7fb0e6;
  --shadow: rgba(20,34,58,.25);
  --dot: #a9b3c4;
  --radius: 14px;
  --max: 1080px;
}
[data-theme="dark"] {
  --heading: #eef3fa;
  --ink: #e3e9f2;
  --text-2: #c3ccd9;
  --muted: #93a0b4;
  --line: #253046;
  --line-2: #34425c;
  --bg: #0f1622;
  --bg-soft: #131c2b;
  --surface: #172234;
  --accent: #7fb0e6;
  --accent-soft: #1c2d46;
  --pill: #1f3656;
  --header-bg: rgba(15,22,34,.88);
  --btn-bg: #eef3fa;
  --btn-bg-hover: #d6e1ef;
  --btn-fg: #0f1622;
  --band: #0a1019;
  --band-text: #dfe6f2;
  --band-muted: #9fb0c8;
  --band-line: #7fb0e6;
  --shadow: rgba(0,0,0,.5);
  --dot: #56637a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header + nav */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 64px; }
.right { display: flex; align-items: center; gap: 10px; min-width: 0; }
nav { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
.pill {
  color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid transparent;
  transition: color .2s, background-color .2s, border-color .2s;
}
.pill:hover { color: var(--heading); text-decoration: none; background: var(--bg-soft); }
.pill.active { color: var(--heading); border-color: var(--heading); background: var(--pill); }
.brand { color: var(--heading); font-weight: 700; font-size: 16px; margin-left: -16px; flex: none; }

.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  transition: color .2s, background-color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--heading); background: var(--bg-soft); border-color: var(--line-2); }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.theme-toggle.floating { display: none; position: fixed; right: 14px; bottom: 14px; z-index: 6; width: 44px; height: 44px; background: var(--surface); box-shadow: 0 6px 20px -6px var(--shadow); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); border-bottom: 1px solid var(--line); padding: 0; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 88px; }
h1 { font-size: clamp(40px, 5.4vw, 58px); line-height: 1.05; margin: 0 0 10px; color: var(--heading); letter-spacing: -1px; font-weight: 700; }
.role { font-size: 19px; font-weight: 500; color: var(--accent); margin: 0 0 22px; }
.lead { font-size: 20px; color: var(--ink); margin: 0 0 12px; max-width: 34em; }
.sub { color: var(--muted); margin: 0 0 12px; max-width: 36em; }
.sub:last-of-type { margin-bottom: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--btn-bg); transition: background .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn.primary:hover { background: var(--btn-bg-hover); }
.btn.ghost { color: var(--heading); background: transparent; border-color: var(--heading); }
.btn.ghost:hover { background: var(--btn-bg); color: var(--btn-fg); }
.portrait {
  width: 100%; max-width: 380px; aspect-ratio: 1; justify-self: end;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px -20px var(--shadow);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 44px; border-top: 1px solid var(--line); }
.facts div { padding: 18px 14px 0 0; }
.facts strong { display: block; font-size: 26px; color: var(--heading); line-height: 1.2; font-weight: 700; }
.facts span { font-size: 14px; color: var(--muted); line-height: 1.4; display: block; margin-top: 2px; }

/* Sections */
section { padding: 88px 0; }
section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(30px, 3.6vw, 38px); color: var(--heading); margin: 0 0 14px; letter-spacing: -.5px; font-weight: 700; line-height: 1.15; width: fit-content; }
h2::after { content: ""; display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 14px; }
.section-intro { color: var(--muted); max-width: 42em; margin: 18px 0 44px; font-size: 18px; }

.about-text { max-width: 46em; margin-top: 28px; }
.about-text p { margin: 0 0 16px; }
.subhead { font-size: 14px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin: 52px 0 18px; font-weight: 600; }
.subhead.first { margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.card h3 { margin: 0; font-size: 17px; color: var(--heading); line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Highlights */
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 56px; }
.hl { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; transition: box-shadow .3s, border-color .3s; }
.hl:hover { box-shadow: 0 14px 36px -16px var(--shadow); border-color: var(--line-2); }
.hl .kicker { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 600; }
.hl .big { font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1.1; margin: 10px 0 4px; letter-spacing: -.5px; }
.hl h3 { font-size: 19px; color: var(--heading); margin: 0 0 10px; line-height: 1.3; }
.hl p { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.hl .tags { margin-top: auto; }

/* Experience */
.jobs { display: grid; gap: 24px; }
.job {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px;
  transition: box-shadow .3s, border-color .3s;
}
.job:hover { box-shadow: 0 14px 36px -16px var(--shadow); border-color: var(--line-2); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.job h3 { margin: 0 0 4px; font-size: 21px; color: var(--heading); display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.job h3 svg { color: var(--accent); flex: none; }
.job .org { font-size: 18px; font-weight: 600; color: var(--accent); }
.job-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.job-meta > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.period { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 500; color: var(--ink); background: var(--surface); font-size: 14px; }
.job-body { margin-top: 18px; }
.job-body p { margin: 0; color: var(--muted); line-height: 1.7; }
.roles { list-style: none; padding: 0; margin: 0 0 14px; }
.roles li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 15.5px; }
.roles li span:last-child { color: var(--muted); white-space: nowrap; }
.job h4 { margin: 18px 0 10px; font-size: 14px; font-weight: 600; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--ink); font-weight: 500; }

/* Skills */
.lists { margin-top: 36px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px 32px; }
.lists h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.lists ul { margin: 0; padding-left: 16px; font-size: 15px; color: var(--text-2); }
.lists li { margin: 3px 0; }
.lists li::marker { color: var(--dot); }
.lists .dim { color: var(--muted); }

/* Contact */
.contact { background: var(--band); color: var(--band-text); min-height: calc(100vh - 64px - 68px); min-height: calc(100svh - 64px - 68px); display: flex; align-items: center; border: 0; }
.contact .wrap { width: 100%; }
.contact h2 { color: #fff; }
.contact h2::after { background: var(--band-line); }
.contact .section-intro { color: var(--band-muted); }
.contact .btn.primary { background: #fff; color: #14223a; border-color: #fff; }
.contact .btn.primary:hover { background: #e6ecf5; }
.contact .btn.ghost { color: #fff; border-color: #6d7fa0; }
.contact .btn.ghost:hover { background: rgba(255,255,255,.08); }

footer { background: var(--band); color: #8d9bb4; font-size: 14px; border-top: 1px solid rgba(255,255,255,.08); }
footer .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .lists { grid-template-columns: repeat(3, 1fr); }
  .highlights { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; padding-bottom: 56px; }
  .portrait { order: -1; justify-self: start; max-width: 200px; border-radius: 18px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  section { padding: 64px 0; }
  .job { padding: 22px; }
  .job-head { flex-direction: column; }
  .job-meta { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
}
@media (max-width: 600px) {
  header.top .wrap { padding: 0 8px; height: 56px; }
  nav { gap: 0; }
  .pill { padding: 5px 9px; font-size: 13.5px; }
  .brand { font-size: 14px; margin-left: 0; }
  header .theme-toggle { display: none; }
  .theme-toggle.floating { display: grid; }
  .cards, .lists { grid-template-columns: 1fr 1fr; gap: 16px; }
  .facts strong { font-size: 22px; }
  .job h3 { font-size: 19px; }
  .hl .big { font-size: 34px; }
}
@media (max-width: 380px) {
  header.top .wrap { padding: 0 4px; gap: 2px; }
  .pill { padding: 4px 5px; font-size: 12.5px; }
  .brand { font-size: 12.5px; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } body, .job, .hl, .pill, .theme-toggle { transition: none; } }
