/* Controls only. No palette change in light mode. Native button supports Enter/Space. */
.appearance-toggle { flex: 0 0 44px; width: 44px; height: 44px; }
.appearance-toggle[hidden] { display: none; }
.appearance-sun { display: none; }
html[data-theme="dark"] .appearance-sun { display: block; }
html[data-theme="dark"] .appearance-moon { display: none; }
.appearance-toggle[aria-pressed="true"] { border-color: var(--xjm-green); }
@media (min-width: 1025px) and (max-width: 1280px) {
 .site-header__inner { gap: 20px; }
 .header-cta span { display: none; }
 .header-cta { width: 44px; height: 44px; padding: 0; }
}
@media (max-width: 680px) {
 .site-header__actions { gap: 6px; margin-left: auto; }
 .site-header__actions .header-cta { display: none; } /* Phone remains in mobile panel + bottom bar. */
}
@media (max-width: 480px) {
 .brand .custom-logo { max-width: 140px; }
 .brand-text__desc { display: none; }
 .brand-text__name { font-size: 14px; }
}
@media (max-width: 360px) {
 .brand .custom-logo { max-width: 110px; }
 .brand-mark { width: 30px; height: 30px; margin-right: 6px; }
 .brand-text__name { max-width: 76px; }
}

/* A sticky control is already visible: do not ask native focus to expose root scroll padding.
   This also covers keyboard focus, without altering normal content anchor offsets. */
@supports selector(:has(*)) {
 html:has(.site-header [data-appearance-toggle]:focus) { scroll-padding-top: 0; }
}
/* Active only during the synchronous palette commit; animations and DOM stay untouched. */
html[data-appearance-changing] *,
html[data-appearance-changing] *::before,
html[data-appearance-changing] *::after { transition: none !important; }

/* Native attachment logos: stable reserved box; same intrinsic proportions in both modes. */
.brand--mode-logo .xjm-mode-logo-link { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); align-items:center; justify-items:start; width:var(--xjm-logo-w-desktop); height:var(--xjm-logo-h-desktop); }
.brand--mode-logo .custom-logo { grid-area:1 / 1; min-width:0; min-height:0; width:auto; height:auto; max-width:100%; max-height:100%; object-fit:contain; padding:0; border-radius:0; background:none; box-shadow:none; filter:none; }
.brand--mode-logo .xjm-logo--dark { display:none; }
html[data-theme="dark"] .brand--mode-logo .xjm-logo--light { display:none; }
html[data-theme="dark"] .brand--mode-logo .xjm-logo--dark { display:block; }
@media(max-width:680px) { .brand--mode-logo .xjm-mode-logo-link { width:var(--xjm-logo-w-mobile); height:var(--xjm-logo-h-mobile); } }
@media(max-width:480px) { .brand--mode-logo .xjm-mode-logo-link { width:var(--xjm-logo-w-phone); height:var(--xjm-logo-h-phone); } }
@media(max-width:360px) { .brand--mode-logo .xjm-mode-logo-link { width:var(--xjm-logo-w-small); height:var(--xjm-logo-h-small); } }

/* Native hero-only IP marks: preserve material layers, animation and original image colors. */
.hero .stage .hero-ip { display:block; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; filter:none; object-fit:contain; }
.hero .stage .hero-ip--poster { position:relative; z-index:1; width:100%; max-width:210px; height:auto; max-height:65%; margin-top:auto; align-self:flex-start; object-position:left bottom; }
.hero .stage .hero-ip--bag { width:72%; height:76%; max-width:120px; max-height:145px; }
.hero .stage .hero-ip--card { position:absolute; left:8%; top:10%; width:30%; height:72%; object-position:left center; }
.hero .stage .mat--card .mat__lines { width:55%; margin-left:auto; margin-top:auto; margin-bottom:3%; }

/* Hero detail correction: slogan lives below BRAND / VI, not behind foreground cards. */
.hero .stage .mat--poster .mat__foot { margin:12px 0 0; font-size:clamp(11px,1.05vw,13px); line-height:1.4; letter-spacing:.06em; white-space:nowrap; flex:0 0 auto; }
.hero .stage .mat--poster .hero-ip--poster { max-height:60%; margin-bottom:32px; }
/* Teal handle contrasts with both the white bag and dark brochure/card backgrounds. */
.hero .stage .mat--bag .mat__handle { border-color:#149B88; }

/* Sidebar archive years: native, independent disclosure; original monthly links stay crawlable. */
.sidebar .xjm-archive-years,
.sidebar .xjm-archive-months { min-width:0; max-width:100%; }
.sidebar .xjm-archive-years > .xjm-archive-year { padding:0; border-bottom:1px solid var(--line); }
.sidebar .xjm-archive-years > .xjm-archive-year:last-child { border-bottom:0; }
.sidebar .xjm-archive-year__details > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:10px 8px; border-radius:8px; color:var(--text); font-size:16px; font-weight:700; line-height:1.5; list-style:none; cursor:pointer; overflow-wrap:anywhere; }
.sidebar .xjm-archive-year__details > summary::marker { content:""; }
.sidebar .xjm-archive-year__details > summary::-webkit-details-marker { display:none; }
.sidebar .xjm-archive-year__details > summary:hover { color:var(--link); }
.sidebar .xjm-archive-year__details > summary:focus-visible,
.sidebar .xjm-archive-months a:focus-visible { outline:2px solid var(--link); outline-offset:3px; border-radius:4px; }
.sidebar .xjm-archive-arrow { flex:0 0 8px; width:8px; height:8px; margin-right:4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); }
.sidebar .xjm-archive-year__details[open] > summary .xjm-archive-arrow { transform:rotate(45deg); }
.sidebar .xjm-archive-year__details > .xjm-archive-months { margin:0 0 8px 12px; padding-left:12px; border-left:1px solid var(--line); }
.sidebar .xjm-archive-months > li { padding:2px 0; overflow-wrap:anywhere; }
.sidebar .xjm-archive-months a { display:inline-flex; align-items:center; min-height:36px; max-width:100%; }

