/* A case study: shared by the four case pages. Built on the article pages' bar (piece.css). */

.case-page { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.cs-head { padding: 96px 0 56px; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.cs-kind { margin: 0; font-size: 15px; color: var(--muted); }
.cs-kind b { font-weight: 500; color: var(--soft); }
.cs-title {
  margin: 0; max-width: 16ch;
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut-lg);
  font-size: clamp(52px, 7.6vw, 112px); line-height: .96; letter-spacing: -0.035em; text-wrap: balance;
}
.cs-intro { margin: 0; max-width: none; font-size: 24px; line-height: 1.5; color: var(--body); text-wrap: pretty; }
/* wide screens: the intro's full lines meet the same right edge as the fact boxes */
@media (min-width: 1001px) { .cs-intro, .cs-flow-foot { text-align: justify; text-align-last: left; } }

/* The facts: four short answers in a row */
.cs-facts { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cs-facts div { padding: 18px 20px; border-radius: 14px; background: var(--raised); display: flex; flex-direction: column; gap: 6px; }
.cs-facts dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.cs-facts dd { margin: 0; font-size: 16px; line-height: 1.45; color: var(--fg); }

/* The story: a heading in the left column, its text on the right */
.cs-sec { padding: 64px 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px 64px; }
.cs-sec h2 {
  margin: 0; font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut);
  font-size: 34px; line-height: 1.1; letter-spacing: -0.01em;
}
.cs-sec h2 .it { font-style: italic; color: var(--soft); }
.cs-prose { display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.7; color: var(--body); }
.cs-prose p { margin: 0; }
/* running text keeps a readable measure; blocks (quotes, steps, figures) use the whole column */
.cs-prose > p:not(.cs-quote), .cs-moves li { max-width: 70ch; }
.cs-todo { color: var(--muted); }

.cs-layers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.cs-layers div { padding: 22px; border-radius: 14px; background: var(--raised); display: flex; flex-direction: column; gap: 8px; }
.cs-layers strong { font-size: 17px; font-weight: 600; color: var(--fg); }
.cs-layers small { font-size: 15px; line-height: 1.55; color: var(--soft); }
.cs-quote { margin: 8px 0 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--accent); }
.cs-quote span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.cs-quote q { font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut); font-style: italic; font-size: 26px; line-height: 1.3; color: var(--fg); }

.cs-shot {
  display: grid; place-items: center; aspect-ratio: 16 / 8; border-radius: 16px; padding: 24px; text-align: center;
  background: linear-gradient(180deg, rgba(15,61,62,.045), rgba(15,61,62,.015)); border: 1px solid rgba(15,61,62,.07);
  font-size: 15px; line-height: 1.5; color: var(--muted);
}

/* The outcome in numbers */
.cs-metrics { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-metrics div { padding: 22px 22px 24px; border-radius: 14px; background: var(--raised); display: flex; flex-direction: column; gap: 10px; }
.cs-metrics dt {
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut-lg);
  font-size: 54px; line-height: 1; letter-spacing: -0.03em; color: var(--fg);
}
.cs-metrics div:first-child dt { color: var(--accent-text); }
.cs-metrics dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }

.cs-facts-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cs-metrics-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-since { font-size: 14px; font-weight: 500; color: var(--muted); }

/* Numbered moves inside the prose */
.cs-moves { margin: 0; padding: 0; list-style: none; counter-reset: mv; display: flex; flex-direction: column; gap: 18px; }
.cs-moves li { counter-increment: mv; position: relative; padding-left: 52px; }
.cs-moves li::before {
  content: counter(mv); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--raised); color: var(--fg);
  font-family: var(--serif); font-variation-settings: var(--serif-cut); font-size: 17px; line-height: 1;
}
.cs-moves strong { font-weight: 600; color: var(--fg); }

