/* Shared styles for case study inner pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --cream: #f4eee2;
  --cream-2: #ece4d2;
  --paper: #faf6ed;
  --maroon: #6b1818;
  --maroon-deep: #4a0d10;
  --maroon-dark: #2c0608;
  --ink: #15110e;
  --ink-soft: #2c2620;
  --grey: #6b6358;
  --grey-line: #d8cfbd;

  --serif: 'Instrument Serif', Georgia, serif;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }

/* TOP NAV */
.cs-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: linear-gradient(to bottom, rgba(244,238,226,0.92), rgba(244,238,226,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.cs-back:hover {
  background: var(--maroon);
  color: var(--cream);
  border-color: var(--maroon);
  transform: translateX(-3px);
}
.cs-back svg { width: 14px; height: 14px; }
.cs-topnav-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
}

/* HERO */
.cs-hero {
  position: relative;
  z-index: 2;
  padding: 140px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.cs-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 28px;
}
.cs-hero-meta span + span::before {
  content: '·';
  margin-right: 24px;
  color: var(--grey);
}

.cs-hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 130px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 1100px;
}
.cs-hero-title .ital {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--maroon);
}

.cs-hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 820px;
  margin-bottom: 60px;
}

/* INFO STRIP */
.cs-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 32px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cs-info-item {
  padding: 0 24px;
  border-right: 1px solid var(--grey-line);
}
.cs-info-item:first-child { padding-left: 0; }
.cs-info-item:last-child { border-right: none; padding-right: 0; }
.cs-info-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}
.cs-info-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.3;
}

/* HERO IMAGE */
.cs-hero-image {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto 80px;
  padding: 0 40px;
}
.cs-hero-image-frame {
  aspect-ratio: 16 / 9;
  background: var(--cream-2);
  border-radius: 12px;
  border: 1px solid var(--ink);
  overflow: hidden;
  position: relative;
  box-shadow: 8px 8px 0 var(--ink);
}
.cs-hero-image-frame::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px;
  text-transform: uppercase;
}

/* HERO IMAGE DUO — side-by-side layout */
.cs-hero-image-duo {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.cs-hero-image-duo .cs-hero-image-frame {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--ink);
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: 8px 8px 0 var(--ink);
  height: fit-content;
}
.cs-hero-image-duo .cs-hero-image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* HERO IMAGE SINGLE — keep the full source image visible */
.cs-hero-image-single .cs-hero-image-frame {
  aspect-ratio: auto;
  height: auto;
}
.cs-hero-image-single .cs-hero-image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* IMAGE GALLERY — natural-height process grid */
.cs-gallery {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto 8px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}
.cs-gallery > figure {
  margin: 0;
  background: var(--cream-2);
  border: 1px solid var(--ink);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}
.cs-gallery img {
  width: 100%;
  height: auto;
  display: block;
}

/* FEATURE IMAGE — single full-width process image */
.cs-feature {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto 8px;
  padding: 0 40px;
}
.cs-feature img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--cream-2);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

/* INTRO BLOCK */
.cs-intro {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto 100px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
}
.cs-intro-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--maroon);
  display: flex;
  align-items: baseline;
  gap: 12px;
  position: sticky;
  top: 100px;
  align-self: start;
}
.cs-intro-label::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--maroon);
  border-radius: 50%;
}
.cs-intro-text {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.45;
  color: var(--ink);
}
.cs-intro-text p {
  margin-bottom: 24px;
}
.cs-intro-text p:last-child { margin-bottom: 0; }
.cs-intro-text em {
  color: var(--maroon);
  font-style: italic;
}

/* FULL-BLEED IMAGES */
.cs-fullbleed {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  width: 100%;
  aspect-ratio: 21 / 9;
  background: var(--cream-2);
  overflow: hidden;
}
.cs-fullbleed.tall { aspect-ratio: 4 / 5; }
.cs-fullbleed.square { aspect-ratio: 1 / 1; }
.cs-fullbleed.wide { aspect-ratio: 21 / 9; }
.cs-fullbleed.med { aspect-ratio: 16 / 10; }

.cs-fullbleed::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px;
  text-transform: uppercase;
}

