/* ==========================================================================
   The Yinbil Family — shared stylesheet
   Self-contained: no external fonts or CDNs (matches the Caddy CSP).
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/playfair-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/playfair-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/sourcesans3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/sourcesans3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/sourcesans3-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --bg-tint: #efe8dc;
  --surface: #fffdf9;
  --surface-2: #f3eee5;
  --text: #13213a;
  --text-muted: #56627a;
  --border: #e0d7c7;
  --border-strong: #cbbfa9;
  --accent: #9a6f1f;          /* gold, darkened for AA contrast on light */
  --accent-soft: rgba(176, 131, 47, 0.12);
  --accent-ink: #fffdf9;
  --gold-grad: linear-gradient(135deg, #b98b35 0%, #d9b061 100%);
  --link: #1d58b3;
  --ring: #2f74e0;
  --header-bg: rgba(247, 243, 236, 0.82);
  --shadow-sm: 0 1px 2px rgba(19, 33, 58, 0.06), 0 1px 3px rgba(19, 33, 58, 0.08);
  --shadow-lg: 0 18px 40px -12px rgba(19, 33, 58, 0.22);
  --glow-1: rgba(61, 139, 253, 0.10);
  --glow-2: rgba(212, 168, 83, 0.14);
  --tree-link: #b9ad97;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 64px;
  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1628;
    --bg-tint: #0d1c33;
    --surface: #0f2137;
    --surface-2: #162d4a;
    --text: #e8edf4;
    --text-muted: #9aa9bd;
    --border: rgba(120, 160, 220, 0.18);
    --border-strong: rgba(120, 160, 220, 0.32);
    --accent: #d4a853;
    --accent-soft: rgba(212, 168, 83, 0.14);
    --accent-ink: #0a1628;
    --gold-grad: linear-gradient(135deg, #d4a853 0%, #e8c87a 100%);
    --link: #7fb2ff;
    --ring: #6ba8ff;
    --header-bg: rgba(10, 22, 40, 0.82);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 44px -14px rgba(0, 0, 0, 0.6);
    --glow-1: rgba(61, 139, 253, 0.10);
    --glow-2: rgba(212, 168, 83, 0.07);
    --tree-link: #2f4a6e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1628;
  --bg-tint: #0d1c33;
  --surface: #0f2137;
  --surface-2: #162d4a;
  --text: #e8edf4;
  --text-muted: #9aa9bd;
  --border: rgba(120, 160, 220, 0.18);
  --border-strong: rgba(120, 160, 220, 0.32);
  --accent: #d4a853;
  --accent-soft: rgba(212, 168, 83, 0.14);
  --accent-ink: #0a1628;
  --gold-grad: linear-gradient(135deg, #d4a853 0%, #e8c87a 100%);
  --link: #7fb2ff;
  --ring: #6ba8ff;
  --header-bg: rgba(10, 22, 40, 0.82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 44px -14px rgba(0, 0, 0, 0.6);
  --glow-1: rgba(61, 139, 253, 0.10);
  --glow-2: rgba(212, 168, 83, 0.07);
  --tree-link: #2f4a6e;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 56px);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 10% -10%, var(--glow-1), transparent 60%),
    radial-gradient(50rem 36rem at 100% 10%, var(--glow-2), transparent 60%);
  background-repeat: no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 2000;
  background: var(--surface); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 12px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
  margin-right: auto;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--gold-grad); color: #0a1628;
  font-size: 0.95rem; font-weight: 700;
}

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--text-muted); text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav-list a[aria-current="page"]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle; transform: translateY(-1px);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 12px var(--gutter) 20px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 1.05rem; }
}

