:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --ink: #16202e;
  --muted: #5a6677;
  --line: #dde2ea;
  --brand: #1f3a5f;
  --accent: #2f6fdb;
  --on-brand: #ffffff;
  --card: #ffffff;
  --map-center: #1f3a5f;
  --map-branch: #e6edf9;
  --map-leaf: #f4f6fa;
  --map-line: #9fb3d1;
  --map-ink: #16202e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1621; --bg-alt: #141c29; --ink: #e8edf5; --muted: #9aa6b8; --line: #263245;
    --brand: #8fb4f5; --accent: #8fb4f5; --on-brand: #0f1621; --card: #172131;
    --map-center: #2f6fdb; --map-branch: #1d2b42; --map-leaf: #172131; --map-line: #3b5278; --map-ink: #e8edf5;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -.02em; max-width: 22ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding-left: 1.2em; }
.muted { color: var(--muted); }
.sub { color: var(--muted); max-width: 62ch; margin-bottom: 2rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--on-brand); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: 20px; font-size: .95rem; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover { color: var(--ink); }
.nav nav a.btn { color: var(--on-brand); }

/* buttons */
.btn { display: inline-block; background: var(--brand); color: var(--on-brand); padding: 12px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 2px solid var(--brand); }
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--bg-alt); filter: none; }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

section { padding: 72px 0; }
section.alt { background: var(--bg-alt); }

/* hero */
.hero { padding: 88px 0 64px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: 1rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 1.2rem 0 1.8rem; }

/* stats */
.stats { padding: 0; border-block: 1px solid var(--line); background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-block: 28px; }
.stats strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--brand); }
.stats span { color: var(--muted); font-size: .9rem; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.when { color: var(--muted); font-size: .95rem; padding-top: 2px; }
.org { color: var(--muted); margin-bottom: .6em; }
.what ul li { margin-bottom: .4em; }

/* sops */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 1.6em; position: relative; margin-bottom: .35em; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.why dt { font-weight: 700; margin-top: .8em; }
.why dd { margin: .15em 0 0; color: var(--muted); }
.map-fig { margin: 2.5rem 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.map-scroll { overflow-x: auto; }
#mindmap { display: block; width: 100%; min-width: 760px; height: auto; }
#mindmap text { font: 13px -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; fill: var(--map-ink); }
#mindmap .center text { fill: #fff; font-weight: 700; font-size: 16px; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card p { color: var(--muted); margin: 0; }

/* project */
.project { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; max-width: 760px; }

/* skills */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.three h3 { margin-top: 1.4em; }
.three > div > h3:first-child { margin-top: 0; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: .4em; }

/* contact + footer */
.contact { background: var(--brand); color: var(--on-brand); }
.contact .sub { color: inherit; opacity: .85; }
.contact .btn { background: var(--on-brand); color: var(--brand); border-color: var(--on-brand); }
.contact .btn-ghost { background: transparent; color: var(--on-brand); }
.contact .btn-ghost:hover { background: rgba(255,255,255,.12); }
footer { padding: 24px 0; color: var(--muted); font-size: .9rem; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.foot a { color: var(--muted); }

@media (max-width: 860px) {
  .nav nav a:not(.btn) { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; }
  .two, .three, .cards { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
}
@media print { .nav, .skip { display: none; } section { padding: 24px 0; } }
