/* Edwin Oduor - design system */
:root {
  --bg: #FAF8F5; --bg-alt: #F4F1EC; --surface: #FFFFFF;
  --ink: #14161A; --ink-soft: #383D44; --muted: #6A6E75; --faint: #969BA1;
  --line: #E7E3DC; --line-strong: #D6D0C6;
  --navy: #16233D; --navy-soft: #223357;
  --accent: #B0501F; --accent-ink: #8C3E17; --accent-tint: #F6EBE3;
  --ok: #1B7A4B; --ok-tint: #E6F2EB; --warn: #8A6412; --warn-tint: #F6EEDC;
  --info: #2B4C8C; --info-tint: #E7ECF6; --proto: #5B4B8A; --proto-tint: #EDEAF5;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px;
  --shadow-md: 0 10px 30px -18px rgba(20,22,26,.28);
  --maxw: 1140px; --maxw-narrow: 720px; --nav-h: 68px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::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-body);
  font-size: 16.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15;
  letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.1vw, 1.4rem); }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; color: var(--ink); }
small { font-size: .875rem; }
.serif { font-family: var(--font-serif); font-weight: 400; }
.lede { font-size: clamp(1.05rem, 1.9vw, 1.3rem); line-height: 1.6; color: var(--ink-soft); }
.eyebrow { font-family: var(--font-head); font-size: .75rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 .9rem; }
.eyebrow--muted { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.container--narrow { max-width: var(--maxw-narrow); }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section--navy { background: var(--navy); color: #E9EAF0; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }
.section--navy .lede, .section--navy p { color: #C3C8D6; }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head p { margin-bottom: 0; }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250,248,245,.86);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 1.5rem; height: var(--nav-h); }
.wordmark { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem;
  letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.wordmark span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.35rem; margin-left: auto; }
.nav-links a { color: var(--ink-soft); font-size: .925rem; font-weight: 500;
  padding: .35rem 0; border-bottom: 1.5px solid transparent; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: .45rem .6rem; cursor: pointer; color: var(--ink); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px 0; }

.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-head);
  font-weight: 600; font-size: .925rem; padding: .7rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-align: center; line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-soft); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: .45rem .8rem; font-size: .85rem; }
