/* Adapt the original desktop case preview to the existing home dropdown. */
body[data-home-layout="direct"] .case-preview,
body[data-home-layout="direct"] .case-preview-content { display:none; }
@media (min-width:768px) and (hover:hover) and (pointer:fine) {
  body[data-home-layout="direct"] .case-preview { display:block; }
  body[data-home-layout="direct"] .case-preview-content { display:contents; }
  html body[data-home-layout="direct"] .stage.has-case-preview .case-preview-media {
    position:absolute;
    --case-caption-height:52px;
    --case-media-left:var(--home-preview-left,42vw);
    --case-media-right:auto;
    --case-media-top:max(98px,11vh);
    --case-media-width:var(--home-preview-width,48vw);
    --case-media-height:var(--home-preview-height,53vh);
    --case-media-content-width:min(var(--case-media-width),calc((var(--case-media-height) - var(--case-caption-height)) * var(--case-media-ratio)));
    left:var(--case-media-left);
    right:auto;
    top:var(--case-media-top);
    width:var(--case-media-content-width);
    height:calc(var(--case-media-content-width) / var(--case-media-ratio) + var(--case-caption-height));
    max-width:none;
    max-height:none;
    margin:0;
    grid-template-rows:minmax(0,1fr) auto;
    gap:8px;
  }
  html body[data-home-layout="direct"] .stage.has-case-preview .case-preview-media[data-preview-narrow="true"] { --case-caption-height:80px; }
  html body[data-home-layout="direct"] .case-preview-media[data-preview-narrow="true"] figcaption { flex-direction:column; align-items:flex-start; gap:0; }
  html body[data-home-layout="direct"] .case-preview-media[data-preview-narrow="true"] [data-case-cta] { min-height:32px; padding:0; }
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-title-wrap {
    position:absolute;
    inset:auto auto 58px 40px;
    width:min(52vw,780px);
    max-width:none;
    align-self:auto;
    justify-self:auto;
  }
  html body[data-home-layout="direct"] .stage.has-case-preview [data-case-title] {
    font-size:clamp(32px,4.2vw,64px);
    line-height:1.25;
    letter-spacing:0;
  }
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-intro {
    position:absolute;
    inset:auto 112px 62px auto;
    width:min(27vw,340px);
    margin:0;
    align-self:auto;
    justify-self:auto;
  }
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-intro-text { color:rgba(255,255,255,.92); font-size:14px; line-height:1.8; }
  html body[data-home-layout="direct"] .stage.has-case-preview .home-news { opacity:0; visibility:hidden; pointer-events:none; }
  html body[data-home-layout="direct"][data-case-preview-active="true"] .stage-header .theme-toggle,
  html body[data-home-layout="direct"][data-case-preview-active="true"] .home-nav>.home-nav-link,
  html body[data-home-layout="direct"][data-case-preview-active="true"] .home-projects>summary { color:#fff; background:rgba(12,22,31,.42); border-color:rgba(255,255,255,.28); }
  html body[data-home-layout="direct"] .home-project-list a.is-active { background:var(--home-control); }
  html body[data-home-layout="direct"] .home-nav { z-index:5; }
  html body[data-home-layout="direct"] .case-preview-media { z-index:3; }
  html body[data-home-layout="direct"] .stage.has-case-preview.is-compact-case-preview :is(.stage-title-wrap,.stage-intro) { visibility:hidden; pointer-events:none; }
}
@media (min-width:768px) and (max-width:1100px) and (hover:hover) and (pointer:fine) {
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-title-wrap { left:24px; bottom:40px; width:49vw; }
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-intro { right:88px; bottom:42px; width:29vw; }
  html body[data-home-layout="direct"] .stage.has-case-preview .stage-intro-text { font-size:12px; line-height:1.7; }
}

/* Section thumbnails use their published artwork on the page's neutral theme. */
:root { --home-section-surface:#fff; --home-section-ink:#171719; --home-section-muted:#646b68; --home-section-line:#dde2df; --home-section-control:#eff2f0; --home-section-accent:#19794b; }
html[data-theme="dark"] { --home-section-surface:#08090a; --home-section-ink:#f3f3f1; --home-section-muted:#b0b8b3; --home-section-line:#363d39; --home-section-control:#222925; --home-section-accent:#85cfa5; }
body:has(.stage[data-active-case="partners"]) { --home-section-surface:#fff; --home-section-ink:#000; }
html[data-theme="dark"] body:has(.stage[data-active-case="partners"]) { --home-section-surface:#000; --home-section-ink:#fff; }
.stage[data-preview-kind="section"] { --case-preview-ink:var(--home-section-ink); --case-preview-muted:var(--home-section-muted); --case-preview-surface:var(--home-section-surface); }
.stage[data-preview-kind="section"] .case-preview-backdrop { background:var(--home-section-surface); }
.stage[data-preview-kind="section"] .case-preview-backdrop [data-case-backdrop-img],
.stage[data-preview-kind="section"] .case-preview-backdrop::after { visibility:hidden; }
html body[data-home-layout="direct"] .stage.has-case-preview[data-preview-kind="section"] .stage-intro-text { color:var(--home-section-muted); }
html body[data-home-layout="direct"] .stage.has-case-preview[data-preview-kind="section"] .case-preview-media [data-case-open] { background:var(--home-section-surface); border-radius:7px; }
.case-preview-media[data-case-layout="partners"] [data-case-image] { background:#000; filter:invert(1); }
html[data-theme="dark"] .case-preview-media[data-case-layout="partners"] [data-case-image] { filter:none; }
html body[data-home-layout="direct"][data-case-preview-active="true"]:has(.stage[data-preview-kind="section"]) .stage-logo .brand-word-home { color:var(--home-section-ink); }
html body[data-home-layout="direct"][data-case-preview-active="true"]:has(.stage[data-preview-kind="section"]) .custom-cursor { --cursor-color:var(--home-section-ink); }
html body[data-home-layout="direct"][data-case-preview-active="true"]:has(.stage[data-preview-kind="section"]) .stage-header .theme-toggle,
html body[data-home-layout="direct"][data-case-preview-active="true"]:has(.stage[data-preview-kind="section"]) .home-nav>.home-nav-link,
html body[data-home-layout="direct"][data-case-preview-active="true"]:has(.stage[data-preview-kind="section"]) .home-projects>summary { color:var(--home-section-ink); background:var(--home-section-control); border-color:var(--home-section-line); }
html body[data-home-layout="direct"][data-case-preview-active="true"] .home-nav>.home-nav-link.is-active { border-color:currentColor; }
.home-section-card { box-sizing:border-box; width:100%; height:100%; min-height:0; container-type:size; display:grid; grid-template-rows:auto minmax(0,1fr); background:var(--home-section-surface); color:var(--home-section-ink); border:1px solid var(--home-section-line); padding:3cqw; gap:2.5cqw; }
.home-section-card[hidden] { display:none!important; }
.stage.has-case-preview[data-active-case="services"] .home-section-card { visibility:visible; }
.case-preview-media[data-case-layout="services"] [data-case-open] { container-type:size; }
.home-section-card-heading { display:grid; gap:1cqw; }
.home-section-card-heading>span { font-size:clamp(9px,1.6cqw,12px); line-height:1.4; color:var(--home-section-accent); }
.home-section-card-heading>strong { font-size:clamp(13px,3cqw,24px); font-weight:500; line-height:1.4; }
.home-section-service-grid { min-height:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:2.4cqw 2cqw; }
.home-section-service-grid figure { min-width:0; min-height:0; margin:0; display:grid; grid-template-rows:minmax(0,1fr) auto; gap:1cqw; }
.home-section-service-grid img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; background:var(--home-section-control); border:1px solid var(--home-section-line); border-radius:3px; box-sizing:border-box; }
.home-section-service-grid figure figcaption { display:block; min-height:0; color:var(--home-section-ink); font-size:clamp(9px,1.75cqw,13px); line-height:1.4; text-align:left; }
.home-section-image-placeholder { display:grid; place-items:center; color:var(--home-section-muted); background:var(--home-section-control); font-size:11px; }
