/* Wavva case study — Apex system adapted to a sparse editorial case-study flow */
.case-study-page {
  overflow-x: clip;
  background: var(--paper);
  color: var(--obsidian)
}
.case-study-page main { overflow: clip }
.case-study-page header.nav .logo img { display: block; flex: none; width: 40px; height: 40px; margin: -7px }
.case-study-page header.nav .nav-links a[aria-current="page"] { color: #fff }
.case-study-page footer { background: var(--forest-deep) }
.case-container { width: min(calc(100% - 64px), 1040px); margin-inline: auto }

.case-hero { padding-top: 150px; padding-bottom: 78px }
.case-back { margin-bottom: 58px; line-height: 1.2 }
.case-back a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .13em
}
.case-back a > span {
  display: inline-flex;
  flex: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(8, 65, 46, .32);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .34s var(--ease)
}
.case-back a .icon-arrow { width: 16px; height: 16px }
/* The ring carries the hover shift; the icon stays centered inside it. */
.case-back a:hover .icon-arrow,
.case-back a:focus-visible .icon-arrow { transform: none }
.case-back a:hover { color: var(--forest-deep) }
.case-back a:hover > span,
.case-back a:focus-visible > span {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--snow);
  transform: translateX(-3px)
}
.case-hero h1 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(54px, 8vw, 108px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: -.04em
}
/* Editorial standfirst: deliberately small against the display h1 and set in
   the local SF Pro Text face (fonts.css) so it reads as annotation, not echo. */
.case-deck {
  max-width: 38ch;
  margin-top: 30px;
  color: var(--iron);
  font-family: 'SF Pro Text Web', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: .01em;
  text-wrap: balance
}
.case-deck::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-bottom: 20px;
  background: var(--forest)
}
.case-hero__meta {
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  gap: 48px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid #d8d8d8
}
.case-label { margin: 0 0 12px; color: var(--fog); font-size: 12px; font-weight: 500; line-height: 1.2; text-transform: uppercase; letter-spacing: .08em }
.case-pills { display: flex; flex-wrap: wrap; gap: 7px }
.case-pills span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--forest);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--forest);
  font-size: 11px;
  line-height: 1
}
.case-meta-copy { max-width: 24ch; color: var(--steel); font-size: 14px; line-height: 1.45 }

.case-media {
  overflow: hidden;
  margin: 0;
  border-radius: 14px;
  background: #e6e5e0
}
.case-media img { display: block; width: 100%; height: 100%; object-fit: cover }
.case-media--hero,
.case-media--wide { width: min(calc(100% - 40px), 1200px); margin-inline: auto; aspect-ratio: 16 / 9 }
.case-media--portrait { width: min(calc(100% - 40px), 760px); margin-inline: auto; aspect-ratio: 4 / 5 }
.case-media--hero img { object-position: 50% 43% }
.case-media--wide img { object-position: 50% 38% }
.case-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(calc(100% - 40px), 1200px);
  margin-inline: auto
}
.case-pair .case-media { aspect-ratio: 4 / 5 }

.case-copy,
.case-system {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(48px, 9vw, 130px);
  padding-top: 150px;
  padding-bottom: 150px
}
.case-copy h2,
.case-system h2,
.case-more h2 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.03em
}
.case-copy > div { max-width: 50ch }
.case-copy p { color: var(--steel); font-size: 16px; line-height: 1.6 }
.case-copy p + p { margin-top: 22px }
.case-disclosure { color: var(--fog) !important; font-size: 12px !important; line-height: 1.5 !important }
.case-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px }
.case-metrics article { display: flex; flex-direction: column; gap: 12px }
.case-metrics strong {
  color: var(--obsidian);
  font-size: clamp(72px, 9vw, 122px);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.045em
}
.case-metrics span { max-width: 19ch; color: var(--steel); font-size: 14px; line-height: 1.4 }