/* ---------- Buttons, chips, tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 0.95rem; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--gold-grad); color: #0a1628; box-shadow: 0 6px 20px -6px rgba(212, 168, 83, 0.55); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -8px rgba(212, 168, 83, 0.7); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--branch, var(--accent)); background: var(--accent-soft); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--branch, var(--accent)); }
.chip .count { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li {
  padding: 3px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem;
}

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 8vw, 88px); text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--border);
  color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 28px;
}
.flag { display: inline-flex; width: 22px; height: 15px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.12); }
.flag svg { width: 100%; height: 100%; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5.25rem);
  margin-bottom: 18px;
  background: linear-gradient(120deg, var(--text) 10%, var(--accent) 50%, var(--text) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-lede { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--text-muted); max-width: 40rem; margin: 0 auto 10px; }
.hero-quote { font-style: italic; color: var(--text-muted); margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; max-width: 760px; margin: 52px auto 0;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--surface); padding: 18px 12px; display: flex; flex-direction: column-reverse; }
.stat dd { margin: 0; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-tint); border-block: 1px solid var(--border); }
.section-head { max-width: 44rem; margin-bottom: 36px; }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.section-head p { color: var(--text-muted); font-size: 1.08rem; }

/* ---------- Directory ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.search {
  position: relative; flex: 1 1 260px; max-width: 360px;
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 14px 10px 42px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.result-count { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 16px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.person-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.person-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--branch, var(--accent)); }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.person-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--branch, var(--accent));
  background: color-mix(in srgb, var(--branch, var(--accent)) 14%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--branch, var(--accent)) 45%, transparent);
}
.person-name { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; margin: 0; letter-spacing: 0; }
.person-role { margin: 2px 0 0; color: var(--text-muted); font-size: 0.92rem; }
.person-meta { display: grid; gap: 6px; font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.person-meta div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.person-meta svg { width: 16px; height: 16px; flex: none; opacity: 0.8; }
.person-meta a { color: inherit; overflow-wrap: anywhere; }
.person-meta a:hover { color: var(--link); }
.person-actions { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.branch-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.branch-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--branch, var(--accent)); }
.soon { font-size: 0.85rem; color: var(--text-muted); font-style: italic; align-self: center; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Feature (tree teaser) ---------- */
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center;
  padding: clamp(24px, 5vw, 48px); border-radius: calc(var(--radius) + 6px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.feature-art { aspect-ratio: 4 / 3; width: 100%; color: var(--accent); }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } .feature-art { max-width: 420px; margin-inline: auto; } }

