/* ==========================================================================
   Robert J. Hill — Portfolio
   Design system: navy + antique gold, serif headings, system sans body.
   No build step. No external requests. Light + dark.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f4f6f9;
  --surface:   #ffffff;
  --ink:       #16202e;
  --ink-2:     #4a5a70;
  --ink-3:     #6d7c92;
  --rule:      #dde3ea;
  --rule-soft: #eaeef3;
  --navy:      #10294a;
  --navy-2:    #1d4374;
  --accent:    #9c762a;
  --accent-2:  #b8903f;
  --accent-bg: #faf5e9;
  --shadow:    0 1px 2px rgba(16, 41, 74, .05), 0 8px 24px -12px rgba(16, 41, 74, .14);
  --shadow-lg: 0 2px 4px rgba(16, 41, 74, .06), 0 20px 48px -20px rgba(16, 41, 74, .22);

  --serif: Cambria, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1120px;
  --prose: 68ch;
  --radius: 4px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0c141f;
    --bg-alt:    #111c2a;
    --surface:   #121d2c;
    --ink:       #e7edf5;
    --ink-2:     #a3b2c6;
    --ink-3:     #8494aa;
    --rule:      #24334a;
    --rule-soft: #1b2839;
    --navy:      #cfe0f5;
    --navy-2:    #a9c6ea;
    --accent:    #d6a951;
    --accent-2:  #e0b86a;
    --accent-bg: #1a2436;
    --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 48px -20px rgba(0, 0, 0, .7);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.05rem); margin-top: 0; }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem); }
h4 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 650; letter-spacing: 0; }
p  { margin: 0 0 1.15em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

a { color: var(--navy-2); text-decoration-color: color-mix(in srgb, var(--navy-2) 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

strong, b { font-weight: 650; color: var(--ink); }

.eyebrow {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
  display: block;
}

.lede {
  font-size: clamp(1.1rem, 1.02rem + .38vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: var(--prose);
}

.prose { max-width: var(--prose); }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 2em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }

.muted { color: var(--ink-2); }
.small { font-size: .9375rem; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.wrap-narrow { max-width: 820px; margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--rule-soft); }
.section--tight { padding-block: clamp(2.25rem, 5vw, 3.5rem); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header__inner {
  max-width: var(--maxw); margin-inline: auto; padding: .85rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  font-family: var(--serif); font-size: 1.0625rem; font-weight: 600;
  color: var(--navy); text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.brand:hover { color: var(--navy); }
.brand span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  font-size: .9375rem; font-weight: 550; color: var(--ink-2); text-decoration: none;
  padding: .45rem .7rem; border-radius: var(--radius); white-space: nowrap;
}
.nav a:hover { color: var(--navy); background: var(--bg-alt); }
.nav a[aria-current="page"] { color: var(--navy); }
.nav a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; background: var(--accent);
  margin: .28rem .1rem -.2rem;
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink); padding: .45rem .6rem; cursor: pointer; font: inherit; line-height: 1;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--pad) 1rem; box-shadow: var(--shadow);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .7rem .25rem; border-bottom: 1px solid var(--rule-soft); border-radius: 0; }
  .nav a:hover { background: none; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1;
  padding: .8rem 1.3rem; border-radius: var(--radius); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-2); color: #fff; }
.btn--ghost { border-color: var(--rule); color: var(--navy); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .btn--primary { background: var(--navy-2); color: #08111c; }
  .btn--primary:hover { background: var(--navy); color: #08111c; }
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.25rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__creds {
  font-size: .8125rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 2rem;
}
.hero__creds span { color: var(--rule); margin-inline: .4rem; }

/* ---------- Stat bar ---------- */
.stats {
  display: grid; gap: 1px; background: var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--surface); padding: 1.5rem 1.4rem; }
.stat__num {
  font-family: var(--serif); font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem);
  font-weight: 600; color: var(--navy); line-height: 1.1; display: block; letter-spacing: -.02em;
}
.stat__label { font-size: .875rem; color: var(--ink-2); margin-top: .5rem; display: block; line-height: 1.45; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: .5rem; }
a.card:hover h3 { color: var(--navy-2); }
.card p { color: var(--ink-2); font-size: .9688rem; }
.card__meta {
  font-size: .8125rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .7rem;
}
.card__more {
  margin-top: auto; padding-top: 1.1rem; font-size: .9375rem; font-weight: 600; color: var(--navy-2);
}
.card__more::after { content: " \2192"; }

