/* ==========================================================================
   Портфолио кейсов — общая дизайн-система
   ========================================================================== */

:root {
  --bg: #1e252d;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e252d;
  --text-soft: #626d74;
  --text-mute: #7e888e;
  --primary: #12ada6;
  --primary-soft: #e7f8f6;
  --primary-dark: #0b7e78;
  --accent: #72d8d1;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --code-bg: #0b1021;
  --code-text: #e2e8f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .12), 0 8px 10px -6px rgba(15, 23, 42, .08);
  --maxw: 980px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Top nav ----- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-soft);
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ----- Hero ----- */
.case-hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(79, 70, 229, .12), transparent 60%),
    radial-gradient(900px 360px at 0% 0%, rgba(14, 165, 233, .10), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--surface-2));
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
}

.case-client-note {
  padding: 13px 0;
  border-bottom: 1px solid #bee7e3;
  background: #f0fbfa;
  color: var(--text-soft);
  font-size: .86rem;
  line-height: 1.5;
}

.case-client-note strong { color: var(--text); }
.case-number {
  display: inline-block;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.case-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 0 0 14px;
  max-width: 18ch;
}
.lead {
  font-size: 1.12rem;
  color: var(--text-soft);
  max-width: 62ch;
  margin: 0 0 24px;
}

/* ----- Tags ----- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag {
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.tag.primary { background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }
.tag.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.tag.danger  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }

/* ----- Meta grid (hero stats) ----- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.meta-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.meta-item .label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mute);
  font-weight: 600;
  margin-bottom: 4px;
}
.meta-item .value {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}

/* ----- Body sections ----- */
.case-body { padding: 56px 0 80px; }
.case-body section { margin-bottom: 56px; scroll-margin-top: 80px; }
.case-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.case-body h2::before {
  content: "";
  width: 4px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  flex-shrink: 0;
}
.case-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}
.case-body h4 {
  font-size: .98rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text-soft);
}
.section-intro { color: var(--text-soft); margin: 0 0 22px; max-width: 70ch; }
p { color: var(--text-soft); }

/* ----- Symptom list ----- */
.symptom-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.symptom-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.symptom-list li .ico {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 800;
  margin-top: 1px;
}
.symptom-list li b { color: var(--text); font-weight: 700; }
.symptom-list li .desc { color: var(--text-soft); font-size: .96rem; }

