/* ============================================================
   ADVANTAGE DESIGN SYSTEM — CASE STUDY PAGE STYLES
   Reuses the VOM case-study system (cs-*) and adds modules
   specific to a process / systems case study:
   pipeline diagram, token swatches, code blocks, agent card,
   component gallery, layer rail.
   Shares page tokens from style.css: --dark, --body, --cream,
   --green, --green-dark, --bg.
============================================================ */

.cs-page { background: #ebe8e0; }

/* ============================================================
   NAV — transparent overlay over the dark hero
============================================================ */
.cs-page .nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: transparent;
  z-index: 10;
}
.cs-page .nav .nav-logo img { filter: brightness(0) invert(1); }
.cs-page .nav .nav-link { color: #fff; }
.cs-page .nav .nav-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ============================================================
   DARK SECTION (hero + statement share one background)
============================================================ */
.cs-dark-section {
  position: relative;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: #0a1024;
}
.cs-dark-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 0;
  opacity: 0.9;
}
/* Subtle blueprint grid behind the hero (brand-blue systems feel) */
.cs-dark-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(115, 171, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 171, 255, 0.07) 1px, transparent 1px),
    radial-gradient(120% 90% at 70% 0%, rgba(33, 112, 237, 0.45), transparent 60%);
  background-size: 48px 48px, 48px 48px, 100% 100%;
}
.cs-dark-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(8, 12, 32, 0.2) 0%, rgba(8, 12, 32, 0.55) 60%, #ebe8e0 100%);
}

.cs-hero-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 54vh;
  padding-bottom: 8vh;
}
.cs-hero-inner {
  width: 74%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vw, 34px);
}
.cs-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9dc1ff;
  margin: 0;
}
.cs-hero-eyebrow::before {
  content: "";
  width: 28px; height: 1.5px;
  background: #9dc1ff;
  display: inline-block;
}
.cs-hero-title {
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 66px);
  line-height: 1.05;
  letter-spacing: -1.4px;
  color: #fff;
  margin: 0;
}
.cs-hero-title em {
  font-style: normal;
  color: #73abff;
}
.cs-hero-body { display: flex; flex-direction: column; gap: 16px; max-width: 60ch; }
.cs-hero-body p {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  letter-spacing: -0.2px;
}

/* Hero tech chips */
.cs-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.cs-chip {
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--sans);
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(157, 193, 255, 0.28);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

/* ============================================================
   HERO DEVICE (laptop mockup of the DS landing page)
============================================================ */
.cs-hero-device {
  position: relative;
  z-index: 1;
  margin: clamp(16px, 4vw, 56px) auto 0;
}
.cs-hero-device figure {
  margin: 0;
  max-width: 1080px;
  margin-inline: auto;
}
.cs-hero-device img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 50px 90px rgba(0, 0, 0, 0.5));
}
.cs-hero-device figcaption {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  font-family: var(--sans);
  color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   STATEMENT (big line in the dark section)
============================================================ */
.cs-hero-statement {
  position: relative;
  z-index: 1;
  padding: clamp(48px, 7vw, 100px) 0 clamp(120px, 16vw, 190px);
}
.cs-hero-statement .cs-measure { max-width: 900px; }
.cs-statement-lead {
  font-weight: 700;
  font-size: clamp(28px, 3.8vw, 52px);
  line-height: 1.18;
  letter-spacing: -1px;
  color: #fff;
  margin: 0;
}
.cs-statement-lead em {
  font-style: normal;
  color: #73abff;
}

/* ============================================================
   CONTEXT BODY
============================================================ */
.cs-context {
  position: relative;
  z-index: 0;
  padding-top: clamp(80px, 10vw, 130px);
  padding-bottom: clamp(40px, 8vw, 80px);
}
.cs-context-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cs-context-inner p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--body);
  margin: 0;
}
.cs-context-inner p strong { color: var(--dark); font-weight: 700; }

