.case-document h1 {
  font-size: clamp(2.35rem, 4.85vw, 4.25rem);
  font-weight: 650;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.case-document h2 { font-size: clamp(1.6rem, 3.1vw, 2.7rem); }
.case-document h3 { font-size: clamp(1.12rem, 1.7vw, 1.4rem); }
.case-site-header .logo { margin: 0; align-self: center; }
.case-breadcrumb, .case-section-links { display: flex; flex-wrap: wrap; gap: 0 13px; }
.case-breadcrumb { align-items: center; color: var(--muted); font-size: .9375rem; }
.case-breadcrumb [aria-current] { color: var(--text); }
.case-breadcrumb a, .case-section-links a, .case-screens-heading a, .case-example a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.case-document { background-image: var(--ice-light); background-size: 100% 680px; background-repeat: no-repeat; }
.case-document-hero { padding-block: clamp(14px, 3vw, 34px) clamp(38px, 6vw, 84px); }
.case-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  grid-template-areas: "copy screen" "details screen";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 20px clamp(20px, 4.2vw, 62px);
  margin-top: clamp(18px, 3vw, 48px);
}
.case-hero-copy { grid-area: copy; min-width: 0; }
.case-hero-grid > .case-shot { grid-area: screen; }
.case-hero-details { grid-area: details; }
.case-project-status {
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.45;
}
.case-project-subtitle { margin-top: 10px; color: var(--accent); font-size: clamp(1.18rem, 2.3vw, 1.85rem); line-height: 1.3; }
.case-project-lead { max-width: 49ch; margin-top: clamp(12px, 2vw, 22px); color: var(--muted); font-size: 1.0625rem; line-height: 1.55; }
.case-document-facts { margin: 0 0 14px; font-size: .9375rem; }
.case-document-facts > div { padding-block: 9px; border-top: 1px solid var(--line); }
.case-document-facts > div:last-child { border-bottom: 1px solid var(--line); }
.case-document-facts dt, .case-document-decisions dt { font-weight: 650; }
.case-document-facts dd { margin: 3px 0 0; color: var(--muted); }
.case-section-links { gap: 5px; }
.case-section-links a { padding: 5px 10px; border: 1px solid var(--control-line); border-radius: var(--control-radius); text-decoration: none; }
.case-section-links a:hover { background: var(--surface-hover); }

