.case-story, .case-portfolio { padding-bottom: clamp(42px, 7vw, 86px); }
.case-story { max-width: 1070px; margin: 0 auto; }
.case-opening { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,230px); align-items: end; gap: clamp(22px,4vw,52px); padding: clamp(18px,3vw,36px) 0 25px; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin: 0 0 16px; font-weight: 740; }
.case-status { padding: 4px 9px; border: 1px solid #b9c9a5; border-radius: 6px; color: #345126; background: #eaf1df; font-size: .75rem; font-weight: 690; }
.case-status.progress { border-color: #bdd0df; color: #254b63; background: #e8f1f6; }
.case-status.internal, .case-portfolio .project-state.internal { border-color: #c6cdd6; color: #394d65; background: #e9eef5; }
.case-intro h1, .case-portfolio-intro h1 { max-width: 20ch; margin: 0; color: #181c19; font-size: clamp(2.15rem, 5.45vw, 4.65rem); line-height: 1.02; letter-spacing: -.06em; text-wrap: balance; }
.case-intro h1 { max-width: 24ch; font-size: clamp(2.1rem,4.65vw,3.95rem); }
.case-lead, .case-portfolio-intro p { max-width: 62ch; margin: 17px 0 12px; color: #445242; font-size: clamp(.99rem, 1.7vw, 1.17rem); line-height: 1.6; }
.case-byline { margin: 0; color: #52614a; font-size: .84rem; }
.case-facts { margin: 0; padding: 4px 14px; border: 1px solid #cbd5c2; border-radius: 10px; background: #edf1e7; }
.case-facts div { padding: 8px 0; }
.case-facts div + div { border-top: 1px solid #cbd5c2; }
.case-facts dt { color: #52614a; font-size: .76rem; }
.case-facts dd { margin: 3px 0 0; font-size: .91rem; font-weight: 710; }
.case-cover { margin: 0 0 clamp(28px, 5vw, 56px); }
.case-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2.15; object-fit: cover; object-position: top; border: 1px solid #d3dbcb; border-radius: 15px; }
.case-cover figcaption { margin-top: 9px; color: #52614a; font-size: .78rem; }
.case-body { display: grid; grid-template-columns: minmax(150px, 225px) minmax(0, 1fr); align-items: start; gap: clamp(24px, 5vw, 68px); }
.case-index { position: sticky; top: 100px; padding: 15px 14px; border: 1px solid #cbd5c2; border-radius: 10px; background: #edf1e7; }
.case-index h2 { margin: 0 0 9px; font-size: .95rem; line-height: 1.4; letter-spacing: normal; font-weight: 760; }
.case-index ol { margin: 0; padding-left: 22px; }
.case-index li { color: #4e612f; font-size: .83rem; }
.case-index a { display: block; padding: 5px 1px; color: #334833; line-height: 1.4; }
.case-index a:hover, .case-related a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.case-chapters { max-width: 71ch; }
.case-chapter { scroll-margin-top: 104px; padding-bottom: 26px; }
.case-chapter + .case-chapter { padding-top: 23px; border-top: 1px solid #cbd5c2; }
.case-chapter h2 { margin: 0 0 12px; font-size: clamp(1.37rem, 3vw, 2.13rem); line-height: 1.15; letter-spacing: -.039em; }
.case-chapter p { margin: 0 0 13px; color: #344233; font-size: clamp(.97rem, 1.5vw, 1.06rem); line-height: 1.7; }
.case-example { margin: 18px 0 6px; padding: 13px 16px; border-left: 3px solid #8aab48; border-radius: 0 8px 8px 0; background: #eaf1df; }
.case-example h3 { margin: 0 0 4px; font-size: .91rem; line-height: 1.4; letter-spacing: normal; }
.case-example p { margin: 0; font-size: .92rem; line-height: 1.55; }
.case-flow { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 6px; padding: 0; list-style: none; }
.case-flow li { padding: 7px 10px; border: 1px solid #c4d2b3; border-radius: 6px; background: #edf2e5; color: #30482a; font-size: .8rem; font-weight: 690; }
.case-related { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 22px; padding: clamp(16px, 3vw, 29px); border-radius: 12px; background: #222c23; color: #f5f5ee; }
.case-related h2 { margin: 4px 0; color: inherit; font-size: clamp(1.13rem, 2.9vw, 1.65rem); letter-spacing: -.035em; }
.case-related span, .case-related p { margin: 0; color: #d4dfca; font-size: .79rem; }
.case-related .btn { background: #d1ff62; color: #181c19; }
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 18px; }
.case-story :focus-visible, .case-portfolio :focus-visible { outline: 2px solid #5d782f; outline-offset: 4px; }
.case-related :focus-visible { outline-color: #d1ff62; }
.operations-art {
  --device-gap: clamp(12px, 3.25vw, 36px);
  --screen-padding: clamp(12px, 2.25vw, 24px);
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(18px, 4vw, 44px);
  border-radius: 15px;
  background: radial-gradient(ellipse at 76% 110%, #344436, #1c272c 72%);
  color: #f6f8f4;
}
.operations-art-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.operations-art-header strong { font-size: clamp(1.2rem, 2.5vw, 1.65rem); line-height: 1; letter-spacing: -.035em; }
.operations-art-header span { color: #ced9ce; font-size: .72rem; }
.operations-art-devices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(108px, .32fr); gap: var(--device-gap); align-items: stretch; }
.operations-device { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.operations-device-label { color: #d5e1d8; font-size: .76rem; font-weight: 700; }
.operations-device:last-child { align-items: center; }
.operations-web, .operations-phone-screen { background: #f2f5f3; color: #1c2927; }
.operations-web { flex: 1; overflow: hidden; border: 1px solid #b4c6be; border-radius: 10px; }
.operations-window-bar { padding: 8px var(--screen-padding); background: #dce6e1; font-size: .72rem; font-weight: 720; }
.operations-overview { padding: var(--screen-padding); }
.operations-overview > strong { display: block; font-size: clamp(.9rem, 2vw, 1.45rem); line-height: 1.15; }
.operations-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 10px 0 0; }
.operations-metrics > div { padding: 8px clamp(5px, 1vw, 12px); border: 1px solid #d3ded8; border-radius: 6px; background: #fff; }
.operations-metrics > div:last-child { border-color: #c3d998; background: #e6f1d0; }
.operations-metrics dt { color: #41534b; font-size: clamp(.68rem, 1.2vw, .81rem); }
.operations-metrics dd { margin: 3px 0 0; font-size: clamp(.85rem, 2.35vw, 1.55rem); font-weight: 760; line-height: 1.1; }
.operations-activity { margin-top: 14px; color: #334841; font-size: .76rem; }
.operations-activity ul { margin: 5px 0 0; padding: 0; list-style: none; }
.operations-activity li { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid #d3ded8; }
.operations-activity li span { color: #51665c; font-variant-numeric: tabular-nums; }
.operations-phone { display: flex; flex: 1; width: 100%; max-width: 155px; min-height: 155px; padding: 5px; border: 1px solid #7d958a; border-radius: 16px; background: #101819; }
.operations-phone-screen { flex: 1; overflow: hidden; padding: 8px; border-radius: 11px; font-size: .71rem; }
.operations-phone-screen::before { display: block; width: 24px; height: 4px; margin: 0 auto 7px; border-radius: 4px; background: #334841; content: ''; }
.operations-phone-screen > b { display: block; padding-bottom: 5px; border-bottom: 1px solid #d3ded8; }
.operations-phone-screen > strong { display: block; margin-top: 7px; line-height: 1.2; }
.operations-phone-screen dl { margin: 5px 0 0; }
.operations-phone-screen dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 4px; padding: 4px 0; border-bottom: 1px solid #d3ded8; }
.operations-phone-screen dd { margin: 0; font-weight: 760; }
.case-portfolio-intro { margin: 24px 0 28px; }
.case-portfolio .portfolio-filters { justify-content: flex-start; }
.case-portfolio .portfolio-count { margin: 8px 0 20px; text-align: left; }
.case-portfolio .portfolio-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: stretch; }
.case-portfolio .portfolio-card { display: flex; flex-direction: column; max-width: none; width: 100%; }
.case-portfolio .portfolio-card[hidden] { display: none; }
.case-portfolio .project-preview { height: clamp(215px, 17vw, 225px); }
.case-portfolio .project-body { flex: 1; }
.case-portfolio .portfolio-client { min-height: 0; margin: 8px 0 0; color: #4c6046; font-weight: 730; }
.case-portfolio .portfolio-client + h3 { margin-top: 5px; }
.case-portfolio .project-body > p { min-height: 0; }
.case-portfolio .operations-art { --device-gap: 9px; --screen-padding: 8px; min-height: 100%; gap: 8px; padding: 12px; border-radius: 0; line-height: 1.25; }
.case-portfolio .operations-art-header strong { font-size: 1rem; }
.case-portfolio .operations-art-header span, .case-portfolio .operations-device-label { font-size: .66rem; }
.case-portfolio .operations-art-devices { grid-template-columns: minmax(0, 1fr) minmax(73px, .39fr); }
.case-portfolio .operations-window-bar { padding-block: 4px; font-size: .65rem; }
.case-portfolio .operations-overview > strong { font-size: .81rem; }
.case-portfolio .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.case-portfolio .operations-metrics > div { padding: 5px 3px; }
.case-portfolio .operations-metrics > div:last-child { display: none; }
.case-portfolio .operations-metrics dt { font-size: .63rem; }
.case-portfolio .operations-metrics dd { font-size: .73rem; }
.case-portfolio .operations-activity { display: none; }
.case-portfolio .operations-phone { min-height: 124px; }
.case-portfolio .operations-phone-screen { padding: 6px; font-size: .61rem; }
.case-portfolio .portfolio-cta { margin-top: 38px; }
@media (max-width: 850px) {
  .case-portfolio .portfolio-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 670px) {
  .case-body, .case-opening { grid-template-columns: 1fr; gap: 16px; }
  .case-index { position: static; }
  .case-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 4px; }
  .case-facts div { padding: 5px 7px; }
  .case-facts div + div { border-top: 0; border-left: 1px solid #cbd5c2; }
  .case-facts dd { font-size: .82rem; overflow-wrap: anywhere; }
  .case-cover img { aspect-ratio: 1.6; }
  .case-cover .operations-art-devices { grid-template-columns: minmax(0, 1fr) minmax(82px, .36fr); }
  .case-cover .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-cover .operations-metrics > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 490px) {
  .case-portfolio .portfolio-grid { grid-template-columns: 1fr; }
}