/* ============================================================
   META BAR
============================================================ */
.cs-meta {
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.cs-meta > div {
  padding-top: 22px;
  border-top: 1.5px solid rgba(38, 20, 7, 0.18);
}
.cs-meta dt {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--green-dark);
  margin: 0 0 10px;
}
.cs-meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--dark);
  letter-spacing: -0.2px;
}

/* ============================================================
   GENERIC STORY SECTION
============================================================ */
.cs-section { padding: clamp(64px, 9vw, 130px) 0; }
.cs-section--tight { padding: clamp(40px, 5vw, 72px) 0; }
.cs-measure { max-width: 760px; margin: 0 auto; }
.cs-measure--wide { max-width: 1100px; }

.cs-eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--green-dark);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cs-eyebrow::before {
  content: "";
  width: 28px; height: 1.5px;
  background: var(--green-dark);
  display: inline-block;
}
.cs-h2 {
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -1.2px;
  color: var(--dark);
  margin: 0 0 28px;
}
.cs-lead {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  color: var(--dark);
  margin: 0 0 24px;
  font-weight: 500;
}
.cs-prose p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--body);
  margin: 0 0 18px;
}
.cs-prose p:last-child { margin-bottom: 0; }
.cs-prose strong { color: var(--dark); font-weight: 700; }
.cs-prose code {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 0.9em;
  background: rgba(33, 112, 237, 0.08);
  color: #14478f;
  padding: 2px 6px;
  border-radius: 6px;
}

.cs-statement {
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.8px;
  color: var(--dark);
  margin: 40px 0 0;
}
.cs-statement em { font-style: normal; color: var(--green-dark); }

/* Bullets */
.cs-bullets {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cs-bullets li {
  position: relative;
  padding-left: 28px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
}
.cs-bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.cs-bullets li strong { color: var(--dark); }

/* ============================================================
   PIPELINE DIAGRAM  (the operating-model centerpiece)
============================================================ */
.cs-pipeline {
  margin: 8px auto 0;
  max-width: 1100px;
}
.cs-pipe-track {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}
.cs-pipe-node {
  flex: 1 1 150px;
  min-width: 0;
  background: var(--cream);
  border-radius: 18px;
  outline: 1px solid rgba(38, 20, 7, 0.1);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.cs-pipe-node--source { background: #eef4ff; outline-color: rgba(33, 112, 237, 0.25); }
.cs-pipe-node--ai     { background: #0f1733; outline-color: rgba(115, 171, 255, 0.35); }
.cs-pipe-node--ai .cs-pipe-label { color: #fff; }
.cs-pipe-node--ai .cs-pipe-desc  { color: rgba(255,255,255,0.7); }
.cs-pipe-node--ai .cs-pipe-step  { color: #9dc1ff; }
.cs-pipe-step {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green-dark);
}
.cs-pipe-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--dark);
  line-height: 1.2;
}
.cs-pipe-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--body);
}
.cs-pipe-arrow {
  align-self: center;
  color: rgba(38, 20, 7, 0.35);
  font-size: 18px;
  flex: 0 0 auto;
}

/* ============================================================
   LAYER BLOCK  (numbered system layer)
============================================================ */
.cs-layer-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green-dark);
  margin: 0 0 14px;
}
.cs-layer-tag b {
  font-size: 14px;
  color: #14478f;
}

/* ============================================================
   TOKEN SWATCH GRID
============================================================ */
.cs-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.cs-swatch {
  background: var(--cream);
  border-radius: 16px;
  outline: 1px solid rgba(38, 20, 7, 0.1);
  overflow: hidden;
}
.cs-swatch-chip {
  height: 76px;
  display: block;
  border-bottom: 1px solid rgba(38, 20, 7, 0.08);
}
.cs-swatch-meta { padding: 12px 14px; }
.cs-swatch-name {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  display: block;
  word-break: break-all;
  line-height: 1.4;
}
.cs-swatch-val {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--body);
  opacity: 0.7;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

