/* ============================================================
   Case Study - Project detail page layout
   Inspired by Pentagram case-study template
   ============================================================ */

.cs-main { padding-top: clamp(48px, 6vw, 96px); }

/* ---------- Title block ---------- */
.cs-head {
  max-width: var(--page-max);
  margin: 0 auto clamp(40px, 5vw, 64px);
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  column-gap: clamp(40px, 6vw, 96px);
  row-gap: 32px;
  align-items: end;
}

.cs-title {
  font-family: var(--font-display, "Instrument Serif"), serif;
  font-weight: 400;
  font-size: clamp(52px, 7.2vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--klime-ink);
}
.cs-title em { font-style: italic; color: var(--klime-blue-500); }

.cs-head-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 8px;
}

.cs-lede {
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.55;
  color: var(--klime-grey-700);
  max-width: 46ch;
  margin: 0;
  font-weight: 400;
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.cs-tags li {
  font-size: 12.5px;
  letter-spacing: -0.005em;
  color: var(--klime-grey-700);
  background: rgba(6, 6, 6, 0.06);
  padding: 6px 12px;
  border-radius: 999px;
}

.cs-about-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--klime-ink);
  background: rgba(6, 6, 6, 0.06);
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background .2s var(--ease);
}
.cs-about-btn:hover { background: rgba(6, 6, 6, 0.1); }
.cs-about-btn .plus { font-weight: 400; font-size: 16px; line-height: 1; }

/* Collapsible "About the project" panel */
.cs-about-panel {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease), margin-top .3s var(--ease);
}
.cs-about-panel[data-open="true"] { max-height: 900px; margin-top: 8px; }
.cs-about-panel-inner {
  padding: 28px 0 8px;
  border-top: var(--hair);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(40px, 6vw, 96px);
  row-gap: 20px;
}
.cs-about-panel h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--klime-grey-500);
  margin: 0 0 10px;
}
.cs-about-panel p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--klime-grey-800);
}

/* ---------- Gallery ---------- */
/* Fixed 12-col grid inside the page-max container.
   Outer left/right rails are identical on every row - so every figure,
   whether full-width or in a 2/3-column row, lines up to the same width. */
.cs-gallery {
  max-width: var(--page-max);
  margin: 0 auto clamp(80px, 10vw, 140px);
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}

.cs-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--klime-bone);
}

.cs-figure {
  margin: 0;
  overflow: hidden;
  position: relative;
  background: var(--klime-bone);
  aspect-ratio: 3 / 2;
}
.cs-figure--tall   { aspect-ratio: 4 / 5; }
.cs-figure--square { aspect-ratio: 1 / 1; }
.cs-figure--wide   { aspect-ratio: 21 / 9; }

/* Column spans - add up to 12 per row so outer rails always match */
.cs-span-12 { grid-column: span 12; }
.cs-span-8  { grid-column: span 8; }
.cs-span-6  { grid-column: span 6; }
.cs-span-4  { grid-column: span 4; }

/* Hero - full 12-col width, flush to the same rails as every other row */
.cs-hero {
  grid-column: span 12;
  aspect-ratio: 21 / 10;
  position: relative;
  overflow: hidden;
  margin: 0;
  background: var(--klime-bone);
}
.cs-hero .cs-img { transition: transform 1.2s var(--ease); }
.cs-hero:hover .cs-img { transform: scale(1.02); }

/* Optional caption */
.cs-cap {
  font-size: 13px;
  color: var(--klime-grey-500);
  margin: -4px 0 8px;
  letter-spacing: -0.005em;
}

/* ---------- Project footer / Next project ---------- */
.cs-next {
  border-top: var(--hair);
  padding: clamp(48px, 6vw, 80px) 24px;
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 32px;
  flex-wrap: wrap;
}
.cs-next-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--klime-grey-500);
  margin: 0 0 12px;
}
.cs-next-link {
  font-family: var(--font-display, "Instrument Serif"), serif;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--klime-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  transition: color .2s var(--ease);
}
.cs-next-link:hover { color: var(--klime-blue-500); }
.cs-next-link em { font-style: italic; }
.cs-next-link .arrow {
  display: inline-block;
  transition: transform .3s var(--ease);
  font-family: var(--font-sans);
  font-size: 0.55em;
}
.cs-next-link:hover .arrow { transform: translateX(6px); }

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--klime-grey-700);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color .2s var(--ease);
}
.cs-back:hover { color: var(--klime-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cs-head {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }
  .cs-about-panel-inner { grid-template-columns: 1fr; }
  .cs-hero { aspect-ratio: 4 / 3; }
  .cs-span-8, .cs-span-6, .cs-span-4 { grid-column: span 12; }
}

/* ============================================================
   Case Study v2 - Paper-matched layout
   Matches the Axion Exchange / Hitonem Paper designs
   ============================================================ */

:root {
  --page-max: 1200px;
  --hair: 1px solid rgba(132, 133, 140, 0.2);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cs2-outer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px 120px;
}

/* ---------- Header ---------- */
.cs2-head {
  display: flex;
  flex-flow: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0px;
  padding: 0 0 72px;
}

.cs2-title {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 50px;
  font-weight: 500;
  letter-spacing: -1.5px;
  line-height: 60px;
  color: #121212;
  margin: 0;
  width: 386px;
}

.cs2-lede {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.16px;
  color: #505358;
  margin: 0 0 0 auto;
  width: 488px;
}

/* ---------- Hero ---------- */
.cs2-hero {
  margin: 0 0 48px;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #e8e8e8;
}

.cs2-hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Stats ---------- */
.cs2-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  border-top: 1px solid rgba(18, 18, 18, 0.1);
  margin-bottom: 72px;
}

.cs2-stat-label {
  display: block;
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.16px;
  color: rgba(18, 18, 18, 0.5);
  padding-top: 16px;
  margin-bottom: 16px;
}

.cs2-stat-value {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.16px;
  line-height: 1.2;
  color: #121212;
}

/* ---------- Work Snippets ---------- */
.cs2-snippets-label {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.16px;
  color: #121212;
  margin: 0 0 16px;
}

.cs2-snippet {
  display: block;
  margin: 0 0 16px;
  width: 100%;
  background: #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #EDEDED;
}

.cs2-snippet img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Quote ---------- */
.cs2-quote-section {
  margin-top: 60px;
  padding-bottom: 60px;
}

.cs2-rule {
  border: none;
  border-top: 1px solid rgba(18, 18, 18, 0.1);
  margin: 0;
}

.cs2-quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 48px 0;
  margin: 0;
}

.cs2-quote-logo {
  height: 28px;
  width: auto;
  display: block;
}

.cs2-quote-text {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.26px;
  line-height: 1.12;
  color: #888888;
  text-align: center;
  max-width: 760px;
  margin: 0;
}

.cs2-quote-cite {
  font-family: 'Inter Display', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #212121;
  text-align: center;
  font-style: normal;
  display: block;
}

/* Disable grain overlay on case study pages */
body::before { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .cs2-title { font-size: 44px; }
  .cs2-head { gap: 0px; }
}

@media (max-width: 900px) {
  .cs2-outer { padding: 0 20px; }
  .cs2-head { flex-flow: column; gap: 20px; padding: 0 0 48px; }
  .cs2-title { font-size: 36px; line-height: 44px; letter-spacing: -1px; width: 100%; }
  .cs2-lede { width: 100%; margin: 0; }
  .cs2-stats { grid-template-columns: 1fr; }
  .cs2-quote-text { font-size: 20px; }
}
