/* ============================================================
   RJ BLAKE — "Institutional Authority"
   Deep navy ink, bone surfaces, single restrained brass accent.
   Display: Newsreader (editorial serif). Body: Satoshi (Fontshare).
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 0.25rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-full: 9999px;
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1240px;

  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- LIGHT (default): bone & navy ink ---------- */
:root, [data-theme='light'] {
  --color-bg: #faf8f4;
  --color-surface: #fffefb;
  --color-surface-2: #f4f0e8;
  --color-surface-offset: #edE8dd;
  --color-border: #ddd5c6;
  --color-divider: #e8e2d6;

  --color-text: #141f30;
  --color-text-muted: #5a6474;
  --color-text-faint: #9099a6;
  --color-text-inverse: #f7f4ee;

  --color-primary: #17365d;         /* BWG navy */
  --color-primary-hover: #0e2542;
  --color-ink-deep: #0c1524;
  --color-gold: #8a6a1f;            /* AA-safe brass on bone */
  --color-gold-bright: #c8a24a;     /* for use on dark only */

  --shadow-sm: 0 1px 2px rgb(20 31 48 / 0.06);
  --shadow-md: 0 6px 20px rgb(20 31 48 / 0.08);
  --shadow-lg: 0 20px 48px rgb(20 31 48 / 0.12);
}

/* ---------- DARK: ink & brass ---------- */
[data-theme='dark'] {
  --color-bg: #0b1320;
  --color-surface: #101a2a;
  --color-surface-2: #162234;
  --color-surface-offset: #1b2940;
  --color-border: #27354c;
  --color-divider: #1e2b40;

  --color-text: #dfe5ee;
  --color-text-muted: #8f9cb0;
  --color-text-faint: #63718a;
  --color-text-inverse: #0b1320;

  --color-primary: #8db3e0;
  --color-primary-hover: #b0cdf0;
  --color-ink-deep: #060c16;
  --color-gold: #d3ae5e;
  --color-gold-bright: #e0bf76;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 6px 20px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 20px 48px rgb(0 0 0 / 0.55);
}

/* ============================ PRIMITIVES ============================ */

.wrap { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: clamp(var(--space-5), 5vw, var(--space-16)); }
.wrap--default { max-width: var(--content-default); }
.wrap--narrow { max-width: var(--content-narrow); }

section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: flex; align-items: center; gap: var(--space-3);
}
.eyebrow::before { content: ''; width: var(--space-8); height: 1px; background: currentColor; flex: none; opacity: 0.6; }
.eyebrow--plain::before { display: none; }

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--color-text);
  margin-top: var(--space-4);
}

.section-head { margin-bottom: clamp(var(--space-10), 5vw, var(--space-16)); max-width: 44ch; }

.prose p { font-size: var(--text-base); color: var(--color-text-muted); max-width: 68ch; }
.prose p + p { margin-top: var(--space-5); }
.prose strong { color: var(--color-text); font-weight: 600; }

/* ============================ HEADER ============================ */

.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease, background 300ms ease;
}
.header--scrolled { border-bottom-color: var(--color-border); }
.header__inner { display: flex; align-items: center; gap: var(--space-6); min-height: 68px; }

.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); flex: none; }
.brand__mark { width: 34px; height: 34px; color: var(--color-primary); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 500; letter-spacing: 0.01em; }
.brand__role { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-faint); }

.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(var(--space-4), 2vw, var(--space-8)); }
.nav a {
  font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  color: var(--color-text-muted); position: relative; padding-block: var(--space-1);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--color-gold); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition-interactive);
}
.nav a:hover { color: var(--color-text); }
.nav a:hover::after { transform: scaleX(1); }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--color-border); border-radius: var(--radius-full);
  color: var(--color-text-muted); background: transparent;
}
.icon-btn:hover { color: var(--color-text); border-color: var(--color-text-faint); background: var(--color-surface-2); }
.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 880px) {
  .nav {
    position: fixed; inset: 68px 0 auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) clamp(var(--space-5), 5vw, var(--space-16)) var(--space-6);
    clip-path: inset(0 0 100% 0); transition: clip-path 340ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav[data-open='true'] { clip-path: inset(0 0 0 0); }
  .nav a { padding-block: var(--space-4); border-bottom: 1px solid var(--color-divider); font-size: var(--text-base); }
  .nav a::after { display: none; }
  .nav .icon-btn { margin-top: var(--space-5); }
  .nav-toggle { display: grid; }
}

