/* ==========================================================================
   Case Studies — page styles.

   Secondary pages on this site are self-contained (see manifesto.html), so
   the shell below repeats index.html's tokens and chrome verbatim rather than
   importing them. Keep the :root block in step with index.html when the
   palette changes.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;560;600;700&family=Playfair+Display:wght@500;600&display=swap');

/* --- Shell: tokens and chrome, mirrored from index.html ------------------ */

:root {
  --bg: #0b0f17;
  --card: rgba(255, 255, 255, .07);
  --card2: rgba(255, 255, 255, .11);
  --line: rgba(255, 255, 255, .13);
  --text: #edf2ff;
  --muted: #a9b4cc;
  --soft: #dbe5ff;
  --accent: #8fd3ff;
  --mint: #b9fbc0;
  --gold: #ffd6a5;
  --max: 1160px;
  --radius: 26px;
  --font: Inter, system-ui, sans-serif;
  --display: 'Playfair Display', Georgia, serif;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(143, 211, 255, .22), transparent 34rem),
    radial-gradient(circle at 85% 18%, rgba(185, 251, 192, .14), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .055;
  background-image:
    linear-gradient(rgba(255, 255, 255, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .55) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: auto; }
section { padding: 70px 0; }

header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 15, 23, .72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

header nav {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 560; }

.navlinks {
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.navlinks a:hover { color: var(--text); }
.navlinks a[aria-current="page"] { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  font-weight: 560;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); }

.kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 560;
  margin-bottom: 13px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .055);
  color: var(--soft);
  font-size: 14px;
  margin-bottom: 22px;
}

footer { padding: 40px 0 60px; color: var(--muted); }

.footer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  font-size: 14px;
}

.footer-social {
  display: flex;
  height: auto;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-social a {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.footer-social a:hover {
  color: var(--accent);
  background: rgba(143, 211, 255, .08);
  border-color: rgba(143, 211, 255, .2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18), 0 0 18px rgba(143, 211, 255, .08);
  transform: translateY(-2px);
}

.footer-social svg { width: 19px; height: 19px; fill: currentColor; }

@media (max-width: 940px) {
  .navlinks { display: none; }
}

/* --- Hero ---------------------------------------------------------------- */

.cs-hero { padding: 64px 0 8px; }

.cs-hero h1 {
  margin: 4px 0 18px;
  max-width: 17ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -.02em;
}

.cs-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.cs-hero p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.cs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.cs-stats span {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
}

.cs-stats b { color: var(--text); font-weight: 560; }

/* --- Filter bar ---------------------------------------------------------- */

.cs-filters {
  position: sticky;
  top: 74px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: rgba(11, 15, 23, .82);
  backdrop-filter: blur(18px);
}

.cs-filter {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.cs-filter:hover { color: var(--text); background: var(--card); }

.cs-filter[aria-pressed="true"] {
  color: #0b0f17;
  background: var(--accent);
  border-color: transparent;
}

.cs-filter[disabled] { opacity: .4; cursor: not-allowed; }
.cs-filter small { opacity: .7; font-size: 11px; }

.cs-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

/* --- Case card ----------------------------------------------------------- */

.cs-list {
  display: grid;
  gap: 24px;
  padding-bottom: 20px;
}

.cs-card {
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.cs-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .24);
  box-shadow: var(--shadow);
}

.cs-card[hidden] { display: none; }

/* Preview panel — a real screenshot of this case's demo. The gradient stays
   underneath as the colour while the lazy image loads. */
.cs-preview {
  position: relative;
  display: block;
  min-height: 330px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 15%, rgba(143, 211, 255, .20), transparent 60%),
    radial-gradient(circle at 85% 90%, rgba(143, 211, 255, .07), transparent 55%);
}

.cs-preview.tone-mint {
  background:
    radial-gradient(circle at 20% 15%, rgba(185, 251, 192, .18), transparent 60%),
    radial-gradient(circle at 85% 90%, rgba(143, 211, 255, .07), transparent 55%);
}

.cs-preview.tone-gold {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 214, 165, .20), transparent 60%),
    radial-gradient(circle at 85% 90%, rgba(182, 106, 74, .10), transparent 55%);
}

