:root {
  --paper: #F2F0E9;
  --paper-2: #E9E6DC;
  --white: #FCFBF7;
  --ink: #181A19;
  --ink-2: #51544F;
  --ink-3: #898C86;
  --petrol: #134E48;
  --petrol-deep: #0B332F;
  --petrol-light: #5FA89D;
  --ochre: #B26A34;
  --line: #D9D5C9;
  --line-strong: #C5C0B2;
  --dark: #0F1413;
  --shadow: 0 22px 48px -34px rgba(20, 30, 25, 0.5);
  --shadow-soft: 0 10px 30px -24px rgba(20, 30, 25, 0.4);
  --r: 6px;
  --r-lg: 10px;
  --maxw: 1140px;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.08; letter-spacing: -0.015em; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 36px; }

.mono { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- NAV ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 240, 233, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
nav.scrolled { border-bottom-color: var(--line); background: rgba(242, 240, 233, 0.94); }
.nav-inner { display: flex; align-items: center; justify-content: flex-end; height: 70px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { font-size: 14.5px; color: var(--ink-2); transition: color .2s; padding: 8px 14px; }
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-cta { color: var(--white) !important; background: var(--petrol); padding: 9px 20px !important; border-radius: var(--r); font-weight: 500; margin-left: 8px; transition: background .2s; }
.nav-cta:hover { background: var(--petrol-deep); }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 24px; cursor: pointer; }

/* ---------- HERO ---------- */
.hero { padding: 92px 0 84px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 72px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.2vw, 66px); margin-bottom: 18px; letter-spacing: -0.025em; color: var(--petrol); }
.hero h1 em { font-style: italic; color: var(--petrol); }
.postnominals { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 16px; line-height: 1.6; }
.hero-affil { color: var(--ink-3); margin-bottom: 30px; }
.hero-affil .mono { font-size: 12px; }
.hero-lead { font-size: 18px; color: var(--ink-2); max-width: 32em; margin-bottom: 38px; line-height: 1.7; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 26px; border-radius: var(--r); font-size: 15px; font-weight: 500; font-family: var(--font-sans); cursor: pointer; transition: transform .2s, background .2s, border-color .2s; border: 1px solid transparent; }
.btn-primary { background: var(--petrol); color: var(--white); }
.btn-primary:hover { background: var(--petrol-deep); transform: translateY(-2px); }

.portrait-wrap { position: relative; width: 100%; max-width: clamp(240px, 25vw, 320px); margin-left: auto; }
.portrait { aspect-ratio: 4/5; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--r-lg); position: relative; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

/* ---------- SECTION SCAFFOLD ---------- */
section { padding: 96px 0; border-top: 1px solid var(--line); }
#about { border-top: none; }
.alt { background: var(--paper-2); }
.section-head { max-width: 660px; margin-bottom: 60px; }
.section-head.mb-0 { margin-bottom: 0; }
.section-num { color: var(--ochre); line-height: 1.6; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.section-num::after { content: ''; flex: 1; max-width: 60px; height: 1px; background: var(--line-strong); }
.section-head .section-tagline { font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 20px; }
.section-head p { font-size: 17.5px; color: var(--ink-2); line-height: 1.7; }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; column-gap: 64px; align-items: start; }
.about-grid .section-head { grid-column: 1 / -1; grid-row: 1; max-width: 820px; margin-bottom: 48px; }
.about-grid .about-body { grid-column: 1; grid-row: 2; }
.about-grid .credentials { grid-column: 2; grid-row: 2; }
.about-body p { color: var(--ink-2); margin-bottom: 18px; font-size: 17.5px; line-height: 1.75; }
.about-body p:last-child { margin-bottom: 0; }
.about-body p strong { color: var(--ink); font-weight: 600; }
blockquote { font-family: var(--font-serif); font-size: 22px; font-style: italic; color: var(--ink); line-height: 1.45; border-left: 2px solid var(--petrol); padding-left: 22px; margin: 30px 0 0; }
.credentials { display: flex; flex-direction: column; gap: 32px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 32px 30px; box-shadow: var(--shadow-soft); }
.cred-group {}
.cred-heading { color: var(--ochre); margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.cred-heading::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.cred-list { list-style: none; }
.cred-item { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cred-item:last-child { border-bottom: none; }
.cred-key { font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cred-val { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }

/* ---------- EXPERTISE ---------- */
.proc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.proc-card { background: var(--white); padding: 32px 30px; transition: background .25s; position: relative; }
.proc-card:hover { background: var(--paper); }
.proc-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); position: absolute; top: 24px; right: 28px; letter-spacing: 0.1em; }
.proc-icon { width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--petrol); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; transition: background .25s, color .25s, border-color .25s; }
.proc-card:hover .proc-icon { background: var(--petrol); color: var(--white); border-color: var(--petrol); }
.proc-icon svg { width: 24px; height: 24px; }
.proc-card h3 { font-size: 21px; margin-bottom: 10px; font-weight: 500; }
.proc-card p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------- RESEARCH ---------- */
.pub-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pub-card { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; transition: transform .2s, box-shadow .2s; color: inherit; }
a.pub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pub-thumb { aspect-ratio: 4/3; background: var(--paper-2); border-bottom: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pub-card-body { padding: 16px 18px; flex: 1; }
.pub-card-journal { color: var(--ochre); font-size: 10px; margin-bottom: 7px; }
.pub-card-title { font-size: 13.5px; color: var(--ink); line-height: 1.45; font-weight: 500; }
a.pub-card:hover .pub-card-title { color: var(--petrol); }
.pub-profiles { display: flex; gap: 32px; margin-top: 32px; justify-content: center; align-items: center; }
.pub-profile-link { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); transition: color .2s, transform .2s; }
.pub-profile-link:hover { color: var(--petrol); transform: translateY(-2px); }
.pub-profile-link svg { width: 28px; height: 28px; }
.pub-profile-link .rg-mark { font-family: var(--font-sans); font-weight: 600; font-size: 20px; letter-spacing: -0.05em; }

