/* ============================================================
   Evidence Consulting & Advisory — Bruno Anthoine
   Prototype stylesheet (static). Semantic tokens — themeable.
   Default theme: "Meridian" (light, serif).
   Theme files override only the :root token block.
   ============================================================ */

:root {
  /* ---- Meridian (default) ---- */
  --bg:         #F3EFE6;
  --bg-2:       #ECE6D9;
  --surface:    #FBF8F1;
  --text:       #1C2620;
  --text-soft:  #444C45;
  --muted:      #6E7E72;
  --brand:      #1E3A31;
  --brand-2:    #2C5446;
  --accent:     #B9652F;
  --accent-2:   #D2854C;
  --line:       #D6CCB8;
  --line-soft:  #E6DECF;
  --invert:     #F4F0E7;      /* light text on brand band */
  --footer-bg:  #151A17;
  --footer-text:#E7E2D7;

  --font-display: 'Bitter', Georgia, serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:    'Overpass Mono', ui-monospace, monospace;

  --display-weight: 600;
  --display-weight-hero: 700;
  --display-tracking: -0.015em;

  --maxw: 1180px;
  --gut: clamp(20px, 5vw, 64px);
  --radius: 3px;

  --shadow-sm: 0 1px 2px rgba(10,14,12,.10), 0 2px 8px rgba(10,14,12,.06);
  --shadow-md: 0 4px 14px rgba(10,14,12,.12), 0 12px 40px rgba(10,14,12,.08);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: var(--grain-blend, multiply);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 600);
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: var(--display-tracking, -0.015em);
  margin: 0;
  text-wrap: balance;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gut);
  position: relative;
  z-index: 1;
}

.label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================ Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: baseline; gap: 11px; text-decoration: none; }
.brand .mark { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--brand); }
.brand .mark b { color: var(--accent); font-weight: inherit; }
.brand .sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { text-decoration: none; font-size: 15px; color: var(--text-soft); position: relative; padding: 4px 0; transition: color .2s; }
.nav a:not(.btn):hover, .nav a:not(.btn).current { color: var(--brand); }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:not(.btn):hover::after, .nav a:not(.btn).current::after { transform: scaleX(1); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  text-decoration: none; padding: 11px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s, color .2s;
}
.btn-primary { background: var(--brand); color: var(--invert); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

.menu-toggle { display: none; background: none; border: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); cursor: pointer; }

