/* Phase 6B: Index palette only; project and testimonial artwork stays unchanged. */
html[data-theme="dark"] body {background-color:#000;color:#ebebeb;}
html[data-theme="dark"] .back-l {background-image:url(imgPixelB.png);color:#ebebeb;}
html[data-theme="dark"] td[style*="imgSideBarL-L.png"] {background-image:url(imgSideBarD-L.png)!important;}
html[data-theme="dark"] td[style*="imgSideBarL-R.png"] {background-image:url(imgSideBarD-R.png)!important;}
html[data-theme="dark"] :is(#topBar,#topBar-m,#bottomBar-m,#bottomBar-m .bottombar-container) {background-color:#000!important;border-color:#0a0a0a!important;}
html[data-theme="dark"] :is(.topbar-btn,.topbar-m-btn) {color:#ebebeb;}
html[data-theme="dark"] :is(.topbar-btn,.topbar-m-btn):hover {background-color:#ebebeb;color:#000;}
html[data-theme="dark"] :is(.resume-gallery,.resume-entry-list,.footer) {color:#ebebeb;}
html[data-theme="dark"] .back-l :is(.text-b,a.no-underline):not(:is(.testimonial-container *, .popup *)) {color:#ebebeb;}
html[data-theme="dark"] .back-l :is(.text-w,a.no-underline-white):not(:is(.testimonial-container *, .popup *)) {color:#333;}
html[data-theme="dark"] .resume-button {background:#333;color:#ebebeb;}
html[data-theme="dark"] .resume-button:is(.active,:hover) {background:#ebebeb;color:#000;}
html[data-theme="dark"] .resume-button:disabled {background:#333;color:#aaa;}
html[data-theme="dark"] .resume-entry-list .resume-section-heading {background:rgba(100,100,100,.35);}

#theme-preview-toggle {position:fixed;right:12px;bottom:12px;z-index:8999;width:28px;height:28px;border:1px solid rgba(128,128,128,.5);border-radius:50%;background:rgba(230,230,230,.38);color:#333;font:22px/1 sans-serif;cursor:pointer;}
html[data-theme="dark"] #theme-preview-toggle {background:rgba(40,40,40,.38);color:#ebebeb;}
@media (max-width:767px) and (orientation:portrait) {#theme-preview-toggle {bottom:58px;}}
body:has(.popup.show) #theme-preview-toggle {visibility:hidden;}

/* Fixed background layers preserve the original centered cover artwork. */
html {background-color:#fff;}
html[data-theme="dark"] {background-color:#000;}
html body {background-color:transparent!important;background-image:none!important;}
.theme-background {position:fixed;inset:0;z-index:-1;pointer-events:none;background-position:center;background-size:cover;background-repeat:no-repeat;}
.theme-background-light {opacity:1;z-index:-2;}
.theme-background-dark {opacity:0;z-index:-1;}
html[data-theme="dark"] .theme-background-dark {opacity:1;}
html.theme-ready .theme-background-dark {transition:opacity 500ms ease;}
html.theme-ready :is(.back-l,#topBar,#topBar-m,#bottomBar-m,#bottomBar-m .bottombar-container,.topbar-btn,.topbar-m-btn,.resume-button,#theme-preview-toggle) {transition:background-color 500ms ease,border-color 500ms ease;}
/* Text and links switch together; avoid a second transition on inherited colours. */
html.theme-ready .back-l :is(.text-b,.text-w,a.no-underline,a.no-underline-white):not(:is(.testimonial-container *, .popup *)) {transition:color 0s!important;}
html.theme-ready :is(.back-l,.resume-gallery,.resume-entry-list,.footer) {transition:background-color 500ms ease,border-color 500ms ease;}
/* Match the top-bar hover palette without changing the heading geometry. */
.testimonial-container .resume-btn:hover {background-color:#333;color:#fff!important;}
html[data-theme="dark"] .testimonial-container .resume-table .resume-btn:hover {background-color:#ebebeb!important;color:#000!important;}
#theme-preview-toggle {display:grid;place-items:center;padding:0;}
#theme-preview-toggle svg {width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
/* Only the first and last carousel slides change artwork. */
html[data-theme="dark"] .testimonial-container :is(.resume-table,.resume-mobile-slide,.testimonial-table[style*="imgTestimonial0002"],.testimonial-mobile-card.quote-misc) {background-image:url('imgPopup-Stasis010.jpg')!important;background-size:cover!important;background-position:center!important;background-color:#111!important;color:#ebebeb!important;}
html[data-theme="dark"] .testimonial-container :is(.resume-table,.resume-mobile-slide,.testimonial-table[style*="imgTestimonial0002"],.testimonial-mobile-card.quote-misc) :is(td,a,button,u,i,abbr,.testimonial-mobile-quote,.testimonial-mobile-quote *, .resume-mobile-fact,.resume-mobile-heading,.resume-mobile-socials) {color:#ebebeb!important;}
@media(prefers-reduced-motion:reduce) {html.theme-ready .theme-background-dark {transition:none;}}

/* Phase 6C.1: hover and compact portrait toggle. */
@media (hover:hover) and (pointer:fine) {
  #theme-preview-toggle:hover {background:rgb(230,230,230);}
  html[data-theme="dark"] #theme-preview-toggle:hover {background:rgb(40,40,40);}
}
@media (max-width:767px) and (orientation:portrait) {
  #theme-preview-toggle {width:25px;height:25px;}
  #theme-preview-toggle svg {width:17px;height:17px;}
}

/* Phase 6C.3: synchronous text, heading hover and résumé photo. */
html.theme-ready :is(.back-l,#topBar,#topBar-m,#bottomBar-m,.resume-gallery,.resume-entry-list,.footer,.testimonial-container) {transition-property:background-color,border-color;}
html.theme-ready :is(.back-l,#topBar,#topBar-m,#bottomBar-m,.testimonial-container) :is(.text-b,.text-w,.text-n,a.no-underline,a.no-underline-white,.topbar-btn,.topbar-m-btn,.resume-button,.resume-btn,.resume-m-btn,.resume-mobile-title-link):not(.popup *) {transition:background-color 500ms ease,border-color 500ms ease!important;}
html[data-theme="dark"] .testimonial-container .resume-table button.resume-btn:hover,
html[data-theme="dark"] .testimonial-container .resume-table button.resume-m-btn:hover,
html[data-theme="dark"] .testimonial-container .resume-mobile-slide a.resume-mobile-title-link:hover {background-color:#ebebeb!important;color:#000!important;}
.testimonial-container :is(.resume-table,.resume-mobile-slide) img.resume-headshot {transition:filter 500ms ease;}
html[data-theme="dark"] .testimonial-container :is(.resume-table,.resume-mobile-slide) img.resume-headshot {filter:brightness(.8);}

/* Phase 6C.4: restore the larger toggle on mobile landscape only. */
@media (orientation: landscape) and (pointer: coarse) and (max-height: 650px) {
  #theme-preview-toggle {width:38px;height:38px;}
  #theme-preview-toggle svg {width:26px;height:26px;}
}

/* Phase 6D: Blog-specific light palette; original dark layout retained. */
html[data-theme-page="blog"][data-theme="light"] .back-d {background-image:url(imgPixelW.png);color:#333;}
html[data-theme-page="blog"][data-theme="light"] .back-d :is(a,.music-list,.text-w) {color:#333;}
html[data-theme-page="blog"][data-theme="dark"] .back-d a {color:#ebebeb;}
html[data-theme-page="blog"][data-theme="light"] td[style*="imgSideBarD-L.png"] {background-image:url(imgSideBarL-L.png)!important;}
html[data-theme-page="blog"][data-theme="light"] td[style*="imgSideBarD-R.png"] {background-image:url(imgSideBarL-R.png)!important;}
html[data-theme-page="blog"][data-theme="light"] :is(#topBar,#topBar-m,#bottomBar-m) {background-color:#fff!important;border-color:#e1e1e1!important;}
html[data-theme-page="blog"] #topBar table,html[data-theme-page="blog"] #topBar td[style*="background-color: Black"] {background-color:transparent!important;}
html[data-theme-page="blog"][data-theme="light"] :is(.topbar-btn,.topbar-m-btn) {color:#333;}
html[data-theme-page="blog"][data-theme="light"] :is(.topbar-btn,.topbar-m-btn):hover {background-color:#333;color:#fff;}
html[data-theme-page="blog"][data-theme="light"] :is(.dropdown-menu,.dropdown-menu-m) {background-color:#e6e6e5;}
html[data-theme-page="blog"][data-theme="light"] :is(.dropdown-menu,.dropdown-menu-m) a {color:#333;}
html[data-theme-page="blog"][data-theme="light"] :is(.dropdown-menu,.dropdown-menu-m) a:hover {background-color:#333;color:#fff;}
html[data-theme-page="blog"].theme-ready :is(.back-d,.back-d a,.music-list,.topbar-btn,.topbar-m-btn) {transition:background-color 500ms ease,border-color 500ms ease!important;}
/* The Blog still uses its original 90px mobile bottom bar. */
@media (max-width:767px) {html[data-theme-page="blog"] #theme-preview-toggle {bottom:102px;}}

/* Phase 6D.1: match Index desktop header and restore editorial colours. */
html[data-theme-page="blog"] .topbar-container {display:flex;justify-content:space-between;align-items:center;height:100%;width:100%;}
html[data-theme-page="blog"] .topbar-container img {vertical-align:middle;border-radius:0;}
html[data-theme-page="blog"] .topbar-left-center {flex:0 0 250px;text-align:left;}
html[data-theme-page="blog"] .topbar-center {flex:0 0 510px;text-align:center;}
html[data-theme-page="blog"] .topbar-right-center {flex:0 0 250px;text-align:right;}
html[data-theme-page="blog"] .back-d a:not(.no-underline) {color:#ffcc00;}
html[data-theme-page="blog"][data-theme="light"] .back-d a:not(.no-underline) {color:#8a6500;}
html[data-theme-page="blog"][data-theme="light"] .back-d blockquote:not(.twitter-tweet) {color:#333!important;}
@media(max-width:767px){html[data-theme-page="blog"] #topBar {display:none;}}