/* ---------- Contact ---------- */
.contact-card {
  max-width: 640px; margin: 0 auto; text-align: center;
  padding: clamp(24px, 5vw, 44px); border-radius: calc(var(--radius) + 6px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.email-line { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.email-line a { font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 700; color: var(--text); text-decoration: none; }
.email-line a:hover { color: var(--link); text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--text-muted); font-size: 0.92rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.footer-brand { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 1.1rem; }

/* ---------- Profile pages ---------- */
.profile-hero { padding: clamp(40px, 7vw, 80px) 0 clamp(28px, 5vw, 48px); }
.profile-hero .container { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; }
.profile-avatar {
  width: clamp(96px, 16vw, 148px); height: clamp(96px, 16vw, 148px); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 5vw, 3.1rem);
  color: var(--branch, var(--accent));
  background: color-mix(in srgb, var(--branch, var(--accent)) 12%, var(--surface));
  border: 3px solid color-mix(in srgb, var(--branch, var(--accent)) 50%, transparent);
  box-shadow: var(--shadow-lg);
}
.profile-hero h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); margin-bottom: 6px; }
.profile-role { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.profile-summary { color: var(--text-muted); max-width: 46rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.crumbs { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.crumbs a { color: inherit; }
@media (max-width: 640px) { .profile-hero .container { grid-template-columns: 1fr; text-align: left; } }

.subnav {
  position: sticky; top: var(--header-h); z-index: 900;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-block: 1px solid var(--border);
}
.subnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 8px 0; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
  display: block; white-space: nowrap; padding: 6px 14px; border-radius: 999px;
  color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.subnav a:hover { color: var(--text); background: var(--surface-2); }
.subnav a.is-active { color: var(--text); background: var(--accent-soft); }

.profile-body .section { padding: clamp(40px, 6vw, 72px) 0; }
.profile-body .section + .section { border-top: 1px solid var(--border); }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.prose p { color: var(--text); }
.panel-card {
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.panel-card h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 0.95rem; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline > li { position: relative; padding: 0 0 28px 36px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-when { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tl-title { font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; margin: 4px 0 2px; letter-spacing: 0; }
.tl-org { color: var(--text-muted); margin-bottom: 10px; }
.tl-body { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tl-body ul { margin: 0; padding-left: 1.15em; }
.tl-body li + li { margin-top: 4px; }
.tl-body p:last-child { margin-bottom: 0; }
.tl-note { margin-top: 10px; font-size: 0.9rem; color: var(--text-muted); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.skill-card h3 { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); }
.skill-card h3 svg { width: 20px; height: 20px; color: var(--accent); }

.pub { display: grid; gap: 6px; }
.pub-title { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; margin: 0; letter-spacing: 0; }
.pub-meta { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.link-list a {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-list a:hover { border-color: var(--border-strong); transform: translateX(2px); }
.link-list svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.link-list .sub { display: block; font-weight: 400; font-size: 0.85rem; color: var(--text-muted); }
.ext::after { content: " ↗"; font-weight: 400; color: var(--text-muted); }

.quote {
  margin: 0; padding: 22px 26px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display); font-style: italic; font-size: 1.15rem;
}

.copy-btn[data-copied="true"] { border-color: var(--accent); color: var(--accent); }
.grid-2 + .quote { margin-top: 28px; }
.facts + .link-list { margin-top: 18px; }

/* ---------- Professional profile extras ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px; margin-bottom: 14px; border-radius: 999px;
  background: color-mix(in srgb, #10b981 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
  color: var(--text); font-weight: 600; font-size: 0.86rem;
}
.status-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.profile-hero .stats { margin: 30px 0 0; max-width: 760px; }
.profile-hero .stat { padding: 16px 14px; }
.profile-hero .stat-num { color: var(--branch, var(--accent)); }

.avatar-wrap { position: relative; display: grid; place-items: center; }
.avatar-net { position: absolute; width: 150%; height: 150%; max-width: none; color: var(--branch, var(--accent)); opacity: 0.45; pointer-events: none; }
.avatar-wrap .profile-avatar { position: relative; }

.expertise-card h3 svg { color: var(--branch, var(--accent)); }
.expertise-card p { color: var(--text-muted); margin-bottom: 12px; }

.speed-card { display: grid; gap: 14px; }
.speed-row { display: grid; gap: 6px; }
.speed-row .label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.speed-row .label strong { font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar { height: 100%; border-radius: 999px; }
.bar-slow { width: 100%; background: var(--border-strong); }
.bar-fast { width: 2%; min-width: 8px; background: var(--branch, var(--accent)); }
.speed-card .facts { margin-top: 6px; }

.platform-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: clamp(22px, 4vw, 36px); border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, var(--branch, var(--accent)), var(--accent)) border-box;
  border: 2px solid transparent; box-shadow: var(--shadow-lg);
}
.platform-card h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 6px; }
.platform-card p { color: var(--text-muted); margin: 0; }
.platform-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  color: var(--branch, var(--accent));
  background: color-mix(in srgb, var(--branch, var(--accent)) 14%, var(--surface));
}
.platform-icon svg { width: 32px; height: 32px; }
.btn-soon { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); cursor: default; }
@media (max-width: 720px) { .platform-card { grid-template-columns: 1fr; } }

/* Branch colours for static (profile) pages — keep in sync with data/family.json */
.branch-ibrahim { --branch: #3d8bfd; }
.branch-philip  { --branch: #10b981; }
.branch-osman   { --branch: #f59e0b; }
.branch-yaw     { --branch: #ec4899; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Family tree page ---------- */
.tree-page { display: flex; flex-direction: column; }
.tree-intro { padding: 32px 0 18px; }
.tree-intro h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 6px; }
.tree-intro p { color: var(--text-muted); margin: 0; max-width: 48rem; }

.tree-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-bottom: 14px; }
.tree-toolbar .search { max-width: 300px; }
.tree-toolbar .chips { flex: 1 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; color: var(--text-muted); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }

.tree-shell {
  position: relative;
  height: min(72vh, 760px); min-height: 420px;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tree-shell[hidden] { display: none; }
.tree-svg { width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tree-svg.is-panning { cursor: grabbing; }
.tree-svg:focus-visible { outline-offset: -3px; }

.tree-controls { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.tree-hint { position: absolute; left: 14px; bottom: 12px; font-size: 0.82rem; color: var(--text-muted); background: var(--surface); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
@media (max-width: 560px) { .tree-hint { display: none; } }

.t-link { fill: none; stroke: var(--tree-link); stroke-width: 2; }
.t-link.is-lit { stroke: var(--accent); stroke-width: 3; }
.t-spouse { stroke: var(--tree-link); stroke-width: 2; stroke-dasharray: 4 4; fill: none; }
.t-node { cursor: pointer; outline: none; transition: opacity 0.2s ease; }
.t-node .t-card { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.25; transition: stroke 0.15s ease; }
.t-node .t-bar { fill: var(--branch, var(--accent)); }
.t-node .t-av { fill: color-mix(in srgb, var(--branch, var(--accent)) 16%, var(--surface)); stroke: var(--branch, var(--accent)); stroke-width: 1.5; }
.t-node .t-ini { fill: var(--branch, var(--accent)); font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.t-node .t-name { fill: var(--text); font-family: var(--font-body); font-weight: 700; font-size: 14.5px; }
.t-node .t-sub { fill: var(--text-muted); font-family: var(--font-body); font-size: 12.5px; }
.t-node:hover .t-card { stroke: var(--accent); }
.t-node:focus-visible .t-card { stroke: var(--ring); stroke-width: 3; }
.t-node.is-selected .t-card { stroke: var(--accent); stroke-width: 3; }
.t-node.is-placeholder .t-card { stroke-dasharray: 6 5; fill: var(--surface-2); }
.t-node.is-dim { opacity: 0.22; }
.t-link.is-dim { opacity: 0.25; }

.tree-layout { display: grid; grid-template-columns: 1fr; gap: 16px; position: relative; }
.person-panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px; width: min(340px, calc(100% - 24px));
  overflow-y: auto; z-index: 5;
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.person-panel[hidden] { display: none; }
.panel-close { position: absolute; top: 10px; right: 10px; }
.person-panel h2 { font-size: 1.5rem; margin: 10px 40px 4px 0; }
.person-panel .person-role { margin-bottom: 14px; }
.person-panel h3 { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 8px; }
.rel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rel-list button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  font-size: 0.88rem; cursor: pointer;
}
.rel-list button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--branch, var(--accent)); }
.rel-list button:hover { border-color: var(--border-strong); }
.panel-note { color: var(--text-muted); font-size: 0.95rem; }
@media (max-width: 640px) {
  .person-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62%; }
}

.tree-list { padding: 8px 0 8px; }
.tree-list[hidden] { display: none; }
.tree-list ul { list-style: none; margin: 0; padding-left: 22px; border-left: 2px solid var(--border); }
.tree-list > ul { padding-left: 0; border-left: 0; }
.tree-list li { margin: 6px 0; }
.tree-list button {
  display: inline-flex; align-items: center; gap: 10px; text-align: left;
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer;
}
.tree-list button:hover { border-color: var(--border-strong); }
.tree-list button .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--branch, var(--accent)); flex: none; }
.tree-list .sub { color: var(--text-muted); font-size: 0.88rem; }

.grow-note {
  margin: 22px 0 8px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.95rem;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(64px, 14vw, 160px) 0; }
.notfound .code { font-family: var(--font-display); font-size: clamp(4rem, 16vw, 9rem); line-height: 1; color: var(--accent); margin-bottom: 8px; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .subnav, .site-footer, .profile-actions, .tree-controls, .tree-toolbar, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 16px 0; }
  a { color: inherit; }
}