/* ============================================================ Hero */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 11vw, 130px) 0 clamp(40px, 7vw, 80px); }
.hero .contours { position: absolute; inset: -10% -5% auto auto; width: min(820px, 78vw); opacity: .5; pointer-events: none; z-index: 0; }
.hero .contours path { fill: none; stroke: var(--brand-2); stroke-width: 1; opacity: .25; }
.hero-inner { position: relative; z-index: 1; max-width: 880px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 { font-size: clamp(40px, 7.2vw, 84px); font-weight: var(--display-weight-hero, 700); letter-spacing: -0.015em; margin-bottom: 26px; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero .lede { font-size: clamp(18px, 2.3vw, 22px); line-height: 1.55; color: var(--text-soft); max-width: 640px; margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-cta .note { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.stats { position: relative; z-index: 1; margin-top: clamp(48px, 8vw, 84px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.stats .stat { padding: 26px 24px; border-right: 1px solid var(--line-soft); }
.stats .stat:first-child { padding-left: 0; }
.stats .stat:last-child { padding-right: 0; border-right: none; }
.stats .num { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); font-weight: 650; color: var(--brand); letter-spacing: -0.02em; line-height: 1; }
.stats .desc { font-size: 14px; color: var(--text-soft); margin-top: 8px; }


/* ============================================================ Sections */
section { position: relative; z-index: 1; }
.section { padding: clamp(56px, 9vw, 110px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 52px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 4.5vw, 46px); font-weight: 600; max-width: 16ch; }
.section-head p { color: var(--text-soft); max-width: 42ch; margin: 0; }
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }

.partners { padding: clamp(34px, 5vw, 52px) 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.partners .lead { display: block; margin-bottom: 22px; }
.partner-row { display: flex; flex-wrap: wrap; gap: 14px 38px; align-items: center; }
.partner-row span { font-family: var(--font-display); font-size: clamp(17px, 2.4vw, 25px); color: var(--brand); font-weight: 500; letter-spacing: -0.01em; opacity: .85; }
.partner-row span::after { content: "·"; margin-left: 38px; color: var(--muted); opacity: .5; }
.partner-row span:last-child::after { content: ""; margin: 0; }

/* ============================================================ Services */
.services { background: var(--surface); border-bottom: 1px solid var(--line); }
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.svc { background: var(--surface); padding: clamp(28px, 3.5vw, 44px); }
.svc h3 { font-size: clamp(21px, 2.6vw, 27px); margin: 14px 0 14px; font-weight: 600; }
.svc p { color: var(--text-soft); margin: 0 0 20px; font-size: 15.5px; }
.svc .tags { display: flex; flex-wrap: wrap; gap: 7px; }
.svc .tags span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--brand-2); background: color-mix(in srgb, var(--brand) 9%, transparent); padding: 4px 9px; border-radius: 2px; }

/* ============================================================ Project cards */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 24px; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .25s ease, border-color .25s; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .3s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card:hover::before { transform: scaleY(1); }
.card .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; align-items: center; }
.card .donor { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--invert); background: var(--brand); padding: 4px 9px; border-radius: 2px; }
.card .place { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .05em; color: var(--muted); }
.card h3 { font-size: clamp(19px, 2.2vw, 23px); font-weight: 600; margin-bottom: 12px; line-height: 1.2; }
.card .role { font-size: 13px; font-style: italic; color: var(--accent); font-family: var(--font-display); margin-bottom: 12px; }
.card p { font-size: 14.5px; color: var(--text-soft); margin: 0 0 20px; flex: 1; }
.card .pillars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.card .pillars span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .03em; color: var(--brand-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 2px; }
.card .more { font-size: 14px; font-weight: 500; color: var(--brand); display: inline-flex; align-items: center; gap: 7px; }
.card .more .arr { transition: transform .2s; }
.card:hover .more .arr { transform: translateX(4px); }
.flag { position: absolute; top: 0; right: 0; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 10px; border-bottom-left-radius: var(--radius); }

.section-cta { margin-top: 46px; display: flex; justify-content: center; }

/* ============================================================ Contact */
.contact { background: var(--brand); color: var(--invert); }
.contact .label { color: color-mix(in srgb, var(--invert) 70%, transparent); }
.contact h2 { color: var(--invert); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.contact .lede { font-size: 19px; color: color-mix(in srgb, var(--invert) 86%, transparent); margin: 22px 0 34px; }
.contact .detail { border-top: 1px solid color-mix(in srgb, var(--invert) 24%, transparent); padding: 16px 0; display: flex; justify-content: space-between; gap: 20px; }
.contact .detail .k { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--invert) 62%, transparent); }
.contact .detail .v { color: var(--invert); text-decoration: none; }
.contact .detail a.v:hover { color: var(--accent-2); }

.booking { background: var(--surface); border-radius: var(--radius); padding: 8px; color: var(--text); }
.calendly-placeholder { border: 1.5px dashed var(--line); border-radius: var(--radius); min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 28px; gap: 14px; background: repeating-linear-gradient(45deg, transparent, transparent 11px, color-mix(in srgb, var(--bg) 60%, transparent) 11px, color-mix(in srgb, var(--bg) 60%, transparent) 12px); }
.calendly-placeholder .ico { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--invert); display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; }
.calendly-placeholder h4 { font-size: 20px; font-weight: 500; }
.calendly-placeholder p { font-size: 14px; color: var(--text-soft); margin: 0; max-width: 34ch; }
.calendly-placeholder code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-2); padding: 3px 7px; border-radius: 2px; color: var(--brand); }

.cform { margin-top: 22px; display: grid; gap: 14px; }
.cform .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cform label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.cform input, .cform textarea { width: 100%; font-family: var(--font-body); font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.cform input:focus, .cform textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.cform textarea { resize: vertical; min-height: 96px; }
.cform .send-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.cform input::placeholder, .cform textarea::placeholder { color: var(--muted); }

/* ============================================================ Footer */
.site-footer { background: var(--footer-bg); color: color-mix(in srgb, var(--footer-text) 80%, transparent); padding: clamp(44px, 6vw, 72px) 0 34px; }
.foot-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; padding-bottom: 34px; border-bottom: 1px solid color-mix(in srgb, var(--footer-text) 18%, transparent); }
.foot-top .mark { font-family: var(--font-display); font-size: 26px; color: var(--footer-text); }
.foot-top .mark b { color: var(--accent-2); font-weight: inherit; }
.foot-top .tag { font-size: 14px; max-width: 30ch; margin-top: 10px; }
.foot-links { display: flex; gap: 40px; flex-wrap: wrap; }
.foot-col .label { color: color-mix(in srgb, var(--footer-text) 55%, transparent); display: block; margin-bottom: 12px; }
.foot-col a, .foot-col span { display: block; text-decoration: none; font-size: 15px; line-height: 1.9; color: color-mix(in srgb, var(--footer-text) 82%, transparent); }
.foot-col a:hover { color: var(--accent-2); }
.foot-bottom { padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: color-mix(in srgb, var(--footer-text) 52%, transparent); }

