:root {
  --case-accent: #1769e8;
  --case-accent-soft: rgba(23, 105, 232, .09);
  --case-deep: #123c78;
  --case-surface: #f5f8fc;
}

html[data-project="ai-platform"] { --case-accent:#2257f4; --case-deep:#102b67; --case-surface:#f3f6ff; }
html[data-project="smart-water"] { --case-accent:#0798ba; --case-deep:#124b66; --case-surface:#f1fafb; }
html[data-project="supervision"] { --case-accent:#1763d6; --case-deep:#173d73; --case-surface:#f4f7fb; }
html[data-project="secure-office"] { --case-accent:#4858d8; --case-deep:#253170; --case-surface:#f5f5fd; }

html body { background:#fbfcfe; color:var(--case-deep); }
html .case-nav { background:rgba(251,252,254,.92); }
html .case-hero {
  min-height:560px;
  background:var(--case-surface);
  border-bottom:1px solid var(--line);
}
html .case-wash {
  opacity:.72;
  background:linear-gradient(115deg, transparent 28%, var(--case-accent-soft) 100%);
}
html .case-wash::after { border-color:color-mix(in srgb, var(--case-accent) 18%, transparent); }
html .case-kicker span, html .case-kicker, html .case-detail-nav span,
html .case-story-chapter > header > span, html .case-html-block > span { color:var(--case-accent); }
html .case-tags span { border-color:color-mix(in srgb, var(--case-accent) 24%, transparent); background:rgba(255,255,255,.54); }
html .case-detail-nav { margin-top:0; }
html .case-detail-nav a::after { background:var(--case-accent); }

.case-decisions {
  width:min(1180px, 86vw);
  margin:0 auto clamp(120px, 14vw, 180px);
  display:grid;
  grid-template-columns:242px minmax(0,1fr);
  gap:0;
}
.case-decisions > header { padding-right:44px; }
.case-decisions small { color:var(--case-accent); font:12px var(--mono); letter-spacing:.13em; }
.case-decisions h2 { margin:20px 0 0; font:400 clamp(28px,3vw,42px)/1.25 var(--serif); }
.case-decisions > div { border-top:1px solid var(--line); }
.case-decisions article { display:grid; grid-template-columns:44px 210px minmax(0,1fr); gap:24px; padding:28px 0; border-bottom:1px solid var(--line); }
.case-decisions article > span { color:var(--case-accent); font:12px var(--mono); }
.case-decisions h3 { margin:0; font:400 21px/1.5 var(--serif); }
.case-decisions p { margin:0; color:var(--ink-soft); font-size:14px; line-height:1.9; }

.case-capabilities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin:56px 0; background:var(--line); border:1px solid var(--line); }
.case-capabilities article { min-height:180px; padding:28px; display:grid; grid-template-columns:42px 1fr; align-content:end; background:rgba(255,255,255,.9); }
.case-capabilities > article > span, .case-capabilities small { color:var(--case-accent); font:12px var(--mono); letter-spacing:.1em; }
.case-capabilities h3 { margin:16px 0 0; font:400 23px/1.45 var(--serif); }

.case-showcase { display:grid; gap:52px; margin:64px 0 12px; }
.case-showcase__item { margin:0; }
.case-showcase__stage {
  aspect-ratio:var(--media-ratio);
  min-height:280px;
  padding:28px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  border:1px solid color-mix(in srgb, var(--case-accent) 20%, transparent);
  border-radius:18px;
  color:color-mix(in srgb, var(--case-deep) 55%, white);
  background:#eef3ff;
  overflow:hidden;
}
.case-showcase__item--video .case-showcase__stage { background:#e8efff; }
.case-showcase__stage span { font:12px var(--mono); letter-spacing:.12em; }
.case-showcase__stage strong { align-self:center; margin:auto; font:400 clamp(22px,2.4vw,34px) var(--serif); opacity:.48; }
.case-showcase figcaption { display:grid; grid-template-columns:180px minmax(220px,.7fr) minmax(240px,1fr); gap:24px; padding:20px 2px 0; }
.case-showcase figcaption small { color:var(--case-accent); font:12px var(--mono); letter-spacing:.12em; }
.case-showcase figcaption h3 { margin:0; font:400 21px/1.5 var(--serif); }
.case-showcase figcaption p { margin:0; color:var(--ink-soft); font-size:13px; line-height:1.8; }

/* AI platform — selected Attio-inspired editorial stage */
html[data-project="ai-platform"] { --ai-rail:112px; }
html[data-project="ai-platform"] body { background:#fbfcff; }
html[data-project="ai-platform"] main,
html[data-project="ai-platform"] .case-footer { margin-left:var(--ai-rail); }
html[data-project="ai-platform"] .case-nav { padding-left:32px; }
html[data-project="ai-platform"] .case-hero {
  min-height:540px;
  padding-left:max(56px, calc((100vw - 1240px) / 2));
  padding-right:max(56px, calc((100vw - 1240px) / 2));
  grid-template-columns:minmax(0,1fr) 270px;
  gap:70px;
}
html[data-project="ai-platform"] .case-hero h1 { max-width:820px; font-size:clamp(52px,5.4vw,76px); }
html[data-project="ai-platform"] .case-hero h1 span { display:block; }
html[data-project="ai-platform"] .case-summary { max-width:720px; }
html[data-project="ai-platform"] .case-detail-nav {
  position:fixed;
  left:0;
  top:78px;
  bottom:0;
  z-index:8;
  width:var(--ai-rail);
  margin:0;
  border-top:0;
  border-right:1px solid var(--line);
  background:rgba(248,250,255,.94);
}
html[data-project="ai-platform"] .case-detail-nav > div { width:100%; height:100%; padding:36px 14px; display:flex; flex-direction:column; justify-content:center; }
html[data-project="ai-platform"] .case-detail-nav a { min-height:56px; padding:10px 8px; gap:8px; border-bottom:1px solid var(--line); }
html[data-project="ai-platform"] .case-detail-nav a::after { left:-23px; right:auto; top:16px; bottom:16px; width:2px; height:auto; transform:scaleY(0); }
html[data-project="ai-platform"] .case-detail-nav a.is-active::after { transform:scaleY(1); }
html[data-project="ai-platform"] .case-detail-nav a strong { font-size:13px; }
html[data-project="ai-platform"] .case-detail-nav + .case-story-intro { padding-top:clamp(100px,10vw,140px); }
html[data-project="ai-platform"] .case-story-intro { margin-bottom:clamp(92px,10vw,132px); }
html[data-project="ai-platform"] .case-overview-stage { margin:72px 0 0 242px; }
html[data-project="ai-platform"] .case-overview-stage > div { aspect-ratio:16/9; min-height:320px; padding:28px; display:flex; flex-direction:column; justify-content:space-between; border:1px solid rgba(34,87,244,.2); border-radius:18px; color:#6a7fa7; background:#eef3ff; }
html[data-project="ai-platform"] .case-overview-stage > div span { font:12px var(--mono); letter-spacing:.12em; }
html[data-project="ai-platform"] .case-overview-stage > div strong { align-self:center; margin:auto; font:400 clamp(22px,2.4vw,34px) var(--serif); opacity:.48; }
html[data-project="ai-platform"] .case-overview-stage figcaption { display:grid; grid-template-columns:180px minmax(220px,.7fr) minmax(240px,1fr); gap:24px; padding:20px 2px 0; }
html[data-project="ai-platform"] .case-overview-stage small { color:var(--case-accent); font:12px var(--mono); letter-spacing:.12em; }
html[data-project="ai-platform"] .case-overview-stage h3 { margin:0; font:400 21px/1.5 var(--serif); }
html[data-project="ai-platform"] .case-overview-stage p { margin:0; color:var(--ink-soft); font-size:13px; line-height:1.8; }
html[data-project="ai-platform"] .case-story-chapter > header h2 { max-width:860px; font-size:clamp(48px,5vw,72px); }
html[data-project="ai-platform"] .case-story-chapter__intro p { font-size:16px; }
html[data-project="ai-platform"] .case-story-chapter__content { margin-left:0; padding-left:242px; }
html[data-project="ai-platform"] .case-story-chapter:nth-child(odd) { padding-left:max(56px, calc((100vw - 1240px) / 2)); padding-right:max(56px, calc((100vw - 1240px) / 2)); }

html .case-system-map article { background:rgba(255,255,255,.92); }
html .case-principles article { border-color:color-mix(in srgb, var(--case-accent) 55%, transparent); }
html .case-story-outcome { background:var(--case-deep); }
html .case-footer { background:var(--case-deep); }

html:not([data-project="rainwater"]) .case-story-chapter:nth-child(odd) {
  width:100%;
  padding:clamp(90px,10vw,130px) max(7vw, calc((100vw - 1180px) / 2));
  background:var(--case-surface);
}
html:not([data-project="rainwater"]) .case-story-chapter:nth-child(odd) > header,
html:not([data-project="rainwater"]) .case-story-chapter:nth-child(odd) > .case-story-chapter__content { max-width:1180px; margin-left:auto; margin-right:auto; }

html[data-project="rainwater"] .case-decisions { width:var(--case-reading-width); }
html[data-project="rainwater"] .case-capabilities article { border-radius:0; }
html[data-project="rainwater"] .case-story-outcome { margin-left:0; }

@media (max-width:820px) {
  .case-decisions { width:86vw; grid-template-columns:1fr; gap:34px; }
  .case-decisions article { grid-template-columns:34px 1fr; }
  .case-decisions article p { grid-column:2; }
  .case-capabilities { grid-template-columns:1fr; }
  html:not([data-project="rainwater"]) .case-story-chapter:nth-child(odd) { padding-left:7vw; padding-right:7vw; }
  .case-showcase figcaption { grid-template-columns:1fr; gap:8px; }
  .case-showcase__stage { min-height:210px; border-radius:12px; }
  html[data-project="ai-platform"] { --ai-rail:0px; }
  html[data-project="ai-platform"] main,
  html[data-project="ai-platform"] .case-footer { margin-left:0; }
  html[data-project="ai-platform"] .case-nav { padding-left:18px; }
  html[data-project="ai-platform"] .case-hero { min-height:auto; padding-left:7vw; padding-right:7vw; grid-template-columns:1fr; }
  html[data-project="ai-platform"] .case-hero h1 { font-size:clamp(42px,12vw,58px); }
  html[data-project="ai-platform"] .case-detail-nav { position:sticky; left:auto; top:66px; bottom:auto; width:100%; border-right:0; border-top:1px solid var(--line); }
  html[data-project="ai-platform"] .case-detail-nav > div { width:max-content; height:auto; padding:0; flex-direction:row; justify-content:flex-start; }
  html[data-project="ai-platform"] .case-detail-nav a { min-width:96px; min-height:50px; border-bottom:0; }
  html[data-project="ai-platform"] .case-detail-nav a::after { left:8px; right:8px; top:auto; bottom:-1px; width:auto; height:2px; transform:scaleX(0); }
  html[data-project="ai-platform"] .case-detail-nav a.is-active::after { transform:scaleX(1); }
  html[data-project="ai-platform"] .case-story-chapter__content { padding-left:0; }
  html[data-project="ai-platform"] .case-story-chapter:nth-child(odd) { padding-left:7vw; padding-right:7vw; }
  html[data-project="ai-platform"] .case-overview-stage { margin-left:0; }
  html[data-project="ai-platform"] .case-overview-stage > div { min-height:210px; border-radius:12px; }
  html[data-project="ai-platform"] .case-overview-stage figcaption { grid-template-columns:1fr; gap:8px; }
}