/* ---------- CONTACT ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.contact-referral-btn { margin-top: 28px; }
.contact-cards { display: flex; flex-direction: column; }
.contact-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); transition: padding-left .2s; }
.contact-row:first-child { padding-top: 0; }
.contact-row:last-child { border-bottom: none; }
.contact-row:hover { padding-left: 6px; }
.contact-row .ci { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--petrol); display: flex; align-items: center; justify-content: center; }
.contact-row .ci svg { width: 21px; height: 21px; }
.contact-row h3 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; margin-bottom: 4px; }
.contact-row p { font-size: 16.5px; color: var(--ink); font-weight: 500; }
.contact-row .ci-sub { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-3); font-weight: 400; }
.section-head p a { color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- FOOTER ---------- */
footer { background: var(--paper-2); padding: 60px 0 36px; border-top: 1px solid var(--line); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 28px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.back-to-top { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.back-to-top:hover { color: var(--petrol); }
.back-to-top svg { width: 13px; height: 13px; }
.disclaimer { font-size: 12.5px; color: var(--ink-3); max-width: 54em; line-height: 1.65; }
.copyright { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s cubic-bezier(.16,.84,.44,1), transform .65s cubic-bezier(.16,.84,.44,1); }
.reveal.in { opacity: 1; transform: none; }

/* Staggered entrance for the hero */
.hero-text > .reveal:nth-child(1) { transition-delay: 0s; }
.hero-text > .reveal:nth-child(2) { transition-delay: .1s; }
.hero-text > .reveal:nth-child(3) { transition-delay: .2s; }
.hero-text > .reveal:nth-child(4) { transition-delay: .3s; }
.hero-text > .reveal:nth-child(5) { transition-delay: .4s; }
.hero .portrait-wrap.reveal { transition-delay: .3s; }

/* ---------- PROFILES MARQUEE ---------- */
.marquee-band { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.marquee { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.marquee-track { display: flex; align-items: center; width: max-content; animation: marquee 72s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.logo-link { flex-shrink: 0; width: 58px; height: 58px; margin-right: 16px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); transition: color .25s, transform .25s; }
.logo-link:hover { color: var(--petrol); transform: translateY(-3px); }
.logo-link svg { width: 24px; height: 24px; }
.logo-link .rg-mark { font-family: var(--font-sans); font-weight: 600; font-size: 17px; letter-spacing: -0.05em; }
.marquee-sep { flex-shrink: 0; width: 1px; height: 32px; background: var(--line); margin: 0 8px; }
.affil-link { flex-shrink: 0; height: 58px; padding: 0 16px; display: flex; align-items: center; justify-content: center; transition: transform .25s; }
.affil-link:hover { transform: translateY(-3px); }
.affil-link img { height: 30px; width: auto; filter: grayscale(1) opacity(0.45); mix-blend-mode: multiply; transition: filter .25s; }
.affil-link:hover img { filter: grayscale(0) opacity(1); }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: 70px; left: 0; right: 0;
    background: var(--paper); flex-direction: column; align-items: flex-start;
    padding: 18px 24px; gap: 6px; border-bottom: 1px solid var(--line);
  }
  .nav-toggle { display: block; }
  .hero { padding: 40px 0 56px; }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-grid .section-head, .about-grid .about-body, .about-grid .credentials { grid-column: 1; grid-row: auto; }
  .about-grid .section-head { margin-bottom: 0; }
  .portrait-wrap { max-width: 340px; margin: 0 auto; }
  .proc-grid { grid-template-columns: 1fr; }
  .pub-panel { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 0 24px; }
  section { padding: 64px 0; }
}

/* ---- Long-form pages (Eleventy renders these from 'site content/') ---- */
.prose-section { padding: 96px 0; border-top: 1px solid var(--line); }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 48px; letter-spacing: -0.015em; }
.prose h3 { font-size: 21px; font-weight: 500; margin-top: 32px; }
.prose p, .prose li { color: var(--ink-2); font-size: 17.5px; line-height: 1.75; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose a { color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 2px solid var(--line-strong); padding-left: 20px; color: var(--ink-3); font-style: italic; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r); }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--paper-2); padding: 2px 5px; border-radius: 3px; }
.reviewed { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); }

@media (max-width: 900px) {
  .prose-section { padding: 64px 0; }
}