.cs-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}

/* Scrim: the chips sit on top of a screenshot, so they need their own ground. */
.cs-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 15, 23, .95) 0%,
    rgba(11, 15, 23, .62) 14%,
    rgba(11, 15, 23, .06) 34%,
    rgba(11, 15, 23, .18) 100%
  );
}

.cs-card:hover .cs-preview img { transform: scale(1.03); }

.cs-preview-open {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 15, 23, .78);
  backdrop-filter: blur(6px);
  color: var(--soft);
  font-size: 12px;
  font-weight: 560;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
}

.cs-card:hover .cs-preview-open,
.cs-preview:focus-visible .cs-preview-open { opacity: 1; transform: none; }

.cs-metric-chips {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-metric-chips span {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 15, 23, .82);
  backdrop-filter: blur(6px);
  font-size: 12.5px;
}

.cs-metric-chips b { color: var(--mint); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .cs-preview img,
  .cs-preview-open { transition: none; }
  .cs-card:hover .cs-preview img { transform: none; }
}

/* --- Card body ----------------------------------------------------------- */

.cs-body { padding: 28px; }

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 560;
}

.cs-meta .dot { width: 3px; height: 3px; border-radius: 99px; background: currentColor; opacity: .6; }
.cs-meta .num { color: var(--accent); }

.cs-body h2 {
  margin: 13px 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.14;
  letter-spacing: -.02em;
}

.cs-tagline {
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 15px;
}

.cs-blocks {
  display: grid;
  gap: 15px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cs-block h4 {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.cs-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.62;
}

.cs-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin: 18px 0;
}

.cs-results div {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card2);
}

.cs-results strong {
  display: block;
  color: var(--mint);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.cs-results span { color: var(--muted); font-size: 12px; }

.cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 20px;
}

.cs-actions .btn { font-size: 14px; padding: 12px 18px; }

.cs-actions .btn-accent {
  background: var(--accent);
  color: #0b0f17;
  border-color: transparent;
}

.cs-actions .btn-accent:hover { background: #a9ddff; }

.cs-demo-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  opacity: .85;
}

/* --- Expandable detail --------------------------------------------------- */

.cs-detail {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.cs-detail[hidden] { display: none; }

.cs-detail h4 {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.cs-detail ol {
  margin: 0 0 18px;
  padding-left: 19px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.68;
}

.cs-detail li::marker { color: var(--accent); }
.cs-detail b { color: var(--soft); font-weight: 560; }

.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.cs-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}

/* --- Closing CTA --------------------------------------------------------- */

.cs-cta {
  margin: 10px 0 20px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.cs-cta h2 {
  margin: 11px 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -.02em;
}

.cs-cta p { margin: 0; max-width: 52ch; color: var(--muted); }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 940px) {
  .cs-card { grid-template-columns: 1fr; }
  .cs-filters { top: 0; }

  /* Stacked, the chips flow under the shot in normal order. Absolute
     positioning cannot work here: the chips wrap to two rows on narrow
     screens, so no fixed padding clears them. */
  .cs-preview {
    display: block;
    min-height: 0;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  /* At phone width the shot is decorative — its detail is unreadable either
     way — so crop it to a banner instead of spending half the screen on it. */
  .cs-preview img {
    position: static;
    height: 240px;
    object-fit: cover;
    object-position: top center;
    border-radius: 12px;
    border: 1px solid var(--line);
  }

  .cs-metric-chips {
    position: static;
    margin-top: 14px;
  }

  .cs-preview::after { display: none; }
  .cs-preview-open { display: none; }
}

@media (max-width: 620px) {
  .cs-body { padding: 22px 18px; }
  .cs-results { grid-template-columns: 1fr; }
  .cs-count { width: 100%; margin-left: 0; }
  .cs-actions .btn { flex: 1 1 100%; }
  .cs-cta { padding: 24px; }
}