/* IMAGE PAIR ROW */
.cs-pair {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 8px;
}
.cs-pair > div {
  aspect-ratio: 4 / 5;
  background: var(--cream-2);
  position: relative;
  overflow: hidden;
}
.cs-pair > div::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px;
  text-transform: uppercase;
}

/* CAPTION ROW */
.cs-caption {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 40px auto 80px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cs-caption-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--maroon);
}
.cs-caption-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--grey);
  max-width: 560px;
  line-height: 1.5;
}

/* SECTION HEADER mid-page */
.cs-mid-head {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 100px auto 60px;
  padding: 0 40px;
}
.cs-mid-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--maroon);
  margin-bottom: 12px;
  display: block;
}
.cs-mid-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 900px;
}
.cs-mid-title .ital {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--maroon);
}
.cs-mid-body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 720px;
  margin-top: 24px;
}

/* COLOR PALETTE */
.cs-palette {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 60px auto 80px;
  padding: 0 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.cs-palette-item {
  flex: 1;
  min-width: 140px;
}
.cs-palette-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  border: 1px solid var(--ink);
}
.cs-palette-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: block;
}
.cs-palette-hex {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
}

/* NEXT PROJECT */
.cs-next {
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: var(--cream);
  padding: 100px 40px;
  margin-top: 80px;
}
.cs-next-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cs-next-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244,238,226,0.6);
  margin-bottom: 12px;
}
.cs-next-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.cs-next-title .ital {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: #d4a574;
}
.cs-next-arrow {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), background 0.3s;
}
.cs-next:hover .cs-next-arrow {
  background: var(--cream);
  color: var(--ink);
  transform: rotate(-45deg) scale(1.05);
}
.cs-next-arrow svg { width: 28px; height: 28px; }

/* FOOTER */
.cs-footer {
  background: var(--maroon-dark);
  color: var(--cream);
  padding: 60px 40px 30px;
  position: relative;
  z-index: 2;
}
.cs-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.cs-footer-inner a { color: var(--cream); transition: color 0.2s; }
.cs-footer-inner a:hover { color: #d4a574; }
.cs-footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

/* IMAGE FILL — hide gradient + label when an img is present */
.cs-hero-image-frame:has(img),
.cs-fullbleed:has(img),
.cs-pair > div:has(img) {
  background: var(--ink);
}
.cs-hero-image-frame:has(img)::after,
.cs-fullbleed:has(img)::after,
.cs-pair > div:has(img)::after { content: none; }
.cs-hero-image-frame img,
.cs-fullbleed img,
.cs-pair > div img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  background: var(--cream-2);
}

/* SWATCH GRID — labelled woven swatches */
.cs-swatch-grid {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto 80px;
  padding: 0 40px;
}
.cs-swatch {
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  display: flex;
  flex-direction: column;
}
.cs-swatch-tag {
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.cs-swatch-tag .num { font-family: var(--mono); font-size: 11px; opacity: 0.85; }
.cs-swatch-img {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--ink);
}
.cs-swatch-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-swatch-meta {
  padding: 14px 18px 18px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-top: 1px dashed var(--grey-line);
}
.cs-swatch-meta b { color: var(--ink); font-weight: 600; }

/* PROCESS NOTEBOOK — horizontal scroll of pages */
.cs-notebook {
  position: relative; z-index: 2;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 0 40px 24px;
  margin: 0 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--maroon) var(--cream-2);
}
.cs-notebook::-webkit-scrollbar { height: 6px; }
.cs-notebook::-webkit-scrollbar-track { background: var(--cream-2); }
.cs-notebook::-webkit-scrollbar-thumb { background: var(--maroon); }
.cs-notebook-page {
  flex: 0 0 auto;
  width: 360px;
  aspect-ratio: 3/4;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  position: relative;
}
.cs-notebook-page img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-notebook-page::before {
  content: attr(data-page);
  position: absolute;
  top: 8px; right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--maroon);
  background: var(--paper);
  padding: 2px 6px;
  border: 1px solid var(--maroon);
  z-index: 2;
}

