:root {
  --ink: #0f172a;
  --paper: #f8fafc;
  --accent: #1e40af;
  --accent-light: #2563eb;
  --accent-bg: #eff6ff;
  --accent-border: #bfdbfe;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --purple: #7c3aed;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 5%;
  background: rgba(248,250,252,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px;
  color: var(--ink); letter-spacing: -0.5px; text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 13.5px; color: var(--muted); text-decoration: none;
  transition: color 0.2s; white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #ffffff !important;
  padding: 10px 24px; border-radius: 7px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; font-weight: 600;
  text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-light); }
.nav-hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: rgba(248,250,252,0.98); border-bottom: 1px solid var(--border);
  padding: 8px 5%; flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 15px; color: var(--muted); text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mobile-menu a:last-child { border-bottom: none; color: var(--accent); font-weight: 600; }

/* HERO */
.cs-hero { padding: 112px 5% 40px; max-width: 1180px; margin: 0 auto; }
.cs-back {
  display: flex; width: fit-content; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 28px;
}
.cs-back:hover { color: var(--accent); }
.cs-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 18px;
}
.cs-eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--accent); }
h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 4.4vw, 54px);
  font-weight: 700; line-height: 1.04; letter-spacing: -2px;
  margin-bottom: 20px; max-width: 820px;
}
h1 em { font-style: normal; color: var(--accent); }
.cs-lede { font-size: 18px; color: var(--muted); font-weight: 300; max-width: 680px; line-height: 1.65; }
.cs-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-top: 36px;
}
.cs-meta div { background: var(--white); padding: 14px 18px; }
.cs-meta dt {
  font-family: 'Space Grotesk', sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.cs-meta dd { font-size: 14px; font-weight: 500; }
.cs-cover { margin-top: 36px; }
.cs-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.cs-note::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #b91c1c; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }

/* LAYOUT */
.cs-body { max-width: 1180px; margin: 0 auto; padding: 0 5%; }
.cs-section { padding: 56px 0; border-top: 1px solid var(--border); }
.cs-section:first-child { border-top: none; }
.cs-label {
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 12px;
}
h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700; letter-spacing: -1.1px; line-height: 1.12; margin-bottom: 14px; max-width: 760px;
}
h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700;
  letter-spacing: -0.3px; margin: 32px 0 12px;
}
.cs-intro { font-size: 17px; color: var(--muted); font-weight: 300; max-width: 720px; margin-bottom: 24px; }
.cs-prose { max-width: 720px; }
.cs-prose p { margin-bottom: 16px; color: #334155; }
.cs-prose strong { color: var(--ink); }

/* FIGURES */
.cs-figure { margin: 28px 0; }
.cs-figure.small { max-width: 420px; }
.cs-figure.medium { max-width: 720px; }
.cs-figure button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; background: var(--white); cursor: zoom-in;
  box-shadow: 0 6px 24px rgba(15,23,42,0.07); transition: box-shadow 0.25s, transform 0.25s;
}
.cs-figure button:hover { box-shadow: 0 12px 36px rgba(15,23,42,0.12); transform: translateY(-2px); }
.cs-figure img { display: block; width: 100%; height: auto; }
.cs-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.cs-figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: start; }
.cs-figure-row .cs-figure { margin: 0; }
.cs-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; margin: 28px 0; }
.cs-split .cs-figure { margin: 0; }