/* ============================ HERO ============================ */

.hero {
  position: relative; isolation: isolate;
  background: var(--color-ink-deep);
  color: #eef2f8;
  padding-block: clamp(var(--space-24), 16vh, var(--space-32));
  display: flex; align-items: center; min-height: min(86vh, 800px);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 70% 55%;
  opacity: 0.85;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, #0c1524 8%, rgb(12 21 36 / 0.86) 42%, rgb(12 21 36 / 0.35) 78%),
    linear-gradient(to top, #0c1524, transparent 45%);
}
.hero__inner { position: relative; width: 100%; }
.hero .eyebrow { color: var(--color-gold-bright); }

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin-top: var(--space-6);
  max-width: 19ch;
  color: #f4f7fb;
}
.hero__title em { font-style: italic; color: var(--color-gold-bright); }

.hero__lead {
  margin-top: var(--space-8); max-width: 54ch;
  font-size: var(--text-lg); line-height: 1.55; color: #b9c5d6; font-weight: 300;
}

.hero__creds {
  margin-top: var(--space-10); display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-3) var(--space-5);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: #8fa0b8;
}
.hero__creds span { display: flex; align-items: center; gap: var(--space-5); }
.hero__creds span:not(:last-child)::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--color-gold-bright); }

.hero__actions { margin-top: var(--space-12); display: flex; flex-wrap: wrap; gap: var(--space-4); }

.btn {
  display: inline-flex; align-items: center; gap: var(--space-3);
  padding: 0.875rem var(--space-6); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; border: 1px solid transparent; min-height: 46px;
}
.btn--primary { background: var(--color-gold-bright); color: #1a1405; }
.btn--primary:hover { background: #dcba68; transform: translateY(-1px); }
.btn--ghost { border-color: rgb(255 255 255 / 0.22); color: #e3eaf4; }
.btn--ghost:hover { border-color: var(--color-gold-bright); color: var(--color-gold-bright); }
.btn svg { width: 15px; height: 15px; flex: none; }

/* ============================ STAT BAND ============================ */

.stats { background: var(--color-surface-2); border-block: 1px solid var(--color-border); padding-block: clamp(var(--space-10), 5vw, var(--space-16)); }
.stats__grid {
  display: grid; gap: var(--space-8) var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat { border-left: 2px solid var(--color-gold); padding-left: var(--space-5); }
.stat__num {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 400;
  line-height: 1; color: var(--color-text); font-variant-numeric: tabular-nums lining-nums;
}
.stat__label { margin-top: var(--space-3); font-size: var(--text-xs); line-height: 1.45; color: var(--color-text-muted); max-width: 22ch; }

/* ============================ BIOGRAPHY ============================ */

.bio__layout { display: grid; gap: clamp(var(--space-10), 6vw, var(--space-20)); grid-template-columns: minmax(0, 1fr); }
.bio__layout > * { min-width: 0; }
@media (min-width: 1000px) { .bio__layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }

.bio__aside { display: flex; flex-direction: column; gap: var(--space-8); }
@media (min-width: 1000px) { .bio__aside { position: sticky; top: 110px; } }

.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.figure figcaption { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-faint); letter-spacing: 0.04em; }

.pullquote {
  border-left: 2px solid var(--color-gold); padding-left: var(--space-6);
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 300;
  font-style: italic; line-height: 1.4; color: var(--color-text); max-width: 32ch;
}
.pullquote cite { display: block; margin-top: var(--space-4); font: inherit; font-style: normal; font-size: var(--text-xs); font-family: var(--font-body); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-faint); }

/* ============================ TIMELINE ============================ */

.timeline { display: flex; flex-direction: column; }
.role {
  display: grid; gap: var(--space-4) var(--space-10); padding-block: clamp(var(--space-8), 4vw, var(--space-12));
  border-top: 1px solid var(--color-divider); grid-template-columns: 1fr;
}
.role:last-child { border-bottom: 1px solid var(--color-divider); }
@media (min-width: 860px) { .role { grid-template-columns: 220px minmax(0, 1fr); } }

.role__meta { display: flex; flex-direction: column; gap: var(--space-2); }
.role__years {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em;
  color: var(--color-gold); font-variant-numeric: tabular-nums;
}
.role__org { font-family: var(--font-display); font-size: var(--text-base); color: var(--color-text); }
.role__title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; color: var(--color-text); margin-bottom: var(--space-3); }
.role__body { font-size: var(--text-base); color: var(--color-text-muted); max-width: 68ch; }

/* ============================ CARD GRIDS ============================ */

.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: clamp(var(--space-6), 3vw, var(--space-8));
  display: flex; flex-direction: column; gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.card__kicker { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-gold); }
