/* ==========================================================================
   Keller Masnyk — Portfolio
   Phase: Layout structure + design tokens (color/type tokens defined,
   not yet applied to elements).
   Approach: desktop-first; scale down with max-width media queries.
   ========================================================================== */

/* --- Fonts -------------------------------------------------------------- */
@font-face {
  font-family: "Cambridge Semibold Condensed";
  src: url("assets/fonts/Cambridgetrial-CondensedSemibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cambridge Regular Condensed";
  src: url("assets/fonts/Cambridgetrial-CondensedRegular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Season VF Sans";
  src: url("assets/fonts/SeasonSans-TRIAL-Regular.otf") format("opentype");
  /* Trial file is a single Regular face; weight range enables synthesis for H1–H3. */
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Spacing scale (base 8px) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;

  /* Grid & container */
  --container-max: 1320px;
  --page-margin: 36px;
  --grid-gutter: 24px;
  --grid-columns: 12;

  /* Section rhythm */
  --section-gap: var(--space-8);

  /* Shared breath after page content and inside the top of the footer.
     Kept intentionally generous so the two voids always match. */
  --footer-gap: clamp(5rem, 14vh, 9rem);

  /* Sticky header */
  --header-height: 86px;

  /* Case study media: full bleed on narrow viewports, gradually inset and
     capped at --container-max as the window widens. */
  --case-study-media-inset: max(0px, calc((100vw - 768px) * 0.12));
  --case-study-media-width: min(
    var(--container-max),
    calc(100vw - (var(--case-study-media-inset) * 2))
  );

  /* Cap in-body case study images to the hero's rendered height
     (16:9 of the media width), so tall images don't dominate. */
  --case-study-media-max-h: calc(var(--case-study-media-width) * 9 / 16);

  /* --- Color ----------------------------------------------------------- */
  --color-bg: #ffffff;
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #333333;
  --color-accent-gold: #d18d15;
  --color-accent-blue: #273f68;
  --color-accent-green: #00291d;

  /* Header/footer link hover: defaults for white page backgrounds.
     Homepage scroll themes override these. */
  --link-hover-text: var(--color-accent-blue);

  /* --- Surface treatment (radius & shadow) ----------------------------- */
  --radius-card: 10px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);

  /* --- Typography ------------------------------------------------------ */
  /* Font families (see @font-face declarations above) */
  --font-title: "Cambridge Semibold Condensed", Georgia, serif;
  --font-subtitle: "Season VF Sans", system-ui, sans-serif;
  --font-h1: "Cambridge Semibold Condensed", Georgia, serif;
  --font-h2: "Season VF Sans", system-ui, sans-serif;
  --font-h3: "Season VF Sans", system-ui, sans-serif;
  --font-body: "Season VF Sans", system-ui, sans-serif;
  --font-hero: "Cambridge Regular Condensed", Georgia, serif;

  /* Font sizes (spec values in typographic points; 1pt = 1.333px, on a 16px base) */
  --text-title: 4rem;        /* 48pt = 64px */
  --text-subtitle: 1.75rem;  /* 21pt ≈ 28px */
  --text-h1: 3rem;           /* 36pt = 48px */
  --text-h2: 1.75rem;        /* 21pt ≈ 28px */
  --text-h3: 1.125rem;       /* 14pt ≈ 18px */
  --text-body: 1.125rem;     /* 14pt ≈ 18px */
  --text-hero: 2rem;         /* 24pt = 32px */

  /* Font weights */
  --weight-title: 600;       /* Semibold */
  --weight-subtitle: 500;
  --weight-h1: 600;          /* Semibold */
  --weight-h2: 500;
  --weight-h3: 500;
  --weight-body: 400;
  --weight-hero: 400;        /* Regular */
}

/* --- Reset / primitives ------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Smooth in-page anchor scrolling + offset for the fixed header.
     Lenis owns wheel inertia when present — native smooth would fight it. */
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

html.lenis {
  scroll-behavior: auto;
}

/* Allow homepage scroll themes to animate bg + text tokens in sync. */
@property --color-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}

@property --color-text-primary {
  syntax: "<color>";
  inherits: true;
  initial-value: #0a0a0a;
}

@property --color-text-secondary {
  syntax: "<color>";
  inherits: true;
  initial-value: #333333;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
}

/* Homepage-only: scroll-driven theme tokens ease together. */
html:has(.home) {
  transition:
    --color-bg 700ms ease,
    --color-text-primary 700ms ease,
    --color-text-secondary 700ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html:has(.home) {
    transition: none;
  }
}

::selection {
  color: #ffffff;
  background: var(--color-accent-blue);
}

::-moz-selection {
  color: #ffffff;
  background: var(--color-accent-blue);
}

/* Page transitions: fade + rise content only — keep html/body backgrounds
   fully opaque so themed colors never wash out mid-navigation. */
html.js main,
html.js .site-footer {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.js body.is-page-entered main,
html.js body.is-page-entered .site-footer {
  opacity: 1;
  transform: none;
}

html.js body.is-page-leaving main,
html.js body.is-page-leaving .site-footer {
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition-duration: 280ms;
  transition-timing-function: ease;
  pointer-events: none;
}

/* Freeze homepage color tokens while exiting so hover-leave can't wash
   orange/navy/green back toward white during the leave animation. */
html.is-page-leaving:has(.home) {
  transition: none;
}

/* Cross-page color bridge: hold the previous theme, then ease to the
   destination page colors (homepage tile → case study white). */
html.is-color-bridging.is-color-bridge-settling {
  transition:
    --color-bg 700ms ease,
    --color-text-primary 700ms ease,
    --color-text-secondary 700ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html.js main,
  html.js .site-footer,
  html.js body.is-page-entered main,
  html.js body.is-page-entered .site-footer,
  html.js body.is-page-leaving main,
  html.js body.is-page-leaving .site-footer {
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: auto;
  }

  html.is-page-leaving:has(.home),
  html.is-color-bridging.is-color-bridge-settling {
    transition: none;
  }
}

/* Offset page content so it isn't hidden beneath the fixed header */
body {
  padding-top: var(--header-height);
}

/* Match the void after the last content block to the void at the top of
   the footer (both use --footer-gap). */
main {
  padding-bottom: var(--footer-gap);
}

.home > :last-child,
.about-page > .about:last-child,
.faq-page > .help:last-child,
.case-study > :last-child {
  padding-bottom: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  color: var(--color-accent-blue);
  text-decoration: none;
}

/* Season trial is Regular-only; allow synthetic weight so <strong> reads bold. */
strong,
b {
  font-weight: 700;
  font-synthesis: weight;
}

/* --- Base typography ---------------------------------------------------- */
/* Site-wide defaults so all text uses the type tokens; components set sizes. */
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  font-synthesis: weight;
  line-height: 1.5;
  color: var(--color-text-primary);
  /* Contain full-bleed media so 100vw elements don't trigger horizontal scroll. */
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  line-height: 1.1;
  color: var(--color-text-primary);
}

