/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --paper-0: #FFFFFF;
  --paper-1: #FBF9F5;
  --paper-2: #F4F1EA;
  --paper-3: #ECE7DD;
  --ink-0:   #15140F;
  --ink-1:   #1C1B16;
  --ink-2:   #45433B;
  --ink-3:   #6B675C;
  --ink-4:   #928D80;
  --line-1:  #E7E2D7;
  --line-2:  #D8D2C4;
  --line-on-ink: rgba(255,255,255,.12);
  --clay-1:  #C5532E;
  --clay-2:  #A8431F;
  --clay-3:  #E07A52;
  --clay-soft: #F6E7DF;
  --clay-line: #EBC9B8;
  --sage-1:  #3F6B5E;
  --sage-soft: #E4EBE6;

  /* semantic shorthands matching old var names */
  --bg:        var(--paper-1);
  --bg-2:      var(--paper-0);
  --bg-3:      var(--paper-2);
  --border:    var(--line-1);
  --border-m:  var(--line-2);
  --accent:    var(--clay-1);
  --text:      var(--ink-1);
  --text-mid:  var(--ink-2);
  --text-low:  var(--ink-3);
  --sans:      'Hanken Grotesk', system-ui, sans-serif;

  --shadow-xs: 0 1px 2px rgba(28,27,22,.05);
  --shadow-sm: 0 1px 3px rgba(28,27,22,.06), 0 1px 2px rgba(28,27,22,.04);
  --shadow-md: 0 4px 14px rgba(28,27,22,.07), 0 2px 4px rgba(28,27,22,.04);
  --shadow-lg: 0 12px 32px rgba(28,27,22,.10), 0 4px 8px rgba(28,27,22,.05);
  --shadow-accent: 0 6px 20px rgba(197,83,46,.22);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --ease-out:  cubic-bezier(.22,1,.36,1);
  --dur-fast:  140ms;
  --dur-base:  220ms;

  --font-display: 'Schibsted Grotesk', system-ui, sans-serif;
  --font-sans:    'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── BASE ───────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
*:focus-visible { outline: 2px solid var(--clay-1); outline-offset: 2px; }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 56px; height: 68px;
  background: color-mix(in srgb, var(--paper-1) 85%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-left { display: flex; align-items: center; gap: 20px; }
.nav-logo {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
  color: var(--ink-1);
}
.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--clay-1); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.nav-back {
  font-family: var(--font-sans); font-size: 13px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.nav-back:hover { border-color: var(--clay-line); color: var(--clay-1); }
.nav-back::before { content: '←'; margin-right: 2px; }
.breadcrumb {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-4);
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb span { color: var(--ink-3); }
.breadcrumb::before { content: '/'; color: var(--line-2); }
.nav-right a { color: var(--ink-3) !important; transition: color var(--dur-fast); }
.nav-right a:hover { color: var(--clay-1) !important; }

/* ── HERO ────────────────────────────────────────────────── */
.cs-hero {
  background: var(--paper-2);
  padding: 64px 56px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cs-hero::before { display: none; }

.cs-company-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--clay-1);
  margin-bottom: 20px;
}
.cs-company-tag::before {
  content: '';
  width: 20px; height: 1.5px; background: var(--clay-1);
}

.cs-title {
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px);
  font-weight: 800; line-height: 1.06;
  letter-spacing: -0.02em; color: var(--ink-1);
  max-width: 760px; margin-bottom: 20px;
}

.cs-subtitle {
  font-size: 18px; color: var(--ink-2);
  max-width: 640px; line-height: 1.7;
  margin-bottom: 48px;
}

/* Outcome strip */
.outcome-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; max-width: 680px;
  margin-bottom: 48px;
  position: relative; z-index: 1;
}
.outcome-card {
  background: var(--paper-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px 20px;
  box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
}
.outcome-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--clay-1);
}
.o-num {
  font-family: var(--font-display); font-size: 38px; font-weight: 800;
  color: var(--clay-1); letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 8px;
}
.o-label { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* Meta row */
.meta-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  background: var(--paper-3);
}
.meta-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}
.meta-cell:last-child { border-right: none; }
.meta-key {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  font-weight: 600; color: var(--ink-4); text-transform: uppercase;
  margin-bottom: 6px;
}
.meta-val {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--ink-1); line-height: 1.4;
}

