:root {
  --bg: #faf7f2;
  --bg-alt: #f2ece2;
  --surface: #ffffff;
  --text: #1f1b16;
  --muted: #6b6258;
  --line: #e4dccf;
  --accent: #001566;
  --accent-soft: #e3e8f7;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(31, 27, 22, .06), 0 8px 24px rgba(31, 27, 22, .06);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #16130f;
  --bg-alt: #1d1914;
  --surface: #241f19;
  --text: #f1ebe2;
  --muted: #a89d90;
  --line: #3a332a;
  --accent: #9aaeff;
  --accent-soft: #1c2238;
  --accent-ink: #16130f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

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

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--text); text-decoration: none; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .925rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}

/* HERO */
.hero { padding: clamp(64px, 12vw, 140px) 0 64px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .02em; min-height: 1.6em; transition: opacity .3s; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 5.5rem); letter-spacing: -.02em; margin-bottom: .15em; }
.hero-role { font-family: var(--serif); font-size: clamp(1.3rem, 3.5vw, 2rem); color: var(--muted); min-height: 1.4em; margin-bottom: 1.2em; }
.role-word { display: inline-block; transition: opacity .35s, transform .35s; border-bottom: 2px solid var(--accent); }
.role-word.out { opacity: 0; transform: translateY(8px); }
.hero-lede { font-size: 1.15rem; max-width: 620px; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .9rem; }
.hero-meta li::before { content: "•"; color: var(--accent); margin-right: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; font: 600 .95rem var(--sans);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }

/* STATS */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stat-num { display: block; font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600; color: var(--accent); }
.stat-label { font-size: .875rem; color: var(--muted); }

/* SECTIONS */
.section { padding: clamp(64px, 10vw, 110px) 0; }
.section.alt { background: var(--bg-alt); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.section-lede { color: var(--muted); max-width: 620px; font-size: 1.05rem; margin-bottom: 2.2em; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* CASES */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.case {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.case:hover, .case.highlight { transform: translateY(-4px); border-color: var(--accent); }
.case-tag { font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; align-self: flex-start; margin-bottom: 16px; }
.case h3 { font-size: 1.35rem; }
.case p { color: var(--muted); font-size: .95rem; flex: 1; }
.case-more { font-weight: 600; font-size: .9rem; color: var(--accent); }

/* MODAL */
.modal {
  border: none; border-radius: var(--radius); padding: 0; max-width: 680px; width: calc(100% - 32px);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(20, 16, 12, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
#modalBody { padding: 40px; max-height: 80vh; overflow-y: auto; }
.modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; width: 40px; height: 40px; border-radius: 50%; }
.modal-close:hover { background: var(--bg-alt); }
.modal h4 { font-family: var(--sans); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--accent); margin: 1.6em 0 .5em; }
.modal ul { padding-left: 1.2em; margin: 0; }
.modal li { margin-bottom: .4em; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: .78rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* PROCESS */
.process { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.process-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step-btn {
  width: 100%; text-align: left; font: 500 1rem var(--sans); color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 14px;
  transition: background .2s, color .2s, border-color .2s;
}
.step-btn:hover { color: var(--text); }
.step-btn[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow); }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); flex-shrink: 0; }
.step-btn[aria-selected="true"] .step-num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.process-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); min-height: 260px; }
.process-panel h3 { font-size: 1.6rem; }
.process-panel .example { margin-top: 1.4em; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: .95rem; }
.process-panel .example strong { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 4px; }
.fade { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateX(8px); } }

/* SKILLS */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font: 500 .9rem var(--sans); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line); transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; min-height: 60px; }
.skill {
  font: 500 .95rem var(--sans); padding: 10px 18px; border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  transition: transform .2s, border-color .2s, background .2s, opacity .25s;
}
.skill:hover { transform: translateY(-2px); border-color: var(--accent); }
.skill[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.skill.hidden { display: none; }
.skill-evidence { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px 28px; min-height: 96px; }
.skill-evidence h3 { font-size: 1.15rem; }
.skill-evidence ul { margin: 0; padding-left: 1.2em; }
.skill-evidence li { margin-bottom: .45em; }
.skill-evidence .where { font-weight: 600; }

/* ASSETS */
.assets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.asset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.asset p { color: var(--muted); font-size: .95rem; margin: 0; }
.asset-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 18px; }
.asset-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* TIMELINE */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -32px; top: 22px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); transition: background .2s;
}
.tl-item.open::before { background: var(--accent); }
.tl-head {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
}
.tl-head:hover { border-color: var(--accent); }
.tl-role { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.tl-org { color: var(--muted); font-size: .92rem; grid-column: 1; }
.tl-date { color: var(--muted); font-size: .85rem; grid-row: 1 / span 2; grid-column: 2; text-align: right; white-space: nowrap; }
.tl-chev { display: inline-block; margin-left: 8px; transition: transform .25s; color: var(--accent); }
.tl-item.open .tl-chev { transform: rotate(90deg); }
.tl-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.tl-item.open .tl-body { grid-template-rows: 1fr; }
.tl-body > div { overflow: hidden; }
.tl-body ul { margin: 12px 0 8px; padding: 0 22px 0 42px; color: var(--muted); }
.tl-body li { margin-bottom: .45em; }

/* EDUCATION */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.edu-degree { font-weight: 600; margin-bottom: .4em; }
.edu .muted { font-size: .92rem; margin: 0; }
.certs { grid-column: 1 / -1; }
.certs ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; }
.certs li { display: flex; flex-direction: column; }
.certs .muted { font-size: .85rem; }

/* CONTACT */
.contact-inner { text-align: center; }
.contact .section-lede { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 12px; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .85rem; text-align: center; }
.footer p { margin: 0; }

/* RESPONSIVE */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr; }
  .process-steps { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .step-btn { white-space: nowrap; }
  .edu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .process-panel, #modalBody { padding: 24px; }
  .tl-head { grid-template-columns: 1fr; }
  .tl-date { grid-row: auto; grid-column: 1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* HERO PHOTO */
.hero-grid { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: center; }
.hero-photo { margin: 0; position: relative; }
.hero-photo::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px;
  border: 2px solid var(--accent); border-radius: 24px; z-index: 0;
}
.hero-photo img {
  position: relative; z-index: 1; display: block; width: 100%; height: auto;
  aspect-ratio: 1; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow);
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { order: -1; width: min(220px, 60vw); }
}

/* ACCESSIBILITY */
.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;
}
.hero-role { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.motion-toggle {
  font: 500 .8rem var(--sans); color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; min-height: 28px;
}
.motion-toggle:hover { color: var(--text); border-color: var(--muted); }
/* Whole card is clickable via the title button */
.case { position: relative; cursor: default; }
.case-link {
  all: unset; cursor: pointer; font: inherit; color: inherit;
}
.case-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.case-link:focus-visible { outline: none; }
.case:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.case:hover { cursor: pointer; }
@media (max-width: 820px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; row-gap: 4px; }
  .nav nav { order: 3; width: 100%; margin-left: 0; }
  .nav-links { display: flex; overflow-x: auto; gap: 20px; padding: 6px 0; }
  .nav-links a { white-space: nowrap; padding: 6px 0; display: inline-block; }
}