/* ---------- Experience timeline ---------- */
.roles { display: grid; gap: 0; }
.role {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 190px 1fr; gap: 2.5rem;
}
.role:last-child { border-bottom: 1px solid var(--rule); }
.role__when {
  font-size: .875rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--accent);
}
.role__where { font-size: .9375rem; color: var(--ink-2); margin-top: .4rem; line-height: 1.5; }
.role__title { margin-bottom: .35rem; }
.role__org { font-weight: 650; color: var(--ink); font-size: 1rem; margin-bottom: 1rem; }
.role ul { margin: 1rem 0 0; padding-left: 1.15em; }
.role li { margin-bottom: .6em; color: var(--ink-2); }
.role li::marker { color: var(--accent); }
@media (max-width: 760px) {
  .role { grid-template-columns: 1fr; gap: .9rem; }
}

/* ---------- Pill list (skills, frameworks) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.pills li {
  font-size: .875rem; color: var(--ink-2); background: var(--bg-alt);
  border: 1px solid var(--rule-soft); border-radius: 999px; padding: .35rem .85rem;
}
.pills--accent li { background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); }

/* ---------- Callout ---------- */
.callout {
  border-left: 3px solid var(--accent); background: var(--bg-alt);
  padding: 1.25rem 1.4rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 2rem 0;
}
.callout p { margin-bottom: .6em; }
.callout h4 { margin-bottom: .5rem; color: var(--navy); }

