/* KSTUDIO — case pages (cases/index.html and cases/*.html).
   Loaded after styles.css; reuses its tokens, header, CTA and footer. */

/* ---------- Hero band ---------- */

.cs-hero {
  padding: clamp(150px, 15vw, 230px) var(--gutter) clamp(56px, 6vw, 96px);
  background: var(--ink);
  color: var(--ivory);
}
.cs-hero--index { padding-bottom: clamp(72px, 8vw, 128px); }

.cs-crumbs { display: flex; gap: 12px; font-size: 14px; color: var(--muted-ivory); }
.cs-crumbs a { color: var(--ivory); border-bottom: 1px solid var(--hair-ivory); }

.cs-cat { margin-top: clamp(28px, 3vw, 44px); color: var(--muted-ivory); }
.cs-hero--index .cs-cat { margin-top: 0; }
.cs-name { margin-top: 14px; font-size: clamp(48px, 8vw, 140px); }
.cs-title {
  margin-top: clamp(20px, 2.4vw, 34px); max-width: 34ch;
  font-size: clamp(20px, 2vw, 30px); line-height: 1.3;
  font-stretch: 108%; font-variation-settings: "wdth" 108;
  text-wrap: balance;
}

.cs-facts {
  display: grid; grid-template-columns: 1fr 1fr 1.2fr 2fr; gap: 0 clamp(20px, 2.4vw, 40px);
  margin-top: clamp(48px, 5vw, 80px);
}
.cs-facts div { padding-top: 16px; border-top: 1px solid var(--hair-ivory); }
.cs-facts dt { font-size: 13px; color: var(--muted-ivory); }
.cs-facts dd { margin-top: 6px; font-size: 17px; font-weight: 500; }
.cs-facts .case-tags { margin-top: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .cs-hero > * { animation: rise .9s var(--ease) both; }
  .cs-hero > :nth-child(2) { animation-delay: .05s; }
  .cs-hero > :nth-child(3) { animation-delay: .1s; }
  .cs-hero > :nth-child(n+4) { animation-delay: .15s; }
}

/* ---------- Screenshot in a browser frame ---------- */

.cs-shot {
  padding: 0 var(--gutter) clamp(64px, 7vw, 112px);
  background: linear-gradient(var(--ink) 0 clamp(120px, 14vw, 240px), var(--ivory) 0);
}
.cs-browser { margin: 0 auto; max-width: 1240px; }
.cs-bar {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  background: var(--ink-2); color: var(--muted-ivory);
  border-radius: 10px 10px 0 0;
  font-size: 13px;
}
.cs-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(242, 238, 230, .2); }
.cs-bar span { margin-left: 12px; }
.cs-viewport {
  height: min(78vh, 860px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: 0 30px 80px -40px rgba(17, 17, 17, .45), inset 0 0 0 1px var(--hair-ink);
  scrollbar-width: thin;
}
.cs-viewport img { width: 100%; height: auto; }
.cs-viewport:focus-visible { outline-offset: 2px; }
.cs-browser figcaption { margin-top: 14px; font-size: 14px; color: var(--muted-ink); }

/* ---------- Brief + what we did ---------- */

.cs-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(40px, 6vw, 112px);
  max-width: var(--max); margin: 0 auto;
  padding: var(--section-y) var(--gutter);
  background: var(--ivory);
}
.cs-intro { align-self: start; position: sticky; top: 40px; }
.cs-lede {
  margin-top: 18px;
  font-size: clamp(24px, 2.4vw, 38px); font-weight: 600; line-height: 1.15;
  font-stretch: 108%; font-variation-settings: "wdth" 108;
  letter-spacing: -.025em; text-wrap: pretty;
}