/* --- Page container ----------------------------------------------------- */
/* Align top-level blocks to the same edges as the nav bar: content is centered
   to the max-width container, falling back to the page margin on narrow screens.
   (Matches the .site-header padding-inline formula exactly.) */
.home > section,
.case-study > *,
.about-page > section,
.faq-page > section {
  padding-inline: max(var(--page-margin), calc((100% - var(--container-max)) / 2));
}

/* --- Header (sticky / fixed) -------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-height);
  padding-block: var(--space-3);
  /* Full-width bar with its inner content centered to the container width */
  padding-inline: max(var(--page-margin), calc((100% - var(--container-max)) / 2));
  /* Hidden on the hero; fades in on the same trigger as the hero reveal — after
     3 seconds, on scroll, or on click (toggled via JS). Timing matches
     .hero-reveal so the two land together. */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease-out;
}

.site-header.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

/* Backdrop layer behind the nav content: a page-bg fade (65% opaque at the top
   edge down to transparent at the bottom) plus a blur that tapers off toward
   the bottom via a mask. Kept on a pseudo-element so the logo/links stay fully
   opaque. Uses --color-bg so scroll themes tint the scrim in sync. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-bg) 65%, transparent) 0%,
    color-mix(in srgb, var(--color-bg) 0%, transparent) 100%
  );
  backdrop-filter: blur(10.8px);
  -webkit-backdrop-filter: blur(10.8px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.site-logo img {
  width: 88px;
  transition: filter 700ms ease;
}

/* Black wordmark PNGs invert when themes use light text on dark bg. */
html.is-inverse .site-logo img {
  filter: invert(1);
}

/* Project themes: logo, nav, and tags use theme chrome instead of plain white. */
html.theme-alpine {
  --theme-chrome: #000000;
}

html.theme-tidepool {
  --theme-chrome: #627cff;
}

html.theme-alpine .site-logo img {
  /* Keep the black wordmark on orange. */
  filter: none;
}

html.theme-tidepool .site-logo img {
  /* Recolor black wordmark to Tidepool #627CFF. */
  filter: brightness(0) saturate(100%) invert(42%) sepia(98%) saturate(2498%) hue-rotate(214deg) brightness(101%) contrast(101%);
}

/* Logo hover: ease to accent green across default and themed states. */
.site-logo:hover img,
.site-logo:focus-visible img,
html.is-inverse .site-logo:hover img,
html.is-inverse .site-logo:focus-visible img,
html.theme-alpine .site-logo:hover img,
html.theme-alpine .site-logo:focus-visible img,
html.theme-tidepool .site-logo:hover img,
html.theme-tidepool .site-logo:focus-visible img {
  filter: brightness(0) saturate(100%) invert(10%) sepia(45%) saturate(1800%) hue-rotate(118deg) brightness(92%) contrast(104%);
}

html.theme-alpine .nav-list a,
html.theme-tidepool .nav-list a {
  color: var(--theme-chrome);
}

html.theme-alpine .case-study-tag,
html.theme-tidepool .case-study-tag {
  color: var(--theme-chrome);
  border-color: var(--theme-chrome);
}

@media (prefers-reduced-motion: reduce) {
  .site-logo img {
    transition: none;
  }
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-list a {
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 800ms ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--link-hover-text);
  outline: none;
}

/* Homepage scroll/hover themes: link hover follows the page background. */
html.theme-default,
html.theme-hero {
  /* White page → blue text */
  --link-hover-text: var(--color-accent-blue);
}

html.theme-tidepool {
  /* Tidepool dark → bright blue text */
  --link-hover-text: #627cff;
}

html.theme-alpine {
  /* Alpine orange → black text */
  --link-hover-text: #000000;
}

/* Mobile scroll: blue work zone → yellow link hover */
html.theme-work {
  --link-hover-text: var(--color-accent-gold);
}

@media (prefers-reduced-motion: reduce) {
  .nav-list a {
    transition: none;
  }
}

/* Hamburger toggle + overlay: hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: color 700ms ease;
}

/* Match hamburger bars to the header wordmark chrome on themed backgrounds. */
html.theme-alpine .nav-toggle,
html.theme-tidepool .nav-toggle {
  color: var(--theme-chrome);
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle {
    transition: none;
  }
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
}

.nav-overlay {
  display: none;
}

/* --- Home: section rhythm ----------------------------------------------- */
.home > section {
  padding-block: var(--section-gap);
}

/* --- Hero (type-led: name + role) -------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  min-height: calc(100vh - var(--header-height));
  text-align: center;
}

.hero-name {
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  line-height: 1.05;
  color: var(--color-text-primary);
}

.hero-statement {
  margin: 0;
  max-width: 32ch;
  font-family: var(--font-subtitle);
  font-size: var(--text-subtitle);
  font-weight: var(--weight-subtitle);
  color: var(--color-text-secondary);
  /* "pretty" keeps both lines filling the same max-width (consistent width
     across window sizes) while still preventing an orphaned last word.
     "balance" was making the two paragraphs render at different widths. */
  text-wrap: pretty;
}

/* Second line is introduced on scroll (toggled via JS). */
.hero-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.hero-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-reveal {
    transition: none;
  }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  color: var(--color-text-secondary);
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hero-scroll-indicator.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hero-scroll-indicator-track {
  position: relative;
  display: block;
  width: 44px;
  height: 72px;
}

.hero-scroll-indicator-arrow {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  /* Three bounce cycles (1.8s each); color advances yellow → blue → green
     at every restart. */
  color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  animation: hero-scroll-arrow 5.4s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

.hero-scroll-indicator-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-scroll-indicator:focus-visible {
  outline: 2px solid rgba(39, 63, 104, 0.9);
  outline-offset: 6px;
  border-radius: 12px;
}

@keyframes hero-scroll-arrow {
  /* Cycle 1 — gold */
  0% {
    transform: translateY(0);
    opacity: 1;
    color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  }

  21.666% {
    transform: translateY(42px);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  }

  22% {
    transform: translateY(0);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  }

  /* Cycle 2 — blue */
  33.333% {
    transform: translateY(0);
    opacity: 1;
    color: color-mix(in srgb, var(--color-accent-blue) 72%, transparent);
  }

  55% {
    transform: translateY(42px);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-blue) 72%, transparent);
  }

  55.333% {
    transform: translateY(0);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-blue) 72%, transparent);
  }

  /* Cycle 3 — green */
  66.666% {
    transform: translateY(0);
    opacity: 1;
    color: color-mix(in srgb, var(--color-accent-green) 72%, transparent);
  }

  88.333% {
    transform: translateY(42px);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-green) 72%, transparent);
  }

  88.666% {
    transform: translateY(0);
    opacity: 0;
    color: color-mix(in srgb, var(--color-accent-green) 72%, transparent);
  }

  100% {
    transform: translateY(0);
    opacity: 1;
    color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-indicator-arrow {
    animation: none;
    top: 50%;
    margin-top: -15px;
    opacity: 0.72;
    color: color-mix(in srgb, var(--color-accent-gold) 72%, transparent);
  }
}

