/* Two reversible visual studies; the recorded portrait always stays white. */
:root{--paper:#fff}
.site-header{background:rgba(255,255,255,.96)}
html[data-background] .visual-stage{background:#fff;color:var(--ink);transition:none}
html[data-background] .visual-stage .stage-caption,
html[data-background] .visual-stage .stage-index{color:var(--muted)}
html[data-background] .visual-stage .chapter-track span:not(.active){background:var(--line)}
html[data-background] .chapter,
html[data-background] .projects-section,
html[data-background] .writing-section,
html[data-background] .personal-projects{background:#fff;color:var(--ink);border-color:var(--line)}
html[data-background] .chapter{border-left:0}
html[data-background] .chapter-tech>.eyebrow,
html[data-background] .chapter-tech .mobile-heading-group>.eyebrow,
html[data-background] .chapter-tech>p:not(.eyebrow):not(.lead),
html[data-background] .expertise-panel p,
html[data-background] .writing-section .section-heading>p,
html[data-background] .empty-writing p,
html[data-background] .post-card p,
html[data-background] .post-card .eyebrow{color:var(--muted)}
html[data-background] .expertise-tabs,
html[data-background] .tags span,
html[data-background] .interest,
html[data-background] .interest-copy,
html[data-background] .empty-writing,
html[data-background] .post-card{border-color:var(--line)}
html[data-background] .expertise-tabs button{color:var(--muted)}
html[data-background] .expertise-tabs button[aria-selected="true"]{color:var(--ink)}
html[data-background] .interest.active{color:#fff;border-color:var(--ink)}
html[data-background] .interest:hover:not(.active){background:#f1f7ed}
html[data-background] .outline-text{-webkit-text-stroke-color:var(--ink)}
html[data-background] .personal-projects{border:1px solid var(--line);border-left:4px solid var(--orange)}
/* Keep the content width; decorative backgrounds reach the viewport edges. */
.chapter-intro{--chapter-tint:#fff}
.chapter-people{--chapter-tint:#f3e7f3}
.chapter-universe{--chapter-tint:#dcf4cb}
.chapter-tech{--chapter-tint:#e5eaf0}
.projects-section{--chapter-tint:#fff0e5}
.writing-section{--chapter-tint:#e9eaf0}
html[data-background="gradient"] .chapter,
html[data-background="gradient"] .projects-section,
html[data-background="gradient"] .writing-section{background:#fff}
html[data-background="gradient"] .projects-section,
html[data-background="gradient"] .writing-section{position:relative;isolation:isolate}
html[data-background="gradient"] .projects-section>*,
html[data-background="gradient"] .writing-section>*{position:relative;z-index:1}
html[data-background="gradient"] .chapter::before,
html[data-background="gradient"] .projects-section::before,
html[data-background="gradient"] .writing-section::before{
 content:"";position:absolute;top:0;bottom:0;left:0;right:calc(-1 * var(--background-gutter, 0px));z-index:0;pointer-events:none;
 background:linear-gradient(180deg,#fff 0%,transparent 22%,transparent 78%,#fff 100%),linear-gradient(90deg,#fff 0%,#fff 8%,var(--chapter-tint) 100%);
}
html[data-background="gradient"] .projects-section::before,
html[data-background="gradient"] .writing-section::before{left:calc(-1 * var(--background-gutter, 0px))}
.background-preview{position:fixed;right:18px;bottom:18px;z-index:15;display:flex;gap:4px;align-items:center;padding:6px;border:1px solid #ddd;border-radius:30px;background:#ffffffed;box-shadow:0 4px 20px #0000000d;backdrop-filter:blur(12px)}
.background-preview>span{font-size:11px;color:var(--muted);padding:0 8px}
.background-preview button{font-size:12px;background:transparent;border:0;border-radius:22px;padding:9px 14px}
.background-preview button[aria-pressed="true"]{background:var(--ink);color:#fff}
@media(max-width:760px){
 html[data-background] .visual-stage{border-bottom:0}
 html[data-background="gradient"] .chapter::before{background:linear-gradient(180deg,#fff 0%,var(--chapter-tint) 58%,#fff 100%)}
 .background-preview{right:12px;bottom:12px}.background-preview>span{display:none}
}
@media print{.background-preview,html[data-background="gradient"] .chapter::before,html[data-background="gradient"] .projects-section::before,html[data-background="gradient"] .writing-section::before{display:none}html[data-background="gradient"] .chapter,html[data-background="gradient"] .projects-section,html[data-background="gradient"] .writing-section{background:#fff}}
