/* ============================================
   Case Study — Shared Stylesheet
   ============================================ */

:root {
  --bg: #0a0a0f;
  --bg-2: #131319;
  --bg-3: #1a1a22;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-dim: #a8a8b2;
  --text-faint: #6a6a74;
  --accent: #7c5cff;
  --accent-2: #5b8def;
  --accent-glow: rgba(124, 92, 255, 0.15);
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ============ NAV ============ */
nav.cs-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid var(--border);
}
nav.cs-nav .logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
nav.cs-nav .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
nav.cs-nav .back-link:hover { color: var(--text); }

/* ============ LAYOUT ============ */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 48px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 48px;
}
.container-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

section.cs-section {
  padding: 80px 0;
}
section.cs-section.tight { padding: 48px 0; }

/* ============ HERO ============ */
.cs-hero {
  padding: 140px 0 60px;
  position: relative;
  overflow: hidden;
}
.cs-hero::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}
.cs-hero-content { position: relative; z-index: 1; }

.cs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 24px;
}

.cs-hero h1 {
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 24px;
  max-width: 900px;
}
.cs-hero .lead {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text-dim);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}
.cs-meta-item .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.cs-meta-item .value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

/* ============ HERO IMAGE ============ */
.cs-hero-image {
  margin: 0 -48px;
  padding: 0 48px;
  position: relative;
}
.cs-hero-image img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5);
}

/* ============ TYPOGRAPHY ============ */
h2.cs-h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 24px;
}
h3.cs-h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  margin-top: 40px;
}
.cs-section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 500;
}
p.cs-p, .cs-prose p {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.7;
}
.cs-prose ul, .cs-prose ol {
  margin: 16px 0 24px 24px;
}
.cs-prose li {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.7;
}
.cs-prose strong { color: var(--text); font-weight: 600; }
.cs-prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-glow); }

/* ============ LEAD / PULLQUOTE ============ */
.cs-lead-p {
  font-size: 22px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.005em;
  margin-bottom: 32px;
  max-width: 760px;
}

.cs-pullquote {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 32px;
  margin: 40px 0;
  font-size: 22px;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
}
.cs-pullquote .cite {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  font-style: normal;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

/* ============ CALLOUT CARDS ============ */
.cs-callout {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin: 32px 0;
}
.cs-callout.accent {
  border-color: rgba(124, 92, 255, 0.3);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), rgba(91, 141, 239, 0.04));
}
.cs-callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}
.cs-callout p { color: var(--text); font-size: 17px; }
.cs-callout p:last-child { margin-bottom: 0; }

/* ============ TWO-COLUMN COMPARISON ============ */
.cs-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}
.cs-compare-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.cs-compare-card.before {
  border-left: 3px solid var(--rose);
}
.cs-compare-card.after {
  border-left: 3px solid var(--green);
}
.cs-compare-card h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}
.cs-compare-card.before h4 { color: var(--rose); }
.cs-compare-card.after h4 { color: var(--green); }
.cs-compare-card p {
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}
.cs-compare-card ul {
  margin-left: 18px;
}
.cs-compare-card li {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ============ PROCESS STEPS ============ */
.cs-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 32px 0;
}
.cs-step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.cs-step .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}
.cs-step h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cs-step p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============ INSIGHTS ============ */
.cs-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0;
}
.cs-insight {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
}
.cs-insight .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 500;
  display: block;
}
.cs-insight h4 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.005em;
}
.cs-insight p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ============ METRICS / RESULTS ============ */
.cs-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0;
}
.cs-metric {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: left;
}
.cs-metric .num {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
}
.cs-metric .label {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============ IMAGE BLOCKS ============ */
.cs-image {
  margin: 48px -24px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.cs-image img {
  width: 100%;
}
.cs-image.full {
  margin: 48px calc((100vw - min(100vw, 1280px)) / -2 - 0px);
  border-radius: 0;
}
.cs-image-caption {
  font-size: 13px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  margin-top: 12px;
  text-align: center;
}

.cs-image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 40px 0;
}
.cs-image-row > div {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* ============ PRINCIPLES / BULLETS ============ */
.cs-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
.cs-principle {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-2);
}
.cs-principle .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.cs-principle h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cs-principle p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============ SECTION HEADER ============ */
.cs-section-header {
  margin-bottom: 32px;
  max-width: 720px;
}

/* ============ NEXT PROJECT ============ */
.cs-next {
  padding: 100px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.cs-next-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.cs-next h2 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.cs-next h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.cs-next h2 a:hover { color: var(--accent); }
.cs-next .next-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

/* ============ FOOTER ============ */
footer.cs-footer {
  padding: 40px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

/* ============ TIMELINE ============ */
.cs-timeline {
  position: relative;
  padding-left: 32px;
  margin: 32px 0;
}
.cs-timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border-2);
}
.cs-timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.cs-timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15);
}
.cs-timeline-item h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
.cs-timeline-item .when {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.cs-timeline-item p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

/* ============ GALLERY ============ */
.cs-gallery {
  margin: 56px 0 24px;
}

/* Mobile-phone gallery grid (6 phones, e.g. Flykk) */
.cs-gallery-phones {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cs-gallery-phones image-slot {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* Hero + grid (1 large + smaller grid) */
.cs-gallery-feature {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.cs-gallery-feature .gf-main {
  aspect-ratio: 1 / 1;
}
.cs-gallery-feature .gf-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
}
.cs-gallery-feature image-slot {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
}

/* Desktop dashboard grid (2x2) */
.cs-gallery-desktop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cs-gallery-desktop image-slot {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
}

/* Multi-device row (laptop wide + 2 phones) */
.cs-gallery-mixed {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}
.cs-gallery-mixed .md-wide {
  aspect-ratio: 1 / 1;
}
.cs-gallery-mixed .md-phone {
  aspect-ratio: 1 / 1;
}
.cs-gallery-mixed image-slot {
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* Single wide screenshot */
.cs-gallery-wide image-slot {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  display: block;
}

/* Gallery caption row */
.cs-gallery-captions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  grid-template-columns: repeat(3, 1fr);
}
.cs-gallery-caption {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.5;
}
.cs-gallery-caption strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* image-slot themed surface */
image-slot {
  --is-bg: linear-gradient(135deg, #16161e 0%, #1c1c26 100%);
  --is-border: rgba(255, 255, 255, 0.08);
  --is-text: rgba(245, 245, 247, 0.5);
  --is-text-hover: var(--accent);
  --is-border-hover: rgba(124, 92, 255, 0.4);
  display: block;
}

@media (max-width: 900px) {
  .cs-gallery-phones { grid-template-columns: repeat(3, 1fr); }
  .cs-gallery-feature, .cs-gallery-desktop, .cs-gallery-mixed { grid-template-columns: 1fr; }
  .cs-gallery-mixed .md-phone { aspect-ratio: 1 / 1; }
  .cs-gallery-captions { grid-template-columns: 1fr; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  nav.cs-nav { padding: 16px 24px; }
  .container, .container-narrow, .container-wide { padding: 0 24px; }
  .cs-meta { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .cs-steps { grid-template-columns: repeat(2, 1fr); }
  .cs-insights { grid-template-columns: 1fr; }
  .cs-metrics { grid-template-columns: repeat(2, 1fr); }
  .cs-compare { grid-template-columns: 1fr; }
  .cs-principles { grid-template-columns: 1fr; }
  .cs-image-row { grid-template-columns: 1fr; }
  footer.cs-footer { flex-direction: column; gap: 12px; padding: 32px 24px; }
}
