:root {
  --bg: #faf8f5;
  --bg-alt: #f2eee8;
  --surface: #ffffff;
  --ink: #0f1b2d;
  --text: #2b3546;
  --muted: #667085;
  --line: #e4ded5;
  --accent: #a8612a;
  --accent-strong: #8a4c1d;
  --accent-soft: #f4e6d9;
  --on-accent: #ffffff;
  --band: #0f1b2d;
  --band-text: #e9edf3;
  --band-muted: #a3afc2;
  --good: #2f8a5b;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .06);
  --radius: 14px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c121c; --bg-alt: #111926; --surface: #151f2e; --ink: #f1f3f7; --text: #c9d1dc; --muted: #8b97a8;
    --line: #243042; --accent: #d08a4f; --accent-strong: #e3a26b; --accent-soft: #2a2119; --on-accent: #10161f;
    --band: #111926; --band-text: #e9edf3; --band-muted: #93a0b3; --good: #5cc28d;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c121c; --bg-alt: #111926; --surface: #151f2e; --ink: #f1f3f7; --text: #c9d1dc; --muted: #8b97a8;
  --line: #243042; --accent: #d08a4f; --accent-strong: #e3a26b; --accent-soft: #2a2119; --on-accent: #10161f;
  --band: #111926; --band-text: #e9edf3; --band-muted: #93a0b3; --good: #5cc28d;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); margin-bottom: 1.5rem; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
strong { color: var(--ink); font-weight: 600; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--bg); font: 600 13px/1 var(--sans); letter-spacing: .04em; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: block; }
}
@media (max-width: 820px) { .nav-links { display: none; } .nav-actions { margin-left: auto; } .brand-name { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 11px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn-small { padding: 9px 14px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* Hero */
.hero { padding: clamp(32px, 5vw, 64px) 0 clamp(40px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.eyebrow { color: var(--accent-strong); font-size: 13.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.4rem); letter-spacing: -.02em; margin-bottom: 14px; }
.headline { font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.5rem); color: var(--ink); opacity: .85; margin-bottom: 18px; }
.tagline { font-size: 17px; max-width: 58ch; color: var(--text); }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); margin: 6px 0 26px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

.portrait { margin: 0; justify-self: center; width: min(380px, 100%); }
.portrait-frame { position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: visible; }
.portrait-frame::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--accent); border-radius: 22px; opacity: .55; }
.portrait-frame img, .monogram { position: relative; width: 100%; height: 100%; border-radius: 22px; object-fit: cover; box-shadow: var(--shadow); }
.monogram { display: grid; place-items: center; background: linear-gradient(150deg, var(--ink), color-mix(in srgb, var(--ink) 70%, var(--accent))); color: var(--bg); font: 600 clamp(4rem, 10vw, 6rem)/1 var(--serif); letter-spacing: .02em; }
:root[data-theme="dark"] .monogram { background: linear-gradient(150deg, #1d2a3d, #3a2a1c); color: #f1f3f7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .monogram { background: linear-gradient(150deg, #1d2a3d, #3a2a1c); color: #f1f3f7; } }
.portrait figcaption { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; color: var(--muted); font-size: 14px; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(240px, 70%); justify-self: start; }
  .portrait figcaption { justify-content: flex-start; margin-top: 26px; }
}

/* Metrics band */
.metrics-band { background: transparent; color: var(--text); padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.metric { border-left: 1px solid var(--line); padding-left: 18px; }
.metric-value { font: 600 clamp(1.6rem, 2.8vw, 2.1rem)/1.05 var(--serif); color: var(--ink); margin-bottom: 8px; }
.metric-label { font-size: 14px; font-weight: 400; color: var(--muted); margin-bottom: 4px; line-height: 1.4; }
.metric-detail { font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .metrics { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: clamp(44px, 6vw, 72px) 0; }
.section.alt { background: var(--bg-alt); }
.kicker { color: var(--accent-strong); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.prose p { font-size: 17px; max-width: 64ch; }
.lead { font-size: 17px; max-width: 52ch; }

.goals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.goals h3 { margin-bottom: 20px; }
.goal-list { list-style: none; margin: 0; padding: 0; position: relative; }
.goal-list li { position: relative; padding: 0 0 22px 30px; }
.goal-list li:last-child { padding-bottom: 0; }
.goal-list li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); }
.goal-list li:first-child::before { background: var(--accent); }
.goal-list li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.goal-when { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.goal-title { font-weight: 600; color: var(--ink); margin: 2px 0; }
.goal-detail { font-size: 14.5px; margin: 0; }

/* Experience */
.company { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow); margin-bottom: 20px; }
.company-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.company-head h3 { font-size: 1.45rem; }
.company-loc { color: var(--muted); font-size: 14.5px; }
.role { position: relative; padding-left: 28px; }
.role + .role { margin-top: 30px; }
.role::before { content: ""; position: absolute; left: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.role:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 24px; bottom: -26px; width: 2px; background: var(--line); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; }
.role-title { font: 600 1.1rem/1.3 var(--sans); color: var(--ink); }
.role-dates { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.role-team { color: var(--muted); font-size: 14.5px; margin: 2px 0 12px; }
.promo { margin-left: 6px; color: var(--muted); font-family: var(--sans); font-size: 13.5px; font-weight: 400; font-style: italic; }
.promo::before { content: "· "; font-style: normal; }
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin-bottom: 8px; padding-left: 4px; }
.bullets li::marker { color: var(--accent); }

/* Credentials */
.cred-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 860px) { .cred-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h3 { margin-bottom: 6px; }
.card .sub { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: 14.5px; margin-bottom: 18px; }
.progress { margin: 4px 0 16px; }
.progress-track { display: flex; gap: 6px; margin-bottom: 8px; }
.progress-step { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.progress-step.done { background: var(--accent); }
.progress-label { font-size: 14px; color: var(--muted); }
.edu-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14.5px; margin-bottom: 10px; flex-wrap: wrap; }

/* Leadership */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.lead-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.lead-card h3 { font: 600 1.05rem/1.3 var(--sans); margin-bottom: 4px; }
.lead-card .org { color: var(--accent-strong); font-size: 13.5px; font-weight: 500; margin-bottom: 10px; }
.lead-card p:last-child { margin: 0; font-size: 15px; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
@media (max-width: 860px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-group h3 { font: 600 .95rem/1.3 var(--sans); margin-bottom: 12px; color: var(--ink); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.chips.subtle li { background: transparent; }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.extras h3 { font: 600 .95rem/1.3 var(--sans); margin-bottom: 12px; }
@media (max-width: 640px) { .extras { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--bg-alt); }
.contact-links { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.contact-links li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.contact-links a { color: var(--ink); text-decoration: none; font-weight: 500; word-break: break-all; }
.contact-links a:hover { color: var(--accent-strong); text-decoration: underline; }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 30px); box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field textarea { resize: vertical; min-height: 120px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 12px 0 0; font-size: 14px; min-height: 1.4em; }
.form-note.ok { color: var(--good); }
.form-note.err { color: #c2412d; }

/* Footer */
.footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.muted { color: var(--muted); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Preview banner (admin draft preview) */
.preview-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); }

@media print {
  .nav, .cta, .contact-form, .metrics-band, #theme-toggle, .footer a, .preview-bar { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .section, .hero { padding: 16px 0; }
  .section.alt, .contact { background: none; }
  .card, .company, .lead-card, .goals { box-shadow: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Compact cards and links */
.company-link { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.company-link:hover { color: var(--accent-strong); }
.company { margin-bottom: 16px; }
.lead-card { padding: 18px 20px; }
.lead-card .org { margin-bottom: 6px; }
.metrics-band { padding: 32px 0; }
.two-col:has(> .goals[hidden]) { grid-template-columns: 1fr; }

/* Inspiration quote */
.quote-band { padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
.quote { margin: 0 auto; max-width: 760px; text-align: center; }
.quote blockquote { margin: 0; }
.quote blockquote p { font: italic 500 clamp(1.35rem, 2.6vw, 1.9rem)/1.35 var(--serif); color: var(--ink); margin: 0 0 14px; }
.quote blockquote p::before { content: "\201C"; color: var(--accent); margin-right: 2px; }
.quote blockquote p::after { content: "\201D"; color: var(--accent); margin-left: 2px; }
.quote figcaption { color: var(--muted); font-size: 14.5px; }
.quote figcaption span:first-child { color: var(--ink); font-weight: 600; }
.quote-role::before { content: " · "; }
.quote-role:empty { display: none; }

/* Hero background: a faint price line crossing a risk limit, flagged where it breaches */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, rgba(0,0,0,.35) 30%, #000 70%), linear-gradient(to bottom, #000 70%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(100deg, transparent 0%, rgba(0,0,0,.35) 30%, #000 70%), linear-gradient(to bottom, #000 70%, transparent); mask-composite: intersect; }
.hb-gridline { fill: none; stroke: var(--line); stroke-width: 1; opacity: .7; }
.hb-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; opacity: .55; stroke-dasharray: 4200; stroke-dashoffset: 4200; animation: hb-draw 3.2s ease-out .3s forwards; }
.hb-stop1 { stop-color: var(--accent); stop-opacity: .10; }
.hb-stop2 { stop-color: var(--accent); stop-opacity: 0; }
.hb-limit { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 6 7; opacity: .28; }
.hb-label { fill: var(--muted); font: 600 12px var(--sans); letter-spacing: .14em; opacity: .8; }
.hb-flag { fill: none; stroke: var(--bad, #c0392b); stroke-width: 1.5; opacity: 0; animation: hb-pulse 2.8s ease-out 2.6s infinite; }
.hb-dot { fill: var(--bad, #c0392b); opacity: 0; animation: hb-in .4s ease-out 2.4s forwards; }
.hb-candles line { stroke: var(--muted); stroke-width: 1; opacity: .3; }
.hb-candles rect { opacity: .22; }
.hb-candles .up { fill: var(--good); } .hb-candles .dn { fill: var(--accent); }
@keyframes hb-draw { to { stroke-dashoffset: 0; } }
@keyframes hb-in { to { opacity: .9; } }
@keyframes hb-pulse { 0% { opacity: .6; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
.hb-flag { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .hb-line { animation: none; stroke-dashoffset: 0; } .hb-flag { animation: none; opacity: .5; } .hb-dot { animation: none; opacity: .75; } }
@media (max-width: 820px) { .hb-label { display: none; } .hero-bg { -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 85%); mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 85%); } }
/* Scroll parallax: app.js sets --p from 0 to 1 as the hero scrolls away. Layers move at different speeds. */
.hero-bg { opacity: calc(1 - var(--p, 0) * .55); }
.hb-grid-layer { transform: translateY(calc(var(--p, 0) * -70px)); }
.hb-series { transform: translate(calc(var(--p, 0) * -180px), calc(var(--p, 0) * 50px)); }
.hb-candles { transform: translateY(calc(var(--p, 0) * -150px)); opacity: calc(1 - var(--p, 0) * .6); }
.hb-limit, .hb-label { transform: translateY(calc(var(--p, 0) * 20px)); }
@media (prefers-reduced-motion: reduce) { .hb-grid-layer, .hb-series, .hb-candles, .hb-limit, .hb-label { transform: none; } }
@media print { .hero-bg { display: none; } }
