/* ==========================================================================
   Case study pages — styling ported from Portfolio-27-1 (css/site.css),
   scoped to <main class="cs-page"> so the rest of the site is untouched.
   ========================================================================== */

.cs-page {
  --bg: #ffffff;
  --sand: #eee6dc;
  --line: #e2d7cc;
  --ink: #2b2420;
  --ink-2: #4d423d;
  --muted: #7d6c66;
  --accent: #2a72de;
  --accent-hover: #2056a6;
  --sage-soft: #e2edd5;
  --night: #151619;
  --night-ink: #f3ece2;
  --night-muted: #a8a5a0;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 24px;
  --radius-sm: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cs-page *, .cs-page *::before, .cs-page *::after { box-sizing: border-box; }
.cs-page img, .cs-page video { display: block; max-width: 100%; height: auto; }
.cs-page a { color: inherit; text-decoration: none; }
.cs-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.cs-page .wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
/* the original site's global h2/p rules zero margins and force left alignment */
.cs-page h1, .cs-page h2, .cs-page h3, .cs-page h4, .cs-page p { text-align: left; }

.cs-page .display {
  font-family: var(--font-serif); font-weight: 400;
  letter-spacing: -0.02em; line-height: 0.98;
}
.cs-page .eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.cs-page .dot { width: 7px; height: 7px; border-radius: 50%; background: #3f9b62; }
.cs-page .serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.cs-page .btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; line-height: 1;
  padding: 15px 24px; border-radius: 999px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.cs-page .btn:hover { background: var(--ink); color: var(--bg); }
.cs-page .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cs-page .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cs-page .btn .arrow, .cs-page .link .arrow { transition: transform .25s var(--ease); }
.cs-page .btn:hover .arrow { transform: translateX(3px); }
.cs-page .link {
  font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.cs-page .cs-head { padding-block: clamp(48px, 7vw, 96px) 48px; }
.cs-page .back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--muted); transition: color .2s var(--ease);
}
.cs-page .back:hover { color: var(--ink); }
.cs-page .cs-head .eyebrow { display: flex; margin-top: 44px; }
.cs-page .cs-head h1 { margin: 18px 0 0; font-size: clamp(48px, 7vw, 104px); max-width: 15ch; text-wrap: balance; }
.cs-page .cs-head .lede {
  margin: 28px 0 0; max-width: 44ch; color: var(--ink-2);
  font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5;
}
.cs-page .cs-meta {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.cs-page .cs-meta dt { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.cs-page .cs-meta dd { margin: 0; font-size: 15px; line-height: 1.5; }
@media (max-width: 760px) {
.cs-page .cs-meta { grid-template-columns: 1fr 1fr; }
}
.cs-page .cs-hero { border-radius: var(--radius); overflow: hidden; background: var(--tint, var(--sand)); padding: clamp(20px, 4vw, 56px); }
.cs-page .cs-hero img, .cs-page .cs-hero video { width: 100%; border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(43, 36, 32, .06), 0 16px 40px -16px rgba(43, 36, 32, .2); }
.cs-page .cs-body {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 72px;
  padding-block: clamp(72px, 9vw, 128px);
}
.cs-page .toc { position: sticky; top: 104px; align-self: start; }
.cs-page .toc p { margin: 0 0 14px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cs-page .toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.cs-page .toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px;
  font-size: 14px; color: var(--muted); border-left: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.cs-page .toc a:hover { color: var(--ink); }
.cs-page .toc a.is-active { color: var(--ink); border-left-color: var(--ink); }
@media (max-width: 960px) {
.cs-page .cs-body { grid-template-columns: 1fr; gap: 0; }
.cs-page .toc { display: none; }
}
.cs-page .prose > section > :not(.figure) { max-width: 700px; }
.cs-page .prose section + section { margin-top: clamp(72px, 9vw, 112px); }
.cs-page .prose h2 { margin: 0 0 22px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(38px, 4vw, 56px); line-height: 1.04; letter-spacing: -0.01em; }
.cs-page .prose h3 { margin: 40px 0 10px; font-size: 16px; font-weight: 600; }
.cs-page .prose p { margin: 0 0 18px; color: var(--ink-2); }
.cs-page .prose p:last-child { margin-bottom: 0; }
.cs-page .prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cs-page .callout {
  margin: 32px 0 0; padding: 32px 36px; border-radius: var(--radius);
  background: var(--sage-soft);
  font-family: var(--font-serif); font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; color: var(--ink);
}
.cs-page .callout .label {
  display: block; font-family: var(--font-sans); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 500; margin-bottom: 14px;
}
.cs-page .split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
.cs-page .split { grid-template-columns: 1fr; }
}
.cs-page .card { background: var(--sand); border-radius: var(--radius-sm); padding: 24px 26px; }
.cs-page .card h4 { margin: 0 0 14px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.cs-page .card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cs-page .card li { font-size: 15.5px; color: var(--ink); }
.cs-page .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.cs-page .stat { background: var(--sand); border-radius: var(--radius-sm); padding: 26px; display: grid; gap: 6px; }
.cs-page .stat b { font-family: var(--font-serif); font-weight: 400; font-size: clamp(48px, 5vw, 68px); line-height: 1; letter-spacing: -0.02em; }
.cs-page .stat span { font-size: 14px; color: var(--ink-2); }
@media (max-width: 560px) {
.cs-page .stats { grid-template-columns: 1fr; }
}
.cs-page .figure { margin: clamp(40px, 5vw, 64px) 0; }
.cs-page .figure .frame { display: block; border-radius: var(--radius); overflow: hidden; background: var(--sand); cursor: zoom-in; }
.cs-page .figure .frame img { width: 100%; transition: transform .8s var(--ease); }
.cs-page .figure .frame:hover img { transform: scale(1.01); }
.cs-page .figure figcaption { margin-top: 12px; font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; }
.cs-page .cta-card {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: clamp(32px, 4vw, 48px); border-radius: var(--radius);
  background: var(--night); color: var(--night-ink);
}
.cs-page .prose .cta-card h2 { margin-bottom: 10px; }
.cs-page .prose .cta-card p { color: var(--night-muted); margin: 0; max-width: 44ch; }
.cs-page .cta-card .btn { border-color: var(--night-ink); color: var(--night-ink); }
.cs-page .cta-card .btn:hover { background: var(--night-ink); color: var(--night); }
@media (max-width: 680px) {
.cs-page .cta-card { grid-template-columns: 1fr; }
}
.cs-page .next { display: block; padding-block: 64px 88px; border-top: 1px solid var(--line); }
.cs-page .next .eyebrow { margin-bottom: 16px; }
.cs-page .next h2 {
  margin: 0; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.015em; max-width: 20ch;
  transition: color .25s var(--ease);
}
.cs-page .next:hover h2 { color: var(--muted); }
.cs-page .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.cs-page .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
.cs-page *, .cs-page *::before, .cs-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.cs-page .reveal { opacity: 1; transform: none; }
.cs-page .hero h1 .struck::after { transform: scaleX(1); }
}

/* This site's header isn't sticky, so the table of contents can sit closer to the top */
.cs-page .toc { top: 32px; }
html { scroll-behavior: smooth; }


/* ---------- Adjustments for this site ---------- */

/* No "next case study" block on these pages, so drop its styles' spacing needs */

/* Figures: no tan backdrop behind photos and diagrams */
.cs-page .figure .frame { background: transparent; }

/* "Get the full story": plain text section instead of a dark card */
.cs-page .cta-card {
  display: block;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
}
.cs-page .prose .cta-card p { color: var(--ink-2); margin: 0 0 20px; max-width: 44ch; }
.cs-page .prose .cta-card .btn { background: #C5BDFF; border-color: #C5BDFF; color: var(--ink); text-decoration: none; }
.cs-page .prose .cta-card .btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Space before the footer now that the next-case-study block is gone */
.cs-page .cs-body { padding-bottom: clamp(96px, 12vw, 160px); }

/* Team & role: plain lists, no beige cards */
.cs-page .card { background: none; border-radius: 0; padding: 0; }
.cs-page .card[style] { margin-bottom: 32px !important; }
.cs-page .split { gap: 32px; }

/* Callouts ("The solution" etc.) use the beige instead of green */
.cs-page .callout { background: var(--sand); }

/* Hero image sits above the title block; title capped at 24ch */
.cs-page .cs-head h1 { max-width: 24ch; }
.cs-page .cs-head .lede { max-width: none; }

/* Hero: content-width image between the title block and "The problem", no tinted panel */
.cs-page .cs-hero-wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.cs-page .cs-hero { background: none; padding: 0; border-radius: 0; }
.cs-page .cs-hero img, .cs-page .cs-hero video { width: 100%; border-radius: 0; box-shadow: none; }

/* Paywall-style break before "Get the full story": fade the content above, then a rule */
.cs-page .prose section#full-story {
  position: relative;
  margin-top: 32px;
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.cs-page .prose section#full-story::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: calc(100% + 1px);
  height: clamp(200px, 26vw, 320px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .85) 60%, var(--bg) 100%);
  pointer-events: none;
}

/* Locked entries in the side nav: sections only in the full case study; they jump to "Get the full story" */
/* Clickable sections darker, locked ones lighter, for clearer contrast between the two */
.cs-page .toc a { color: var(--ink); }
.cs-page .toc a.is-locked, .cs-page .toc a.is-locked:hover { color: #cdc4bf; }
.cs-page .visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Figures with square corners */
.cs-page .figure.square .frame { border-radius: 0; }