.cs-blocks { margin-top: 18px; }
.cs-block {
  display: grid; grid-template-columns: 64px 1fr; align-items: baseline;
  padding-block: 26px; border-top: 1px solid var(--hair-ink);
}
.cs-block .step-n { color: var(--vermilion); }
.cs-block h3 { font-size: 21px; font-weight: 600; }
.cs-block ul { margin-top: 12px; display: grid; gap: 8px; }
.cs-block ul li { display: flex; gap: 12px; font-size: 16px; color: var(--muted-ink); }
.cs-block ul li::before { content: "→"; color: var(--vermilion); flex: none; }

/* ---------- Result ---------- */

.cs-result {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(40px, 6vw, 112px);
  padding: var(--section-y) var(--gutter);
  background: var(--ink); color: var(--ivory);
}
.cs-result::after {
  content: ""; position: absolute; right: 0; bottom: 0; z-index: -1;
  width: clamp(100px, 14vw, 240px); aspect-ratio: 1;
  background: var(--vermilion);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.cs-result-title { font-size: clamp(44px, 6vw, 104px); }
.cs-result-list li {
  padding-block: 20px; border-top: 1px solid var(--hair-ivory);
  font-size: clamp(19px, 1.7vw, 26px); line-height: 1.3;
}

/* ---------- Prev / next ---------- */

.cs-pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: clamp(40px, 4vw, 64px) var(--gutter);
  background: var(--paper);
}
.cs-pager-link { display: grid; gap: 6px; }
.cs-pager-link span { font-size: 14px; color: var(--muted-ink); }
.cs-pager-link strong {
  font-weight: 700; font-stretch: 125%; font-variation-settings: "wdth" 125;
  font-size: clamp(22px, 2.4vw, 40px); letter-spacing: -.035em; line-height: 1;
}
.cs-pager-next { text-align: right; }
.cs-pager-all { padding: 14px 24px; border: 1px solid var(--ink); border-radius: 999px; font-size: 15px; }

/* ---------- Cases index ---------- */

.cs-index {
  max-width: var(--max); margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}
.cs-index-title {
  margin-top: 14px; max-width: 20ch;
  font-size: clamp(32px, 3.6vw, 60px); font-weight: 700;
  font-stretch: 125%; font-variation-settings: "wdth" 125;
  letter-spacing: -.035em; line-height: .98;
}

.cs-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(40px, 4vw, 64px) clamp(20px, 2.6vw, 42px);
  margin-top: clamp(44px, 5vw, 76px);
}
.cs-card a { display: block; }
.cs-thumb { overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hair-ink); }
.cs-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
.cs-card .case-cat { margin-top: 18px; color: var(--muted-ink); opacity: 1; }
.cs-card-name {
  margin-top: 6px;
  font-weight: 700; font-stretch: 125%; font-variation-settings: "wdth" 125;
  font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -.035em; line-height: 1;
}
.cs-card-title { margin-top: 10px; font-size: 16px; line-height: 1.4; text-wrap: pretty; }
.cs-card-stack { margin-top: 10px; font-size: 13px; color: var(--muted-ink); }

.cs-platforms { padding-top: 0; }

@media (hover: hover) and (pointer: fine) {
  .cs-card a:hover .cs-thumb img { transform: scale(1.03); }
  .cs-card a:hover .cs-card-name { color: var(--vermilion); }
  .cs-crumbs a:hover { border-color: currentColor; }
  .cs-pager-link:hover strong { color: var(--vermilion); }
  .cs-pager-all:hover { background: var(--ink); color: var(--ivory); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .cs-facts { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cs-body, .cs-result { grid-template-columns: minmax(0, 1fr); }
  .cs-intro { position: static; }
}

@media (max-width: 640px) {
  .cs-hero { padding-top: 120px; }
  .cs-facts { grid-template-columns: minmax(0, 1fr); }
  .cs-viewport { height: 70vh; }
  .cs-block { grid-template-columns: 44px 1fr; }
  .cs-grid { grid-template-columns: minmax(0, 1fr); }
  .cs-pager { grid-template-columns: 1fr 1fr; }
  .cs-pager-all { display: none; }
  .site-nav a[href$="#studio"] { display: none; }
}
