/* ============================================================
   Case study page styles
   ============================================================ */

.cs-hero {
  padding: 140px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.cs-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 56px;
  transition: color .25s;
}
.cs-back:hover { color: var(--mark); }
.cs-back::before {
  content: "←";
  display: inline-block;
  transition: transform .25s;
}
.cs-back:hover::before { transform: translateX(-4px); }

.cs-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mark);
  margin-bottom: 24px;
}
.cs-eyebrow .sep { color: var(--ink-3); margin: 0 8px; }

.cs-title {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  margin-bottom: 56px;
}
.cs-title em { font-style: normal; font-weight: 500; color: var(--mark); }

.cs-lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  max-width: 42ch;
  margin-bottom: 60px;
}
.cs-lede em { font-style: normal; font-weight: 500; color: var(--ink); }

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cs-meta .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.cs-meta .value {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ============ Hero schematic frame ============ */
.cs-hero-frame {
  margin: 60px auto 0;
  position: relative;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  aspect-ratio: 16 / 9;
  max-height: 500px;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cs-hero-frame--photo {
  background: var(--ink);
  padding: 0;
}
.cs-hero-frame .cs-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.cs-hero-frame::before {
  content: "Schematic · representative · NDA";
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper);
  padding: 4px 8px;
  border: 1px solid var(--rule);
}
.cs-hero-frame--photo::before { content: none; }
.cs-hero-frame--contain {
  background: transparent;
  border: none;
  max-height: 560px;
}
.cs-hero-frame--contain .corner { display: none; }
.cs-hero-frame--borderless {
  border: none;
  max-height: 680px;
  max-width: 1100px;
}
.cs-hero-frame--borderless .corner { display: none; }
.cs-hero-frame .corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--ink);
}
.cs-hero-frame .corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.cs-hero-frame .corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.cs-hero-frame .corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.cs-hero-frame .corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.cs-hero-frame .schema { max-width: 70%; max-height: 75%; }

/* ============ Section ============ */
.cs-section { padding: 80px 0; border-top: 4px solid var(--mark); }
.cs-section:nth-of-type(even) { background: var(--paper-2); }
.cs-section h2 {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(28px, 3.2vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-bottom: 40px;
  max-width: 75%;
}
.cs-section h2 em { font-style: normal; font-weight: 500; color: var(--mark); }

.cs-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
}
.cs-body .lhs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 6px;
}
.cs-body .rhs p {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 60ch;
  margin-bottom: 22px;
}
.cs-body .rhs p:last-child { margin-bottom: 0; }
.cs-body .rhs p em { font-style: normal; font-weight: 500; color: var(--mark); }
.cs-body .rhs p strong { font-weight: 400; color: var(--ink); background: var(--mark-soft); padding: 0 2px; }

/* Results section — inverted */
.cs-section--results {
  background: var(--ink) !important;
  color: var(--paper);
  border-top: 4px solid var(--mark) !important;
}
.cs-section--results .lhs { color: color-mix(in srgb, var(--paper) 45%, transparent); }
.cs-section--results .rhs p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.cs-section--results .cs-results { border-top-color: color-mix(in srgb, var(--paper) 15%, transparent); border-bottom-color: color-mix(in srgb, var(--paper) 15%, transparent); }
.cs-section--results .cs-results .cell { border-left-color: color-mix(in srgb, var(--paper) 15%, transparent); }
.cs-section--results .cs-results .cell .top { color: color-mix(in srgb, var(--paper) 45%, transparent); }
.cs-section--results .cs-results .cell .top::before { content: "◆"; color: var(--mark); font-size: 16px; margin-right: 8px; display: inline-block; vertical-align: -1px; line-height: 1; }
.cs-section--results .cs-results .cell .desc { color: color-mix(in srgb, var(--paper) 60%, transparent); }

