/* Layout: a single reading column (max 1040px) with a two-column hero; case pages open with an "at a glance" file card, then prose and flow diagrams. */
:root {
  --bg: #fbfcfd;
  --surface: #f1f4f7;
  --ink: #15202b;
  --muted: #56636f;
  --line: #dbe1e7;
  --accent: #1d4f7a;
  --accent-ink: #ffffff;
  --signal: #b4561a;
  --chip: #e6eef5;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-label: var(--font-body);
  --max: 1040px;
  --read: 68ch;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: 3.1rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151b; --surface: #17202a; --ink: #e7ecf1; --muted: #a2afbc; --line: #2a3644;
    --accent: #8db9e2; --accent-ink: #0f151b; --signal: #e39a63; --chip: #1d2b3a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f151b; --surface: #17202a; --ink: #e7ecf1; --muted: #a2afbc; --line: #2a3644;
  --accent: #8db9e2; --accent-ink: #0f151b; --signal: #e39a63; --chip: #1d2b3a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: -0.005em; }
h2 { font-size: var(--step-2); margin: 0 0 16px; }
h3 { font-size: var(--step-1); margin: 22px 0 8px; }
p, li { max-width: var(--read); }
.label-row, .meta { font-family: var(--font-label); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 16px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }

/* Hero */
.hero { padding-block: 56px 36px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; align-items: center; }
.hero h1 { font-size: var(--step-4); margin: 0; }
.hero .title { font-family: var(--font-display); font-style: italic; font-size: var(--step-2); color: var(--accent); margin: 6px 0 14px; font-weight: 500; text-wrap: balance; }
.hero .proofline { font-size: 0.95rem; color: var(--muted); margin: 0 0 22px; }
.hero .thesis { font-size: var(--step-1); line-height: 1.55; margin: 0 0 18px; }
.hero .open { font-weight: 600; margin: 0; }
.headshot { width: 240px; height: 290px; object-fit: cover; object-position: center 18%; border-radius: 6px; filter: saturate(0.92); box-shadow: 0 1px 2px rgb(21 32 43 / 0.08), 0 8px 24px rgb(21 32 43 / 0.08); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn { transition: background-color .15s, color .15s; display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--accent); text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { background: var(--chip); }
.btn.primary:hover { background: var(--accent); filter: brightness(1.12); }

/* Stats: a ruled metrics strip, not cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-block: 8px 48px; }
.stat { padding: 18px 18px 18px 0; }
.stat + .stat { padding-left: 18px; border-left: 1px solid var(--line); }
.stat .num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .label { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }

/* Range */
.range-grid { margin: 0; display: grid; border-top: 1px solid var(--line); }
.range-grid div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 6px 24px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.range-grid dt { font-family: var(--font-label); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.range-grid dd { margin: 0; line-height: 1.6; }
.range-grid .chip { display: inline; background: none; border: 0; padding: 0; font-size: 1rem; color: var(--ink); border-radius: 0; white-space: nowrap; }
.range-grid .chip + .chip::before { content: "\00a0\00b7\0020"; color: var(--muted); white-space: normal; }

/* Certifications */
.cert-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.cert-list li { max-width: none; margin: 0; padding-block: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.cert-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.cert-meta { font-size: 0.9rem; color: var(--muted); }
.cert-list a { font-size: 0.88rem; }
.cert-list .degree { grid-column: 1 / -1; }

/* Sections */
section { padding-block: 16px 56px; }
.about p { margin: 0 0 14px; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; }

/* Work index */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.card { display: block; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.cards .card h3 { margin: 0 0 6px; color: var(--accent); font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; text-transform: none; letter-spacing: -0.005em; }
.card p { margin: 0; font-size: 0.97rem; color: var(--muted); }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--signal); }

/* Experience timeline */
.timeline { display: grid; border-top: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 24px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.role .meta { padding-top: 4px; font-variant-numeric: tabular-nums; }
.role .head { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }
.role p { margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-family: var(--font-label); font-size: 0.8rem; background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 2px 9px; border-radius: 999px; line-height: 1.5; }

/* Lists of references */
.proof { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.proof li { font-size: 0.97rem; padding-left: 16px; position: relative; margin: 0; }
.proof li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 7px; height: 1px; background: var(--signal); }
section h3 { font-family: var(--font-label); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }

.note { font-size: 0.88rem; color: var(--muted); margin: -4px 0 10px; }

/* Case study pages */
.page-head { padding-block: 48px 8px; }
.page-head h1 { font-size: var(--step-3); margin: 0 0 14px; }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin: 22px 0 8px; }
.glance div { padding: 14px 16px; min-width: 0; }
.glance div + div { border-left: 1px solid var(--line); }
.glance dt { font-family: var(--font-label); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.glance dd { margin: 0; font-size: 0.95rem; line-height: 1.4; }
.outcomes { border-left: 3px solid var(--signal); padding: 4px 0 4px 20px; margin: 28px 0; }
.outcomes h3 { margin-top: 0; font-family: var(--font-label); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.outcomes ul { margin: 0; padding-left: 18px; }
.case { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 32px; }
.case h2 { margin-top: 12px; }
.label-row { margin: 22px 0 4px; }
ul { padding-left: 22px; }
li { margin: 5px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th { text-align: left; font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line) !important; padding: 8px 12px 8px 0 !important; }
td { border-bottom: 1px solid var(--line) !important; padding: 9px 12px 9px 0 !important; vertical-align: top; }

/* Flow diagrams (real sequences, so numbered) */
.flow { list-style: none; padding: 0; margin: 24px 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; counter-reset: step; }
.flow li { position: relative; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 0.92rem; line-height: 1.45; max-width: none; counter-increment: step; }
.flow li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-label); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; color: var(--signal); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.flow li strong { display: block; font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
.flow li + li::after { content: "\2192"; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.flow-note { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }

/* Architecture before/after: two parallel rows, same columns, so the change reads at a glance */
.arch { display: grid; gap: 14px; margin: 26px 0 8px; }
.arch-row { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 16px 18px 14px; }
.arch-label { font-family: var(--font-label); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.arch-row.after .arch-label { color: var(--accent); }
.arch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.node { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: var(--bg); min-width: 0; }
.node.cloud { border: 1.5px solid var(--accent); }
.node-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.25; margin-bottom: 8px; }
.node.cloud .node-name { color: var(--accent); }
.node .chips { margin-top: 0; gap: 5px; }
.chip.hot { border-color: var(--signal); color: var(--signal); }
.chip.key { border-color: var(--accent); color: var(--accent); }
.wires { display: grid; gap: 12px; font-size: 0.8rem; line-height: 1.35; color: var(--muted); text-align: center; }
.wire { border-top: 1px solid var(--muted); padding-top: 5px; position: relative; }
.wire::after { position: absolute; top: -0.62em; font-size: 0.9rem; line-height: 1; color: var(--muted); background: var(--surface); padding: 0 2px; }
.wire.right::after { content: "\25B8"; right: -4px; }
.wire.left::after { content: "\25C2"; left: -4px; }
.arch-foot { max-width: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.arch-foot b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.arch-row.before .arch-foot b { color: var(--signal); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 32px; padding-block: 28px 44px; color: var(--muted); font-size: 0.92rem; }
.site-footer a { color: var(--muted); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .headshot { order: -1; width: 150px; height: 180px; }
  .hero { padding-block: 28px 24px; }
  .hero h1 { font-size: 2.4rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; }
  .cert-list { grid-template-columns: 1fr; }
  .range-grid div { grid-template-columns: 1fr; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance div:nth-child(3) { border-left: 0; }
  .glance div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .flow { grid-auto-flow: row; gap: 24px; }
  .arch-grid { grid-template-columns: 1fr; gap: 12px; }
  .wires { grid-template-columns: 1fr 1fr; }
  .wire { border-top: 0; padding-top: 0; }
  .wire::after { content: none !important; }
  .wire.right::before { content: "\2193\00a0"; color: var(--accent); }
  .wire.left::before { content: "\2191\00a0"; color: var(--accent); }
  .site-header .wrap { padding-block: 12px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; gap: 18px; width: 100%; font-size: 0.9rem; padding-bottom: 2px; padding-right: 48px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .hero .title { font-size: 1.4rem; }
  .flow li + li::after { content: "\2193"; left: 50%; top: -21px; transform: translateX(-50%); }
  .page-head h1 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