/* A short sequence: one step leads to the next, the last is the result */
.cs-steps { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.cs-steps li { position: relative; padding: 0 0 22px 32px; font-size: 17px; line-height: 1.55; }
.cs-steps li::before { content: ''; position: absolute; left: 0; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.cs-steps li::after { content: ''; position: absolute; left: 4px; top: 22px; bottom: 2px; width: 2px; background: var(--line-strong); }
.cs-steps li:last-child { padding-bottom: 0; }
.cs-steps li:last-child::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(232, 112, 74, .16); }
.cs-steps li:last-child::after { display: none; }
.cs-steps b { display: block; font-weight: 600; color: var(--fg); }
.cs-steps li:last-child { color: var(--fg); }

/* The diagram: four stages left to right, joined by coral connectors; stacked on phones */
.cs-flow { margin: 0; padding: 64px 0; }
.cs-flow-head { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px 64px; align-items: baseline; margin-bottom: 32px; font-size: 18px; line-height: 1.7; color: var(--body); }
.cs-flow-head > span:first-child {
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut);
  font-size: 34px; line-height: 1.1; letter-spacing: -0.01em; color: var(--fg);
}
.cs-flow-head .it { font-style: italic; color: var(--soft); }
.cs-flow-panel { padding: 32px; border-radius: 20px; background: var(--panel); }
.flow { display: grid; grid-template-columns: .85fr 1fr 1fr 1.25fr; gap: 28px; }
.flow-col { position: relative; padding: 22px; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.flow-col + .flow-col::before {
  content: ''; position: absolute; left: -28px; top: 50%; width: 28px; height: 2px; background: var(--accent);
}
.flow-col + .flow-col::after {
  content: ''; position: absolute; left: -8px; top: calc(50% - 4px); width: 6px; height: 6px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); rotate: 45deg;
}
.flow-step { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--accent-text); }
.flow-col h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--fg); }
.flow-col ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--soft); }
.flow-before { background: transparent; border: 1.5px dashed var(--off); padding: calc(22px - 1.5px); }
.flow-before .flow-step { color: var(--muted); }
.flow-nums { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.flow-nums div { display: flex; flex-direction: column; gap: 2px; }
.flow-nums dt {
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut-lg);
  font-size: 32px; line-height: 1; letter-spacing: -0.02em; color: var(--fg);
}
.flow-nums dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--soft); }
.flow-note, .flow-sub { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.flow-agent { background: var(--fg); }
.flow-agent h3 { color: var(--bg); }
.flow-agent .flow-step { color: var(--accent); }
.flow-agent .flow-sub { color: #A9BDB8; }
.flow-tags { flex-direction: row !important; flex-wrap: wrap; gap: 8px !important; }
.flow-tags li { padding: 6px 12px; border-radius: 999px; background: rgba(245, 240, 230, .1); color: var(--bg); font-size: 14px; }
.flow-views { gap: 10px; }
.flow-view { padding: 14px 16px; border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.flow-view h3 { font-size: 16px; }
.flow-view p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--soft); }
.flow-out {
  margin: 28px 0 0; padding: 18px 22px; border-radius: 14px; background: var(--accent); color: var(--on-accent);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut); font-size: 24px; line-height: 1.2;
}
.flow-out span { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.cs-flow-foot { margin: 20px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

/* Next case */
.cs-next {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 40px 0 0; padding: 36px 40px; border-radius: 18px;
  background: var(--raised); color: var(--fg); transition: background .3s ease;
}
.cs-next:hover { background: #E4DCCC; color: var(--fg); }
.cs-next span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.cs-next b {
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut);
  font-size: clamp(30px, 3.6vw, 48px); line-height: 1.05; letter-spacing: -0.02em; color: var(--fg);
}
.cs-next i {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent);
  transition: translate .4s var(--ease);
}
.cs-next i::before { content: ''; width: 12px; height: 12px; border-top: 2px solid var(--on-accent); border-right: 2px solid var(--on-accent); rotate: 45deg; translate: -2px 0; }
.cs-next:hover i { translate: 6px 0; }

@media (prefers-reduced-motion: no-preference) {
  .cs-kind, .cs-title, .cs-intro, .cs-facts { animation: settle .8s var(--ease) both; }
  .cs-title { animation-delay: .05s; } .cs-intro { animation-delay: .12s; } .cs-facts { animation-delay: .2s; }
  @keyframes settle { from { opacity: 0; translate: 0 14px; } }
}
@media (max-width: 1000px) {
  .cs-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-sec { grid-template-columns: 1fr; padding: 48px 0; }
  .cs-flow { padding: 48px 0; }
  .cs-flow-head { grid-template-columns: 1fr; }
  .cs-facts-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-facts-5 div:last-child { grid-column: span 2; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-col + .flow-col::before, .flow-col + .flow-col::after { display: none; }
}
@media (max-width: 760px) {
  .cs-flow-panel { padding: 20px 16px; }
  .cs-flow-head { gap: 12px; font-size: 17px; }
  .cs-flow-head > span:first-child { font-size: 28px; }
  .flow { grid-template-columns: 1fr; gap: 26px; }
  .flow-col + .flow-col::before, .flow-col + .flow-col::after { display: block; }
  .flow-col + .flow-col::before { left: 50%; top: -26px; width: 2px; height: 26px; }
  .flow-col + .flow-col::after { left: calc(50% - 3px); top: -10px; rotate: 135deg; }
  .cs-facts-5 div:last-child { grid-column: auto; }
  .cs-metrics-2 { grid-template-columns: 1fr; }
  .flow-out { font-size: 20px; }
}
@media (max-width: 760px) {
  .cs-head { padding: 56px 0 40px; }
  .cs-intro { font-size: 19px; }
  .cs-facts, .cs-layers, .cs-metrics { grid-template-columns: 1fr; }
  .cs-sec h2 { font-size: 28px; }
  .cs-prose { font-size: 17px; }
  .cs-metrics dt { font-size: 44px; }
  .cs-next { padding: 24px; }
}
