/* ============================================================ tokens */
:root {
  --bg:        #fcfbf9;
  --surface:   #ffffff;
  --surface-2: #f5f2ec;
  --ink:       #17171a;
  --ink-2:     #3d3d44;
  --muted:     #6d6d75;
  --rule:      #e3ded5;
  --rule-2:    #efebe3;
  --accent:    #1c4b57;
  --accent-2:  #2a6b7c;
  --accent-bg: #eaf1f2;
  --shadow:    0 1px 2px rgba(23,23,26,.04), 0 8px 24px -12px rgba(23,23,26,.10);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 44rem;
  --wide: 64rem;
}

html[data-theme="dark"] {
  --bg:        #14161a;
  --surface:   #1a1d22;
  --surface-2: #20242a;
  --ink:       #eceae5;
  --ink-2:     #c8c6c1;
  --muted:     #94949d;
  --rule:      #2b3037;
  --rule-2:    #23272d;
  --accent:    #7fc0cf;
  --accent-2:  #9ed3df;
  --accent-bg: #1b2b31;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@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(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.shell { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: var(--measure); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 4px 0;
}
.skip:focus { left: 0; }

/* ============================================================ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav.stuck { border-bottom-color: var(--rule); }

.nav-in {
  max-width: var(--wide); margin: 0 auto; padding: .75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 1rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em; margin-right: auto;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .sub { color: var(--muted); font-weight: 400; font-size: .82rem; font-family: var(--sans); display: block; margin-top: .05rem; }

.nav-links { display: flex; gap: .25rem; align-items: center; }
.nav-links a {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-2);
  padding: .4rem .6rem; border-radius: 4px; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid var(--rule); border-radius: 5px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 15px; height: 15px; }
html[data-theme="dark"] .sun { display: block; }
html[data-theme="dark"] .moon { display: none; }
.sun { display: none; }
.moon { display: block; }

@media (max-width: 60rem) { .nav-links a[data-opt] { display: none; } }
@media (max-width: 42rem) { .nav-links { display: none; } .brand .sub { display: none; } }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--sans); font-size: .87rem; font-weight: 500;
  padding: .6rem 1.1rem; border-radius: 5px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
}
html[data-theme="dark"] .btn-primary { color: #10242a; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
html[data-theme="dark"] .btn-primary:hover { color: #10242a; }
.btn svg { width: 14px; height: 14px; flex: none; }

/* ============================================================ hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 78% 40%, #000 10%, transparent 72%);
          mask-image: radial-gradient(120% 90% at 78% 40%, #000 10%, transparent 72%);
}
.lattice { width: 100%; height: 100%; }
.lat-bond path { fill: none; stroke: var(--accent); stroke-width: 1.1; opacity: .22; }
.lat-atom circle { fill: var(--accent); opacity: .3; }
html[data-theme="dark"] .lat-bond path { opacity: .18; }
html[data-theme="dark"] .lat-atom circle { opacity: .26; }

.hero-in { position: relative; padding: 5.5rem 0 4.25rem; }

.eyebrow {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 1rem;
}
h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.4rem); font-weight: 600;
  letter-spacing: -.022em; line-height: 1.06; margin: 0 0 .9rem;
}
.hero-role { font-size: 1.12rem; color: var(--ink-2); margin: 0 0 .3rem; max-width: 34rem; }
.hero-affil { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin: 0 0 1.6rem; }
.hero-lede { font-size: 1.08rem; color: var(--ink-2); max-width: 32rem; margin: 0 0 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.75rem; }

.profile-links { display: flex; flex-wrap: wrap; gap: .3rem 1.15rem; font-family: var(--sans); font-size: .84rem; }
.profile-links a { color: var(--muted); }
.profile-links a:hover { color: var(--accent); }

/* ============================================================ stats */
.stats { border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.stats-in {
  max-width: var(--wide); margin: 0 auto; padding: 1.6rem 1.5rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem 1.5rem;
}
.stat .n {
  font-family: var(--sans); font-size: 1.55rem; font-weight: 600;
  letter-spacing: -.02em; color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-family: var(--sans); font-size: .76rem; color: var(--muted);
  margin-top: .2rem; line-height: 1.35;
}
@media (max-width: 42rem) { .stats-in { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================ sections */
section { padding: 4.25rem 0; border-bottom: 1px solid var(--rule-2); }
section:last-of-type { border-bottom: none; }
#consulting { background: var(--surface-2); border-bottom-color: var(--rule); }

.sec-head { margin-bottom: 2.25rem; max-width: var(--measure); }
.sec-kicker {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 .7rem; display: flex; align-items: center; gap: .55rem;
}
.sec-kicker::after { content: ""; flex: 1; height: 1px; background: var(--rule); max-width: 4rem; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2rem); font-weight: 600; letter-spacing: -.018em; margin: 0 0 .8rem; line-height: 1.18; }
h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 .45rem; letter-spacing: -.01em; }
.sec-head p { color: var(--ink-2); margin: 0; }

p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 0; }
.lede { font-size: 1.1rem; }
em, .it { font-style: italic; }