/* CALLOUT */
.cs-callout {
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 20px 24px; margin: 24px 0; max-width: 760px;
}
.cs-callout h4 { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.cs-callout p { font-size: 14.5px; color: #334155; }
.cs-callout p + p { margin-top: 10px; }
.cs-quote {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700; letter-spacing: -0.8px; line-height: 1.25;
  border-left: 3px solid var(--accent); padding: 6px 0 6px 24px; margin: 32px 0; max-width: 760px;
}

/* STATS */
.cs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.cs-stat { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.cs-stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 38px; font-weight: 700; letter-spacing: -1.5px; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.cs-stat-label { font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 6px; }
.cs-stat-desc { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* BEFORE / AFTER */
.cs-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.cs-compare > div { border-radius: 10px; padding: 22px 24px; border: 1px solid; }
.cs-compare .before { background: var(--red-bg); border-color: var(--red-border); }
.cs-compare .after { background: var(--green-bg); border-color: var(--green-border); }
.cs-compare h4 { font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; margin-bottom: 12px; }
.cs-compare .before h4 { color: var(--red); }
.cs-compare .after h4 { color: var(--green); }
.cs-compare .big { font-family: 'Space Grotesk', sans-serif; font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; margin-bottom: 10px; }
.cs-compare ul { list-style: none; }
.cs-compare li { font-size: 14px; padding: 6px 0 6px 22px; position: relative; color: #334155; }
.cs-compare .before li::before { content: '✕'; position: absolute; left: 0; color: var(--red); font-size: 12px; top: 8px; }
.cs-compare .after li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cs-compare p { font-size: 14px; color: #334155; }

/* TABLE */
.cs-table-wrap { overflow-x: auto; margin: 28px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.cs-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.cs-table th, .cs-table td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cs-table th { font-family: 'Space Grotesk', sans-serif; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); background: var(--paper); }
.cs-table tr:last-child td { border-bottom: none; }
.cs-table td:nth-child(2) { color: var(--red); font-weight: 500; }
.cs-table td:nth-child(3) { color: var(--green); font-weight: 600; }

/* LISTS */
.cs-points { list-style: none; max-width: 760px; margin: 20px 0; }
.cs-points li { padding: 12px 0 12px 30px; border-bottom: 1px solid var(--border); position: relative; font-size: 15px; color: #334155; }
.cs-points li:last-child { border-bottom: none; }
.cs-points li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.cs-points li strong { color: var(--ink); }
.cs-defs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0; }
.cs-def { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.cs-def strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 15px; margin-bottom: 4px; }
.cs-def span { font-size: 14px; color: var(--muted); line-height: 1.55; display: block; }
.cs-def .num { color: var(--accent); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }

/* FLOW */
.cs-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0; }
.cs-flow span {
  background: var(--white); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 500;
}
.cs-flow i { font-style: normal; color: var(--accent); font-weight: 700; }

/* PROCESS */
.cs-process { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--white); margin-top: 24px; }
.cs-process div { padding: 20px 18px; border-right: 1px solid var(--border); }
.cs-process div:last-child { border-right: none; }
.cs-process b { display: block; font-family: 'Space Grotesk', sans-serif; color: var(--purple); font-size: 22px; line-height: 1; margin-bottom: 6px; }
.cs-process strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 15px; margin-bottom: 4px; }
.cs-process span { font-size: 13px; color: var(--muted); line-height: 1.5; display: block; }

/* PREV / NEXT */
.cs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 48px 0 64px; border-top: 1px solid var(--border); }
.cs-pager a {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 20px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cs-pager a:hover { border-color: var(--accent-border); box-shadow: 0 8px 24px rgba(15,23,42,0.06); }
.cs-pager small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cs-pager strong { font-family: 'Space Grotesk', sans-serif; font-size: 16px; }
.cs-pager .next { text-align: right; }

/* CTA */
.cta-section { background: var(--ink); padding: 72px 5%; text-align: center; }
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-section h2 { color: var(--white); margin: 0 auto 16px; }
.cta-section p { color: rgba(255,255,255,0.55); font-size: 16px; margin-bottom: 32px; font-weight: 300; }
.btn-cta {
  background: var(--accent-light); color: var(--white);
  padding: 16px 44px; border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700;
  text-decoration: none; display: inline-block; transition: all 0.2s;
}
.btn-cta:hover { background: #3b82f6; transform: translateY(-2px); }

footer {
  padding: 24px 5%; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--muted); background: var(--white);
}
footer strong { color: var(--ink); font-family: 'Space Grotesk', sans-serif; }
footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--accent); }

/* LIGHTBOX */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(15,23,42,0.94); padding: 56px 72px 24px;
  flex-direction: column; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; background: var(--white); }
.lightbox p { color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 14px; max-width: 760px; text-align: center; }
.lightbox button {
  position: absolute; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: var(--white); width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,0.18); }
.lb-close { top: 14px; right: 18px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 24px; left: 24px; color: rgba(255,255,255,0.5); font-size: 13px; }

@media (max-width: 860px) {
  .cs-stats { grid-template-columns: repeat(2, 1fr); }
  .cs-process { grid-template-columns: 1fr; }
  .cs-process div { border-right: none; border-bottom: 1px solid var(--border); }
  .cs-process div:last-child { border-bottom: none; }
  .cs-split { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .cs-hero { padding-top: 96px; }
  .cs-compare, .cs-defs, .cs-pager { grid-template-columns: 1fr; }
  .cs-pager .next { text-align: left; }
  .lightbox { padding: 64px 12px 24px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}
@media (max-width: 520px) {
  .cs-stats { grid-template-columns: 1fr; }
}

/* Small crops stay at their natural size so they stay sharp */
.cs-figure.tiny button { width: auto; max-width: 100%; }
.cs-figure.tiny img { width: auto; max-width: 100%; }