/* Results strip */
.cs-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cs-results .cell {
  padding: 36px 28px;
  border-left: 1px solid var(--rule);
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 16px;
}
.cs-results .cell:first-child { border-left: 0; }
.cs-results .cell .top {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.cs-results .cell .stat {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(56px, 6.5vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}
.cs-results .cell .stat .unit { font-size: 0.5em; color: var(--mark); font-weight: 500; letter-spacing: -0.02em; margin-left: 4px; }
.cs-results .cell .desc { font-size: 13px; color: var(--ink-2); line-height: 1.4; max-width: 28ch; }

/* Process numbered list */
.cs-process {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.cs-process .item {
  display: grid;
  grid-template-columns: 80px 220px 1fr;
  gap: 32px;
  padding: 32px 8px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.cs-process .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mark);
  letter-spacing: 0.1em;
  padding-top: 6px;
}
.cs-process .heading {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.cs-process .heading em { font-style: normal; font-weight: 500; color: var(--mark); }
.cs-process .body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  max-width: 60ch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-process .body em { font-style: normal; font-weight: 500; color: var(--ink); }

/* Inline process step image */
.cs-process-img {
  grid-column: 3 / -1;
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  object-position: left center;
  display: block;
  border-radius: 6px;
  margin-top: 4px;
}

.cs-process-imgs {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.cs-process-imgs img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  object-position: top center;
  display: block;
  border-radius: 6px;
}

.cs-process-video {
  grid-column: 3 / -1;
  width: 100%;
  max-height: 600px;
  display: block;
  border-radius: 6px;
  margin-top: 4px;
  background: #000;
}

@media (max-width: 900px) {
  .cs-process-img { grid-column: 1 / -1; }
  .cs-process-imgs { grid-column: 1 / -1; }
  .cs-process-video { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .cs-process-imgs { grid-template-columns: 1fr; }
}

/* Testimonial quotes — "What users said" section */
.cs-testimonial {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.cs-testimonial:last-child { padding-bottom: 0; }
.cs-testimonial p {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 60ch;
  margin-bottom: 10px;
}
.cs-testimonial cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Pull quote */
.cs-quote {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 60px 0;
}
.cs-quote blockquote {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 32ch;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.cs-quote blockquote::before, .cs-quote blockquote::after {
  position: absolute;
  font-family: var(--serif);
  font-size: 2em;
  color: var(--mark);
  font-style: normal;
}
.cs-quote blockquote::before { content: "\201C"; top: -0.2em; left: -0.5em; }
.cs-quote blockquote::after  { content: "\201D"; bottom: -0.6em; right: -0.3em; }
.cs-quote cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 32px;
  text-align: center;
}

/* Key screens — schematic gallery */
.cs-screens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.cs-screens .screen {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-screens .screen .body {
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cs-screens .screen .body svg { max-width: 100%; max-height: 100%; }

.cs-screens .screen--photo .body {
  padding: 0;
  background: var(--paper-2);
}
.cs-screens .screen--photo .body img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}
.cs-screens .screen .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0 2px;
}

/* Clickable screen */
.screen--clickable { cursor: zoom-in; }
.screen--clickable:hover .label { color: var(--mark); }

/* Lightbox */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: oklch(0.08 0.01 60 / 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  animation: lb-in .2s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cs-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
  box-shadow: 0 40px 100px -20px oklch(0 0 0 / 0.6);
}
.cs-lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  font-family: var(--mono);
  font-size: 14px;
  color: oklch(0.70 0.01 60);
  background: none;
  border: 1px solid oklch(0.30 0.01 60);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.cs-lightbox-close:hover { color: var(--paper); border-color: oklch(0.60 0.01 60); }

.cs-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  line-height: 1;
  color: oklch(0.70 0.01 60);
  background: oklch(0.14 0.01 60 / 0.7);
  border: 1px solid oklch(0.30 0.01 60);
  border-radius: 999px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
  z-index: 2;
}
.cs-lightbox-nav:hover { color: var(--paper); background: oklch(0.22 0.01 60 / 0.9); border-color: oklch(0.50 0.01 60); }
.cs-lightbox-prev { left: 20px; }
.cs-lightbox-next { right: 20px; }

.cs-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: oklch(0.55 0.01 60);
  pointer-events: none;
}
.cs-lightbox-counter span { margin: 0 4px; }

/* Next project card */
.cs-next {
  padding: 100px 0;
  border-top: 1px solid var(--ink);
}
.cs-next .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.cs-next a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background .3s, padding .3s;
}
.cs-next a:hover { background: var(--paper-2); padding-left: 16px; }
.cs-next a:hover .title { color: var(--mark); }
.cs-next .title {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(40px, 5.5vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  transition: color .25s;
}
.cs-next .arrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Process step callout */
.cs-process-callout {
  grid-column: 3 / -1;
  max-width: 60ch;
  padding: 12px 16px;
  background: var(--mark-soft);
  border-left: 3px solid var(--mark);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  color: var(--mark);
  line-height: 1.55;
}

/* Confidential banner */
.cs-confidential {
  margin: 32px 0 0;
  padding: 12px 16px;
  background: var(--mark-soft);
  border-left: 3px solid var(--mark);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-results { grid-template-columns: 1fr; }
  .cs-results .cell { border-left: 0; border-top: 1px solid var(--rule); }
  .cs-body { grid-template-columns: 1fr; gap: 24px; }
  .cs-process .item { grid-template-columns: 60px 1fr; }
  .cs-process .item .heading { grid-column: 1 / -1; }
  .cs-process-callout { grid-column: 1 / -1; }
  .cs-screens { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .cs-hero { padding: 100px 0 32px; }
  .cs-back { margin-bottom: 36px; }
  .cs-meta { grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; }
  .cs-meta .value { font-size: 14px; }
  .cs-lede { font-size: clamp(18px, 4.5vw, 24px); margin-bottom: 40px; }
  .cs-section { padding: 48px 0; }
  .cs-section h2 { margin-bottom: 28px; }
  .cs-process .item { gap: 20px; padding: 24px 0; }
  .cs-process .heading { font-size: 20px; }
  .cs-process .body { font-size: 15px; }
  .cs-process-callout { font-size: 15px; }
  .cs-results .cell { padding: 24px 16px; min-height: 160px; }
  .cs-quote { padding: 48px 0; margin: 40px 0; }
  .cs-next { padding: 60px 0; }
  .cs-next .title { font-size: clamp(28px, 7vw, 52px); }
}