/* ============================================================ cards */
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 52rem) { .g2, .g3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; padding: 1.5rem 1.55rem;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); box-shadow: var(--shadow); }
.card p { font-size: .95rem; color: var(--ink-2); }
.card-tag {
  font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 .7rem;
}
.card-links {
  margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--rule-2);
  font-family: var(--sans); font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .3rem .9rem;
}

.num {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  width: 1.65rem; height: 1.65rem; border-radius: 4px;
  display: grid; place-items: center; margin-bottom: .9rem;
}

/* ============================================================ publications */
.filters {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.75rem;
}
.chip {
  font-family: var(--sans); font-size: .79rem;
  padding: .35rem .8rem; border-radius: 100px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
html[data-theme="dark"] .chip[aria-pressed="true"] { color: #10242a; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  padding: 1.1rem 0; border-top: 1px solid var(--rule-2);
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 1.5rem;
  font-size: .95rem;
}
.pub:first-child { border-top: none; }
.pub[hidden] { display: none; }
.pub-year {
  font-family: var(--sans); font-size: .8rem; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: .12rem;
}
.pub-title { display: block; color: var(--ink); font-weight: 600; margin-bottom: .2rem; }
.pub-authors { color: var(--muted); font-size: .89rem; display: block; margin-bottom: .3rem; }
.pub-meta { font-family: var(--sans); font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; }
.pub-venue { font-style: italic; font-family: var(--serif); font-size: .92rem; color: var(--ink-2); }
.me { color: var(--ink); font-weight: 600; }
.badge {
  font-family: var(--sans); font-size: .67rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg);
  padding: .12rem .45rem; border-radius: 3px; white-space: nowrap;
}
@media (max-width: 42rem) {
  .pub { grid-template-columns: 1fr; gap: .3rem; }
  .pub-year { order: -1; }
}
.pub-note { margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.empty { padding: 2rem 0; color: var(--muted); font-size: .95rem; }

/* ============================================================ timeline */
.tl { border-left: 1px solid var(--rule); padding-left: 1.6rem; margin-left: .3rem; }
.tl-item { position: relative; padding-bottom: 1.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: calc(-1.6rem - 4px); top: .5rem;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--rule);
}
.tl-item.now::before { background: var(--accent); border-color: var(--accent); }
.tl-when {
  font-family: var(--sans); font-size: .76rem; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-bottom: .1rem;
}
.tl-what { font-weight: 600; font-size: .98rem; }
.tl-where { color: var(--muted); font-size: .92rem; }
.tl-note { color: var(--ink-2); font-size: .91rem; margin-top: .3rem; }

/* ============================================================ consulting */
.svc { counter-reset: svc; }
.svc-item {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; padding: 1.5rem 1.55rem;
}
.svc-item ul { margin: .8rem 0 0; padding-left: 1.05rem; font-size: .9rem; color: var(--ink-2); }
.svc-item li { margin-bottom: .35rem; }
.svc-item li::marker { color: var(--accent); }

.cta-panel {
  margin-top: 2rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 7px;
  padding: 1.8rem 1.75rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
}
.cta-panel h3 { margin-bottom: .3rem; }
.cta-panel p { font-size: .93rem; color: var(--muted); margin: 0; max-width: 30rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.fineprint {
  font-family: var(--sans); font-size: .8rem; color: var(--muted);
  margin-top: 1.25rem; max-width: var(--measure); line-height: 1.55;
}

/* ============================================================ methods */
.methods { display: grid; gap: 1.4rem 2.5rem; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 52rem) { .methods { grid-template-columns: 1fr; } }
.methods dt { font-weight: 600; font-size: .96rem; margin-bottom: .25rem; }
.methods dd { margin: 0; color: var(--ink-2); font-size: .93rem; }

/* ============================================================ contact */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 52rem) { .contact-grid { grid-template-columns: 1fr; gap: 1.75rem; } }
.kv { font-family: var(--sans); font-size: .88rem; }
.kv dt { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .2rem; }
.kv dd { margin: 0 0 1.1rem; color: var(--ink); }
.kv dd:last-child { margin-bottom: 0; }

/* ============================================================ footer */
footer {
  border-top: 1px solid var(--rule); padding: 2rem 0 2.5rem;
  font-family: var(--sans); font-size: .82rem; color: var(--muted);
}
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.5rem; align-items: center; }
.foot-in a { color: var(--muted); }
.foot-in a:hover { color: var(--accent); }

/* ============================================================ reveal */
.rv { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }

