/* =====================================================
   Tokens — light (default)
   Palette taken from the portrait: olive backdrop, warm paper, ink.
   ===================================================== */
:root {
  --bg:          #f5f4ef;
  --surface:     #ffffff;
  --text:        #1b1d18;
  --muted:       #5c6055;
  --faint:       #74786c;
  --border:      rgba(27, 29, 24, 0.12);
  --accent:      #4a5a2b;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(74, 90, 43, 0.08);

  --font-serif: ui-serif, 'New York', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:  ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --max-w: 1120px;
  --radius: 14px;
  --ease: 0.2s ease;

  color-scheme: light;
}

/* Dark — follows the system unless the visitor picked light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #131510;
    --surface:     #1b1e17;
    --text:        #ecebe4;
    --muted:       #a7aa9c;
    --faint:       #8b8e81;
    --border:      rgba(236, 235, 228, 0.12);
    --accent:      #b9c78f;
    --accent-ink:  #131510;
    --accent-soft: rgba(185, 199, 143, 0.1);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:          #131510;
  --surface:     #1b1e17;
  --text:        #ecebe4;
  --muted:       #a7aa9c;
  --faint:       #8b8e81;
  --border:      rgba(236, 235, 228, 0.12);
  --accent:      #b9c78f;
  --accent-ink:  #131510;
  --accent-soft: rgba(185, 199, 143, 0.1);
  color-scheme: dark;
}

/* =====================================================
   Base
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img    { max-width: 100%; display: block; }
a      { color: inherit; }
ul     { list-style: none; }
button { font: inherit; cursor: pointer; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px)  { .container { padding: 0 2rem; } }
@media (min-width: 1024px) { .container { padding: 0 3rem; } }

.section { padding: 5.5rem 0; border-top: 1px solid var(--border); }

@media (min-width: 768px) { .section { padding: 7rem 0; } }

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.section__head { margin-bottom: 3rem; max-width: 680px; }

.section__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.section__lead {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 600px;
}

/* =====================================================
   Header
   ===================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease);
}

.header.scrolled { border-bottom-color: var(--border); }

/* backdrop-filter makes the header the containing block for fixed children,
   which collapses the mobile menu overlay — turn it off while the menu is open */
.header.menu-open {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav { display: flex; align-items: center; gap: 0.25rem; }

.nav__links { display: none; gap: 1.75rem; margin-right: 1rem; }

.nav__links a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--ease);
}

.nav__links a:hover,
.nav__links a.active { color: var(--text); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: color var(--ease), background-color var(--ease);
}

.icon-btn:hover { color: var(--text); background: var(--accent-soft); }

/* Sun shows in dark mode, moon in light mode */
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun  { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.nav__toggle { flex-direction: column; }
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav__toggle span + span { margin-top: 5px; }
.nav__toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__links.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  height: calc(100vh - 4rem);
  height: calc(100dvh - 4rem);
  overflow-y: auto;
  margin: 0;
  padding: 2rem 1rem;
  gap: 1.5rem;
  background: var(--bg);
}

.nav__links.open a { font-size: 1.25rem; color: var(--text); }

@media (min-width: 860px) {
  .nav__links  { display: flex; }
  .nav__toggle { display: none; }
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }

.btn--ghost { border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }

/* =====================================================
   Hero
   ===================================================== */
.hero { padding: 3.5rem 0 4.5rem; }

.hero__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.hero__text {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 590px;
}

.hero__text + .hero__text { margin-top: 0.9rem; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__avail {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero__avail::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b8a3a;
  box-shadow: 0 0 0 4px rgba(91, 138, 58, 0.18);
  flex-shrink: 0;
  transform: translateY(-1px);
}

.portrait {
  max-width: 340px;
  width: 100%;
  justify-self: center;
}

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
}

.portrait figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

@media (min-width: 900px) {
  .hero { padding: 5rem 0 6rem; }
  .hero__grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr); gap: 4.5rem; }
  .portrait { justify-self: end; }
}

/* Facts strip */
.facts {
  display: grid;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.fact__value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.fact__label { font-size: 0.9rem; color: var(--muted); }

@media (min-width: 700px) { .facts { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* =====================================================
   Services
   ===================================================== */
.services { display: grid; border-top: 1px solid var(--border); }

.service {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 1rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.service__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 0.3rem;
}

.service__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: -0.005em;
}

.service__desc { color: var(--muted); font-size: 0.98rem; }

@media (min-width: 820px) {
  .services { grid-template-columns: 1fr 1fr; column-gap: 3.5rem; border-top: none; }
  .service:nth-child(-n+2) { border-top: 1px solid var(--border); }
}

.note {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.note strong { color: var(--text); font-weight: 600; }

/* =====================================================
   Case studies
   ===================================================== */
.cases { display: grid; gap: 1.25rem; }

.case {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.case__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.case__sector {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.case__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.case__block + .case__block { margin-top: 1.1rem; }

.case__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.3rem;
}

.case__block p { color: var(--muted); }

.case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.case__tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

@media (min-width: 860px) {
  .case { grid-template-columns: 220px 1fr; gap: 3rem; padding: 2.75rem; }
}

/* =====================================================
   Recommendations
   ===================================================== */
.quotes { display: grid; gap: 1.25rem; }

.quote {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quote blockquote {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.6;
  flex: 1;
}

.quote blockquote p + p { margin-top: 0.8rem; }

.quote figcaption {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.quote__name { display: block; font-weight: 600; }
.quote__role { display: block; color: var(--muted); }
.quote__rel  { display: block; color: var(--faint); font-size: 0.85rem; margin-top: 0.2rem; }

.quote--wide blockquote { font-size: 1.25rem; }

@media (min-width: 1000px) {
  .quotes { grid-template-columns: repeat(3, 1fr); }
  .quote--wide { grid-column: 1 / -1; padding: 2.75rem; }
}

.link-arrow {
  display: inline-flex;
  margin-top: 1.75rem;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* =====================================================
   Experience
   ===================================================== */
.roles { border-top: 1px solid var(--border); }

.role {
  display: grid;
  gap: 0.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.role__period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.role__badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  vertical-align: 1px;
}

.role__title { font-size: 1.1rem; font-weight: 600; }
.role__org   { color: var(--muted); margin-bottom: 0.4rem; }
.role__desc  { color: var(--muted); font-size: 0.98rem; max-width: 680px; }

@media (min-width: 820px) {
  .role { grid-template-columns: 220px 1fr; gap: 2rem; }
}

.creds {
  display: grid;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.creds strong { color: var(--text); font-weight: 600; }

/* =====================================================
   Also building
   ===================================================== */
.building {
  display: grid;
  gap: 0.75rem;
  padding: 2rem 1.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.building__status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.building__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
}

.building p { color: var(--muted); max-width: 720px; }

/* =====================================================
   Contact
   ===================================================== */
.contact__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 760px;
}

.contact__text { margin-top: 1.25rem; color: var(--muted); max-width: 580px; }

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* =====================================================
   Footer
   ===================================================== */
.footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--faint);
}

.footer p + p { margin-top: 0.35rem; }

/* =====================================================
   Motion — subtle, JS-only, content visible without it
   ===================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