/* ============================================================
   CODE BLOCK  (styled, on-brand "editor" panel)
============================================================ */
.cs-code {
  background: #0f1733;
  border-radius: 20px;
  outline: 1px solid rgba(115, 171, 255, 0.18);
  overflow: hidden;
  margin-top: 8px;
  box-shadow: 0 1px 2px rgba(8,12,32,.2), 0 18px 40px -24px rgba(8,12,32,.6);
}
.cs-code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-code-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.18); flex: 0 0 auto; }
.cs-code-dot:nth-child(1) { background: #ff6058; }
.cs-code-dot:nth-child(2) { background: #ffbd2e; }
.cs-code-dot:nth-child(3) { background: #28c93f; }
.cs-code-file {
  margin-left: 8px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}
.cs-code pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 13px;
  line-height: 1.7;
  color: #d7e3ff;
}
.cs-code pre .c { color: #6f86b8; font-style: italic; } /* comment */
.cs-code pre .k { color: #ff9b6b; }                     /* keyword / property */
.cs-code pre .s { color: #8fe0a4; }                     /* string / value */
.cs-code pre .t { color: #73abff; }                     /* token / var name */
.cs-code pre .p { color: #c4b6ff; }                     /* punctuation accent */

/* ============================================================
   TWO-COLUMN  (prose beside code/visual)
============================================================ */
.cs-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.cs-cols--narrow-left { grid-template-columns: 0.85fr 1.15fr; }

/* ============================================================
   SCREENS / FIGURES  (Storybook screenshots, swap-able)
============================================================ */
.cs-screens { padding-bottom: clamp(60px, 7vw, 120px); }
.cs-screens > .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cs-card {
  border-radius: 32px;
  overflow: hidden;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  outline: 1px solid rgba(26, 24, 20, 0.18);
  outline-offset: 10px;
  background: var(--cream);
}
.cs-shot {
  margin: 0;
  display: block;
}
.cs-shot img {
  width: 100%;
  height: auto;
  display: block;
}
.cs-shot figcaption,
.cs-card figcaption {
  font-size: 13px;
  font-family: var(--sans);
  color: var(--dark);
  opacity: 0.45;
  text-align: center;
  padding: 14px 16px 18px;
}

/* Swap-able placeholder (until a Figma / Storybook export is dropped in) */
.cs-slot {
  border: 2px dashed rgba(33, 112, 237, 0.32);
  border-radius: 28px;
  background:
    repeating-linear-gradient(45deg,
      rgba(33, 112, 237, 0.03) 0, rgba(33, 112, 237, 0.03) 12px,
      transparent 12px, transparent 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 48px 32px;
  min-height: 280px;
  box-sizing: border-box;
}
.cs-slot-tag {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #14478f;
}
.cs-slot-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.3px;
}
.cs-slot-note {
  font-size: 13px;
  color: var(--body);
  opacity: 0.7;
  max-width: 380px;
  line-height: 1.5;
}

/* ============================================================
   COMPONENT GALLERY  (count strip + chips)
============================================================ */
.cs-count-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.cs-count {
  background: var(--cream);
  border-radius: 20px;
  outline: 1px solid rgba(38, 20, 7, 0.1);
  padding: 26px 24px;
}
.cs-count-num {
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1.6px;
  color: var(--dark);
  display: block;
}
.cs-count-num em { font-style: normal; color: var(--green-dark); }
.cs-count-label {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body);
  margin-top: 10px;
  display: block;
}
.cs-comp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.cs-comp-chips span {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dark);
  background: var(--cream);
  border: 1px solid rgba(38, 20, 7, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
}

/* ============================================================
   AGENT CONVERSATION CARD
============================================================ */
.cs-agent {
  background: #0f1733;
  border-radius: 24px;
  outline: 1px solid rgba(115, 171, 255, 0.18);
  overflow: hidden;
  margin-top: 8px;
  box-shadow: 0 1px 2px rgba(8,12,32,.2), 0 22px 50px -28px rgba(8,12,32,.7);
}
.cs-agent-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
}
.cs-agent-bar .cs-dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #28c93f; flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(40,201,63,0.18);
}
.cs-agent-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cs-msg { display: flex; flex-direction: column; gap: 6px; }
.cs-msg-who {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.cs-msg--user .cs-msg-who { color: #9dc1ff; }
.cs-msg--agent .cs-msg-who { color: #8fe0a4; }
.cs-msg p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
}
.cs-msg code,
.cs-msg .cs-cmd {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
  background: rgba(115,171,255,0.12);
  color: #cfe0ff;
  border-radius: 6px;
  padding: 2px 7px;
}
.cs-msg .cs-cmd {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(115,171,255,0.22);
}

/* ============================================================
   TILES  (key decisions, principles)
============================================================ */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.cs-tile {
  background: var(--cream);
  border-radius: 24px;
  padding: clamp(28px, 3vw, 40px);
  outline: 1px solid rgba(38, 20, 7, 0.1);
}
.cs-tile-num {
  font-family: var(--script);
  font-size: 80px;
  line-height: 1;
  color: var(--green);
  display: block;
  margin-bottom: 12px;
}
.cs-tile h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--dark);
  margin: 0 0 10px;
  line-height: 1.25;
}
.cs-tile p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
}

/* ============================================================
   OUTCOME (checks)
============================================================ */
.cs-checks {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-checks li {
  position: relative;
  padding-left: 38px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--dark);
  font-weight: 500;
}
.cs-checks li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: -1px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   REFLECTION (dark close)
============================================================ */
.cs-reflection {
  background: var(--dark);
  border-radius: 36px;
  padding: clamp(48px, 8vw, 110px) clamp(28px, 6vw, 96px);
  margin-bottom: clamp(40px, 6vw, 80px);
}
.cs-reflection .cs-eyebrow { color: var(--green); }
.cs-reflection .cs-eyebrow::before { background: var(--green); }
.cs-reflection-text {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0;
}
.cs-reflection-text em { font-style: normal; color: rgba(255, 255, 255, 0.55); }

/* ============================================================
   RESPONSIVE
============================================================ */

/* Ultra-wide (4K / 5K) — widen the column so the hero doesn't
   strand as a narrow strip in a vast dark field. */
@media (min-width: 1600px) {
  .cs-page .container { max-width: 1520px; }
  .cs-hero-inner { width: 82%; max-width: 1320px; }
  .cs-hero-title { font-size: clamp(60px, 3vw, 78px); }
  .cs-hero-body { max-width: 70ch; }
  .cs-statement-lead { font-size: clamp(40px, 2.7vw, 58px); }
}

@media (max-width: 1024px) {
  .cs-hero-inner { width: 86%; max-width: none; }
}
@media (max-width: 900px) {
  .cs-cols, .cs-cols--narrow-left { grid-template-columns: 1fr; }
  .cs-count-row { grid-template-columns: repeat(2, 1fr); }
  .cs-pipe-arrow { transform: rotate(90deg); }
  .cs-pipe-node { flex-basis: 100%; }
}
@media (max-width: 768px) {
  .cs-hero-content { padding-top: calc(100svh - 230px); min-height: auto; padding-bottom: 8vh; }
  .cs-hero-inner { width: 100%; }
  .cs-hero-title { font-size: clamp(30px, 8vw, 44px); }
  .cs-meta { grid-template-columns: repeat(2, 1fr); gap: 22px 28px; }
  .cs-grid { grid-template-columns: 1fr; }
  .cs-count-row { grid-template-columns: 1fr; gap: 14px; }
  .cs-card { border-radius: 22px; outline-offset: 6px; }
}
@media (max-width: 480px) {
  .cs-context-inner p { font-size: 15.5px; }
  .cs-swatches { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