/* ============================================================ print */
@media print {
  .nav, .hero-bg, .filters, .cta-actions, .icon-btn, footer { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  section { padding: 1rem 0; border: none; page-break-inside: avoid; }
  .card, .svc-item, .cta-panel { border: 1px solid #ccc; box-shadow: none; }
  .pub[hidden] { display: grid !important; }
  a { color: #000; }
}

/* ============================================================ subpage header */
.page-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.page-head .hero-bg {
  -webkit-mask-image: radial-gradient(110% 80% at 82% 30%, #000 5%, transparent 68%);
          mask-image: radial-gradient(110% 80% at 82% 30%, #000 5%, transparent 68%);
}
.page-head-in { position: relative; padding: 4.25rem 0 3.25rem; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 2.85rem); margin-bottom: 1rem; }
.page-head .hero-lede { max-width: 36rem; margin-bottom: 1.6rem; }
.crumb { font-family: var(--sans); font-size: .82rem; margin: 0 0 1.1rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* ============================================================ jump bar */
.jump {
  position: sticky; top: 3.55rem; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.jump-in {
  max-width: var(--wide); margin: 0 auto; padding: .6rem 1.5rem;
  display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none;
}
.jump-in::-webkit-scrollbar { display: none; }
.jump-in a {
  font-family: var(--sans); font-size: .81rem; color: var(--ink-2);
  padding: .35rem .7rem; border-radius: 4px; white-space: nowrap;
}
.jump-in a:hover { background: var(--surface-2); text-decoration: none; }
.jump-in a.active { color: var(--accent); font-weight: 600; background: var(--accent-bg); }

/* ============================================================ capability blocks */
.cap { padding: 4rem 0; border-bottom: 1px solid var(--rule-2); }
.cap:last-of-type { border-bottom: none; }

.cap-head { display: grid; grid-template-columns: 3.25rem 1fr; gap: 0 1.4rem; margin-bottom: 2rem; align-items: start; }
.cap-mark {
  width: 3.25rem; height: 3.25rem; border-radius: 8px;
  background: var(--accent-bg); color: var(--accent);
  display: grid; place-items: center;
}
.cap-mark svg { width: 22px; height: 22px; }
.cap-head h2 { margin-bottom: .5rem; }
.cap-head p { color: var(--ink-2); margin: 0; max-width: var(--measure); }

.cap-body { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: start; }
@media (max-width: 56rem) { .cap-body { grid-template-columns: 1fr; gap: 2rem; } .cap-head { grid-template-columns: 1fr; } .cap-mark { margin-bottom: 1rem; } }

/* what I can do — client facing */
.can { list-style: none; margin: 0; padding: 0; }
.can li {
  position: relative; padding-left: 1.6rem; margin-bottom: .85rem;
  font-size: .96rem; color: var(--ink-2);
}
.can li::before {
  content: ""; position: absolute; left: 0; top: .58em;
  width: .5rem; height: .5rem; border-radius: 1px;
  background: var(--accent); transform: rotate(45deg);
}
.can strong { color: var(--ink); font-weight: 600; }

/* method development — researcher facing */
.method {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0; padding: 1.35rem 1.5rem;
}
.method h3 {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .7rem;
}
.method p { font-size: .93rem; color: var(--ink-2); margin-bottom: .8rem; }
.method p:last-of-type { margin-bottom: 0; }

.evidence {
  margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--rule-2);
  font-family: var(--sans); font-size: .81rem;
}
.evidence-label { color: var(--muted); display: block; margin-bottom: .45rem; }
.evidence a { display: block; margin-bottom: .3rem; }
.evidence a:last-child { margin-bottom: 0; }
.evidence .yr { color: var(--muted); font-variant-numeric: tabular-nums; }

/* technique index */
.tech { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: var(--surface); }
@media (max-width: 56rem) { .tech { grid-template-columns: 1fr; } }
.tech > div { padding: 1.15rem 1.3rem; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.tech > div:nth-child(3n) { border-right: none; }
@media (max-width: 56rem) { .tech > div { border-right: none; } }
.tech dt { font-family: var(--sans); font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.tech dd { margin: 0; font-size: .87rem; color: var(--muted); line-height: 1.5; }

/* teaser on the landing page */
.teaser {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-bottom: 1.75rem;
}
@media (max-width: 52rem) { .teaser { grid-template-columns: 1fr; } }
.teaser-item {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px;
  padding: 1.3rem 1.4rem; transition: border-color .18s ease, box-shadow .18s ease;
}
.teaser-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); box-shadow: var(--shadow); }
.teaser-item h3 { font-size: 1rem; margin-bottom: .35rem; }
.teaser-item p { font-size: .91rem; color: var(--ink-2); margin: 0; }
.teaser-mark { color: var(--accent); margin-bottom: .8rem; display: block; }
.teaser-mark svg { width: 20px; height: 20px; }
