/**
 * Codantrix Labs — shared stylesheet for /work/<slug>/ case study pages.
 *
 * Documented exception to the "inline <style> per page" rule in
 * .claude/skills/codantrix-site/SKILL.md. The rule still applies to every
 * top-level page (home, /book, /studio, /founder, /privacy, /terms, /404).
 * This file exists ONLY because the 5 case-study detail pages share an
 * identical template — inlining would duplicate ~3000 lines across them.
 *
 * Do NOT add styles here that aren't shared by all case-study detail pages.
 * Do NOT load this from any other page on the site.
 */

:root {
  --bg: #0b0a08;
  --bg-deep: #080705;
  --surface-1: #14110d;
  --surface-2: #181510;
  --surface-3: #1c1813;
  --bg-elev: #131210;
  --ink: #ede5d6;
  --ink-soft: #a39d8e;
  --ink-faint: #5e584d;
  --line: rgba(237, 229, 214, 0.07);
  --line-strong: rgba(237, 229, 214, 0.13);
  --accent: #ff6b35;
  --accent-deep: #c44a1f;
  --accent-glow: rgba(255, 107, 53, 0.16);
  --accent-tint: rgba(255, 107, 53, 0.06);

  --depth-md:
    inset 0 1px 0 rgba(237, 229, 214, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 8px 24px -8px rgba(0, 0, 0, 0.4),
    0 24px 48px -20px rgba(0, 0, 0, 0.5);

  --depth-lg:
    inset 0 1px 0 rgba(237, 229, 214, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 12px 32px -8px rgba(0, 0, 0, 0.4),
    0 32px 64px -20px rgba(0, 0, 0, 0.55);

  --depth-hover:
    inset 0 1px 0 rgba(237, 229, 214, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.5),
    0 20px 40px -8px rgba(0, 0, 0, 0.5),
    0 40px 80px -20px rgba(0, 0, 0, 0.6);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  --display: 'Outfit', system-ui, sans-serif;
  --body: 'Poppins', system-ui, sans-serif;
  --max: 1240px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); position: relative; }

/* ============ SYSBAR ============ */
.sysbar { padding: 12px 0; background: var(--bg-elev); }
.sysbar .row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sysbar .seg { display: flex; align-items: center; gap: 10px; }
.sysbar .seg span { font-family: var(--body); font-weight: 500; font-size: 11px; letter-spacing: 0.02em; color: var(--ink-soft); }
.sysbar .seg.accent span { color: var(--accent); font-weight: 600; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); flex-shrink: 0; }
.pulse.green { background: #6ee7a8; box-shadow: 0 0 10px rgba(110, 231, 168, 0.35); }
@media (max-width: 720px) { .sysbar .seg.optional { display: none; } }

/* ============ NAV ============ */
nav.top { position: sticky; top: 0; z-index: 50; background: rgba(11, 10, 8, 0.78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
nav.top .row { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.wordmark .sep { color: var(--accent); font-weight: 700; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(255, 107, 53, 0.32)); }
.logo-mark svg { display: block; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-family: var(--body); font-weight: 500; font-size: 14px; color: var(--ink-soft); transition: color 220ms ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-cta { font-family: var(--body); font-weight: 500; font-size: 13px; background: var(--accent); color: var(--bg); padding: 11px 22px; border-radius: 999px; transition: all 240ms ease; display: inline-flex; align-items: center; gap: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 14px -2px rgba(255, 107, 53, 0.35); }
.nav-cta:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 22px -4px rgba(255, 107, 53, 0.5); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ============ CASE HERO ============ */
.case-hero { padding: clamp(48px, 7vw, 80px) 0 clamp(40px, 6vw, 72px); position: relative; }
.case-hero::before {
  content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 600px;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none; z-index: 0; filter: blur(80px); opacity: 0.42;
}
.case-hero .wrap { position: relative; z-index: 1; }

.back-link { margin-bottom: 28px; }
.back-link a {
  font-family: var(--body); font-weight: 500; font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 200ms ease;
}
.back-link a:hover { color: var(--accent); }

.case-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  font-family: var(--body); font-weight: 500; font-size: 12.5px;
  letter-spacing: 0.02em; color: var(--ink-soft);
  flex-wrap: wrap;
}
.case-eyebrow .vertical { display: inline-flex; align-items: center; gap: 8px; }
.case-eyebrow .vertical svg { color: var(--accent); }
.case-eyebrow .dot { color: var(--ink-faint); }
.case-eyebrow .tier { color: var(--accent); font-weight: 600; }
.case-eyebrow .duration { color: var(--ink-soft); }

.case-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.06; letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: 24px;
}
.case-summary {
  font-family: var(--body); font-weight: 400;
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.7; color: var(--ink-soft);
  max-width: 64ch;
  margin-bottom: 36px;
}

.outcome-banner {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 18px 24px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-lg);
  box-shadow: var(--depth-md);
  margin-bottom: 40px;
  max-width: 100%;
}
.outcome-banner .outcome-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-tint);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.outcome-banner .outcome-text { display: flex; flex-direction: column; gap: 4px; }
.outcome-banner .label {
  font-family: var(--body); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.outcome-banner .value {
  font-family: var(--display); font-weight: 500;
  font-size: 17px; color: var(--ink); letter-spacing: -0.01em;
}
.outcome-banner .value strong { color: var(--accent); font-weight: 600; }
.outcome-banner .delta { color: var(--accent); font-weight: 500; font-size: 14px; }

.case-facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-lg);
  padding: 22px 0;
  box-shadow: var(--depth-md);
}
.case-facts .fact {
  padding: 0 24px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.case-facts .fact:last-child { border-right: none; }
.case-facts .fact .label {
  font-family: var(--body); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.case-facts .fact .value {
  font-family: var(--display); font-weight: 500;
  font-size: 15px; color: var(--ink); letter-spacing: -0.005em;
  line-height: 1.4;
}
@media (max-width: 860px) {
  .case-facts { grid-template-columns: repeat(2, 1fr); padding: 16px 0; gap: 16px 0; }
  .case-facts .fact { padding: 8px 20px; }
  .case-facts .fact:nth-child(2) { border-right: none; }
}
@media (max-width: 540px) {
  .case-facts { grid-template-columns: 1fr; }
  .case-facts .fact { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .case-facts .fact:last-child { border-bottom: none; padding-bottom: 0; }
}

/* ============ SECTION HEADER ============ */
.case-section { padding: clamp(50px, 7vw, 90px) 0; }
.sec-head { margin-bottom: clamp(32px, 4vw, 48px); padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.sec-eyebrow { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sec-eyebrow .num { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--accent); letter-spacing: 0.04em; }
.sec-eyebrow .bar { width: 28px; height: 1px; background: var(--accent); opacity: 0.5; }
.sec-eyebrow .name { font-family: var(--body); font-weight: 500; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.02em; }
.sec-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.15; letter-spacing: -0.02em;
}
.sec-title .muted { color: var(--ink-faint); }

/* ============ PROSE BLOCKS ============ */
.prose {
  max-width: 70ch;
}
.prose p {
  font-family: var(--body); font-weight: 400;
  font-size: 16px; line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.prose p strong { color: var(--ink); font-weight: 500; }
.prose p em { color: var(--accent); font-style: normal; font-weight: 500; }

/* ============ DIAGRAM FRAME ============ */
.diagram-frame {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-xl);
  padding: 14px;
  box-shadow: var(--depth-lg);
  margin-bottom: 40px;
}
.diagram-frame .diag-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 6px 14px 12px;
  font-family: var(--body); font-weight: 500; font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint);
}
.diagram-frame .accent-dot {
  color: var(--accent); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.diagram-frame .accent-dot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.case-diag {
  width: 100%; height: auto;
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 16px;
  display: block;
}

/* ============ PHASE FLOW ============ */
.phase-flow {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 920px) { .phase-flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .phase-flow { grid-template-columns: 1fr; } }

.phase {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-lg);
  padding: 22px 22px 24px;
  box-shadow: var(--depth-md);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: all 240ms ease;
}
.phase:hover { transform: translateY(-2px); box-shadow: var(--depth-hover); }
.phase .phase-num {
  font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.1em; color: var(--accent);
}
.phase h4 {
  font-family: var(--display); font-weight: 500;
  font-size: 17px; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--ink);
}
.phase p {
  font-family: var(--body); font-weight: 400;
  font-size: 13px; line-height: 1.65;
  color: var(--ink-soft);
}
.phase .duration-tag {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--body); font-weight: 500; font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ============ OUTCOMES GRID ============ */
.outcomes-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
@media (max-width: 920px) { .outcomes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .outcomes-grid { grid-template-columns: 1fr; } }