/* ----- Diagnosis steps ----- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 64px;
  box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px; top: 18px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-family: var(--mono);
  display: grid; place-items: center;
  font-size: .9rem;
}
.steps li .step-title { font-weight: 700; color: var(--text); display: block; margin-bottom: 2px; }
.steps li .step-text { color: var(--text-soft); font-size: .96rem; }
.steps li code { font-size: .88em; }

/* ----- Code blocks ----- */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  border: 1px solid #1e293b;
  overflow: hidden;
  margin: 14px 0 22px;
  box-shadow: var(--shadow);
}
.code-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #131a31;
  border-bottom: 1px solid #1e293b;
  font-family: var(--mono);
  font-size: .78rem;
  color: #94a3b8;
  font-weight: 600;
}
.code-label .badge {
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.code-label .badge.before { background: rgba(220, 38, 38, .15); color: #fca5a5; }
.code-label .badge.after  { background: rgba(5, 150, 105, .15); color: #6ee7b7; }
.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  color: var(--code-text);
}
.code-block pre code { font-family: inherit; }
/* lightweight token coloring */
.tok-com { color: #64748b; font-style: italic; }
.tok-key { color: #c4b5fd; }
.tok-str { color: #86efac; }
.tok-num { color: #fcd34d; }
.tok-fn  { color: #7dd3fc; }
.tok-tag { color: #f9a8d4; }
.tok-err { color: #fca5a5; }

/* inline code */
code, p code, li code, .steps code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-3);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.code-block code { background: none; border: none; padding: 0; color: inherit; }

/* ----- Before / After ----- */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 8px;
}
.ba-block {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.ba-block .ba-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .95rem;
  margin-bottom: 10px;
}
.ba-block.before { border-left: 4px solid var(--danger); }
.ba-block.after  { border-left: 4px solid var(--success); }
.ba-block.before .ba-head { color: var(--danger); }
.ba-block.after  .ba-head { color: var(--success); }
.ba-block .ba-head .pill {
  font-size: .68rem; padding: 2px 8px; border-radius: 999px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.ba-block.before .pill { background: var(--danger-soft); color: var(--danger); }
.ba-block.after  .pill { background: var(--success-soft); color: var(--success); }
.ba-block p { margin: 0 0 8px; font-size: .94rem; }
.ba-block p:last-child { margin-bottom: 0; }

/* mock screen for before/after visuals */
.screen {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-3);
  padding: 14px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text-mute);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.screen .row { display: flex; gap: 8px; align-items: center; }
.screen .bar { height: 8px; border-radius: 4px; background: var(--border-strong); }
.screen .bar.w-30 { width: 30%; } .screen .bar.w-50 { width: 50%; }
.screen .bar.w-70 { width: 70%; } .screen .bar.w-90 { width: 90%; }
.screen .bar.full { width: 100%; }
.screen .bar.ok { background: var(--success); }
.screen .bar.bad { background: var(--danger); }

/* ----- Metric grid (result) ----- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 22px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.metric-card .delta {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.metric-card .from { color: var(--text-mute); text-decoration: line-through; }
.metric-card .num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1;
}
.metric-card .lbl {
  font-size: .82rem;
  color: var(--text-mute);
  margin-top: 6px;
  font-weight: 500;
}

/* ----- Callout ----- */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  margin: 18px 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-left: 4px solid var(--accent);
}
.callout.warn { border-left-color: var(--warning); background: var(--warning-soft); }
.callout.ok   { border-left-color: var(--success); background: var(--success-soft); }
.callout .ci { flex-shrink: 0; font-size: 1.2rem; }
.callout .ct { font-size: .94rem; color: var(--text); }
.callout .ct b { font-weight: 700; }

/* ----- Error table ----- */
.err-table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: .92rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.err-table th, .err-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.err-table th { background: var(--surface-3); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }
.err-table tr:last-child td { border-bottom: none; }
.err-table td code { font-size: .82em; }
.err-code { font-family: var(--mono); font-weight: 700; padding: 3px 9px; border-radius: 6px; font-size: .82rem; }
.err-code.c4 { background: var(--warning-soft); color: var(--warning); }
.err-code.c5 { background: var(--danger-soft); color: var(--danger); }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 0;
  color: var(--text-mute);
  font-size: .9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer .next-case { font-weight: 600; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }

/* ==========================================================================
   Index (витрина)
   ========================================================================== */
.index-hero { padding: 72px 0 56px; background: radial-gradient(1000px 420px at 85% -20%, rgba(79,70,229,.14), transparent 60%), radial-gradient(800px 360px at 0% 10%, rgba(14,165,233,.10), transparent 55%), linear-gradient(180deg,#fff,var(--surface-2)); border-bottom: 1px solid var(--border); }
.index-hero { background: radial-gradient(950px 410px at 86% -12%, rgba(18,173,166,.18), transparent 60%), radial-gradient(720px 340px at 0% 12%, rgba(30,37,45,.06), transparent 55%), linear-gradient(180deg,#fff,var(--surface-2)); }
.eyebrow { margin: 0 0 14px; color: var(--primary-dark); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.collection-client-note { margin: 40px 0 -26px; padding: 15px 18px; border: 1px solid #bee7e3; border-radius: var(--radius-sm); background: #f0fbfa; color: var(--text-soft); font-size: .9rem; line-height: 1.5; }
.collection-client-note strong { color: var(--text); }
.index-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; max-width: 16ch; line-height: 1.1; }
.index-hero p { font-size: 1.15rem; color: var(--text-soft); max-width: 60ch; }
.statline { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.statline .s .n { font-size: 1.8rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.statline .s .l { font-size: .85rem; color: var(--text-mute); }

.cases-grid { padding: 56px 0 88px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.case-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  color: var(--text);
}
.case-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.case-card .cc-num { font-family: var(--mono); font-size: .76rem; font-weight: 600; color: var(--primary); letter-spacing: .1em; }
.case-card h3 { font-size: 1.2rem; font-weight: 800; margin: 8px 0 10px; letter-spacing: -.02em; color: var(--text); }
.case-card p { font-size: .94rem; color: var(--text-soft); margin: 0 0 16px; flex-grow: 1; }
.case-card .cc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.case-card .cc-tags .tag { font-size: .74rem; padding: 4px 10px; }
.case-card .cc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-mute); }
.case-card .cc-foot .arrow { color: var(--primary); font-weight: 700; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .meta-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .before-after { grid-template-columns: 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
  .case-hero { padding: 40px 0 36px; }
  .case-body { padding: 40px 0 60px; }
  .case-body section { margin-bottom: 44px; }
  .steps li { padding-left: 60px; }
}
@media (max-width: 440px) {
  .meta-grid, .metric-grid { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
}

/* ==========================================================================
   2026 redesign — shared dark system for all diagnostic detail pages
   ========================================================================== */
:root {
  --bg: #0b0c0e;
  --surface: #101219;
  --surface-2: #0b0c0e;
  --surface-3: #0c1424;
  --border: rgba(255,255,255,.085);
  --border-strong: rgba(145,165,220,.2);
  --text: #f3f4f7;
  --text-soft: #a2a7b2;
  --text-mute: #747b89;
  --primary: #8aa7ff;
  --primary-soft: rgba(109,135,238,.1);
  --primary-dark: #a9bbff;
  --accent: #9fe2d5;
  --success: #8bd3bf;
  --success-soft: rgba(54,133,111,.13);
  --danger: #e7a089;
  --danger-soft: rgba(181,81,58,.13);
  --warning: #e7b36f;
  --warning-soft: rgba(177,121,49,.13);
  --code-bg: #080d18;
  --code-text: #dce3ef;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 16px 46px rgba(0,0,0,.18);
  --shadow: 0 24px 68px rgba(0,0,0,.26);
  --shadow-lg: 0 32px 86px rgba(0,0,0,.36);
  --maxw: 1120px;
}

html { background: var(--bg); }
body {
  color: var(--text);
  background:
    radial-gradient(850px 560px at 76% 2%, rgba(44,74,149,.15), transparent 62%),
    radial-gradient(680px 520px at 5% 46%, rgba(41,48,94,.1), transparent 66%),
    var(--bg);
  line-height: 1.55;
  letter-spacing: -.012em;
  overflow-x: hidden;
}
.container {
  width: min(var(--maxw), calc(100% - 48px));
  max-width: none;
  padding: 0;
}
a { color: inherit; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid #a8bbff; outline-offset: 4px; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,12,14,.84);
  backdrop-filter: blur(18px);
}
.topnav .container { height: 100%; }
.brand {
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -.035em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 20%, rgba(255,255,255,.4), transparent 32%),
    linear-gradient(145deg,#2d3d74,#151925 60%);
  color: #f5f6fb;
  font-size: 12px;
  font-weight: 750;
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.back-link {
  color: #b8bcc5;
  font-size: 13px;
  font-weight: 500;
}
.back-link:hover { color: #fff; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: transform .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-primary {
  color: #141519;
  background: linear-gradient(180deg,#fff,#d8d9dd);
  box-shadow: 0 7px 24px rgba(255,255,255,.1);
}

.case-client-note {
  padding: 11px 0;
  border-bottom: 1px solid rgba(159,226,213,.11);
  background: rgba(69,130,115,.07);
  color: #7e978f;
  font-size: 12px;
}
.case-hero {
  position: relative;
  overflow: hidden;
  padding: 86px 0 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(780px 480px at 72% 4%, rgba(65,91,177,.19), transparent 66%),
    linear-gradient(180deg,rgba(15,18,28,.35),rgba(11,12,14,.92));
}
.case-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(137,159,220,.22),transparent);
}
.case-number {
  margin-bottom: 20px;
  padding: 7px 11px;
  border: 1px solid rgba(152,173,255,.24);
  border-radius: 999px;
  color: #dce3fb;
  background: rgba(109,135,238,.09);
  font-size: 11px;
  letter-spacing: .09em;
}
.case-hero h1 {
  max-width: 850px;
  margin: 0 0 18px;
  color: transparent;
  background: linear-gradient(180deg,#fff 40%,#a4a8b1 96%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(42px,5.4vw,68px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 580;
  text-wrap: balance;
}
.lead {
  max-width: 760px;
  margin-bottom: 26px;
  color: #a7abb5;
  font-size: 17px;
  line-height: 1.55;
}
.tag-row { margin-bottom: 32px; }
.tag {
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.02);
  color: #7f8795;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}
.tag.primary {
  border-color: rgba(152,173,255,.18);
  background: rgba(109,135,238,.09);
  color: #bdc9ee;
}
.meta-grid { gap: 12px; }
.meta-item {
  min-height: 112px;
  padding: 17px;
  border-color: var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
  box-shadow: none;
}
.meta-item .label {
  color: #697386;
  font-family: var(--mono);
  font-size: 9px;
}
.meta-item .value {
  color: #dfe2e9;
  font-size: 14px;
  line-height: 1.38;
  font-weight: 560;
}

.case-body {
  width: min(980px, calc(100% - 48px));
  padding: 76px 0 98px;
}
.case-body *,
.meta-grid > *,
.metric-grid > *,
.before-after > * { min-width: 0; }
.case-body p,
.case-body li,
.case-body td,
.meta-item .value { overflow-wrap: anywhere; }
.case-body section {
  margin-bottom: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(16,18,25,.96),rgba(13,15,21,.99));
  box-shadow: 0 18px 58px rgba(0,0,0,.16);
  scroll-margin-top: 88px;
}
.case-body h2 {
  color: #eef0f5;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.035em;
  font-weight: 600;
}
.case-body h2::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(159,226,213,.35);
}
.case-body h3 { color: #e7e9ee; font-size: 19px; letter-spacing: -.025em; }
.case-body h4 { color: #c5c9d2; }
.section-intro, p { color: var(--text-soft); }
.section-intro { line-height: 1.58; }

.symptom-list li,
.steps li,
.ba-block,
.metric-card,
.callout,
.err-table {
  border-color: var(--border);
  background: rgba(255,255,255,.018);
  box-shadow: none;
}
.symptom-list li { border-left-color: var(--danger); }
.symptom-list li .ico { background: var(--danger-soft); }
.steps li::before {
  border: 1px solid rgba(152,173,255,.22);
  background: rgba(109,135,238,.1);
  color: #c7d3f6;
}
.before-after { gap: 12px; }
.ba-block.before { border-left-color: var(--danger); }
.ba-block.after { border-left-color: var(--success); }
.screen { border-color: var(--border); background: #0b111e; }
.metric-card .num { color: #f0f1f4; font-weight: 600; }
.metric-card .delta { color: var(--success); }
.callout.warn { background: var(--warning-soft); }
.callout.ok { background: var(--success-soft); }
.callout {
  display: block;
  overflow-wrap: anywhere;
}
.callout .ci {
  float: left;
  margin-right: 12px;
}
.callout .ct { display: block; }
.err-table th { background: #0c1424; }
.err-table td, .err-table th { border-color: var(--border); }
code, p code, li code, .steps code {
  border-color: rgba(138,167,255,.12);
  background: rgba(58,80,135,.12);
  color: #b9c8f3;
}
.code-block {
  width: 100%;
  max-width: 100%;
  border-color: rgba(101,125,180,.16);
  background: #080d18;
  box-shadow: none;
}
.code-block pre { width: 100%; max-width: 100%; overflow-x: auto; }
.code-block pre code { display: block; width: max-content; min-width: 100%; white-space: pre; overflow-wrap: normal; }
.code-label { border-color: rgba(255,255,255,.06); background: #0c1424; }

.case-cta { padding: 0 0 96px; }
.case-cta-card {
  position: relative;
  overflow: hidden;
  padding: 54px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background:
    radial-gradient(520px 340px at 0 0,rgba(151,66,47,.27),transparent 67%),
    radial-gradient(420px 300px at 95% 70%,rgba(75,43,112,.2),transparent 72%),
    #0e111b;
}
.case-cta-kicker {
  color: #c8cbd2;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.case-cta-card h2 {
  max-width: 760px;
  margin: 12px 0 12px;
  color: transparent;
  background: linear-gradient(180deg,#fff 38%,#a4a7af 95%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(36px,4.8vw,56px);
  line-height: 1;
  letter-spacing: -.05em;
  font-weight: 580;
  text-wrap: balance;
}
.case-cta-card p { max-width: 680px; margin: 0; font-size: 16px; }
.case-cta-card .btn { margin-top: 26px; }

.site-footer {
  padding: 42px 0 46px;
  border-top-color: var(--border);
  background: transparent;
  color: #777d89;
  font-size: 12px;
}
.site-footer .container { align-items: flex-start; }
.footer-copy { display: grid; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }
.footer-links a:hover { color: #fff; }

@media (max-width: 760px) {
  .container, .case-body { width: min(100% - 30px, var(--maxw)); padding-left: 0; padding-right: 0; }
  .topnav { height: 64px; }
  .nav-actions { gap: 10px; }
  .back-link { display: none; }
  .topnav .btn { min-height: 40px; padding: 0 14px; font-size: 12px; }
  .case-client-note { padding: 10px 0; }
  .case-hero { padding: 52px 0 44px; }
  .case-hero h1 { font-size: clamp(38px,11vw,52px); line-height: 1.03; }
  .lead { font-size: 15px; }
  .meta-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .meta-item { min-height: 104px; }
  .case-body { padding-top: 48px; padding-bottom: 72px; }
  .case-body section { margin-bottom: 16px; padding: 24px; }
  .case-body h2 { font-size: 23px; }
  .before-after { grid-template-columns: 1fr; }
  .case-cta { padding-bottom: 74px; }
  .case-cta-card { padding: 38px 26px; }
  .site-footer .container { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 460px) {
  .brand { font-size: 15px; }
  .topnav .btn { padding: 0 12px; }
  .meta-grid, .metric-grid { grid-template-columns: 1fr; }
  .case-body section { padding: 21px 18px; border-radius: 15px; }
  .steps li { padding-left: 58px; }
  .code-block pre { padding: 16px; font-size: .77rem; }
  .case-cta-card { padding: 34px 21px; }
  .case-cta-card h2 { font-size: 34px; }
}