.case-thesis {
  margin: 150px 0;
  padding: 130px 0 !important;
  background: var(--forest);
  color: var(--snow)
}
.case-thesis .case-container { display: grid; grid-template-columns: 1.35fr .65fr; gap: 72px; align-items: end }
.case-thesis p {
  margin: 0;
  font-size: clamp(48px, 6.8vw, 92px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em
}
.case-thesis span { max-width: 36ch; color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.55 }

.case-more { display: flex; align-items: baseline; justify-content: space-between; gap: 30px; padding-top: 150px; padding-bottom: 150px }
.case-more a { color: var(--forest); font-size: 15px; text-decoration: underline; text-underline-offset: 5px }
.case-more a:hover { text-decoration-thickness: 2px }
.case-more a:focus-visible,
.case-back a:focus-visible,
.case-cta__button:focus-visible { outline: 3px solid rgba(94,178,139,.6); outline-offset: 5px }

.case-cta { padding: 128px 0 !important; background: var(--forest); color: var(--snow) }
.case-cta .case-label { color: rgba(255,255,255,.62) }
.case-cta h2 {
  max-width: 15ch;
  margin: 0;
  color: var(--snow);
  font-size: clamp(44px, 6vw, 78px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.035em
}
.case-cta p:not(.case-label) { max-width: 46ch; margin-top: 24px; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.5 }
.case-cta__button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  margin-top: 34px;
  border-radius: 999px;
  background: var(--snow);
  color: var(--forest);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform .22s var(--ease), background-color .22s ease
}
.case-cta__button:hover { transform: translateY(-2px); background: #eff6f2 }
.case-footer { padding-top: 72px }
.case-footer .foot { display: block; max-width: 1200px; margin-inline: auto }
.case-footer .foot > div { max-width: 420px }
.case-footer .logo { gap: 8px; color: var(--snow) }
.case-footer .logo img { width: 26px; height: 26px; filter: invert(1) }
.case-footer .tagline,
.case-footer .copyright { color: rgba(255,255,255,.62) }
.case-footer .legal-links a { color: rgba(255,255,255,.72) }

/* ─── motion ──────────────────────────────────────────────────────
   html.case-motion is added by an inline head script only when JS runs
   and reduced motion is off, so without JS everything renders visible.
   First-load hero sequence is pure CSS; scroll reveals stage content
   with .is-pending, added by case-study.js in the same tick the
   IntersectionObserver starts watching, and only below the fold. */
html.case-motion .case-hero .case-back,
html.case-motion .case-hero h1,
html.case-motion .case-hero .case-deck,
html.case-motion .case-hero__meta,
html.case-motion .case-media--hero {
  animation: case-enter .9s var(--ease) both;
  animation-delay: var(--case-enter-delay, .05s)
}
html.case-motion .case-hero h1 { --case-enter-delay: .13s }
html.case-motion .case-hero .case-deck { --case-enter-delay: .22s }
html.case-motion .case-hero__meta { --case-enter-delay: .32s }
html.case-motion .case-media--hero { --case-enter-delay: .4s }
html.case-motion .case-media--hero img { animation: case-settle 1.5s var(--ease) .4s both }
/* A route arrival stays fully covered by the shared wipe. Pause the hero
   choreography under that cover, then let it begin only after the wipe exits;
   otherwise the destination can expose a half-finished opacity frame. */
html.apex-transition-arrival.case-motion .case-hero .case-back,
html.apex-transition-arrival.case-motion .case-hero h1,
html.apex-transition-arrival.case-motion .case-hero .case-deck,
html.apex-transition-arrival.case-motion .case-hero__meta,
html.apex-transition-arrival.case-motion .case-media--hero,
html.apex-transition-arrival.case-motion .case-media--hero img { animation-play-state: paused }
@keyframes case-enter {
  from { opacity: 0; transform: translateY(22px) }
  to { opacity: 1; transform: none }
}
@keyframes case-settle {
  from { transform: scale(1.045) }
  to { transform: none }
}

/* unit reveals (solitary media figures) */
html.case-motion .case-media.case-reveal.is-pending:not(.is-visible) { opacity: 0; transform: translateY(26px) }
html.case-motion .case-media.case-reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .65s ease, transform .9s var(--ease)
}

/* staggered reveals: parents stay static, direct children carry the rise */
html.case-motion .case-pair.is-pending:not(.is-visible) > .case-media,
html.case-motion .case-copy.is-pending:not(.is-visible) > *,
html.case-motion .case-system.is-pending:not(.is-visible) > h2,
html.case-motion .case-system.is-pending:not(.is-visible) .case-metrics article,
html.case-motion .case-thesis.is-pending:not(.is-visible) .case-container > *,
html.case-motion .case-more.is-pending:not(.is-visible) > *,
html.case-motion .case-cta.is-pending:not(.is-visible) .case-container > * {
  opacity: 0;
  transform: translateY(24px)
}
html.case-motion .case-pair.is-visible > .case-media,
html.case-motion .case-copy.is-visible > *,
html.case-motion .case-system.is-visible > h2,
html.case-motion .case-system.is-visible .case-metrics article,
html.case-motion .case-thesis.is-visible .case-container > *,
html.case-motion .case-more.is-visible > *,
html.case-motion .case-cta.is-visible .case-container > * {
  opacity: 1;
  transform: none;
  transition: opacity .65s ease, transform .9s var(--ease);
  transition-delay: var(--case-stagger, 0s)
}
html.case-motion .case-pair.is-visible > .case-media + .case-media,
html.case-motion .case-copy.is-visible > h2 + div,
html.case-motion .case-system.is-visible .case-metrics article,
html.case-motion .case-thesis.is-visible .case-container > p + span,
html.case-motion .case-more.is-visible > h2 + a { --case-stagger: .12s }
html.case-motion .case-system.is-visible .case-metrics article + article { --case-stagger: .22s }
html.case-motion .case-cta.is-visible .case-container > :nth-child(2) { --case-stagger: .1s }
html.case-motion .case-cta.is-visible .case-container > :nth-child(3) { --case-stagger: .2s }
html.case-motion .case-cta.is-visible .case-container > :nth-child(4) { --case-stagger: .3s }

/* clipped image settle on revealed media */
html.case-motion .case-media.case-reveal.is-pending:not(.is-visible) img,
html.case-motion .case-pair.is-pending:not(.is-visible) .case-media img { transform: scale(1.045) }
html.case-motion .case-media.case-reveal.is-visible img,
html.case-motion .case-pair.is-visible .case-media img {
  transform: none;
  transition: transform 1.3s var(--ease);
  transition-delay: var(--case-stagger, 0s)
}

@media (max-width: 900px) {
  .case-study-page header.nav .nav-cta { font-size: 0 }
  .case-study-page header.nav .nav-cta::after { content: "Free concepts"; font-size: 12px }
  .case-container { width: min(calc(100% - 40px), 1040px) }
  .case-hero { padding-top: 126px; padding-bottom: 58px }
  .case-back { margin-bottom: 42px }
  .case-hero__meta { grid-template-columns: 1fr; gap: 28px; margin-top: 44px }
  .case-media--hero,
  .case-media--wide,
  .case-pair { width: calc(100% - 24px) }
  .case-copy,
  .case-system { grid-template-columns: 1fr; gap: 38px; padding-top: 100px; padding-bottom: 100px }
  .case-thesis { margin: 100px 0; padding: 96px 0 !important }
  .case-thesis .case-container { grid-template-columns: 1fr; gap: 40px }
}

@media (max-width: 620px) {
  .case-container { width: calc(100% - 32px) }
  .case-hero { padding-top: 112px; padding-bottom: 48px }
  .case-back { margin-bottom: 34px }
  .case-deck { max-width: 34ch; margin-top: 24px; font-size: 17px }
  .case-deck::before { margin-bottom: 16px }
  .case-back a > span { width: 31px; height: 31px }
  .case-hero__meta { margin-top: 36px; padding-top: 20px }
  .case-pills span { min-height: 28px; padding: 5px 10px }
  .case-media { border-radius: 9px }
  .case-media--hero { aspect-ratio: 4 / 5 }
  .case-media--hero img { object-position: 50% 47% }
  .case-media--wide { aspect-ratio: 4 / 5 }
  .case-pair { grid-template-columns: 1fr; gap: 10px }
  .case-copy,
  .case-system { padding-top: 78px; padding-bottom: 78px }
  .case-copy p { font-size: 15px }
  .case-metrics { gap: 20px }
  .case-metrics strong { font-size: 68px }
  .case-thesis { margin: 78px 0; padding: 78px 0 !important }
  .case-thesis p { font-size: 46px }
  .case-more { flex-direction: column; align-items: flex-start; padding-top: 90px; padding-bottom: 90px }
  .case-cta { padding: 88px 0 !important }
  .case-footer { padding-top: 56px }
}

@media (prefers-reduced-motion: reduce) {
  html.case-motion .case-reveal,
  html.case-motion .case-reveal *,
  html.case-motion .case-hero .case-back,
  html.case-motion .case-hero h1,
  html.case-motion .case-hero .case-deck,
  html.case-motion .case-hero__meta,
  html.case-motion .case-media--hero,
  html.case-motion .case-media--hero img {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important
  }
  .case-cta__button,
  .case-back a > span { transition: none }
}