/* ── BODY ────────────────────────────────────────────────── */
.cs-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 72px 24px;
}

.cs-section { margin-bottom: 72px; }

.section-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  font-weight: 600; color: var(--clay-1); text-transform: uppercase;
  margin-bottom: 12px;
}
.section-h2 {
  font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px);
  font-weight: 800; color: var(--ink-1);
  letter-spacing: -0.02em; margin-bottom: 18px; line-height: 1.2;
}
.section-body {
  font-size: 16px; color: var(--ink-2);
  line-height: 1.8; margin-bottom: 28px;
}
.section-body + .section-body { margin-top: -12px; }

/* Callout */
.callout {
  border-left: 3px solid var(--clay-1);
  background: var(--clay-soft);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 28px 0;
}
.callout p {
  font-size: 16px; color: var(--ink-2);
  line-height: 1.7; font-style: italic;
}
.callout-attr {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-4);
  margin-top: 10px; font-style: normal; letter-spacing: 0.04em;
}

/* Problem grid */
.problem-grid {
  display: flex; flex-direction: column;
  margin: 28px 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.problem-card {
  display: grid; grid-template-columns: 44px 1fr;
  align-items: start; gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--paper-0);
}
.problem-card:last-child { border-bottom: none; }
.problem-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; margin-top: 2px;
}
.problem-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--ink-1); margin-bottom: 6px;
}
.problem-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* Artifact grid */
.artifact-grid { display: grid; gap: 14px; margin: 28px 0; }
.artifact-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.artifact-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.artifact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--paper-0);
  box-shadow: var(--shadow-xs);
}
.artifact-img {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4);
  background: var(--paper-2);
  position: relative; overflow: hidden;
}
.artifact-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Keep dark placeholder backgrounds for diagram-only cards */
.ai-dark    { background: linear-gradient(135deg, #0d1a2a 0%, #06101a 100%); color: rgba(255,255,255,.3); }
.ai-dark-2  { background: linear-gradient(135deg, #1a0d2a 0%, #0d0618 100%); color: rgba(255,255,255,.3); }
.ai-mid     { background: linear-gradient(135deg, #0d1a14 0%, #060e0a 100%); color: rgba(255,255,255,.3); }
.ai-warm    { background: linear-gradient(135deg, #1a140d 0%, #0e0a06 100%); color: rgba(255,255,255,.3); }
.ai-slate   { background: linear-gradient(135deg, #10141a 0%, #080b10 100%); color: rgba(255,255,255,.3); }
.ai-dark::before { display: none; }

.artifact-caption {
  padding: 10px 14px;
  font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--border);
  background: var(--paper-1);
  line-height: 1.4;
}

/* Full-image card (treasures page) */
.full-img-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.full-img-card img {
  width: 100%; display: block; max-height: 420px; object-fit: contain;
  background: var(--paper-2);
}
.full-img-caption {
  padding: 12px 16px;
  font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--border);
  background: var(--paper-1); line-height: 1.5;
}

/* Insight cards */
.insight-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 28px 0;
}
.insight-card {
  background: var(--paper-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-xs);
}
.insight-num {
  font-family: var(--font-display); font-size: 30px; font-weight: 800;
  color: var(--clay-1); letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 8px;
}
.insight-label { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.insight-body  { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* Process steps */
.process-steps {
  display: flex; flex-direction: column;
  margin: 28px 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.process-step {
  display: grid; grid-template-columns: 48px 1fr;
  align-items: start; gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--paper-0);
}
.process-step:last-child { border-bottom: none; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--clay-1); flex-shrink: 0;
}
.step-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--ink-1); margin-bottom: 5px;
}
.step-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* A/B comparison */
.ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.ab-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--paper-0);
  box-shadow: var(--shadow-xs);
}
.ab-card.winner { border-color: var(--clay-line); }
.ab-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-1);
}
.ab-label { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--ink-1); }
.ab-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
}
.ab-badge.preferred { background: var(--clay-soft); color: var(--clay-1); border: 1px solid var(--clay-line); }
.ab-badge.variant   { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--border); }
.ab-body {
  padding: 16px; min-height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.ab-body img { width: 100%; display: block; border-radius: 6px; }
.ab-diagram { font-size: 11px; color: var(--ink-4); text-align: center; letter-spacing: 0.05em; }
.ab-caption {
  padding: 10px 16px;
  font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--border);
  background: var(--paper-1); line-height: 1.5;
}

