
:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #475569;
  --paper: #f6f8fc;
  --line: #dce5f2;
  --accent: #174eb4;
  --surface: #fff;
  --surface-soft: #eef3fb;
  --thumbnail: #dce8fa;
  --book-panel: #e6eefc;
  --footer: #edf3fc;
  --nav-chip: #e6efff;
  --nav-chip-hover: #d7e6ff;
  --nav-chip-ink: #17449b;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: .24em; }
a:focus-visible { outline: 3px solid #2563eb; outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
.wrap { width: min(1152px, calc(100% - 88px)); margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 12px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

nav { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 76px; }
.brand, .navlinks a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; font-weight: 680; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #122756; color: #e7efff; font-size: 11px; letter-spacing: .055em; }
.navlinks { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 9px clamp(13px, 2.5vw, 33px); }
.navlinks a { font-size: .85rem; font-weight: 560; color: var(--muted); }
.navlinks a:hover { color: var(--ink); text-decoration: underline; }
.navlinks .nav-contact { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }


.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 999px; font-size: .86rem; font-weight: 650; text-decoration: none; transition: background-color .18s, border-color .18s; }

main section { padding-top: clamp(52px, 7vw, 96px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 23px; }
.eyebrow, .meta { color: var(--accent); font-size: .77rem; font-weight: 670; letter-spacing: .015em; }
.section-head h2 { margin-top: 7px; font-size: clamp(2.15rem, 4.7vw, 4rem); line-height: 1.03; font-weight: 670; }
.section-head a { flex-shrink: 0; padding-bottom: 4px; color: var(--accent); font-size: .88rem; font-weight: 650; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color .18s, box-shadow .18s; }
.card:hover { border-color: #8aaef0; box-shadow: 0 7px 24px #173b9014; }
.thumb { overflow: hidden; aspect-ratio: 16 / 9; background: var(--thumbnail); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.card h3 { margin: 8px 0; font-size: clamp(1.18rem, 1.9vw, 1.46rem); font-weight: 680; line-height: 1.16; }
.card p { margin-bottom: 17px; color: var(--muted); font-size: .91rem; line-height: 1.57; }
.read { margin-top: auto; color: var(--accent); font-size: .82rem; font-weight: 650; }
.card-text { min-height: 174px; background: var(--surface-soft); }

.section-intro { max-width: 77ch; margin: -5px 0 24px; color: var(--muted); line-height: 1.68; }
.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; padding: 2px clamp(18px, 3.2vw, 38px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.experience-grid article { padding: 25px 0; border-bottom: 1px solid var(--line); }
.experience-grid article:nth-last-child(-n + 2) { border-bottom: 0; }
.experience-grid h3 { margin-top: 8px; font-size: 1.37rem; line-height: 1.15; }
.experience-grid p, .book-copy p { margin-top: 10px; color: var(--muted); font-size: .94rem; line-height: 1.65; }

.book-feature { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.12fr); gap: clamp(24px, 5vw, 67px); align-items: center; padding: clamp(24px, 4.5vw, 54px); border-radius: var(--radius); background: var(--book-panel); }
.book-cover-link { display: block; justify-self: center; width: min(100%, 206px); border-radius: 3px; }
.book-cover { width: 100%; height: auto; border-radius: 3px; box-shadow: 8px 16px 36px #142d6e45; }
.book-copy h3 { font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.08; }
.book-copy .button { margin-top: 18px; color: #fff; background: #163c86; }
.book-copy .button:hover { background: #2456b4; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  nav { min-height: auto; gap: 12px; padding: 14px 0; }
  .navlinks { gap: 6px 13px; }
  .navlinks a { font-size: .77rem; }
  .navlinks .nav-contact { padding: 5px 9px; }

  .section-head { align-items: start; flex-direction: column; gap: 9px; }
  .grid, .experience-grid, .book-feature { grid-template-columns: 1fr; }
  .card-text { min-height: 0; }
  .experience-grid article:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.navlinks .nav-resume {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--nav-chip);
  color: var(--nav-chip-ink);
}
.navlinks .nav-resume:hover,
.navlinks .nav-resume[aria-current="page"] { background: var(--nav-chip-hover); }
.resume { width: min(860px, calc(100% - 48px)); margin-inline: auto; }
.resume-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; padding: 46px 0 25px; }
.resume-heading h1 { font-size: clamp(2.55rem, 6vw, 4.5rem); line-height: 1.02; }
.resume-heading p { margin-top: 9px; color: var(--muted); font-size: 1.02rem; }
.resume-download { background: #163c86; color: white; }
.resume-download:hover { background: #2456b4; }
.resume-sheet { padding: clamp(20px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.resume-sheet section { padding-top: 0; }
.resume-sheet section + section { margin-top: 30px; }
.resume-sheet h2 { padding-bottom: 8px; margin-bottom: 15px; border-bottom: 1px solid var(--line); font-size: 1.32rem; }
.resume-sheet h3 { font-size: 1.07rem; letter-spacing: -.02em; }
.resume-entry + .resume-entry { margin-top: 19px; }
.resume-entry-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.resume-entry-head span, .resume-date { color: var(--muted); font-size: .85rem; }
.resume-job { color: var(--accent); font-weight: 600; }
.resume-sheet p, .resume-sheet li { font-size: .94rem; line-height: 1.55; }
.resume-sheet p { margin-top: 6px; }
.resume-sheet ul { margin: 7px 0 0; padding-left: 21px; }
.resume-sheet li + li { margin-top: 3px; }
.resume-links { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-bottom: 26px; }
.resume-links a { color: var(--accent); font-size: .87rem; font-weight: 650; }
@media (max-width: 650px) {
  .navlinks .nav-resume { padding: 5px 9px; }
  .resume { width: calc(100% - 32px); }
  .resume-heading { padding-top: 30px; }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f0f5ff;
    --muted: #b7c6e1;
    --paper: #0c1425;
    --line: #304364;
    --accent: #a9c9ff;
    --surface: #141f36;
    --surface-soft: #172642;
    --thumbnail: #213453;
    --book-panel: #192a4c;
    --footer: #101c31;
    --nav-chip: #223863;
    --nav-chip-hover: #2d487a;
    --nav-chip-ink: #d4e5ff;
  }
  [data-theme="dark"] .resume-download,
  [data-theme="dark"] .book-copy .button { background: #305fac; }
  [data-theme="dark"] .resume-download:hover,
  [data-theme="dark"] .book-copy .button:hover { background: #356bc5; }
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--nav-chip); }
.theme-toggle:focus-visible { outline: 3px solid #528bf4; outline-offset: 4px; }
.theme-toggle[hidden], .theme-toggle .theme-sun,
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
.theme-toggle svg { width: 19px; height: 19px; }
@media (max-width: 650px) {
  .theme-toggle { width: 36px; height: 36px; }
}
@media print {
  header, footer, .skip-link, .resume-download { display: none !important; }
  body { background: white; }
  .resume { width: 100%; }
  .resume-heading, .resume-sheet { padding: 0; border: none; }
  .resume-heading { margin-bottom: 18px; }
  .resume-entry { break-inside: avoid; }
}

:root {
  --contact-space: 70px;
  scroll-padding-bottom: calc(var(--contact-space) + env(safe-area-inset-bottom));
}

body {
  padding-bottom: calc(var(--contact-space) + env(safe-area-inset-bottom));
}

.site-header { border-bottom: 1px solid var(--line); }
.site-header nav { gap: clamp(14px, 2.4vw, 28px); }
.site-header .brand { flex: 0 1 auto; }
.site-header .brand-name { display: inline; }
.site-header .navlinks { gap: 7px; }
.site-header .navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
}
.site-header .navlinks a:hover,
.site-header .navlinks [aria-current="page"] { background: var(--nav-chip-hover); }
.site-header .theme-toggle { margin-left: 3px; }

.portrait-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 66px);
  align-items: center;
  padding-top: clamp(36px, 6vw, 76px);
  padding-bottom: clamp(12px, 3.5vw, 40px);
}
.portrait-hero h1,
.page-heading h1 {
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -.03em;
}
.portrait-hero p {
  max-width: 58ch;
  margin-top: 15px;
  font-size: clamp(1rem, 1.45vw, 1.1rem);
  color: var(--muted);
  line-height: 1.65;
}
.portrait-hero .hero-lead { color: var(--ink); margin-top: 20px; }
.portrait-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  aspect-ratio: 1.14;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.button-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.button-outline:hover { background: var(--nav-chip); }

.inner-page { padding-block: clamp(38px, 6vw, 68px) 30px; }
.inner-page > section:first-of-type { padding-top: 34px; }
.page-heading p { max-width: 60ch; margin-top: 14px; color: var(--muted); line-height: 1.6; }
.inner-page section { scroll-margin-top: 18px; }
.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-card .button { overflow-wrap: anywhere; }

.contact-bar {
  position: fixed;
  z-index: 5;
  inset: auto 0 0;
  padding-block: 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--footer);
}
.contact-bar .wrap,
.contact-bar .contact-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 17px;
}
.contact-bar .wrap { justify-content: space-between; }
.contact-bar a { color: var(--accent); font-size: .88rem; font-weight: 650; text-decoration: none; }
.contact-bar a:hover { text-decoration: underline; }
.contact-bar .contact-label { color: var(--ink); font-weight: 680; }
.contact-bar .contact-links { min-width: 0; }
.contact-bar .contact-links a { overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .site-header nav { flex-wrap: wrap; padding-block: 13px; }
}
@media (max-width: 700px) {
  :root { --contact-space: 100px; }
  .site-header nav { flex-direction: column; align-items: start; gap: 10px; }
  .site-header .navlinks { justify-content: flex-start; }
  .site-header .navlinks a { min-height: 34px; padding-inline: 8px; }
  .portrait-hero { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .portrait-frame { width: 100%; max-width: 485px; }
  .contact-bar .wrap { justify-content: flex-start; column-gap: 16px; }
}
@media print {
  body { padding-bottom: 0; }
}
