/* Structural case-study compositions. Loaded only on modular case studies.
   Reuses d1-hero, d1-heading, d1-bento__cell, pill, buttons and theme tokens.
   Content stays visible without JS; no scroll-driven layout or fixed section height. */
.case-layout { color: var(--d1-text); background: var(--d1-canvas); }
.case-layout h1, .case-layout h2, .case-layout h3 { font-family: var(--ui-font-heading); text-wrap: balance; }
.case-layout h3 { margin: 0; font-size: clamp(21px, 2vw, 28px); line-height: 1.2; color: var(--d1-title); }
.case-layout p { margin: 0; line-height: 1.65; }
.case-layout img { display: block; width: 100%; height: auto; }
.case-layout [id], .case-layout-contact [id] { scroll-margin-top: var(--site-header-safe-area, 110px); }
.case-layout .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.case-layout__section { padding-block: clamp(48px, 6vw, 88px); }
.case-layout__section--soft { background: var(--ui-surface-light); }
html[data-theme="dark"] .case-layout__section--soft { background: var(--ui-surface-dark); }
.case-layout__section--light { background: var(--d1-canvas); }
.case-layout__section--light .pill { color: var(--d1-pill-text); border-color: var(--d1-line-strong); background: transparent; }
.case-layout__section--light .case-layout__responsive { background: var(--d1-cell-bg); border-color: var(--d1-cell-border); }
.case-layout__section--dark {
  --d1-title: var(--ui-white); --d1-text: var(--ui-light-blue); --d1-text-muted: #c3cde2;
  background: var(--ui-gradient-dark); color: var(--d1-text);
  border-radius: var(--ui-radius-section) var(--ui-radius-section) 0 0;
}
.case-layout .case-layout__heading { gap: 16px; margin-bottom: clamp(24px, 3vw, 40px); }
.case-layout .case-layout__heading h2 { max-width: 30ch; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.12; }
.case-layout .case-layout__heading > p:not(.pill) { max-width: 66ch; font-size: var(--ui-font-body); }
.case-layout .case-layout__heading--left { align-items: flex-start; text-align: left; margin-inline: 0; }
.case-layout__section--dark .pill { color: var(--ui-white); border-color: var(--ui-border-light); background: transparent; }
.case-layout__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); align-items: start; }
.case-layout__pair > :only-child { grid-column: 1 / -1; }
.case-layout__pair > *, .case-layout__context > *, .case-layout__responsive > * { min-width: 0; }
.case-layout__figure { margin: 0; min-width: 0; }
.case-layout__figure img { border-radius: var(--ui-radius-sm); }
.case-layout__figure figcaption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--d1-text-muted); }
.case-layout .case-layout__card { min-height: 0; gap: 18px; box-shadow: none; overflow: visible; }
.case-layout .case-layout__card h3 { max-width: none; margin: 0; }
.case-layout .case-layout__card p { max-width: 65ch; }
.case-layout__card .case-text-link { align-self: start; line-height: 1.5; }
.case-layout__prose { max-width: 65ch; }
.case-layout__prose > * + * { margin-top: 20px; }
/* The global hero supplies the gradient and header contrast. Only geometry differs. */
.site-organic .case-layout .case-layout__hero {
  min-height: 0; height: auto; padding: calc(var(--site-header-safe-area, 110px) + 32px) 0 32px;
  border-radius: 0 0 var(--ui-radius-section) var(--ui-radius-section);
}
.case-layout__hero::after { content: none; }
.case-layout__hero-header {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: clamp(48px, 7vw, 112px); align-items: end; width: 100%; margin: 0 0 clamp(32px, 4vw, 52px);
}
.case-layout__hero-copy { display: grid; justify-items: start; gap: 20px; max-width: 720px; text-align: left; color: rgba(255, 255, 255, .76); }
.case-layout__hero-copy .home-hero__pill { color: inherit; }
.case-layout__hero-copy .d1-hero__title { max-width: 17ch; font-size: clamp(40px, 4.5vw, 68px); line-height: 1.04; color: var(--ui-white); }
.case-layout__hero-copy .d1-hero__lead { max-width: 59ch; font-size: clamp(16px, 1.3vw, 18px); color: var(--ui-light-blue); }
.case-layout__hero-links { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; }
.case-layout__hero-links a { color: var(--ui-white); text-decoration: underline; text-underline-offset: 5px; }
.case-layout__metadata { display: grid; grid-template-columns: 1fr; margin: 0; color: var(--ui-white); }
.case-layout__metadata > div { display: grid; grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr); gap: 18px; align-items: baseline; padding: 13px 0; border-top: 1px solid rgba(255, 255, 255, .18); }
.case-layout__metadata > div:last-child { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.case-layout__metadata dt { font-size: 12px; color: rgba(255, 255, 255, .6); }
.case-layout__metadata dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ui-white); }
.case-layout__stage { width: 100%; margin-inline: 0; }
.case-layout__stage .case-layout__figure { padding: 8px; background: var(--d1-cell-bg); border-radius: var(--ui-radius-md); }
.case-layout__stage figcaption { margin: 10px 6px 4px; color: var(--d1-text); }
.case-layout__context { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.case-layout__context > :only-child { grid-column: 1 / -1; max-width: 760px; }
.case-layout__context-copy, .case-layout__context-visual { min-width: 0; }
.case-layout__context-copy .case-layout__heading { margin-bottom: 24px; }
.case-layout__context-copy .case-layout__heading h2 { max-width: 17ch; }
.case-layout__context-copy .case-layout__prose { max-width: 58ch; }
.case-layout__context-visual { display: grid; gap: clamp(24px, 3vw, 36px); }
.case-layout__companies { margin-top: 0; gap: 24px 36px; }
.case-layout__companies h3 { font-size: 19px; margin-bottom: 10px; }
.case-layout__companies p { max-width: 42ch; font-size: 15px; }
.case-layout__context-points { display: grid; gap: 0; }
.case-layout__context-points > div { display: grid; grid-template-columns: minmax(170px, .65fr) minmax(0, 1.35fr); gap: 20px 32px; align-items: baseline; padding: 20px 0; border-top: 1px solid var(--d1-line-strong); }
.case-layout__context-points h3 { font-size: 18px; }
.case-layout__context-points p { font-size: 14px; }
.case-layout__strategy { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.case-layout__strategy .case-layout__card { height: 100%; }
.case-layout__strategy .case-layout__figure { margin-top: auto; }
/* A real side-by-side comparison, not a slider or duplicated homepage gallery. */
.case-layout__comparison .case-layout__card {
  --d1-title: var(--ui-dark-blue); --d1-text-muted: #5f6d8c;
  --d1-cell-bg: var(--ui-white); --d1-cell-border: transparent;
  color: var(--ui-text-dark);
}
.case-layout__shared { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 24px 64px; align-items: baseline; margin-top: 36px; }
.case-layout__shared p { max-width: 70ch; }
.case-layout__responsive {
  display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr);
  gap: clamp(36px, 6vw, 88px); align-items: center; margin-top: clamp(40px, 5vw, 72px);
  padding: clamp(28px, 4vw, 56px); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--ui-radius-md); background: rgba(255, 255, 255, .045);
}
.case-layout__responsive-copy { display: grid; justify-items: start; gap: 18px; max-width: 560px; }
.case-layout__responsive-copy .pill { margin: 0; }
.case-layout__responsive-copy h3 { font-size: clamp(28px, 3vw, 42px); }
.case-layout__responsive-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: clamp(18px, 3vw, 34px); justify-content: end; align-items: start; }
.case-layout__responsive-devices .case-layout__figure { width: 100%; }
.case-layout__responsive-devices img { border: 5px solid rgba(255, 255, 255, .94); border-radius: 22px; }
.case-layout__responsive-devices figcaption { text-align: center; }
.case-layout__system { max-width: 1050px; margin: 0 auto; }
.case-layout__system-source { --d1-title: var(--ui-white); --d1-text-muted: var(--ui-light-blue); max-width: 650px; margin-inline: auto; text-align: center; align-items: center; }
.case-layout__system-detail { max-width: 58ch; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .8); font-size: 14px; }
.case-layout .case-layout__system-connector { position: relative; width: fit-content; max-width: calc(100% - 32px); margin: 30px auto 0; padding: 9px 16px; border: 1px solid var(--d1-line); border-radius: 999px; background: var(--d1-canvas); color: var(--d1-text-muted); font-size: 13px; text-align: center; z-index: 1; }
.case-layout__system-connector::before, .case-layout__system-connector::after { content: ""; position: absolute; left: 50%; z-index: -1; border-left: 1px solid var(--d1-line-strong); }
.case-layout__system-connector::before { top: -31px; height: 30px; }
.case-layout__system-connector::after { bottom: -37px; height: 36px; }
.case-layout__branches { margin-top: 36px; padding-top: 20px; position: relative; }
.case-layout__branches::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 20px; border: 1px solid var(--d1-line-strong); border-bottom: 0; }
.case-layout__branches::after { content: ""; position: absolute; top: -12px; left: 50%; height: 12px; border-left: 1px solid var(--d1-line-strong); }
.case-layout .case-layout__system-output { padding-top: 16px; border-top: 1px solid var(--d1-line); color: var(--d1-title); font-weight: 600; }
.case-layout__architecture-section { border-radius: var(--ui-radius-section); }
.case-layout__architecture-pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1120px; margin: clamp(40px, 5vw, 68px) auto 0; border-block: 1px solid rgba(255, 255, 255, .2); }
.case-layout__architecture-pillars article { min-width: 0; padding: clamp(30px, 4vw, 52px); }
.case-layout__architecture-pillars article + article { border-left: 1px solid rgba(255, 255, 255, .2); }
.case-layout__architecture-number { display: block; margin-bottom: 28px; color: #7ca7ff; font-family: var(--ui-font-heading); font-size: 14px; }
.case-layout__architecture-pillars h3 { max-width: 18ch; margin-bottom: 20px; font-size: clamp(23px, 2.4vw, 34px); }
.case-layout__architecture-pillars article > p:not(.case-layout__architecture-purpose) { max-width: 57ch; }
.case-layout .case-layout__architecture-purpose { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); color: var(--ui-white); font-weight: 600; }
.case-layout__architecture-why { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 28px 64px; align-items: baseline; max-width: 1120px; margin: 0 auto; padding: clamp(30px, 4vw, 48px) clamp(30px, 4vw, 52px) 0; }
.case-layout__architecture-why h3 { font-size: clamp(22px, 2vw, 28px); }
.case-layout__architecture-why p { max-width: 68ch; }
.case-layout__architecture-visual { max-width: 1120px; margin: clamp(32px, 4vw, 52px) auto 0; }
.case-layout .case-layout__credit { margin: 0 0 24px; text-align: center; color: var(--d1-text-muted); font-size: 13px; }
.case-study--ogb-batiment .case-layout__responsive-devices { grid-template-columns: minmax(0, 300px); justify-content: center; }
.case-layout__evidence-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); align-items: stretch; }
.case-layout__evidence-card { grid-column: span 7; display: flex; flex-direction: column; min-width: 0; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--d1-cell-border); border-radius: var(--ui-radius-md); background: var(--d1-cell-bg); }
.case-layout__evidence-card:nth-child(2) { grid-column: span 5; }
.case-layout__evidence-card:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.case-layout__evidence-copy { margin-bottom: 24px; }
.case-layout__evidence-copy h3 { margin-bottom: 14px; }
.case-layout__evidence-copy p { max-width: 62ch; color: var(--d1-text-muted); }
.case-layout__evidence-card .case-layout__figure { margin-top: auto; }
.case-layout__evidence-card .case-layout__figure img { border: 1px solid var(--d1-line); }
.case-layout__evidence-card:nth-child(3) .case-layout__evidence-copy { margin-bottom: 0; }
.case-layout__testimonial-grid { display: grid; grid-template-columns: minmax(230px, .55fr) minmax(0, 1.45fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.case-layout__testimonial .case-layout__heading { margin-bottom: 0; }
.case-layout__testimonial figure { margin: 0; }
.case-layout__testimonial blockquote { margin: 0 0 28px; font-family: var(--ui-font-heading); font-size: clamp(22px, 2.5vw, 34px); line-height: 1.5; color: var(--d1-title); }
.case-layout__testimonial figcaption { display: flex; flex-direction: column; gap: 5px; color: var(--d1-text-muted); }
.case-layout__testimonial figcaption strong { color: var(--d1-title); }
.case-layout__conversion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; margin-top: 48px; }
.case-layout__conversion > div { flex: 1 1 480px; max-width: 70ch; }
.case-layout__conversion h3 { margin-bottom: 16px; }
.case-layout__conversion h2 { max-width: 24ch; margin: 0 0 16px; font-family: var(--ui-font-heading); font-size: clamp(28px, 3vw, 42px); line-height: 1.15; color: var(--d1-title); }
.case-layout__conversion .btn { max-width: 100%; }
.case-layout.case-layout .case-layout__conversion--standalone { margin-top: 0; }
.case-layout a:focus-visible { outline: 3px solid var(--ui-secondary); outline-offset: 5px; }
/* The shared form must also remain readable if a reveal observer fails. */
.case-layout-contact .d1-reveal { opacity: 1; transform: none; transition: none; }
@media (max-width: 1000px) {
  .case-layout__hero-header { grid-template-columns: 1fr; gap: 30px; align-items: start; }
  .case-layout__hero-copy { max-width: 760px; }
  .case-layout__metadata { width: 100%; max-width: 760px; }
  .case-layout__context { grid-template-columns: 1fr; }
  .case-layout__context .case-layout__prose { max-width: 75ch; }
  .case-layout__context-copy .case-layout__heading h2 { max-width: 24ch; }
  .case-layout__context-visual { width: min(100%, 850px); }
  .case-layout__responsive { grid-template-columns: 1fr; }
  .case-layout__responsive-devices { justify-content: start; }
  .case-layout__testimonial-grid { grid-template-columns: 1fr; gap: 22px; }
  .case-layout__evidence-card, .case-layout__evidence-card:nth-child(2) { grid-column: 1 / -1; }
  .case-layout__evidence-card:nth-child(3) { grid-template-columns: 1fr; gap: 0; }
  .case-layout__evidence-card:nth-child(3) .case-layout__evidence-copy { margin-bottom: 24px; }
}
@media (max-width: 700px) {
  .case-layout__pair, .case-layout__strategy { grid-template-columns: 1fr; }
  .site-organic .case-layout .case-layout__hero { padding-top: calc(var(--site-header-safe-area, 88px) + 20px); }
  .case-layout__hero-header { margin-bottom: 28px; }
  .case-layout__hero-copy { gap: 16px; }
  .case-layout__hero-copy .d1-hero__title { font-size: clamp(36px, 10vw, 48px); }
  .case-layout__metadata > div { grid-template-columns: 1fr; gap: 4px; padding-block: 11px; }
  .case-layout .case-layout__card { padding: 20px; }
  .case-layout__companies { grid-template-columns: 1fr; }
  .case-layout__context-points > div { grid-template-columns: 1fr; gap: 7px; }
  .case-layout__shared { grid-template-columns: 1fr; gap: 12px; }
  .case-layout__architecture-pillars { grid-template-columns: 1fr; }
  .case-layout__architecture-pillars article + article { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
  .case-layout__architecture-why { grid-template-columns: 1fr; gap: 12px; padding-inline: 0; }
  .case-layout .case-layout__system-connector { margin-top: 22px; }
  .case-layout__system-connector::before, .case-layout__system-connector::after { content: none; }
  .case-layout__branches { padding: 0; gap: 16px; border-left: 0; margin: 20px 0 0; }
  .case-layout__branches::before, .case-layout__branches::after { content: none; }
  .case-layout__branches > div::before { content: none; }
  .case-layout__conversion { margin-top: 32px; }
  .case-layout__conversion .btn { --btn-padding-extra: 0px; font-size: 14px; }
}
@media (max-width: 520px) {
  .case-layout__responsive { padding: 22px 16px; }
  .case-layout__responsive-devices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .case-layout__responsive-devices img { border-width: 3px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-layout *, .case-layout-contact * { animation: none !important; transition: none !important; }
}