/* --- Work --------------------------------------------------------------- */
.work {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.work-heading,
.about-heading,
.help-heading {
  font-family: var(--font-h1);
  font-size: var(--text-h1);
  font-weight: var(--weight-h1);
}

.work-intro {
  margin: 0;
  max-width: 60ch;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-secondary);
}

.case-study-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gutter);
}

/* Project card (home page case studies) */
.case-study-link {
  display: flex;
  flex-direction: column;
  color: var(--color-text-primary);
  text-decoration: none;
}

.case-study-media {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.project-collage {
  position: relative;
  width: 100%;
  height: 100%;
}

.project-collage-photo {
  position: absolute;
  border-radius: var(--radius-card);
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

/* Alpine Modern tile collage layout: coffee bag as anchor, theatre wide, film roll tucked in. */
.project-collage--alpine .project-collage-photo--alpine-anchor {
  top: 10%;
  left: 6%;
  width: 46%;
  height: auto;
  transform: rotate(-4deg);
  z-index: 2;
}

.project-collage--alpine .project-collage-photo--alpine-support {
  bottom: 6%;
  right: 4%;
  width: 54%;
  height: auto;
  transform: rotate(3deg);
  z-index: 1;
}

.project-collage--alpine .project-collage-photo--alpine-detail {
  top: 8%;
  right: 18%;
  width: 26%;
  height: auto;
  transform: rotate(9deg);
  z-index: 3;
}

.case-study-link:hover .project-collage--alpine .project-collage-photo--alpine-anchor {
  transform: translate(-10px, -8px) scale(1.06) rotate(-6deg);
}

.case-study-link:hover .project-collage--alpine .project-collage-photo--alpine-support {
  transform: translate(10px, 8px) scale(1.06) rotate(5deg);
}

.case-study-link:hover .project-collage--alpine .project-collage-photo--alpine-detail {
  transform: translate(8px, -10px) scale(1.06) rotate(12deg);
}

/* Tidepool tile collage layout: data vis anchor with split supporting cards and ring detail. */
.project-collage--tidepool .project-collage-photo--tidepool-anchor {
  top: 7%;
  left: 20%;
  width: 58%;
  height: auto;
  transform: rotate(-2deg);
  z-index: 1;
}

.project-collage--tidepool .project-collage-photo--tidepool-support-women {
  top: 10%;
  left: 5%;
  width: 30%;
  height: auto;
  transform: rotate(-6deg);
  z-index: 2;
}

.project-collage--tidepool .project-collage-photo--tidepool-support-men {
  bottom: 8%;
  right: 7%;
  width: 33%;
  height: auto;
  transform: rotate(5deg);
  z-index: 2;
}

.project-collage--tidepool .project-collage-photo--tidepool-detail {
  bottom: 10%;
  left: 14%;
  width: 24%;
  height: auto;
  transform: rotate(10deg);
  z-index: 3;
}

.case-study-link:hover .project-collage--tidepool .project-collage-photo--tidepool-anchor {
  transform: translate(0, -8px) scale(1.06) rotate(-2deg);
}

.case-study-link:hover .project-collage--tidepool .project-collage-photo--tidepool-support-women {
  transform: translate(-10px, -8px) scale(1.06) rotate(-8deg);
}

.case-study-link:hover .project-collage--tidepool .project-collage-photo--tidepool-support-men {
  transform: translate(10px, 8px) scale(1.06) rotate(7deg);
}

.case-study-link:hover .project-collage--tidepool .project-collage-photo--tidepool-detail {
  transform: translate(8px, 10px) scale(1.06) rotate(13deg);
}

@media (max-width: 768px) {
  .project-collage--alpine .project-collage-photo--alpine-anchor {
    top: 8%;
    left: 4%;
    width: 52%;
  }

  .project-collage--alpine .project-collage-photo--alpine-support {
    bottom: 4%;
    right: 2%;
    width: 58%;
  }

  .project-collage--alpine .project-collage-photo--alpine-detail {
    top: 6%;
    right: 16%;
    width: 28%;
  }

  .project-collage--tidepool .project-collage-photo--tidepool-anchor {
    left: 18%;
    width: 62%;
  }

  .project-collage--tidepool .project-collage-photo--tidepool-support-women {
    left: 2%;
    width: 34%;
  }

  .project-collage--tidepool .project-collage-photo--tidepool-support-men {
    right: 3%;
    width: 36%;
  }

  .project-collage--tidepool .project-collage-photo--tidepool-detail {
    left: 10%;
    width: 28%;
  }
}

.case-study-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.case-study-link:hover .case-study-media > img {
  transform: scale(1.06);
}

.case-study-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.case-study-title {
  margin: 0;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  color: var(--color-text-primary);
}

.case-study-blurb {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-secondary);
}

.case-study-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.case-study-tag {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
  border: 1px solid var(--color-text-primary);
  border-radius: var(--radius-card);
  padding: var(--space-1) var(--space-2);
  transition: color 700ms ease, border-color 700ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .case-study-tag {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-study-media img,
  .case-study-audience-card,
  .case-study-stat-card,
  .framework-card {
    transition: none;
  }

  .case-study-audience-card:hover,
  .case-study-stat-card:hover,
  .framework-card:hover {
    transform: none;
  }
}

/* --- About -------------------------------------------------------------- */
.about-page > .about {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--space-6);
  /* Fill the first screen (body already clears the fixed header) and
     vertically center the heading + content block in that space. */
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  align-content: center;
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.about-page .about-heading,
.about-page .about-content {
  grid-column: 4 / 10;
}

.about {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.about-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--grid-gutter);
  align-items: stretch;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.about-statement {
  margin: 0;
  font-family: var(--font-hero);
  font-size: var(--text-hero);
  font-weight: var(--weight-hero);
  line-height: 1.1;
  color: var(--color-text-primary);
}

.about-bio {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
}

/* Portrait keeps the photo's square ratio so the head is never cropped.
   The frame is at least as tall as the About copy; when the square is taller,
   the row grows and the copy column gets whitespace below. */
.about-portrait {
  position: relative;
  margin: 0;
  align-self: start;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.about-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- FAQ (expandable sections) ------------------------------------------ */
/* Type roles per DESIGN.md:
   H1       → .help-heading
   Hero     → .help-subheading
   H2       → .faq-title (question), .recipe-name
   H3       → .recipe-subtitle (Servings / Ingredients / Steps), .recipe-closing
   Body     → panel copy (ingredients, steps, cause, readout, tip) */
.faq-page > .help {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--space-6);
  /* Fill the first screen (body already clears the fixed header) and
     vertically center the FAQ block in that space. */
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  align-content: center;
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.faq-page .help-heading,
.faq-page .help-subheading,
.faq-page .faq-list {
  grid-column: 4 / 10;
}

.help {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.help-heading {
  margin: 0;
  font-family: var(--font-h1);
  font-size: var(--text-h1);
  font-weight: var(--weight-h1);
  line-height: 1.1;
  color: var(--color-text-primary);
}

.help-subheading {
  margin: 0;
  font-family: var(--font-hero);
  font-size: var(--text-hero);
  font-weight: var(--weight-hero);
  line-height: 1.1;
  color: var(--color-text-primary);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--color-text-primary);
}

.faq-toggle:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 4px;
}

/* "What's up?" item: cold-face emoji cursor once the panel is open,
   matching the recipe card's emoji-cursor treatment. */
.faq-item--chill.is-open,
.faq-item--chill.is-open .faq-toggle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%F0%9F%A5%B6%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

/* Ski FAQ item: skier emoji cursor once the panel is open. */
.faq-item--ski.is-open,
.faq-item--ski.is-open .faq-toggle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%E2%9B%B7%EF%B8%8F%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

/* FAQs spelling FAQ item: nerd-face emoji cursor once the panel is open. */
.faq-item--nerd.is-open,
.faq-item--nerd.is-open .faq-toggle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%F0%9F%A4%93%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

.faq-title {
  flex: 1;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  line-height: 1.3;
  color: var(--color-text-primary);
}

.faq-censored {
  display: inline;
  user-select: none;
}

.faq-censored-mid {
  display: inline-block;
  filter: blur(4.37px);
}

.faq-icon {
  flex-shrink: 0;
  width: 1.25em;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  line-height: 1.3;
  text-align: center;
  color: var(--color-text-secondary);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition:
    padding-top 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding-bottom 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.faq-item.is-open .faq-panel-inner {
  padding-top: var(--space-3);
  padding-bottom: var(--space-4);
}

.faq-panel-inner .recipe-card {
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

@media (prefers-reduced-motion: reduce) {
  .faq-panel,
  .faq-panel-inner {
    transition: none;
  }
}

/* Recipe card */
.recipe-card {
  --cursor-pinched: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%F0%9F%A4%8C%3C/text%3E%3C/svg%3E") 16 16, pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: var(--cursor-pinched);
}

.recipe-card .recipe-tip,
.recipe-card .recipe-tip-trigger {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%F0%9F%A5%AB%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

.recipe-name {
  margin: 0;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  line-height: 1.3;
  color: var(--color-text-primary);
}

.recipe-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.recipe-subtitle {
  margin: 0;
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  line-height: 1.3;
  color: var(--color-text-secondary);
}

.recipe-ingredients {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-1) var(--space-4);
}

.recipe-ingredients li,
.recipe-steps li {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
}

.recipe-ingredient-with-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em;
}

.recipe-tip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
}

.recipe-tip-trigger {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-size='22'%3E%F0%9F%A5%AB%3C/text%3E%3C/svg%3E") 16 16, pointer;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  font-style: italic;
  line-height: inherit;
  color: var(--color-text-secondary);
  opacity: 0.55;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.15em;
}

.recipe-tip-trigger:hover,
.recipe-tip-trigger:focus-visible {
  opacity: 0.85;
  color: var(--color-text-secondary);
}

.recipe-tip-trigger:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

.recipe-tip-popup {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-card);
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  font-style: normal;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s ease;
}

.recipe-tip-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  transform: translateX(-50%);
}