.case-shot { min-width: 0; margin: 0; }
.case-shot-link {
  display: grid;
  overflow: clip;
  border: 1px solid var(--glass-rim);
  border-radius: var(--panel-radius);
  background: var(--glass-sheen) var(--glass-base);
  color: var(--accent);
  box-shadow: var(--glass-shadow);
}
.case-shot-link img { height: auto; margin-inline: auto; object-fit: contain; }
.case-shot--landscape img { width: 100%; aspect-ratio: 16 / 9; max-height: 460px; padding: 6px; }
.case-shot--portrait .case-shot-link {
  background-image: linear-gradient(#8da2bf24 1px, transparent 1px), linear-gradient(90deg, #8da2bf24 1px, transparent 1px);
  background-size: 26px 26px;
}
.case-shot--portrait img { width: min(220px, 54vw); height: clamp(250px, 33vw, 450px); padding-block: 9px; }
.case-shot-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border-top: 1px solid var(--glass-rim);
  background: #152031b8;
  font-size: .9375rem;
  font-weight: 650;
}
.case-shot-link:is(:hover, :focus-visible) { border-color: #8fa7c7; }
.case-shot-link:is(:hover, :focus-visible) .case-shot-action { background: #263851; text-decoration: underline; }
.case-shot figcaption { display: grid; gap: 3px; max-width: 65ch; margin: 9px 0 0; font-size: .9375rem; line-height: 1.45; }
.case-shot figcaption p { color: var(--muted); }
.case-screen-source { color: var(--accent); font-size: .875rem; }
.case-shot:target .case-shot-link { outline: 2px solid var(--accent); outline-offset: 4px; }

.case-document-body { background: var(--paper); color: var(--ink); color-scheme: light; }
.case-document-body :focus-visible { outline-color: var(--ink-accent); }
.case-document-section { padding-block: clamp(34px, 5.6vw, 78px); }
.case-document-section + .case-document-section { border-top: 1px solid var(--paper-line); }
.case-document-intro { max-width: 62ch; margin-top: 15px; font-size: clamp(1.08rem, 2vw, 1.35rem); font-weight: 600; }
.case-document-context { max-width: 74ch; margin-top: 8px; color: var(--ink-muted); }
.case-detail-grid, .case-document-gallery, .case-verification, .case-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 58px);
}
.case-detail-grid { margin-top: 24px; }
.case-detail-grid > div { min-width: 0; border-top: 1px solid var(--paper-line); padding-top: 14px; }
.case-document-steps { padding-inline-start: 23px; margin: 11px 0 0; color: var(--ink-muted); }
.case-document-steps li { padding-inline-start: 3px; }
.case-document-steps li + li { margin-top: 9px; }
.case-document-steps li::marker { color: var(--ink-accent); font-weight: 700; }
.case-document-decisions { margin: 11px 0 0; }
.case-document-decisions > div + div { margin-top: 8px; }
.case-document-decisions dd { margin: 2px 0 0; color: var(--ink-muted); }
.case-example { margin-top: clamp(24px, 4vw, 48px); padding: clamp(13px, 2vw, 26px); padding-bottom: 8px; border-inline-start: 3px solid var(--ink-accent); background: var(--paper-surface); }
.case-example p { margin-top: 6px; color: var(--ink-muted); }
.case-example a, .case-screens-heading a, .case-document-body .case-screen-source { color: var(--ink-accent); }
.sms-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 4px; padding: 0; list-style: none; }
.sms-flow li { min-width: 0; padding: clamp(9px, 1.4vw, 17px); border: 1px solid var(--paper-line); border-radius: var(--control-radius); }
.sms-flow h4 { margin: 0 0 8px; font-size: 1.0625rem; line-height: 1.3; text-wrap: balance; }
.sms-flow li > p { font-size: .9375rem; line-height: 1.5; text-wrap: pretty; }
.sms-flow-sample { min-height: 3.45em; margin: 0; padding: 8px 10px; border-radius: 5px; background: #e7edf6; color: var(--ink); font-size: .875rem; line-height: 1.35; overflow-wrap: anywhere; }
.sms-flow-sample > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; }
.sms-flow-sample dd { margin: 0; font-weight: 650; }
.case-verification p { max-width: 63ch; }
.case-verification p + p { margin-top: 9px; color: var(--ink-muted); }
.case-screens-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0 8px; margin-bottom: 18px; }
.case-document-gallery { gap: clamp(16px, 3vw, 36px); align-items: start; }
.case-document-gallery--portrait { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.case-document-body .case-shot figcaption p { color: var(--ink-muted); }
.case-document-body .case-shot:target .case-shot-link { outline-color: var(--ink-accent); }

.case-next { align-items: center; padding-block: clamp(37px, 6.3vw, 90px); }
.case-next p { margin: 9px 0 16px; color: var(--muted); }
.case-related {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  max-width: 560px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--control-line);
  border-radius: var(--control-radius);
  color: var(--accent);
}
.case-related:hover { background: var(--surface-hover); }
.case-related > span:first-of-type { color: var(--muted); }
.case-related > span:last-child { grid-column: 2; grid-row: 1 / 3; }

@media (max-width: 760px) {
  .case-site-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; padding-block: 7px; }
  .case-site-header > .header-contact { display: inline-flex; }
  .case-site-header .logo { min-height: 44px; }
  .case-hero-grid, .case-detail-grid, .case-verification, .case-next { grid-template-columns: minmax(0, 1fr); }
  .case-hero-grid { grid-template-areas: "copy" "screen" "details"; grid-template-rows: auto; }
  .case-document-hero { padding-top: 14px; }
}
@media (max-width: 580px) {
  .case-document-gallery, .sms-flow { grid-template-columns: minmax(0, 1fr); }
  .case-site-header .header-contact { font-size: .8125rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .case-shot-link { transition: border-color var(--motion-quick) var(--ease-out); }
  .case-shot-action { transition: background-color var(--motion-quick) var(--ease-out); }
  .case-shot-action > span { transition: translate var(--motion-quick) var(--ease-out); }
  .case-shot-link:is(:hover, :focus-visible) .case-shot-action > span { translate: 2px -2px; }
}