.outcome-card {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-lg);
  padding: 24px 22px 22px;
  box-shadow: var(--depth-md);
  display: flex; flex-direction: column; gap: 8px;
  transition: all 240ms ease;
  position: relative; overflow: hidden;
}
.outcome-card:hover { transform: translateY(-2px); box-shadow: var(--depth-hover); }
.outcome-card.featured {
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
}
.outcome-card.featured::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(30px); pointer-events: none;
}
.outcome-card .oc-label {
  font-family: var(--body); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
  position: relative; z-index: 1;
}
.outcome-card .oc-value {
  font-family: var(--display); font-weight: 500;
  font-size: 22px; line-height: 1.25; letter-spacing: -0.015em;
  color: var(--ink);
  position: relative; z-index: 1;
}
.outcome-card .oc-value .accent { color: var(--accent); font-weight: 600; }
.outcome-card .oc-delta {
  font-family: var(--body); font-weight: 500; font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.02em;
  position: relative; z-index: 1;
}

.illustrative-note {
  font-family: var(--body); font-weight: 400; font-size: 12px;
  color: var(--ink-faint); line-height: 1.65;
  max-width: 64ch;
  padding-left: 16px;
  border-left: 2px solid var(--accent-tint);
  margin-top: 12px;
}
.illustrative-note strong { color: var(--ink-soft); font-weight: 500; }