.recipe-tip:hover .recipe-tip-popup,
.recipe-tip:focus-within .recipe-tip-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .recipe-tip-popup {
    transition: none;
  }
}

.recipe-steps {
  padding-left: var(--space-4);
}

.recipe-steps li + li {
  margin-top: var(--space-2);
}

.recipe-closing {
  margin: var(--space-3) 0 0;
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  color: var(--color-text-primary);
}

/* Recipe serving scaler */
.recipe-scaler {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 28rem;
}

.recipe-scaler-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.recipe-scaler-col {
  flex: 1;
  min-width: 0;
}

.recipe-scaler-readout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-start;
  box-sizing: border-box;
  width: 3rem;
  min-width: 3rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e8e8e8;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  font-style: normal;
  font-synthesis: none;
  line-height: 1;
  letter-spacing: normal;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.recipe-scaler-track {
  position: relative;
  height: 1.75rem;
  display: flex;
  align-items: center;
}

.recipe-scaler-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 14px;
  border-radius: 999px;
  background: #e8e8e8;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  transform: translateY(-50%);
  pointer-events: none;
}

.recipe-scaler-track::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: calc((100% - 22px) * var(--scaler-progress, 0.25));
  height: 2px;
  border-radius: 999px;
  background: var(--color-accent-gold);
  transform: translateY(-50%);
  pointer-events: none;
}

.recipe-scaler-range {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 1.75rem;
  margin: 0;
  background: transparent;
  cursor: var(--cursor-pinched);
}

.recipe-scaler-range:focus {
  outline: none;
}

.recipe-scaler-range:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 4px;
  border-radius: 999px;
}

.recipe-scaler-range::-webkit-slider-runnable-track {
  height: 14px;
  background: transparent;
}

.recipe-scaler-range::-moz-range-track {
  height: 14px;
  border: 0;
  background: transparent;
}

.recipe-scaler-range::-moz-range-progress {
  height: 14px;
  background: transparent;
}

/* Spherical thumb */
.recipe-scaler-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f3f3f3 45%, #d8d8d8 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  cursor: var(--cursor-pinched);
}

.recipe-scaler-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f3f3f3 45%, #d8d8d8 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  cursor: var(--cursor-pinched);
}

.recipe-scaler-range:active::-webkit-slider-thumb,
.recipe-scaler-range:active::-moz-range-thumb {
  cursor: var(--cursor-pinched);
}

.recipe-scaler-scale {
  position: relative;
  height: 1.75rem;
  margin-top: 0.35rem;
}

.recipe-scaler-tick {
  position: absolute;
  top: 0;
  left: calc((100% - 22px) * var(--tick) / 8 + 11px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.recipe-scaler-tick i {
  display: block;
  width: 1px;
  height: 6px;
  background: #b0b0b0;
}

.recipe-scaler-tick--major i {
  height: 10px;
  background: #8a8a8a;
}

.recipe-scaler-tick b {
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-secondary);
}

/* Responsive video embed (16:9) */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.cause-text + .video-embed {
  margin-top: var(--space-3);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-card);
}