/* Case-wall heading stays fully readable on its permanent dark surface in light mode.
   Disable only this heading's scroll-reveal fade/translation, not the page or its images. */
html:not([data-theme="dark"]) body.page-template-template-cases #works .section-head[data-reveal] { opacity:1; transform:none; transition:none; }
/* The active gradient chip's small count must not dim below normal-text contrast. */
html:not([data-theme="dark"]) body.page-template-template-cases #works .filter-chip sup { opacity:1; }

/* 1.4.10 Decorative IPs: stable material hit areas, only image-local transforms move. */
body.home .hero .stage .hero-ip { pointer-events: none; transform-origin: 50% 85%; }
body.home .hero .stage .mat--poster::after { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
 body.home .hero .stage .hero-ip { animation: none !important; transition: none !important; }
}
/* Freeze only the already-floating hit material while a real mouse is inside it.
   Existing translate/rotation stay at their current phase, then resume without a jump. */
body.home .hero .stage .mat.is-ip-hovering { animation-play-state: paused; }

/* 1.4.14 Compact header only. Shared height keeps sticky panels/anchors in sync. */
:root { --header-h: 64px; }
.site-header { --compact-control-bg: transparent; --compact-control-hover: var(--paper); --compact-control-border: var(--line); --compact-control-hover-border: var(--line-strong); }
.site-header .site-header__inner { gap: 24px; }
.site-header .site-header__actions { gap: 8px; }
.site-header .site-header__actions .icon-btn { flex: 0 0 36px; width: 36px; height: 36px; }
.site-header .site-header__actions .icon-btn svg { width: 18px; height: 18px; }
.site-header .site-header__actions .nav-toggle svg { width: 20px; height: 20px; }
.site-header .header-cta { height: 30px; min-height: 30px; padding: 0 12px; font-size: 13px; line-height: 1.2; gap: 6px; }
.site-header .header-cta svg { flex: none; width: 14px; height: 14px; }
.contact-flow__form { scroll-margin-top: calc(var(--header-h) + 24px); }
html[data-theme="dark"] .site-header { --compact-control-bg: #1B232D; --compact-control-hover: #25313E; --compact-control-border: #66788A; --compact-control-hover-border: #80C8FF; }
@media (min-width: 1025px) and (max-width: 1280px) {
 .site-header .site-header__inner { gap: 18px; }
}
@media (max-width: 1280px) {
 .site-header .header-cta { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; }
}
@media (max-width: 1024px) {
 :root { --header-h: 56px; }
 /* Actual target stays44px; centered36px paint is independent of hit geometry. */
 html .site-header .site-header__actions button.icon-btn { position: relative; flex-basis: 44px; width: 44px; height: 44px; background: transparent; border-color: transparent; }
 .site-header .site-header__actions button.icon-btn::before { content: ""; position: absolute; box-sizing: border-box; left: 50%; top: 50%; width: 36px; height: 36px; transform: translate(-50%, -50%); border: 1px solid var(--compact-control-border); border-radius: 50%; background: var(--compact-control-bg); pointer-events: none; }
 .site-header .site-header__actions button.icon-btn:hover::before { background: var(--compact-control-hover); border-color: var(--compact-control-hover-border); }
 .site-header .site-header__actions button.icon-btn:focus-visible::before { border-color: var(--xjm-blue); }
 .site-header .site-header__actions .icon-btn svg { position: relative; z-index: 1; }
 .site-header .header-cta { position: relative; width: 44px; min-width: 44px; height: 44px; min-height: 44px; background: transparent; box-shadow: none; }
 .site-header .header-cta::before { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--grad); pointer-events: none; }
 .site-header .header-cta svg { position: relative; z-index: 1; }
 .site-header .header-cta:hover { transform: none; background: transparent; box-shadow: none; }
}
@media (max-width: 680px) {
 .site-header .site-header__inner { gap: 10px; }
 .site-header .site-header__actions { gap: 6px; }
}

/* 1.4.15 Article brand-author mark only; not WP/comment/account avatars. */
body.single-post .article-hero__author .article-hero__avatar--ip { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 40px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
body.single-post .article-hero__author .article-hero__avatar--ip::before,
body.single-post .article-hero__author .article-hero__avatar--ip::after { content: none; display: none; }
body.single-post .article-hero__author .article-hero__author-ip { display: block; width: auto; height: 40px; max-width: 36px; object-fit: contain; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; filter: none; transform: none; }

/* 1.4.16 Story signature uses the same attachment-backed mark as the header. */
.about-v2__sign { flex-wrap: wrap; gap: 12px 20px; }
.about-v2__sign > .about-v2__logo { flex: 0 0 auto; min-width: 0; max-width: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.about-v2__sign > span { flex: 1 1 250px; min-width: 0; overflow-wrap: anywhere; }
.about-v2__logo .brand { max-width: 100%; }
.about-v2__logo .xjm-mode-logo-link { max-width: 100%; }
.about-v2__logo::before, .about-v2__logo::after { content: none; display: none; }
