/* Theme (light/dark), themed header logo, splash & motion — loaded after modern.css */
:root{--kx-surface:#fff;--kx-text:#14241d;--kx-soft:#3d4f46}
html[data-theme=dark]{color-scheme:dark;--kx-surface:#0f261d;--kx-text:#f4f0e8;--kx-soft:rgba(244,240,232,.72)}
html.kx-theming *{transition:background-color .5s,color .5s,border-color .5s,box-shadow .5s!important}

/* ---- header: two logos + toggle ---- */
.kx-logo .logo-dark{display:none}
[data-theme=light] .kx-head.is-solid{background:rgba(250,247,241,.9);box-shadow:0 10px 30px -16px rgba(7,31,25,.35)}
[data-theme=light] .is-solid .kx-logo .logo-dark{display:block}
[data-theme=light] .is-solid .kx-logo .logo-light{display:none}
[data-theme=light] .is-solid .kx-nav a{color:#14241d}
[data-theme=light] .is-solid .kx-nav a:hover,[data-theme=light] .is-solid .kx-nav a.is-on{color:#a98a3f}
[data-theme=light] .is-solid .kx-nav a.kx-pill-cta{color:#0c3328}
[data-theme=light] .is-solid .kx-nav a.kx-pill-cta:hover{color:#071f19}
[data-theme=light] .is-solid .kx-burger i{background:#0c3328}
[data-theme=light] .is-solid .kx-menu a{color:#f4f0e8}
.kx-theme{position:relative;width:2.5rem;height:2.5rem;margin-left:.9rem;border-radius:50%;border:1px solid rgba(196,163,90,.6);background:transparent;color:#f0dca0;cursor:pointer;flex:none;overflow:hidden;transition:.3s}
.kx-theme:hover{background:rgba(196,163,90,.18);transform:rotate(15deg)}
[data-theme=light] .is-solid .kx-theme{color:#0c3328;border-color:#c4a35a}
.kx-theme svg{position:absolute;inset:0;margin:auto;width:1.15rem;height:1.15rem;transition:transform .6s var(--kx-ease),opacity .4s}
.kx-theme .i-sun{transform:rotate(-90deg) scale(0);opacity:0}
[data-theme=dark] .kx-theme .i-sun{transform:none;opacity:1}
[data-theme=dark] .kx-theme .i-moon{transform:rotate(90deg) scale(0);opacity:0}
.kx-bar>div.kx-tools{display:flex;align-items:center}

/* ---- dark surfaces ---- */
[data-theme=dark] .bg-parchment{background:#07140f}
[data-theme=dark] .text-ink,[data-theme=dark] .text-forest{color:#f4f0e8}
[data-theme=dark] .text-ink-soft,[data-theme=dark] .text-muted{color:var(--kx-soft)}
[data-theme=dark] .bg-white:not(a):not(button),[data-theme=dark] .bg-cream:not(a):not(button){background:var(--kx-surface)}
[data-theme=dark] .border-line{border-color:rgba(196,163,90,.22)}
[data-theme=dark] .section-shade{background:rgba(12,51,40,.42)!important}
[data-theme=dark] .section-shade--soft{background:rgba(7,25,19,.55)!important}
[data-theme=dark] :is(.kx-card,.glass-card,.lead-card,.brand-link,.office-card,.org-box,.card,.value-item,.kx-map,.fin-card,form,input,textarea,select){background-color:var(--kx-surface);border-color:rgba(196,163,90,.22);color:var(--kx-text)}
[data-theme=dark] :is(.kx-card h3,.lead-card__name,.kx-title,.card__title,.brand-link span,.value-item__title,.org-box__title){color:#f4f0e8}
[data-theme=dark] :is(.kx-card p,.lead-card__note,.lead-card__bio,.card p,.value-item__text,.org-box__meta){color:var(--kx-soft)}
[data-theme=dark] :is(h1,h2,h3,h4,label,th,td,li,p):not([class*=text-cream]):not([class*=text-gold]){color:inherit}
[data-theme=dark] .lead-card__photo{border-bottom-color:#c4a35a}
[data-theme=dark] .kx-logos img{filter:brightness(1.6) saturate(.9)}
[data-theme=dark] #kx-bg{opacity:.55}

/* ---- splash (pure CSS, once per session) ---- */
#kx-splash{position:fixed;inset:0;z-index:200;display:grid;place-items:center;background:#faf7f1;animation:kxSplash 1.9s .15s var(--kx-ease) forwards}
[data-theme=dark] #kx-splash{background:#071f19}
#kx-splash img{width:min(300px,64vw);height:auto;animation:kxLogo 1.4s var(--kx-ease) both}
#kx-splash .s-light,[data-theme=dark] #kx-splash .s-dark{display:none}
[data-theme=dark] #kx-splash .s-light{display:block}
#kx-splash i{position:absolute;left:50%;top:calc(50% + 150px);width:120px;height:2px;margin-left:-60px;background:linear-gradient(90deg,transparent,#c4a35a,transparent);animation:kxBar 1.3s ease-in-out infinite}
.no-splash #kx-splash{display:none}
@keyframes kxSplash{0%,70%{opacity:1;visibility:visible}100%{opacity:0;visibility:hidden}}
@keyframes kxLogo{from{opacity:0;transform:translateY(14px) scale(.94);filter:blur(6px)}to{opacity:1;transform:none;filter:none}}
@keyframes kxBar{0%{transform:scaleX(.2);opacity:.3}50%{transform:scaleX(1);opacity:1}100%{transform:scaleX(.2);opacity:.3}}

/* ---- motion & design touches ---- */
.kx-w{display:inline-block;overflow:hidden;vertical-align:top;padding-bottom:.08em}
.kx-w>span{display:inline-block;transform:translateY(110%);animation:kxRise .9s calc(.15s*var(--i) + 1.2s) var(--kx-ease) forwards}
.no-splash .kx-w>span{animation-delay:calc(.09s*var(--i) + .2s)}
@keyframes kxRise{to{transform:none}}
.gold-rule{position:relative;overflow:hidden}
.gold-rule::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.9),transparent);transform:translateX(-100%);animation:kxShine 3.6s 1.5s ease-in-out infinite}
@keyframes kxShine{to{transform:translateX(100%)}}
.kicker{background:linear-gradient(90deg,#a98a3f,#e6c982,#a98a3f);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent!important;animation:kxFlow 6s linear infinite}
@keyframes kxFlow{to{background-position:-200% 0}}
@media(hover:hover){
 .kx-card,.lead-card{transform-style:preserve-3d}
 .kx-card:hover,.lead-card:hover{transform:perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-8px)}
 .kx-card>.kx-glow,.lead-card>.kx-glow{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .3s;background:radial-gradient(260px circle at var(--mx,50%) var(--my,50%),rgba(196,163,90,.22),transparent 60%)}
 .kx-card:hover>.kx-glow,.lead-card:hover>.kx-glow{opacity:1}
}
.lead-card{position:relative}
@media(prefers-reduced-motion:reduce){#kx-splash{display:none}.kx-w>span{transform:none;animation:none}.gold-rule::after,.kicker{animation:none}}

.kx-nav{gap:1.1rem}.kx-nav a{white-space:nowrap}@media(min-width:1120px) and (max-width:1300px){.kx-nav{gap:.8rem}.kx-nav a{letter-spacing:.09em}}

/* ---- DARK: one consistent alternating palette (overrides earlier ad-hoc shades) ---- */
html[data-theme=dark]{--d1:#091812;--d2:#0d2119;--kx-surface:#14291f}
[data-theme=dark] body,[data-theme=dark] .bg-parchment,[data-theme=dark] .bg-forest-deep:not(a):not(button){background:var(--d1)}
[data-theme=dark] section.bg-white,[data-theme=dark] section.bg-cream,[data-theme=dark] .bg-white.py-20{background:var(--d2)}
[data-theme=dark] .section-shade--soft{background:var(--d1)!important}
[data-theme=dark] .section-shade,[data-theme=dark] .section-shade--dark{background:var(--d2)!important}
[data-theme=dark] section.bg-forest{background:linear-gradient(135deg,#0f2d24,#0a2018)}
[data-theme=dark] .kx-band{background:linear-gradient(135deg,#0f2d24,#0a2018)!important}
[data-theme=dark] .card__media{background:radial-gradient(circle at 50% 42%,rgba(196,163,90,.18),transparent 62%),#0f241b}
[data-theme=dark] .kx-medal{box-shadow:0 0 0 4px #14291f,0 0 0 6px #c4a35a,0 16px 32px -14px rgba(0,0,0,.7)}
[data-theme=dark] #kx-bg{opacity:.35}
/* keep light pill buttons readable in dark theme */
[data-theme=dark] a.bg-cream,[data-theme=dark] a.bg-cream.text-forest,[data-theme=dark] a.bg-white.text-forest{color:#0c3328}
[data-theme=dark] .card__link,[data-theme=dark] .card .text-forest,[data-theme=dark] a.card span.text-forest{color:#e6c982}
[data-theme=dark] .page-company .text-forest,[data-theme=dark] .page-about .kx-title{color:#f4f0e8}