/* Cause (POW) — two columns: text + button left, logo right */
.cause {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gutter);
  align-items: center;
}

.cause-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.cause-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cause-text p {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
}

.cause-logo {
  margin: 0;
  aspect-ratio: 1 / 1;
  max-width: 33.333vw;
  justify-self: center;
}

.cause-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Button (.btn) — Figma "Let's talk" pill: light circle icon that grows into a
   blue fill on hover. Geometry pulled from the Figma component (41px tall,
   39px circle inset 1px, 25px radius, 0.25px #d9d9d9 border). */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 41px;
  padding-left: 48px;
  padding-right: var(--space-3);
  border: 0.25px solid #d9d9d9;
  border-radius: 25px;
  background: rgba(210, 210, 210, 0.25);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
}

.btn-icon {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 39px;
  height: 39px;
  border-radius: 25px;
  background: #e4e1e1;
  color: var(--color-text-primary);
  transition: width 0.3s ease, background-color 0.3s ease, color 0.3s ease;
  z-index: 0;
}

.btn-arrow {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%) rotate(-90deg);
}

.btn-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: normal;
  white-space: nowrap;
  color: var(--color-text-primary);
  transition: color 0.3s ease;
}

.btn:hover .btn-icon,
.btn:focus-visible .btn-icon {
  width: calc(100% - 2px);
  background: rgba(39, 63, 104, 0.9);
  color: #ffffff;
}

.btn:hover .btn-label,
.btn:focus-visible .btn-label {
  color: #ffffff;
}

/* --- Footer ------------------------------------------------------------- */
/* Full-bleed: no page-margin inset. Logo bleeds off the bottom-left edge;
   contact stack sits left-aligned at the bottom-right, level with the mark.
   Default: black ground / white type. Homepage themes invert to each
   project's accent pair (see html.theme-* rules below). */
.site-footer {
  --footer-logo-width: min(560px, 58vw);
  /* Intrinsic wordmark ratio from Keller_blackAsset 5@4x.png (686×215). */
  --footer-logo-height: calc(var(--footer-logo-width) * 215 / 686);
  --footer-logo-bleed-y: 0.18;
  --footer-bg: #0a0a0a;
  --footer-fg: #ffffff;
  --link-hover-text: var(--color-accent-gold);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  box-sizing: border-box;
  /* Top gap matches main's padding-bottom. Bottom padding reserves the
     visible wordmark band so the in-flow contact stack stays inside. */
  height: auto;
  min-height: 0;
  padding-top: var(--footer-gap);
  padding-right: var(--space-6);
  padding-bottom: calc(var(--footer-logo-height) * (1 - var(--footer-logo-bleed-y)));
  padding-left: 0;
  overflow: hidden;
  background: var(--footer-bg);
  color: var(--footer-fg);
  transition:
    background-color 700ms ease,
    color 700ms ease;
}

/* Homepage themes: footer flips to the complementary accent of the page bg. */
html.theme-alpine .site-footer {
  /* Orange page → white footer, orange type */
  --footer-bg: #ffffff;
  --footer-fg: #f44b25;
  --link-hover-text: #0a0a0a;
}

html.theme-tidepool .site-footer {
  /* Navy page → indigo footer, navy type */
  --footer-bg: #627cff;
  --footer-fg: #0a0c1a;
  --link-hover-text: #ffffff;
}

html.theme-default .site-footer,
html.theme-hero .site-footer {
  --footer-bg: #0a0a0a;
  --footer-fg: #ffffff;
  --link-hover-text: var(--color-accent-gold);
}

.footer-logo {
  display: block;
  width: var(--footer-logo-width);
  height: auto;
  position: absolute;
  left: 0;
  bottom: 0;
  /* Bleed bottom (crop the mark) and left (first shaft of the K sits
     half on / half off the viewport — stem ≈ 6.1% of the wordmark width). */
  transform: translate(-3.06%, calc(var(--footer-logo-bleed-y) * 100%));
  /* Default white wordmark on black. */
  filter: invert(1);
  transition: filter 700ms ease;
}

html.theme-alpine .footer-logo {
  /* Orange #f44b25 wordmark on white. */
  filter: brightness(0) saturate(100%) invert(42%) sepia(98%) saturate(2500%) hue-rotate(349deg) brightness(101%) contrast(96%);
}

html.theme-tidepool .footer-logo {
  /* Near-navy wordmark on indigo — black asset reads as navy. */
  filter: none;
}

html.theme-default .footer-logo,
html.theme-hero .footer-logo {
  filter: invert(1);
}

@media (prefers-reduced-motion: reduce) {
  .site-footer {
    transition: none;
  }

  .footer-logo {
    transition: none;
  }
}

.footer-bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  width: 100%;
  box-sizing: border-box;
  padding-left: var(--space-6);
}

.footer-back-top {
  flex-shrink: 0;
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  line-height: 1.3;
  color: var(--footer-fg);
  text-decoration: none;
  transition: color 800ms ease;
}

.footer-back-top:hover,
.footer-back-top:focus-visible {
  color: var(--link-hover-text);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .footer-back-top {
    transition: none;
  }
}

.footer-contact {
  /* In-flow above the wordmark band; footer grows with this stack. */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.footer-contact a,
.footer-phone,
.footer-local {
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  line-height: 1.3;
  color: var(--footer-fg);
  text-decoration: none;
  transition: color 700ms ease;
}

.footer-contact a,
.footer-phone {
  transition: color 800ms ease;
}

.footer-contact a:hover,
.footer-contact a:focus-visible,
.footer-phone:hover,
.footer-phone:focus-visible {
  color: var(--link-hover-text);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .footer-contact a,
  .footer-phone,
  .footer-local {
    transition: none;
  }
}

.footer-local {
  display: flex;
  gap: 0.35em;
  white-space: nowrap;
  opacity: 0.7;
  /* Double-line break below the local time row. */
  margin-bottom: 1.3em;
}

.footer-clock {
  font: inherit;
  color: inherit;
}

.footer-phone {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.footer-phone:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 4px;
}

.footer-phone.is-copied::after {
  content: " — Copied";
  font-weight: var(--weight-body);
  color: color-mix(in srgb, var(--footer-fg) 70%, transparent);
}

/* ==========================================================================
   Case study pages
   ========================================================================== */
/* Case study type roles per DESIGN.md:
   Title    → .case-study-headline-text
   Subtitle → .case-study-intro, .case-study-subhead
   H1       → .case-study-block-title
   H2       → .case-study-media-heading, .case-study-subsection-title
   H3       → overview labels, framework/audience card titles, pager
   Body     → running copy, captions, lists
   Hero     → .case-study-hero-line */
.case-study > * {
  padding-block: var(--section-gap);
}

/* First block clears the fixed header.
   Content is centered on the page measure; copy stays left-aligned. */
.case-study-headline {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--space-6);
  padding-top: calc(var(--header-height) + var(--section-gap));
  /* Match hero→body: headline padding-bottom + hero padding-top = 2× section-gap. */
  padding-bottom: var(--section-gap);
  text-align: left;
}