.card__title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; letter-spacing: -0.01em; color: var(--color-text); }
.card__sub { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.card__body { font-size: var(--text-sm); line-height: 1.6; color: var(--color-text-muted); }

.strength { counter-increment: s; position: relative; }
.strength::before {
  content: '0' counter(s); position: absolute; top: clamp(var(--space-6), 3vw, var(--space-8)); right: clamp(var(--space-6), 3vw, var(--space-8));
  font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text-faint); opacity: 0.5;
  font-variant-numeric: tabular-nums;
}
.grid--strengths { counter-reset: s; }
.strength .card__title { max-width: 26ch; }

/* ---------- chip list ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); list-style: none; }
.chips li {
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.02em;
  padding: var(--space-2) var(--space-4); border: 1px solid var(--color-border);
  border-radius: var(--radius-full); color: var(--color-text-muted); background: var(--color-surface);
  max-width: none;
}

/* ---------- certification list ---------- */
.certs { list-style: none; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.certs li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-sm); color: var(--color-text); max-width: none; }
.certs svg { width: 16px; height: 16px; margin-top: 3px; color: var(--color-gold); flex: none; }

/* ============================ DARK FEATURE BAND ============================ */

.band {
  background: var(--color-ink-deep); color: #e4eaf3;
  position: relative; isolation: isolate; overflow: hidden;
}
.band::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.35;
  background: radial-gradient(120% 90% at 82% 8%, rgb(200 162 74 / 0.16), transparent 58%);
}
.band .eyebrow { color: var(--color-gold-bright); }
.band .section-title { color: #f2f6fb; }
.band .prose p { color: #aab8cc; }
.band .card { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.1); box-shadow: none; }
.band .card__title { color: #eef2f8; }
.band .card__body { color: #a4b2c6; }
.band .card__kicker { color: var(--color-gold-bright); }
.band .chips li { border-color: rgb(255 255 255 / 0.14); color: #b7c3d4; background: rgb(255 255 255 / 0.03); }

.philosophy__layout { display: grid; gap: clamp(var(--space-10), 6vw, var(--space-20)); grid-template-columns: minmax(0, 1fr); }
.philosophy__layout > * { min-width: 0; }
@media (min-width: 1000px) { .philosophy__layout { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.philosophy__quote {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 300; font-style: italic;
  line-height: 1.32; color: #f2f6fb; letter-spacing: -0.015em; max-width: 24ch;
}
.philosophy__quote span { color: var(--color-gold-bright); }

/* ============================ CONTACT ============================ */

.contact__layout { display: grid; gap: clamp(var(--space-10), 6vw, var(--space-16)); grid-template-columns: minmax(0, 1fr); align-items: start; }
.contact__layout > * { min-width: 0; }
@media (min-width: 900px) { .contact__layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.contact__links { list-style: none; display: flex; flex-direction: column; }
.contact__links li { border-top: 1px solid var(--color-divider); max-width: none; }
.contact__links li:last-child { border-bottom: 1px solid var(--color-divider); }
.contact__links a {
  display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-5);
  text-decoration: none; color: var(--color-text);
}
.contact__links a:hover { color: var(--color-primary); }
.contact__links .label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-faint); min-width: 92px; flex: none; }
.contact__links .value { font-size: var(--text-base); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }

@media (max-width: 520px) {
  .contact__links a { flex-wrap: wrap; row-gap: var(--space-1); }
  .contact__links .label { min-width: 100%; }
  .contact__links .arrow { margin-left: auto; }
}
.contact__links .arrow { margin-left: auto; width: 16px; height: 16px; color: var(--color-gold); flex: none; }

/* ============================ FOOTER ============================ */

.footer { border-top: 1px solid var(--color-border); padding-block: var(--space-12); background: var(--color-surface-2); }
.footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: space-between; }
.footer__note { font-size: var(--text-xs); color: var(--color-text-faint); max-width: 48ch; }
.footer__links { display: flex; gap: var(--space-6); list-style: none; flex-wrap: wrap; }
.footer__links a { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); text-decoration: none; }
.footer__links a:hover { color: var(--color-gold); }

/* ============================ SCROLL REVEAL ============================ */

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

.skip {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--color-primary); color: #fff; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: var(--space-4); }

/* ---------- balanced 2x2 for the four-item grids ---------- */
@media (min-width: 900px) {
  #education .grid--2, #governance .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- biography portrait ---------- */
.figure--portrait img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 12%; }
.figure--portrait { border-top: 2px solid var(--color-gold); padding-top: var(--space-4); }
.figure--small img { max-height: 240px; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 999px) { .figure--small { display: none; } }

/* ============================ SERVICE GALLERY ============================ */

.section-lede {
  margin-top: var(--space-5); max-width: 62ch;
  font-size: var(--text-base); line-height: 1.62; color: var(--color-text-muted);
}
.band .section-lede { color: #a4b2c6; }

.gallery__lead { margin: 0 0 var(--space-6); }
.gallery__lead img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid rgb(255 255 255 / 0.10);
}
.gallery__lead figcaption,
.gallery figcaption {
  margin-top: var(--space-3); font-size: var(--text-xs); line-height: 1.5;
  letter-spacing: 0.04em; color: #8b99ad;
}

.gallery {
  list-style: none; display: grid; gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
}
.gallery li { max-width: none; min-width: 0; }

/* two-up on tablet */
@media (min-width: 620px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* three-up on desktop, with the final row of two spanning wider so there is no orphan */
@media (min-width: 940px) {
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gallery li { grid-column: span 2; }
  .gallery li:nth-child(4), .gallery li:nth-child(5) { grid-column: span 3; }
  .gallery li:nth-child(4) img, .gallery li:nth-child(5) img { aspect-ratio: 3 / 2; }
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-md); border: 1px solid rgb(255 255 255 / 0.10);
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .gallery figure:hover img { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery img { transition: none; }
  .gallery figure:hover img { transform: none; }
}

/* ===================== ENGAGEMENT (COLOR) GALLERY ===================== */

section.alt {
  background: var(--color-surface-2);
  border-block: 1px solid var(--color-border);
}

.gallery--pro { gap: var(--space-7) var(--space-6); }
.gallery--pro img {
  aspect-ratio: 3 / 2;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.gallery--pro figcaption { color: var(--color-text-muted); }

@media (min-width: 620px) {
  .gallery--pro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 940px) {
  .gallery--pro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery--pro li,
  .gallery--pro li:nth-child(4),
  .gallery--pro li:nth-child(5) { grid-column: auto; }
  .gallery--pro li:nth-child(4) img,
  .gallery--pro li:nth-child(5) img { aspect-ratio: 3 / 2; }
}