/* ============================================================ Projects page */
.page-hero { padding: clamp(60px, 9vw, 110px) 0 clamp(30px, 4vw, 50px); }
.page-hero h1 { font-size: clamp(36px, 6vw, 66px); font-weight: var(--display-weight-hero, 700); letter-spacing: -0.025em; margin: 18px 0 22px; }
.page-hero h1 em { font-style: italic; color: var(--brand); }
.page-hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-soft); max-width: 56ch; }

.filter-bar { position: sticky; top: 70px; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-block: 1px solid var(--line); padding: 14px 0; }
.filter-bar .wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar .label { margin-right: 6px; }
.chip { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); padding: 7px 13px; border-radius: 100px; cursor: pointer; transition: all .18s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); color: var(--invert); border-color: var(--brand); }

.donor-group { padding: clamp(40px, 6vw, 70px) 0; border-bottom: 1px solid var(--line); }
.donor-group:nth-child(even) { background: var(--surface); }
.donor-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 34px; flex-wrap: wrap; }
.donor-head h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; }
.donor-head .count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.donor-head .blurb { flex-basis: 100%; color: var(--text-soft); max-width: 64ch; margin-top: 6px; font-size: 15.5px; }
.proj-grid.three { grid-template-columns: repeat(3, 1fr); }
.back-top { text-align: center; padding: 40px 0; }
.donor-group.hide { display: none; }

/* ============================================================ Reveal */
.reveal { transition: opacity .7s ease, transform .7s ease; }
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ============================================================ Theme switcher */
.theme-switch { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 100px; padding: 9px 14px; box-shadow: var(--shadow-md); }
.theme-switch .ts-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.theme-switch .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform .15s ease; }
.theme-switch .sw:hover { transform: scale(1.14); }
.theme-switch .sw.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ============================================================ Responsive */
@media (max-width: 860px) {
  .svc-grid { grid-template-columns: 1fr; }
  .proj-grid, .proj-grid.three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat { border-bottom: 1px solid var(--line-soft); }
  /* ponytail: clears bottom border on the last row for any count (even pair or lone odd) */
  .stats .stat:last-child, .stats .stat:nth-last-child(2):nth-child(odd) { border-bottom: none; }
  .stats .stat:nth-child(odd) { padding-left: 0; padding-right: 24px; border-right: 1px solid var(--line-soft); }
  .stats .stat:nth-child(even) { padding-left: 24px; padding-right: 0; border-right: none; }
  .stats .stat:nth-child(odd):last-child { border-right: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .cform .row { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gut) 18px; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a.btn { margin-top: 12px; }
  .menu-toggle { display: block; }
  .partner-row span::after { margin-left: 22px; }
  .partner-row { gap: 10px 22px; }
  .theme-switch { right: 12px; bottom: 12px; padding: 8px 11px; gap: 8px; }
  .theme-switch .ts-label { display: none; }
}

/* ============================================================ Accessibility & Focus */
a:focus-visible,
button:focus-visible,
.chip:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.nowrap {
  white-space: nowrap;
}

.stacked-title {
  max-width: 25ch !important;
  line-height: 1.2 !important;
}

.stacked-title .head-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stacked-title .head-main {
  display: block;
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: var(--display-weight, 500);
  color: var(--brand);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stacked-title .head-desc {
  display: block;
  font-size: clamp(20px, 3.2vw, 32px);
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.2;
}

/* ---- About: intro + evidence-cycle ledger ---- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}
.about-intro .stacked-title { margin-bottom: 26px; }
.about-lede {
  font-size: clamp(19px, 2.1vw, 22px);
  line-height: 1.5;
  color: var(--text);
  max-width: 40ch;
  margin: 0 0 18px;
}
.about-close {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 46ch;
  margin: 0;
}
.about-cycle .label { display: block; margin-bottom: 18px; }
.cycle-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cycle-list li {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  align-items: baseline;
  gap: 8px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.cycle-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.cycle-list .stage {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.cycle-list .what {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-soft);
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: clamp(28px, 7vw, 44px); }
  .about-lede, .about-close { max-width: 60ch; }
  .cycle-list li { grid-template-columns: 1fr; gap: 4px; }
}