/* INSPIRATION DUO — orchid + sketch side by side */
.cs-inspiration {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1240px;
  margin: 0 auto 80px;
  padding: 0 40px;
  align-items: center;
}
.cs-inspiration > figure {
  margin: 0;
  background: var(--ink);
  aspect-ratio: 3/4;
  overflow: hidden;
  border: 1px solid var(--ink);
}
.cs-inspiration > figure:first-child { box-shadow: 8px 8px 0 var(--maroon); }
.cs-inspiration > figure:last-child { box-shadow: 8px 8px 0 var(--ink); margin-left: -2px; }
.cs-inspiration img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* PULLQUOTE — set in display serif */
.cs-pullquote {
  position: relative; z-index: 2;
  max-width: 1000px;
  margin: 60px auto 80px;
  padding: 0 40px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.25;
  color: var(--maroon-deep);
}
.cs-pullquote::before {
  content: '“';
  font-family: var(--serif);
  font-size: 1.6em;
  line-height: 0;
  color: var(--maroon);
  margin-right: 8px;
  vertical-align: -0.3em;
}
.cs-pullquote em { font-style: italic; color: var(--ink); }

/* SPEC SHEETS DUO */
.cs-specs {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto 80px;
  padding: 0 40px;
}
.cs-specs > figure {
  margin: 0;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.cs-specs img { width: 100%; height: auto; display: block; }

/* RESPONSIVE — case study additions */
@media (max-width: 720px) {
  .cs-swatch-grid { grid-template-columns: 1fr; padding: 0 20px; gap: 18px; }
  .cs-inspiration { grid-template-columns: 1fr; padding: 0 20px; gap: 18px; }
  .cs-inspiration > figure:last-child { margin-left: 0; }
  .cs-specs { grid-template-columns: 1fr; padding: 0 20px; }
  .cs-notebook { padding: 0 20px 24px; }
  .cs-notebook-page { width: 260px; }
  .cs-pullquote { padding: 0 20px; }
}

/* SAMPLE GRADIENTS for placeholders */
.bg-1 { background: linear-gradient(135deg, #c8543a 0%, #6b1818 100%); }
.bg-2 { background: linear-gradient(135deg, #d4b89a 0%, #8b7355 100%); }
.bg-3 { background: linear-gradient(135deg, #e8d8b8 0%, #b8956e 100%); }
.bg-4 { background: linear-gradient(135deg, #2c4a2e 0%, #1a2820 100%); }
.bg-5 { background: linear-gradient(135deg, #f0d8e0 0%, #c87a90 100%); }
.bg-6 { background: linear-gradient(135deg, #4a2c2a 0%, #2c1614 100%); }
.bg-7 { background: linear-gradient(135deg, #d4956a 0%, #7a3e2a 100%); }
.bg-8 { background: linear-gradient(135deg, #9a8a6a 0%, #5a4a3a 100%); }
.bg-9 { background: linear-gradient(135deg, #b85c38 0%, #6b1e1e 100%); }
.bg-10 { background: linear-gradient(135deg, #c2a878 0%, #8a6a40 100%); }
.bg-11 { background: linear-gradient(135deg, #5a4540 0%, #2a1e1c 100%); }
.bg-12 { background: linear-gradient(135deg, #d4d0c4 0%, #8a8478 100%); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .cs-topnav { padding: 16px 20px; }
  .cs-hero { padding: 110px 20px 50px; }
  .cs-hero-image { padding: 0 20px; margin-bottom: 50px; }
  .cs-hero-image-frame { box-shadow: 5px 5px 0 var(--ink); }
  .cs-info {
    grid-template-columns: 1fr 1fr;
    gap: 24px 0;
    row-gap: 28px;
  }
  .cs-info-item {
    padding: 0 16px;
    border-right: none;
  }
  .cs-info-item:nth-child(odd) { padding-left: 0; }
  .cs-info-item:nth-child(even) { padding-right: 0; }
  .cs-intro {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 60px;
    padding: 0 20px;
  }
  .cs-intro-label { position: static; }
  .cs-pair { grid-template-columns: 1fr; }
  .cs-caption { padding: 0 20px; margin-bottom: 50px; }
  .cs-mid-head { padding: 0 20px; margin: 60px auto 40px; }
  .cs-gallery { grid-template-columns: 1fr; padding: 0 20px; }
  .cs-feature { padding: 0 20px; }
  .cs-palette { padding: 0 20px; gap: 14px; }
  .cs-palette-item { min-width: 100px; }
  .cs-next { padding: 60px 20px; }
  .cs-next-arrow { width: 60px; height: 60px; }
  .cs-footer { padding: 40px 20px 24px; }
}