.btn--link { padding: 0; background: none; color: var(--accent-ink); border: 0; }
.btn--link:hover { color: var(--accent); text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: border-color .15s ease, box-shadow .15s ease; }
.card--link:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card__meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.card__foot { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.25rem;
  padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.project-card { display: flex; flex-direction: column; }
.project-card__desc { color: var(--muted); flex: 1; }
.project-card__contrib { font-size: .875rem; color: var(--ink-soft); background: var(--bg-alt);
  border-radius: var(--radius-sm); padding: .6rem .75rem; margin-top: .9rem; }
.project-card__contrib b { font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--font-head);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 999px; background: var(--bg-alt); color: var(--muted);
  border: 1px solid var(--line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.is-live { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.badge.is-dev { background: var(--info-tint); color: var(--info); border-color: transparent; }
.badge.is-proto { background: var(--proto-tint); color: var(--proto); border-color: transparent; }
.badge.is-research { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.badge.is-concept { background: var(--bg-alt); color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: .15rem .55rem; background: var(--surface); }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .75rem 0 0; }

.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { margin-bottom: 1.1rem; }
.hero__sub { font-size: clamp(1.05rem, 1.9vw, 1.28rem); color: var(--ink-soft); max-width: 34em; }
.hero__note { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.75rem; font-size: .875rem; color: var(--muted); }
.hero__note::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.portrait { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-alt); aspect-ratio: 4 / 5; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__empty { display: grid; place-items: center; height: 100%; padding: 1.5rem; text-align: center;
  color: var(--muted); font-size: .85rem;
  background: repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 12px, #EFEBE5 12px, #EFEBE5 24px); }
.statement { font-family: var(--font-serif); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.4;
  letter-spacing: -0.015em; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 1.4rem; margin: 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.check-list li { position: relative; padding-left: 1.6rem; color: var(--ink-soft); }
.check-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px;
  border-radius: 2px; background: var(--accent); opacity: .85; }
.numbered { list-style: none; counter-reset: n; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.numbered li { counter-increment: n; position: relative; padding-left: 3rem; }
.numbered li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .1em;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 1px solid var(--line); }
.timeline > li { position: relative; padding-bottom: 2.25rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { content: ""; position: absolute; left: -1.5rem; top: .55rem; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline__when { font-family: var(--font-head); font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.timeline h3 { margin: .25rem 0 .15rem; font-size: 1.1rem; }
.timeline__org { color: var(--ink-soft); font-weight: 500; font-size: .95rem; margin-bottom: .5rem; }
.prose { max-width: var(--maxw-narrow); }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote { margin: 2rem 0; padding: .25rem 0 .25rem 1.4rem; border-left: 3px solid var(--accent);
  font-family: var(--font-serif); font-size: 1.2rem; color: var(--ink); }
.prose code { font-family: var(--font-mono); font-size: .875em; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 4px; padding: .1rem .35rem; }
.prose pre { background: var(--navy); color: #E9EAF0; padding: 1.25rem; border-radius: var(--radius);
  overflow-x: auto; font-size: .875rem; }
.prose pre code { background: none; border: 0; color: inherit; padding: 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; font-family: var(--font-head); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.field .error { font-size: .82rem; color: #A4262C; margin-top: .3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: .68rem .8rem; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; }
.form-grid { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr 1fr; }
.form-grid .field--full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.checkbox input { width: auto; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { border: 1px solid var(--line); border-left: 3px solid var(--muted); background: var(--surface);
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1.25rem; font-size: .925rem; }
.alert--success { border-left-color: var(--ok); background: var(--ok-tint); }
.alert--danger { border-left-color: #A4262C; background: #FBECEC; }
.alert--info { border-left-color: var(--info); background: var(--info-tint); }
.site-footer { background: var(--navy); color: #C3C8D6; padding: 3.5rem 0 2rem; }
.site-footer a { color: #E9EAF0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .925rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; font-size: .85rem; }
.page-head { padding: clamp(2.75rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.25rem); border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: .6rem; }
.page-head p { max-width: 46em; color: var(--ink-soft); margin-bottom: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-ink); }
.meta-row { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.meta-row dt { font-family: var(--font-head); font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.meta-row dd { margin: .2rem 0 0; font-weight: 500; }
.cv-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 3rem); }
.cv-doc h2 { border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-top: 2.25rem; font-size: 1.15rem; letter-spacing: 0; }
.cv-doc h2:first-of-type { margin-top: 0; }
.cv-item { margin-bottom: 1.25rem; }
.cv-item__head { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; }
.cv-item__head b { font-weight: 600; }
.cv-item__when { color: var(--muted); font-size: .875rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .925rem; }
table.data th, table.data td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-family: var(--font-head); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-alt); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--bg); }
.admin-body { background: var(--bg-alt); }
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-side { background: var(--navy); color: #C3C8D6; padding: 1.5rem 1rem; }
.admin-side .wordmark { color: #fff; display: block; margin-bottom: 1.5rem; padding-inline: .5rem; }
.admin-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.admin-nav a { display: block; padding: .5rem .6rem; border-radius: var(--radius-sm); color: #C3C8D6; font-size: .9rem; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.admin-main { padding: clamp(1.25rem, 3vw, 2.25rem); }
.admin-top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-top h1 { font-size: 1.5rem; margin: 0; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.stat b { display: block; font-family: var(--font-head); font-size: 1.7rem; line-height: 1; }
.stat span { font-size: .8rem; color: var(--muted); }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2.5rem 1.5rem;
  text-align: center; color: var(--muted); background: var(--surface); }
.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
}

@media (max-width: 980px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: .5rem 24px 1.25rem; }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-links a[aria-current="page"] { border-bottom-color: var(--line); color: var(--accent-ink); }
  .nav-actions { margin-left: 0; padding-top: .75rem; }
  .nav-actions .btn { width: 100%; justify-content: center; }
  .hero__grid { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; aspect-ratio: 1 / 1; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
  .admin-side .wordmark { margin: 0; }
  .admin-nav { display: flex; flex-wrap: wrap; }
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .container { padding-inline: 20px; }
  .card { padding: 1.25rem; }
}
@media print {
  .site-header, .site-footer, .no-print, .btn-row { display: none !important; }
  body { background: #fff; font-size: 11.5pt; }
  .cv-doc { border: 0; padding: 0; border-radius: 0; }
  a { color: #000; text-decoration: none; }
  .section { padding: 0; }
  h1, h2, h3 { break-after: avoid; }
  .cv-item { break-inside: avoid; }
}