/* Capability grid */
.capability-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 28px 0;
}
.capability-item {
  background: var(--paper-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-xs);
}
.cap-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; width: 28px; text-align: center; }
.cap-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--ink-1); margin-bottom: 4px; }
.cap-desc  { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* Tool chips */
.tool-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.tool-chip {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 5px 13px; border-radius: var(--radius-pill);
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  color: var(--clay-1);
}

/* Code inline */
code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--clay-soft); padding: 2px 6px;
  border-radius: var(--radius-sm); color: var(--clay-1);
}

/* Divider */
.section-divider { height: 1px; background: var(--border); margin: 0 0 72px; }

/* Outcome summary */
.outcome-summary {
  background: var(--paper-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.os-heading {
  font-family: var(--font-display); font-size: 17px; font-weight: 800;
  color: var(--ink-1); margin-bottom: 20px;
}
.os-items { display: flex; flex-direction: column; }
.os-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.os-item:last-child { border-bottom: none; }
.os-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--clay-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--clay-1);
  flex-shrink: 0; margin-top: 1px;
}
.os-text { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.os-text strong { color: var(--ink-1); font-weight: 600; }

/* Reflection */
.reflection {
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  border-radius: var(--radius-lg); padding: 32px 36px;
  margin: 28px 0;
}
.reflection-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  font-weight: 600; color: var(--clay-1); text-transform: uppercase;
  margin-bottom: 14px;
}
.reflection-body { font-size: 15px; color: var(--ink-2); line-height: 1.8; }
.reflection-body + .reflection-body { margin-top: 14px; }

/* ── PAGINATION ──────────────────────────────────────────── */
.cs-pagination {
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr;
}
.page-link {
  padding: 32px 56px;
  display: flex; flex-direction: column; gap: 8px;
  border-right: 1px solid var(--border);
  transition: background var(--dur-fast);
}
.page-link:hover { background: var(--paper-2); }
.page-link.next { border-right: none; text-align: right; align-items: flex-end; }
.page-direction {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  font-weight: 600; color: var(--ink-4); text-transform: uppercase;
}
.page-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink-1); }
.page-co { font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
  padding: 24px 56px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
  background: var(--ink-0);
}
.footer-left { font-family: var(--font-mono); font-size: 12px; color: rgba(243,239,230,.55); }
.footer-right { display: flex; gap: 24px; }
.footer-right a { font-size: 13px; color: rgba(243,239,230,.55); transition: color var(--dur-fast); }
.footer-right a:hover { color: var(--clay-3); }

/* ── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .breadcrumb { display: none; }
  .cs-hero { padding: 40px 24px 0; }
  .cs-title { font-size: 28px; margin-bottom: 14px; }
  .cs-subtitle { font-size: 15px; margin-bottom: 32px; }
  .outcome-strip { grid-template-columns: 1fr; max-width: 100%; margin-bottom: 32px; }
  .meta-row { grid-template-columns: 1fr 1fr; }
  .meta-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .meta-cell:nth-child(odd) { border-right: 1px solid var(--border); }
  .meta-cell:last-child { border-bottom: none; }
  .cs-body { padding: 48px 20px; }
  .section-h2 { font-size: 22px; }
  .artifact-grid.cols-2,
  .artifact-grid.cols-3 { grid-template-columns: 1fr; }
  .insight-row { grid-template-columns: 1fr; }
  .ab-grid { grid-template-columns: 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
  .cs-pagination { grid-template-columns: 1fr; }
  .page-link { padding: 24px 20px; border-right: none; border-bottom: 1px solid var(--border); }
  .page-link.next { text-align: left; align-items: flex-start; border-bottom: none; }
  .footer { padding: 24px 20px; flex-direction: column; gap: 14px; text-align: center; }
}