/* ---------- Case study bits ---------- */
.kv { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 2rem 0; }
.kv > div { background: var(--surface); padding: 1.05rem 1.25rem; display: grid; grid-template-columns: 150px 1fr; gap: 1.25rem; align-items: baseline; }
.kv dt { font-size: .8125rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.kv dd { margin: 0; color: var(--ink); }
@media (max-width: 640px) { .kv > div { grid-template-columns: 1fr; gap: .3rem; } }

.outcomes { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.outcomes li { padding-left: 1.9rem; position: relative; color: var(--ink-2); }
.outcomes li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 11px; height: 11px;
  border: 2px solid var(--accent); border-radius: 2px; transform: rotate(45deg);
}

/* ---------- Article list ---------- */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { border-top: 1px solid var(--rule); }
.article-list li:last-child { border-bottom: 1px solid var(--rule); }
.article-list a { display: block; padding: 1.6rem 0; text-decoration: none; color: inherit; }
.article-list a:hover h3 { color: var(--accent); }
.article-list time { font-size: .8125rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.article-list p { color: var(--ink-2); margin: .55rem 0 0; font-size: .9688rem; max-width: var(--prose); }
.article-list h3 { margin: .55rem 0 0; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; list-style: none; padding: 0; }
.tags li { font-size: .75rem; color: var(--ink-3); background: var(--bg-alt); border-radius: 3px; padding: .2rem .55rem; }

/* ---------- Checklist (insights) ---------- */
.checklist { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1.4rem; counter-reset: ck; }
.checklist > li { counter-increment: ck; padding-left: 3rem; position: relative; }
.checklist > li::before {
  content: counter(ck, decimal-leading-zero);
  position: absolute; left: 0; top: .05em;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding-bottom: .1rem;
}
.checklist h3 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 650; margin-bottom: .35rem; color: var(--ink); }
.checklist p { color: var(--ink-2); margin: 0; font-size: .9688rem; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.contact-list li { background: var(--surface); padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.1rem; }
.contact-list svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.contact-list .label { font-size: .8125rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: .15rem; }
.contact-list a { font-weight: 550; }

/* ---------- Figures & data graphics ----------
   All SVGs use CSS custom properties for fill/stroke rather than hardcoded
   colours, so they follow the light/dark theme automatically. Never put a
   literal hex value in an inline SVG here. */
.figure {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.75rem) clamp(1rem, 2.5vw, 1.5rem);
  margin: 2rem 0 .9rem;
}
.figure svg { display: block; width: 100%; height: auto; }
.figure + .figure-note { margin-top: 0; }
.figure-note { font-size: .875rem; color: var(--ink-3); margin-bottom: 2rem; }

/* The career timeline is a dense summary of the role list beneath it. Below
   the breakpoint the list itself is the better presentation, so the chart
   steps aside rather than becoming a cramped horizontal scroll. */
.figure--timeline { display: none; }
@media (min-width: 800px) {
  .figure--timeline { display: block; }
}

.card-icon { width: 32px; height: 32px; margin-bottom: 1rem; flex: none; }

.dial { width: 100%; max-width: 200px; margin: 0 auto .5rem; display: block; }

/* Small-viewBox figures would otherwise scale their type up with the container.
   Cap the width so label sizes stay close to the intended pixel size. */
.figure--compact svg { max-width: 440px; margin-inline: auto; }

/* A dense diagram shrunk to phone width renders its labels at ~5px. Let it keep
   a legible minimum and scroll sideways instead. The container is focusable so
   the scroll region is reachable by keyboard, not just by touch. */
.figure--scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.figure--scroll svg { min-width: 600px; }
.figure--scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.figure-pair { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 2rem 0; }
.figure-pair .figure { margin: 0; }

/* ---------- Forms ---------- */
.form { max-width: 640px; margin-top: 2.25rem; }
.field { margin-bottom: 1.4rem; }
.field label {
  display: block; font-size: .9375rem; font-weight: 650; color: var(--ink); margin-bottom: .4rem;
}
.field .hint { display: block; font-weight: 400; font-size: .875rem; color: var(--ink-3); margin-top: .15rem; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .7rem .85rem; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 7.5rem; resize: vertical; line-height: 1.55; }
.field input:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b3261e; }
@media (prefers-color-scheme: dark) {
  .field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #f2b8b5; }
}
.field .error { display: none; font-size: .875rem; color: #b3261e; margin-top: .4rem; }
@media (prefers-color-scheme: dark) { .field .error { color: #f2b8b5; } }
.field .error:not(:empty) { display: block; }

/* Honeypot — off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 1.5rem; }
.form-status:empty { margin-top: 0; }
.notice {
  border-left: 3px solid var(--accent); background: var(--bg-alt);
  padding: 1.1rem 1.3rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.notice--ok { border-left-color: #1f7a4d; }
.notice--bad { border-left-color: #b3261e; }
.notice h3 { margin-bottom: .35rem; font-size: 1.0625rem; font-family: var(--sans); font-weight: 650; }
.notice p { margin: 0; color: var(--ink-2); font-size: .9688rem; }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule); background: var(--bg-alt);
  padding-block: clamp(2.5rem, 5vw, 3.5rem); margin-top: auto;
}
.site-footer__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.site-footer__top { display: flex; flex-wrap: wrap; gap: 2rem 3rem; justify-content: space-between; }
.site-footer h4 { color: var(--navy); margin-bottom: .8rem; font-size: .8125rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer a { font-size: .9375rem; color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__name { font-family: var(--serif); font-size: 1.15rem; color: var(--navy); margin: 0 0 .35rem; }
.site-footer__bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  font-size: .875rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
}

/* ---------- Page head ---------- */
.page-head { padding-block: clamp(2.75rem, 6vw, 4.25rem) clamp(1.5rem, 3vw, 2.25rem); border-bottom: 1px solid var(--rule-soft); }
.breadcrumb { font-size: .875rem; color: var(--ink-3); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 1.25rem; }
.center { text-align: center; }
.u-mb-lg { margin-bottom: 2rem; }
.u-mb-xl { margin-bottom: 2.5rem; }
.u-mt-md { margin-top: 1rem; }
.u-gap-xl { gap: 3rem; }
.u-center-inline { margin-inline: auto; }
.u-center-row { justify-content: center; }
.u-pad-tall { padding-block: clamp(4rem, 12vw, 8rem); }
.u-blurb { margin: 0; max-width: 26ch; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.page { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

@media print {
  .site-header, .site-footer, .btn-row, .nav-toggle { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { text-decoration: none; color: #000; }
}
