/* =========================================================
   Product Cases — graphite section for the ZANZARA site
   Self-contained: no Bootstrap / Isotope. Icons via bootstrap-icons CDN.
   ========================================================= */

:root {
  --bg: #22252a;
  --surface: #2b2f36;
  --surface-2: #333843;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --ink: #eceef1;
  --ink-dim: #c6cad1;
  --muted: #949ba6;
  --accent: #5e9bff;
  --before: #8b929e;
  --after: #37d39b;
  --warn: #f2b45c;
  --radius: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

/* language switch (shared with cv/) */
.lang-switch {
  position: fixed; top: 20px; right: 20px; z-index: 20;
  display: flex; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 40px; padding: 3px;
}
.lang-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 30px; cursor: pointer; transition: color .15s, background .15s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: #10131a; }

body.cases-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- shell ---------- */
.cases-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 24px 96px;
}

.cases-back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 20;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  transition: background .2s, transform .2s;
}
.cases-back:hover { background: var(--surface-2); transform: translateY(-1px); }

/* ---------- header ---------- */
.cases-head { max-width: 760px; margin-bottom: 40px; }

.cases-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.cases-head h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.cases-sub {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
  max-width: 640px;
}

/* ---------- filters ---------- */
.cases-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}

.cases-filters button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 40px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.cases-filters button:hover { color: var(--ink); border-color: var(--line-strong); }
.cases-filters button[aria-pressed="true"] {
  color: #10131a;
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 600;
}

/* ---------- grid ---------- */
.cases-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.case-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s, background .2s;
}
.case-card:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--surface-2); }
.case-card.is-hidden { display: none; }

.case-card > a { display: flex; flex-direction: column; height: 100%; padding: 22px; }

.case-card__strip {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--after));
}

.case-card__icon {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 16px;
}

.case-card__name {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.case-card__role {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.case-card__line {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 0 20px;
  flex: 1;
}

.case-card__metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.case-card__metric b {
  font-size: 22px;
  font-weight: 700;
  color: var(--after);
  letter-spacing: -0.02em;
}
.case-card__metric b span { font-size: inherit; color: inherit; }
.case-card__metric > span { font-size: 12px; color: var(--muted); }

.case-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.case-card__tags i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ---------- footer ---------- */
.cases-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cases-foot a:hover { color: var(--accent); }

/* =========================================================
   Case detail page
   ========================================================= */
.case { max-width: 900px; margin: 0 auto; padding: 88px 24px 96px; }

.case__crumbs { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.case__crumbs a:hover { color: var(--accent); }
.case__crumbs span { margin: 0 8px; opacity: .5; }

.case__kicker {
  font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px;
}
.case__title {
  font-size: clamp(30px, 5vw, 44px); font-weight: 700; line-height: 1.08;
  letter-spacing: -0.03em; margin: 0 0 14px;
}
.case__lead { font-size: 18px; color: var(--ink-dim); margin: 0 0 8px; }
.case__meta { font-size: 13px; color: var(--muted); margin: 0 0 40px; }
.case__meta b { color: var(--ink-dim); font-weight: 600; }

/* hero metric row */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 48px;
}
.hero-metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.hero-metric b {
  display: block;
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--after);
  margin-bottom: 4px;
}
.hero-metric.is-neutral b { color: var(--ink); }
.hero-metric > span { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; }
.hero-metric b span { font-size: inherit; color: inherit; display: inline; }

/* sections */
.case section { margin: 0 0 44px; }
.case h2 {
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.case p { margin: 0 0 14px; color: var(--ink-dim); }
.case strong { color: var(--ink); }

.case ul.plain { list-style: none; margin: 0; padding: 0; }
.case ul.plain li {
  position: relative; padding-left: 22px; margin-bottom: 12px; color: var(--ink-dim);
}
.case ul.plain li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--accent);
}

/* steps (approach) */
.steps { display: grid; gap: 12px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.step h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

/* results table */
.rtable { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 14px; }
.rtable th, .rtable td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.rtable th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.rtable td:first-child { color: var(--ink-dim); }
.rtable .v-after { color: var(--after); font-weight: 600; }
.rtable .v-delta { color: var(--muted); }

/* chart figure */
.figure {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 16px;
}
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; }
.figure svg { width: 100%; height: auto; overflow: visible; display: block; }

.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.chart-legend i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.chart-legend .k-before { color: var(--before); }
.chart-legend .k-after { color: var(--after); }

/* note / disclaimer */
.note {
  font-size: 12.5px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  border-radius: 8px; padding: 12px 14px; margin: 0 0 14px;
}

/* prev/next */
.case__nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.case__nav a { color: var(--muted); }
.case__nav a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cases-wrap { padding: 76px 16px 72px; }
  .case { padding: 76px 16px 72px; }
  .cases-grid { grid-template-columns: 1fr; }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .case__nav { flex-direction: column; }
}
