/* ==========================================================
   PROJECT PAGES
   Case studies, project stories, and mini projects. Loaded after
   the live styles (incl. case-study.css) and system.css. Maps the
   project-page template onto the design system.
========================================================== */

:root {
  --case-pad: var(--page-padding);
}

/* ----------------------------------------------------------
   1. HEADER: the menu band, pinned
   Solid versions of the band tint (15% black over #2a2d30 = #242629;
   12% terracotta over #f3f2ee = #ede2d9) so text stays legible as the
   page scrolls under it.
---------------------------------------------------------- */

.case-header {
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--case-pad);
  border-bottom: 0;
  background: color-mix(in srgb, #ede2d9 92%, transparent);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .case-header {
  background: color-mix(in srgb, #242629 92%, transparent);
}

.case-header a,
.case-header .theme-toggle {
  top: 0;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The toggle previews the other theme. */
.case-header .theme-toggle {
  color: var(--muted);
}

html[data-theme="dark"] .case-header .theme-toggle {
  color: #f5946f;
}

.case-header .theme-toggle:hover,
.case-header .theme-toggle:focus-visible {
  color: var(--text);
}

/* ----------------------------------------------------------
   2. HERO
---------------------------------------------------------- */

.case-hero {
  gap: clamp(40px, 6vw, 96px);
  padding: 128px var(--case-pad) 64px;
}

.case-hero h1 {
  max-width: 18ch;
  margin: 0 0 20px;
  font-family: "Gloock", Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: none;
}

.case-hero p {
  max-width: 600px;
  font-family: "Inter", sans-serif;
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.6;
}

/* Details column: muted labels, values in body text. */
.project-meta {
  gap: 18px;
}

.project-meta div {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.project-meta span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Any remaining in-page labels: muted, never accent. */
.case-hero ~ section .eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

/* ----------------------------------------------------------
   3. SECTIONS
---------------------------------------------------------- */

.story,
.sticky-section,
.results,
.case-section,
.case-media,
.case-takeaways {
  padding: 64px var(--case-pad);
}

.story,
.case-section,
.case-media__intro,
.case-takeaways {
  gap: clamp(32px, 6vw, 96px);
}

/* Section headings: the system's 26px Gloock heading. */
.story h2,
.results h2,
.sticky-copy h2,
.case-section__heading h2,
.case-media h2,
.case-takeaways h2 {
  margin: 0;
  font-family: "Gloock", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

/* Long-form body: 16px Inter at 1.7. */
.story p,
.sticky-copy p,
.case-section__body > p,
.case-media__copy,
.case-takeaways li {
  font-size: 1rem;
  line-height: 1.7;
}

/* ----------------------------------------------------------
   4. LISTS, METHODS, METRICS
   Ruled rows instead of grey boxes, matching the home page.
---------------------------------------------------------- */

.case-section .case-list {
  gap: 0;
  margin: 24px 0;
  border-bottom: 1px solid var(--border);
}

.case-section .case-list li {
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  font-size: 0.94rem;
  line-height: 1.65;
}

.methods-grid {
  gap: 0 24px;
  margin-top: 24px;
}

.methods-grid div {
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.metrics {
  gap: 0 24px;
  margin-top: 32px;
}

.metrics div {
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: none;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.metrics span {
  font-family: "Gloock", Georgia, serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1.05;
}

.case-takeaways li::before {
  color: var(--accent-text);
}

/* ----------------------------------------------------------
   5. IMAGES
   System image corners (2px); no frame or drop shadow.
---------------------------------------------------------- */

.case-media {
  gap: 32px;
}

.case-media__figure img,
.sticky-images img,
html[data-theme="dark"] .case-media__figure img,
html[data-theme="dark"] .sticky-images img {
  border: 0;
  border-radius: 2px;
  box-shadow: none;
}

.case-media__figure figcaption {
  margin-top: 12px;
  font-size: 0.66rem;
  font-weight: 500;
}

/* ----------------------------------------------------------
   6. NEXT PROJECT
---------------------------------------------------------- */

.next-project {
  padding: 64px var(--case-pad) 80px;
}

.next-project a {
  color: var(--accent-text);
  font-family: "Gloock", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
}

/* ----------------------------------------------------------
   7. DARK THEME HEADLINE LAYER
---------------------------------------------------------- */

html[data-theme="dark"] .case-hero h1,
html[data-theme="dark"] .story h2,
html[data-theme="dark"] .results h2,
html[data-theme="dark"] .sticky-copy h2,
html[data-theme="dark"] .case-section__heading h2,
html[data-theme="dark"] .case-media h2,
html[data-theme="dark"] .case-takeaways h2,
html[data-theme="dark"] .metrics span {
  color: var(--headline);
}

html[data-theme="dark"] .case-hero p {
  color: #dcdfe0;
}

/* ----------------------------------------------------------
   8. RESPONSIVE
---------------------------------------------------------- */

@media (max-width: 760px) {
  .case-header {
    padding: 14px var(--case-pad);
  }

  .case-header a,
  .case-header .theme-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .case-hero {
    padding: 108px var(--case-pad) 48px;
  }

  .story,
  .sticky-section,
  .results,
  .case-section,
  .case-media,
  .case-takeaways {
    padding: 48px var(--case-pad);
  }

  .story h2,
  .results h2,
  .sticky-copy h2,
  .case-section__heading h2,
  .case-media h2,
  .case-takeaways h2,
  .next-project a {
    font-size: 1.5rem;
  }

  .next-project {
    padding: 48px var(--case-pad) 64px;
  }
}