.case-study-headline-text,
.case-study-subhead,
.case-study-intro,
.case-study-overview {
  grid-column: 4 / 10;
}

.case-study-headline-text {
  font-family: var(--font-title);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  line-height: 1.05;
  text-wrap: balance;
}

.case-study-subhead {
  margin: 0;
  font-family: var(--font-subtitle);
  font-size: var(--text-subtitle);
  font-weight: var(--weight-subtitle);
  color: var(--color-text-secondary);
}

.case-study-intro {
  margin: 0;
  max-width: 60ch;
  font-family: var(--font-subtitle);
  font-size: var(--text-subtitle);
  font-weight: var(--weight-subtitle);
  line-height: 1.1;
  color: var(--color-text-secondary);
}

/* Project overview widget — reusable card across case studies. Meta row of
   client / type / role. Sits beneath the intro on the centered text measure. */
.case-study-overview {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.case-study-hero {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--space-6);
}

/* Hero image — full bleed on narrow screens, gradually inset on wide. */
.case-study-hero-media {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 0;
  margin-inline: auto;
  width: var(--case-study-media-width);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: clamp(0px, var(--case-study-media-inset), var(--radius-card));
  overflow: hidden;
}

.case-study-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Tidepool hero collage — logo top-left, outcome cards bottom-left,
   research gap on the right. Sized to ~2/3 viewport height with a
   vertically tight composition. */
.case-study-hero.case-study-hero--collage {
  /* Let layers travel into the page margins toward the window edge. */
  overflow: visible;
}

.case-study-hero-collage {
  --hero-collage-max-h: 66.666vh;
  grid-column: 1 / -1;
  justify-self: center;
  position: relative;
  margin: 0 auto;
  /* Cap height at ~2/3 viewport; width follows aspect and stays within margins. */
  width: min(100%, calc(var(--hero-collage-max-h) * 16 / 9));
  max-height: var(--hero-collage-max-h);
  aspect-ratio: 16 / 9;
}

.case-study-hero-collage .hero-collage-item {
  position: absolute;
  display: block;
  height: auto;
  max-width: none;
  will-change: transform, opacity;
}

.case-study-hero-collage--tidepool .hero-collage-item--logo {
  top: 12%;
  left: 0;
  width: 48%;
  z-index: 3;
}

.case-study-hero-collage--tidepool .hero-collage-item--research {
  top: 0;
  right: 0;
  width: auto;
  height: 100%;
  z-index: 1;
}

.case-study-hero-collage--tidepool .hero-collage-item--outcome {
  left: 0;
  bottom: 34%;
  width: 40%;
  z-index: 2;
}

/* Alpine Modern hero collage — coffee + X left, film + theater right,
   Sundance frame bridging the center. */
.case-study-hero-collage--alpine .hero-collage-item--coffee {
  top: 0;
  left: 0;
  width: 42%;
  z-index: 2;
}

.case-study-hero-collage--alpine .hero-collage-item--rect {
  top: 2%;
  left: 24%;
  width: 42%;
  z-index: 4;
}

.case-study-hero-collage--alpine .hero-collage-item--film {
  top: 0;
  right: 1%;
  width: 32%;
  z-index: 3;
}

.case-study-hero-collage--alpine .hero-collage-item--theater {
  right: 0;
  bottom: 0;
  width: 52%;
  z-index: 2;
}

.case-study-hero-collage--alpine .hero-collage-item--x {
  left: 4%;
  bottom: 6%;
  width: 20%;
  z-index: 5;
}

html.js .case-study-hero-collage .hero-collage-item {
  opacity: 0.88;
  transform: translate3d(0, -1.75rem, 0);
}

html.js .case-study-hero-collage--tidepool .hero-collage-item--logo,
html.js .case-study-hero-collage--tidepool .hero-collage-item--outcome,
html.js .case-study-hero-collage--alpine .hero-collage-item--coffee,
html.js .case-study-hero-collage--alpine .hero-collage-item--x {
  transform: translate3d(-1.25rem, -1.75rem, 0);
}

html.js .case-study-hero-collage--tidepool .hero-collage-item--research,
html.js .case-study-hero-collage--alpine .hero-collage-item--film,
html.js .case-study-hero-collage--alpine .hero-collage-item--theater {
  transform: translate3d(1.5rem, -2rem, 0);
}

html.js .case-study-hero-collage--alpine .hero-collage-item--rect {
  transform: translate3d(0.85rem, -2.5rem, 0);
}

