/* ==========================================================================
   FORGYEN — Case study page (templates/case-study.html)
   Builds on main.css tokens, header and .text-link. Scoped to .csp-*.
   Editorial and restrained: the approved cover artwork is the main visual;
   the documented results and scope follow as plain, structured text.
   Structure: 1 Page · 2 Intro · 3 Cover · 4 Blocks · 5 Results · 6 Scope
              6b Project Details · 7 More case studies · 8 Responsive
   ========================================================================== */

/* 1. Page ---------------------------------------------------------------- */
.csp-body { background-color: #F3F4F6; }
/* the page wash spans the article only, so the site footer below doesn't stretch it */
.csp {
  min-height: 100vh;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(48% 38% at 92% 0%, rgba(40, 74, 99, 0.07), transparent 70%),
    radial-gradient(40% 30% at 0% 8%, rgba(184, 115, 51, 0.06), transparent 70%),
    linear-gradient(180deg, #F9F4EF 0%, #F4F1EE 34%, #F1F2F4 72%, #F3F4F6 100%);
  display: block;
  padding: calc(var(--fg-header-h) + clamp(28px, 4vw, 56px)) 0 clamp(80px, 9vw, 128px);
}

/* 2. Intro --------------------------------------------------------------- */
.csp-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0 0 clamp(28px, 4vw, 48px);
  padding: 0;
  list-style: none;
  color: var(--fg-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.csp-crumbs li + li::before {
  content: "/";
  margin: 0 10px;
  color: rgba(184, 115, 51, 0.6);
}
.csp-crumbs a { text-decoration: none; }
.csp-crumbs a:hover { color: var(--fg-copper-700); text-decoration: underline; text-underline-offset: 3px; }
.csp-crumbs [aria-current] { color: var(--fg-navy-950); }

.csp-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.csp-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: var(--fg-copper-700);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.csp-eyebrow__mark {
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--fg-copper);
}
.csp-title {
  margin: 0;
  color: var(--fg-navy-950);
  font-size: clamp(2.5rem, 1.1rem + 3.3vw, 4.5rem);      /* 40 → 72 */
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.csp-lead {
  max-width: 62ch;
  margin: clamp(18px, 2vw, 26px) 0 0;
  color: #2E3B52;
  font-size: clamp(1.0625rem, 0.92rem + 0.45vw, 1.3125rem);   /* 17 → 21 */
  line-height: 1.55;
}

.csp-facts {
  margin: 0;
  border-top: 1px solid rgba(184, 115, 51, 0.35);
}
.csp-fact {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--fg-line);
}
.csp-fact dt {
  color: var(--fg-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.7;
}
.csp-fact dd {
  margin: 0;
  color: var(--fg-navy-950);
  font-weight: 600;
  line-height: 1.45;
}

/* 3. Cover --------------------------------------------------------------- */
.csp-cover { margin-block: clamp(40px, 5vw, 72px) 0; }
.csp-cover__frame {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #E9ECEF;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(40, 74, 99, 0.08),
    0 40px 70px -44px rgba(40, 74, 99, 0.5);
}
.csp-cover__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;                          /* the approved artwork is never cropped */
}

/* 4. Blocks (label column + content) ------------------------------------- */
.csp-block {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(64px, 8vw, 112px);
}
.csp-block__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(184, 115, 51, 0.35);
}
.csp-block__index {
  color: var(--fg-copper);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.csp-block__title {
  margin: 0;
  color: var(--fg-navy-950);
  font-size: clamp(1.375rem, 1.1rem + 0.7vw, 1.875rem);     /* 22 → 30 */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.csp-block__body {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--fg-line);
}

/* 5. Results ------------------------------------------------------------- */
.csp-primary { margin-bottom: clamp(28px, 3vw, 40px); }
.csp-primary__value {
  margin: 0;
  font-size: clamp(3rem, 1.8rem + 3.6vw, 5.25rem);          /* 48 → 84 */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg-copper);
  background: linear-gradient(180deg, #CC8650, #A35A28);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.csp-primary__label {
  margin: 12px 0 0;
  color: var(--fg-navy-950);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
  font-weight: 600;
}

.csp-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
}
.csp-metric {
  position: relative;
  display: flex;
  flex-direction: column-reverse;               /* value reads first; dt stays first in the markup */
  justify-content: flex-end;
  gap: 8px;
  padding: 24px 22px 22px;
  border: 1px solid rgba(184, 115, 51, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 34px -28px rgba(40, 74, 99, 0.35);
}
.csp-metric::before {                            /* copper tab, echoing the cover cards */
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 32px;
  height: 2px;
  border-radius: 2px;
  background: var(--fg-copper);
}
.csp-metric__value {
  margin: 0;
  color: var(--fg-navy-950);
  font-size: clamp(1.375rem, 1.1rem + 0.6vw, 1.75rem);     /* 22 → 28 */
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.csp-metric__label {
  color: var(--fg-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* 6. Scope --------------------------------------------------------------- */
.csp-scope__intro {
  max-width: 62ch;
  margin: 0 0 20px;
  color: #2E3B52;
  font-size: 1.0625rem;
  line-height: 1.6;
}
.csp-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.csp-scope li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-bottom: 1px solid var(--fg-line);
  color: var(--fg-navy-950);
  font-weight: 600;
  line-height: 1.45;
}
.csp-scope li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(14px + 0.725em - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #FFE6CC, #E3A26C 35%, #9A5627);
}

/* 6b. Project Details (optional article section) ------------------------ */
.csp-prose {
  max-width: 68ch;
  color: #2E3B52;
  font-size: 1.0625rem;
  line-height: 1.7;
}
.csp-prose > :first-child { margin-top: 0; }
.csp-prose > :last-child { margin-bottom: 0; }
.csp-prose p { margin: 0 0 1.15em; }
.csp-prose h3 {
  margin: 2em 0 0.6em;
  color: var(--fg-navy-950);
  font-size: clamp(1.125rem, 1rem + 0.35vw, 1.3125rem);   /* 18 → 21 */
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.csp-prose ul {
  margin: 0 0 1.3em;
  padding: 0;
  list-style: none;
}
.csp-prose li {
  position: relative;
  margin: 0.45em 0;
  padding-left: 22px;
}
.csp-prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(0.85em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-copper);
}
.csp-figure { margin: 2em 0; }
.csp-figure img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #E9ECEF;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 24px 44px -34px rgba(40, 74, 99, 0.45);
}
.csp-figure figcaption {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid rgba(184, 115, 51, 0.5);
  color: var(--fg-text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* 7. More case studies --------------------------------------------------- */
.csp-more {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-top: clamp(72px, 9vw, 128px);
}
.csp-next {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(184, 115, 51, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--fg-dur-std) var(--fg-ease), border-color var(--fg-dur-std) var(--fg-ease);
}
.csp-next:hover {
  border-color: rgba(184, 115, 51, 0.45);
  box-shadow: 0 26px 48px -34px rgba(40, 74, 99, 0.45);
}
.csp-next__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #E9ECEF;
}
.csp-next__media img { width: 100%; height: 100%; object-fit: contain; }
.csp-next__text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.csp-next__kicker {
  color: var(--fg-copper-700);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.csp-next__title {
  color: var(--fg-navy-950);
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.csp-next__action { color: var(--fg-copper-700); }
.csp-next:hover .text-link__label::after { width: 100%; }
.csp-next:hover .text-link__arrow { transform: translateX(4px); }

.csp-back { color: var(--fg-navy-950); }
.csp-next__action,
.csp-back { align-self: flex-start; }             /* main.css centres .text-link on small screens */
.csp-back .csp-back__arrow { transform: scaleX(-1); }
.csp-back:hover .csp-back__arrow,
.csp-back:focus-visible .csp-back__arrow { transform: scaleX(-1) translateX(4px); }

/* 8. Responsive ---------------------------------------------------------- */
@media (max-width: 1023px) {
  .csp-intro__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .csp-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 24px;
  }
  .csp-fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .csp-block { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .csp-block__body { border-top: 0; padding-top: 24px; }
}

@media (max-width: 767px) {
  .csp-next { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 20px; gap: 18px; }
  .csp-next__text { padding-inline: 6px; }
}

@media (max-width: 599px) {
  .csp-crumbs ol { font-size: 0.8125rem; }
  .csp-crumbs li[aria-current] { display: none; }   /* the h1 right below names the page */
  .csp-title { font-size: min(2.5rem, 10.6vw); }
  .csp-facts { grid-template-columns: minmax(0, 1fr); }
  .csp-fact { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
  .csp-cover__frame { border-radius: 12px; }
  .csp-metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .csp-metric { padding: 20px 16px 18px; }
  .csp-metric::before { left: 16px; }
  .csp-metric__value { font-size: 1.3125rem; white-space: normal; }
  .csp-metric__label { font-size: 0.875rem; }
  .csp-scope { grid-template-columns: minmax(0, 1fr); }
  .csp-prose { font-size: 1rem; line-height: 1.65; }
  .csp-figure { margin: 1.6em 0; }
  .csp-figure img { border-radius: 10px; }
}