/* ============ MORE WORK ============ */
.more-work { padding: clamp(50px, 7vw, 90px) 0; border-top: 1px solid var(--line); }
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 56px;
}
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--depth-md);
  display: flex; flex-direction: column; gap: 10px;
  transition: all 240ms ease;
}
.related-card:hover { transform: translateY(-3px); box-shadow: var(--depth-hover); }
.related-card .rc-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.related-card .rc-vertical { font-family: var(--body); font-weight: 500; font-size: 11px; letter-spacing: 0.04em; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.related-card .rc-vertical svg { color: var(--accent); }
.related-card .rc-duration { font-family: var(--body); font-weight: 600; font-size: 10px; letter-spacing: 0.08em; color: var(--accent); padding: 2px 9px; border-radius: 999px; background: var(--accent-tint); border: 1px solid rgba(255, 107, 53, 0.22); }
.related-card h4 { font-family: var(--display); font-weight: 500; font-size: 15.5px; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); }
.related-card .rc-outcome { margin-top: auto; padding-top: 4px; font-family: var(--body); font-weight: 500; font-size: 11.5px; color: var(--accent); }

/* ============ CTA STRIP ============ */
.case-cta {
  padding: clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border-radius: var(--r-xl);
  box-shadow: var(--depth-md);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.case-cta::before { content: ''; position: absolute; top: -120px; right: -120px; width: 360px; height: 360px; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); filter: blur(40px); pointer-events: none; }
.case-cta .text { position: relative; z-index: 1; max-width: 56ch; }
.case-cta .text h3 { font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; letter-spacing: -0.015em; color: var(--ink); margin-bottom: 8px; }
.case-cta .text p { font-family: var(--body); font-weight: 400; font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.case-cta .actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { font-family: var(--body); font-weight: 500; font-size: 14px; padding: 12px 24px; border-radius: 999px; transition: all 240ms ease; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 20px -4px rgba(255, 107, 53, 0.4); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 28px -4px rgba(255, 107, 53, 0.5); }
.btn.ghost { background: var(--bg-elev); color: var(--ink-soft); box-shadow: var(--depth-md); }
.btn.ghost:hover { color: var(--accent); transform: translateY(-1px); }

/* ============ FOOTER ============ */
footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: clamp(48px, 6vw, 72px) 0 32px; margin-top: clamp(60px, 8vw, 100px); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.footer-grid .col h5 { font-family: var(--body); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; }
.footer-grid .col a:not(.wordmark) { display: block; font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--ink-soft); padding: 5px 0; transition: color 200ms; }
.footer-grid .col a:not(.wordmark):hover { color: var(--accent); }
.footer-grid .col .wordmark { font-size: 18px; color: var(--ink); padding: 0; }
.footer-grid .col.about p { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin-top: 14px; max-width: 36ch; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--ink-faint); }
.footer-bottom a { color: var(--ink-soft); }
.footer-bottom a:hover { color: var(--accent); }
.colophon { margin-top: 14px; font-family: var(--body); font-weight: 400; font-size: 11px; color: var(--ink-faint); opacity: 0.7; }
