/* Case study pages (layout: case-study). Everything is scoped to .cs so the rest of the site is untouched.
   Colours follow the site's theme classes: dark by default (body / body.dark), light with body.light. */
body, body.dark {
  --cs-surface: #1E1E1E; --cs-sunk: #111111; --cs-line: #2C2C31;
  --cs-title: #FFFFFF; --cs-text: #D6D6DC; --cs-muted: #9C9CA6;
  --cs-accent: #8F7BFF; --cs-grad-a: #75BCFF; --cs-grad-b: #3344FF;
}
body.light {
  --cs-surface: #F6F6F8; --cs-sunk: #F1F1F4; --cs-line: #E1E1E6;
  --cs-title: #17171A; --cs-text: #2D2D33; --cs-muted: #63636E;
  --cs-accent: #4717F6;
}

.cs { color: var(--cs-text); font-size: 16px; line-height: 1.7; padding-bottom: 32px; }
.cs * { letter-spacing: normal; }
.cs h1, .cs h2, .cs h3 { color: var(--cs-title); margin: 0; line-height: 1.22; text-wrap: balance; }
.cs p { margin: 0; line-height: 1.7; }
.cs img { max-width: 100%; }
.cs-gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .cs-gut { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
.cs-col { max-width: 46rem; margin-inline: auto; width: 100%; }
.cs-wide { max-width: 72rem; margin-inline: auto; width: 100%; }

/* Head */
.cs-head { padding-block: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.cs-kicker { font-size: 14px; font-weight: 600; color: var(--cs-accent); }
.cs-h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 700; }
.cs-h1 .cs-grad { display: block; padding-bottom: 0.06em; background: linear-gradient(30deg, var(--cs-grad-a), var(--cs-grad-b)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cs-lead { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); line-height: 1.6; color: var(--cs-title); max-width: 36em; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px 28px; margin: 4px 0 0; padding-top: 18px; border-top: 1px solid var(--cs-line); }
.cs-facts div { min-width: 0; }
.cs-facts dt { font-size: 13px; color: var(--cs-muted); }
.cs-facts dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--cs-title); line-height: 1.45; }

/* Figures */
.cs figure { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cs-shot { display: block; width: 100%; padding: 8px; border: 1px solid var(--cs-line); border-radius: 14px; background: var(--cs-sunk); cursor: zoom-in; font: inherit; }
.cs-shot img { display: block; width: 100%; height: auto; border-radius: 8px; filter: none; }
.cs figcaption { font-size: 14px; line-height: 1.55; color: var(--cs-muted); }
.cs figcaption b { color: var(--cs-title); font-weight: 600; }
.cs-demo { border-radius: 18px; overflow: hidden; min-height: 640px; }

/* Sections */
.cs-sec { padding-block: 72px 0; display: flex; flex-direction: column; gap: 22px; }
.cs-sec > *, .cs-head > * { min-width: 0; }
.cs-label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em !important; text-transform: uppercase; color: var(--cs-accent); }
.cs-h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); font-weight: 700; }
.cs-p { font-size: 1.08rem; max-width: 40em; }
.cs-note { font-size: 13px; color: var(--cs-muted); }
.cs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.cs-card { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: 14px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cs-card b { color: var(--cs-title); font-weight: 600; }
.cs-card p { font-size: 15px; color: var(--cs-muted); line-height: 1.6; }
.cs-list { list-style: none; margin: 0; padding: 0; }
.cs-list li { padding: 12px 0; border-bottom: 1px solid var(--cs-line); display: grid; grid-template-columns: 1.4rem 1fr; gap: 10px; }
.cs-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cs-accent); margin-top: 0.62em; }
.cs-list b { color: var(--cs-title); font-weight: 600; }
.cs-list span { color: var(--cs-muted); }
.cs-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.cs-flow span { padding: 7px 13px; border-radius: 10px; background: var(--cs-surface); border: 1px solid var(--cs-line); color: var(--cs-title); font-weight: 500; }
.cs-flow i { font-style: normal; color: var(--cs-accent); font-weight: 700; }
.cs-table { overflow-x: auto; border: 1px solid var(--cs-line); border-radius: 14px; }
.cs-table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.cs-table th, .cs-table td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--cs-line); line-height: 1.55; }
.cs-table th { font-size: 13px; color: var(--cs-muted); font-weight: 600; background: var(--cs-surface); }
.cs-table td:first-child { color: var(--cs-muted); width: 46%; }
.cs-table td:last-child { color: var(--cs-title); }
.cs-table tr:last-child td { border-bottom: 0; }

/* Grids */
.cs-phones { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .cs-phones { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cs-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-phones .cs-shot { padding: 5px; border-radius: 16px; }
.cs-phones .cs-shot img { border-radius: 11px; }
.cs-phones figcaption { font-size: 13px; line-height: 1.45; }
.cs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; align-items: start; }
@media (max-width: 760px) { .cs-grid2 { grid-template-columns: 1fr; } }

/* Audio */
.cs-audio { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--cs-line); border-radius: 14px; background: var(--cs-surface); }
.cs-audio b { color: var(--cs-title); font-weight: 600; font-size: 15px; }
.cs-audio span { font-size: 14px; color: var(--cs-muted); }
.cs-audio audio { width: 100%; }

/* Lightbox */
.cs-lb { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.86); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: max(3vh, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(3vh, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow: auto; cursor: zoom-out; }
.cs-lb[hidden] { display: none; }
.cs-lb img { width: min(100%, 1700px); height: auto; border-radius: 10px; background: #fff; }
.cs-lb p { color: #E6E6EA; font-size: 14px; text-align: center; max-width: 70ch; }
.cs :focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 3px; border-radius: 6px; }