html.js .case-study-hero-collage.is-hero-settled .hero-collage-item,
html.js .case-study-hero-collage .hero-collage-item.is-layer-settled {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .case-study-hero-collage .hero-collage-item {
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

/* Tablet: keep the compact stack, slight size bump for readability. */
@media (max-width: 1024px) {
  .case-study-hero-collage {
    width: min(100%, calc(var(--hero-collage-max-h) * 16 / 10));
    aspect-ratio: 16 / 10;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--logo {
    top: 11%;
    width: 52%;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--research {
    top: 0;
    height: 100%;
    width: auto;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--outcome {
    bottom: 32%;
    width: 44%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--coffee {
    width: 46%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--rect {
    left: 24%;
    width: 42%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--film {
    width: 32%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--theater {
    width: 52%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--x {
    width: 18%;
  }
}

/* Phone: slightly taller frame still capped at 2/3 viewport. */
@media (max-width: 768px) {
  .case-study-hero-collage {
    width: min(100%, calc(var(--hero-collage-max-h) * 4 / 5));
    aspect-ratio: 4 / 5;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--logo {
    top: 10%;
    width: 78%;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--research {
    top: 0;
    right: 0;
    height: 100%;
    width: auto;
    max-width: 68%;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--outcome {
    left: 0;
    bottom: 28%;
    width: 78%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--coffee {
    top: 2%;
    left: 0;
    width: 58%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--rect {
    top: 4%;
    left: 18%;
    width: 52%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--film {
    top: 2%;
    right: 0;
    width: 40%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--theater {
    right: 0;
    bottom: 8%;
    width: 62%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--x {
    left: 2%;
    bottom: 10%;
    width: 22%;
  }
}

@media (max-width: 480px) {
  .case-study-hero-collage {
    width: min(100%, calc(var(--hero-collage-max-h) * 3 / 4));
    aspect-ratio: 3 / 4;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--logo {
    top: 9%;
    width: 84%;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--research {
    top: 0;
    height: 100%;
    width: auto;
    max-width: 72%;
  }

  .case-study-hero-collage--tidepool .hero-collage-item--outcome {
    bottom: 26%;
    width: 84%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--coffee {
    width: 62%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--rect {
    left: 14%;
    width: 58%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--film {
    width: 44%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--theater {
    width: 68%;
  }

  .case-study-hero-collage--alpine .hero-collage-item--x {
    width: 26%;
  }
}

.case-study-overview-meta {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: var(--grid-gutter);
}

.overview-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc((100% - (2 * var(--grid-gutter))) / 3);
}

.overview-meta-item dt {
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  color: var(--color-text-secondary);
}

.overview-meta-item dt::after {
  content: ":";
}

.overview-meta-item dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--color-text-primary);
  overflow-wrap: break-word;
}

.overview-meta-note {
  color: var(--color-text-secondary);
}

/* Tidepool case study: overview uses project navy with white type. */
.case-study--tidepool .case-study-overview {
  background: #0a0c1a;
  /* Soft black card shadow disappears on navy — deepen it so the lift reads. */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.case-study--tidepool .overview-meta-item dt,
.case-study--tidepool .overview-meta-item dd {
  color: #ffffff;
}

.case-study--tidepool .overview-meta-note {
  color: rgba(255, 255, 255, 0.7);
}

/* Alpine case study: overview uses project orange with white type. */
.case-study--alpine .case-study-overview {
  background: #f44b25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.case-study--alpine .overview-meta-item dt,
.case-study--alpine .overview-meta-item dd {
  color: #ffffff;
}

.case-study--alpine .overview-meta-note {
  color: rgba(255, 255, 255, 0.7);
}

.case-study-body {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--section-gap);
  align-items: start;
}

/* Text + the framework widget sit in the centered middle 6 columns (~50%),
   matching the body text measure. */
.case-study-body > .case-study-block,
.case-study-body > .case-study-block-text,
.case-study-body > .case-study-hero-line,
.case-study-body > .case-study-framework,
.case-study-body > .case-study-media-heading {
  grid-column: 4 / 10;
}

/* In-body media — full bleed on narrow screens, gradually inset on wide. */
.case-study-body > .case-study-media-center,
.case-study-body > .case-study-media-full,
.case-study-body > .case-study-placeholder {
  grid-column: 1 / -1;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: var(--case-study-media-width);
  max-width: 100%;
  margin-block: var(--space-4);
  margin-inline: auto;
  border-radius: 0;
  overflow: visible;
}

/* Radius lives on the media so captions sit outside the crop. */
.case-study-media-center:not(.case-study-collage-media):not(.case-study-media-hero) > :is(img, video),
.case-study-media-full > :is(img, video) {
  border-radius: clamp(0px, var(--case-study-media-inset), var(--radius-card));
}

.case-study-media-caption {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  color: #7A7A7A;
}

/* In-body highlight frame — 75% media width, native aspect, no crop. */
.case-study-body > .case-study-media-center.case-study-media-hero {
  aspect-ratio: auto;
  width: calc(var(--case-study-media-width) * 0.75);
  border-radius: clamp(0px, var(--case-study-media-inset), var(--radius-card));
  overflow: visible;
}

.case-study-media-center.case-study-media-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  margin-inline: 0;
  object-fit: contain;
  border-radius: clamp(0px, var(--case-study-media-inset), var(--radius-card));
}

/* In-body collage — free overlapping photos, no card crop. */
.case-study-body > .case-study-media-center.case-study-collage-media {
  overflow: visible;
  border-radius: 0;
}

.case-study-collage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* Family collage — shorter frame so the box hugs the overlapping portraits. */
.case-study-collage--family {
  aspect-ratio: 1320 / 763;
}

.case-study-collage-photo {
  position: absolute;
  border-radius: var(--radius-card);
  object-fit: cover;
  transform-origin: center center;
}

/* Family portraits — two-photo overlap, distinct from homepage tile layouts. */
.case-study-collage--family .case-study-collage-photo--pop {
  top: 8%;
  left: 8%;
  width: 46%;
  height: auto;
  transform: rotate(-5deg);
  z-index: 1;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-size='24'%3E%F0%9F%A5%A5%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

.case-study-collage--family .case-study-collage-photo--aunt {
  top: 18%;
  right: 6%;
  width: 48%;
  height: auto;
  transform: rotate(4deg);
  z-index: 2;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' font-size='24'%3E%F0%9F%A9%B9%3C/text%3E%3C/svg%3E") 16 16, pointer;
}

@media (max-width: 768px) {
  .case-study-collage--family .case-study-collage-photo--pop {
    left: 2%;
    width: 52%;
  }

  .case-study-collage--family .case-study-collage-photo--aunt {
    right: 2%;
    width: 54%;
  }
}

.case-study-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Extra breathing room before in-body section headers. */
.case-study-body > .case-study-block:has(> .case-study-block-title):not(:first-child) {
  margin-top: var(--space-4);
}

.case-study-block-title {
  font-family: var(--font-h1);
  font-size: var(--text-h1);
  font-weight: var(--weight-h1);
  line-height: 1.1;
  text-align: left;
}

/* Moodboard label — H2 type role, sits above full-bleed images. */
.case-study-media-heading {
  margin: 0;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  line-height: 1.1;
  text-align: left;
  color: var(--color-text-primary);
}

.case-study-block-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

.case-study-block--foundation {
  gap: var(--section-gap);
}

.case-study-foundation-part {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.case-study-subsection-title {
  margin: 0;
  font-family: var(--font-h2);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  line-height: 1.1;
  text-align: left;
  color: var(--color-text-primary);
}

.case-study-audience-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gutter);
  margin-block: var(--space-2);
}

.case-study-audience-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.5;
  text-align: left;
  color: var(--color-text-primary);
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.case-study-audience-card:hover {
  transform: scale(1.06);
  z-index: 1;
}

.case-study-audience-card-title {
  margin: 0;
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.case-study-audience-card-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

.case-study-label-groups--three {
  grid-template-columns: repeat(3, 1fr);
}

/* Standout one-line hero moment — Hero type role (Cambridge Regular Condensed). */
.case-study-hero-line {
  margin: 0;
  font-family: var(--font-hero);
  font-size: var(--text-hero);
  font-weight: var(--weight-hero);
  line-height: 1.1;
  text-align: left;
  color: var(--color-text-primary);
}

.case-study-feature {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.case-study-feature img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Placeholder for an asset that isn't ready yet. */
.case-study-placeholder {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 320px;
  padding: var(--space-4);
  background: rgba(10, 10, 10, 0.04);
  border: 1px dashed rgba(10, 10, 10, 0.25);
  border-radius: var(--radius-card);
}

.case-study-placeholder-label {
  max-width: 46ch;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text-secondary);
}

/* Wide placeholder for a future image carousel — 16:9 proportion. */
.case-study-placeholder-wide {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

/* Stat cards — copy-only surfaces matching the project overview card. */
.case-study-body > .case-study-stat-series {
  grid-column: 4 / 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.case-study-stat-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.case-study-stat-card:hover {
  transform: scale(1.06);
  z-index: 1;
}

.case-study-stat-card .case-study-stat-text {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

/* Full-bleed images fill the viewport width edge to edge. */
.case-study-media-center:not(.case-study-media-natural):not(.case-study-media-hero):not(.case-study-collage-media) img,
.case-study-media-full img,
.case-study-media-center .case-study-media-video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--case-study-media-max-h);
  margin-inline: auto;
}

/* Side-by-side in-body image pair. */
.case-study-body > .case-study-media-duo {
  grid-column: 1 / -1;
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gutter);
  width: var(--case-study-media-width);
  max-width: 100%;
  margin-block: var(--space-4);
  margin-inline: auto;
}

.case-study-media-duo-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: visible;
  border-radius: 0;
}

.case-study-media-duo-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(0px, var(--case-study-media-inset), var(--radius-card));
}

/* Assets with non–16:9 proportions — keep native aspect ratio, no max-height cap. */
.case-study-body > .case-study-media-center.case-study-media-natural {
  width: auto;
  max-width: var(--case-study-media-width);
  margin-inline: auto;
}

.case-study-media-center.case-study-media-natural img {
  display: block;
  width: auto;
  max-width: min(62%, calc(var(--case-study-media-width) * 0.62));
  height: auto;
  max-height: none;
  margin-inline: auto;
  border-radius: 0;
}

/* Brand framework widget — three cards (values / actions / traits) sharing the
   project overview's visual language: card surface, gold dot markers. */
.case-study-framework {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.framework-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.framework-card:hover {
  transform: scale(1.06);
  z-index: 1;
}

.framework-card-title {
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.framework-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.framework-list li {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.5;
  color: var(--color-text-primary);
}

.case-study-pager {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  align-items: center;
}

.case-study-pager-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  grid-column: 4 / 10;
  grid-row: 1;
  align-self: center;
  font-family: var(--font-h3);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  color: var(--color-text-primary);
  text-decoration: none;
}

.case-study-pager-link:not(.case-study-pager-link--next) {
  justify-self: start;
}

.case-study-pager-link--next {
  justify-self: end;
}

.case-study-pager-arrow {
  flex-shrink: 0;
  width: 0.85em;
  height: 0.85em;
}

.case-study-pager-link:hover,
.case-study-pager-link:focus-visible {
  color: var(--color-accent-blue);
}

/* ==========================================================================
   Responsive — desktop-first, scaling down
   ========================================================================== */

/* Tablet: 1024px and below */
@media (max-width: 1024px) {
  :root {
    --page-margin: var(--space-3);
    --section-gap: var(--space-6);
    --footer-gap: clamp(4rem, 12vh, 7rem);
  }

  /* Tablet: widen the centered text column to 8 of 12. */
  .case-study-body > .case-study-block,
  .case-study-body > .case-study-block-text,
  .case-study-body > .case-study-hero-line,
  .case-study-body > .case-study-framework,
  .case-study-body > .case-study-stat-series,
  .case-study-body > .case-study-media-heading,
  .case-study-overview,
  .case-study-headline-text,
  .case-study-subhead,
  .case-study-intro,
  .case-study-pager-link,
  .about-page .about-heading,
  .about-page .about-content,
  .faq-page .help-heading,
  .faq-page .help-subheading,
  .faq-page .faq-list {
    grid-column: 3 / 11;
  }
}

/* Phone: 768px and below */
@media (max-width: 768px) {
  :root {
    --page-margin: var(--space-2);
  }

  /* Phone: text spans the full content width. */
  .case-study-body > .case-study-block,
  .case-study-body > .case-study-block-text,
  .case-study-body > .case-study-hero-line,
  .case-study-body > .case-study-framework,
  .case-study-body > .case-study-stat-series,
  .case-study-body > .case-study-media-heading,
  .case-study-overview,
  .case-study-headline-text,
  .case-study-subhead,
  .case-study-intro,
  .case-study-pager-link,
  .about-page .about-heading,
  .about-page .about-content,
  .faq-page .help-heading,
  .faq-page .help-subheading,
  .faq-page .faq-list {
    grid-column: 1 / -1;
  }

  .case-study-body > .case-study-media-duo {
    grid-template-columns: 1fr;
  }

  /* Stack pager links so long labels don’t overlap; keep edge alignment. */
  .case-study-pager {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .case-study-pager-link {
    grid-column: auto;
  }

  .case-study-pager-link:not(.case-study-pager-link--next) {
    align-self: flex-start;
  }

  .case-study-pager-link--next {
    align-self: flex-end;
  }

  /* Header stays a row: logo left, hamburger right */
  .nav-toggle {
    display: flex;
  }

  /* Nav becomes a slide-out panel from the right (1/3 width) */
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 300;
    width: 33.3333%;
    height: 100%;
    padding: var(--header-height) var(--page-margin) var(--space-4);
    background: var(--color-bg);
    transform: translateX(100%);
    transition: transform 0.3s ease, background-color 700ms ease;
    overflow-y: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .nav-list a {
    font-family: var(--font-h3);
    font-size: var(--text-h3);
    font-weight: var(--weight-h3);
  }

  /* Dimmed overlay of the page behind the panel (remaining 1/3) */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  /* Open state (toggled via JS on <body>) */
  body.nav-open .site-nav {
    transform: translateX(0);
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
  }

  .case-study-list {
    grid-template-columns: 1fr;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  /* Stacked: no text column to match, so give the portrait its own ratio. */
  .about-portrait {
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .case-study-overview {
    padding: var(--space-4);
  }

  .case-study-overview-meta {
    flex-direction: column;
    gap: var(--space-3);
  }

  .overview-meta-item {
    max-width: none;
  }

  .case-study-framework {
    grid-template-columns: 1fr;
  }

  .case-study-audience-groups {
    grid-template-columns: 1fr;
  }

  .case-study-label-groups--three {
    grid-template-columns: 1fr;
  }

  .recipe-ingredients {
    grid-template-columns: 1fr;
  }

  .cause {
    grid-template-columns: 1fr;
  }

  .case-study-hero {
    display: flex;
    flex-direction: column;
  }

  .site-footer {
    --footer-logo-width: min(320px, 78vw);
    --footer-logo-bleed-y: 0.14;
    padding-right: var(--space-4);
  }

  .footer-bar {
    padding-left: var(--space-4);
    gap: var(--space-4);
  }

  .footer-logo {
    transform: translate(-3.06%, calc(var(--footer-logo-bleed-y) * 100%));
  }
}
