/* Case study (case-study-split-light) — edit case-study.html */

:root {
  --page: #eceef4;
  --panel: #f2f3f7;
  --surface: #08071f;
  --text: #08071f;
  --text-muted: #6b7280;
  --text-body: #4b5563;
  --border: #e5e7eb;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --cta: #50a2ff;
  --cta-hover: #7bb8ff;
  --container: 72rem;
  --carousel-gap: 3rem;
  --carousel-interval: 5000;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.compare-bar {
  background: #ede8f7;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  color: #4b5563;
  text-align: center;
}

.compare-bar a {
  color: var(--surface);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.compare-bar a:hover {
  color: var(--cta);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 4rem;
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .site-nav {
    height: 4.5rem;
  }
}

.site-nav .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.brand {
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-context {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 639px) {
  .nav-context {
    display: none;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-desktop a {
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-desktop a:hover {
  color: var(--cta);
}

.nav-mobile {
  display: block;
}

@media (min-width: 768px) {
  .nav-mobile {
    display: none;
  }
}

.nav-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.nav-mobile summary::-webkit-details-marker {
  display: none;
}

.nav-mobile summary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-mobile[open] summary {
  background: rgba(0, 0, 0, 0.05);
}

.nav-mobile-panel {
  position: absolute;
  top: 4rem;
  right: 0;
  left: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

@media (min-width: 768px) {
  .nav-mobile-panel {
    display: none;
  }
}

.nav-mobile-panel a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 1.125rem;
}

.nav-mobile-panel a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--cta);
}

.page-wrap {
  margin-top: -4rem;
}

@media (min-width: 768px) {
  .page-wrap {
    margin-top: -4.5rem;
  }
}

/* Split hero — text left, media right */
.split-hero {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.split-hero .container {
  padding-top: 4rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .split-hero .container {
    padding-top: 4.5rem;
    padding-bottom: 3.5rem;
  }
}

.split-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .split-hero__grid {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .eyebrow {
    font-size: 0.875rem;
  }
}

.split-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
}

.split-hero__subtitle {
  margin: 1rem 0 0;
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--text-body);
}

@media (min-width: 1024px) {
  .split-hero__subtitle {
    font-size: 1.25rem;
  }
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 1.5rem 0 0;
}

.meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta dd {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.split-hero__media {
  aspect-ratio: 7 / 8;
  max-width: 28rem;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
}

@media (min-width: 1024px) {
  .split-hero__media {
    margin: 0;
    max-width: none;
  }
}

.split-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

@media (prefers-reduced-motion: reduce) {
  .split-hero__media img {
    opacity: 1;
  }
}

.intro {
  background: linear-gradient(to bottom, #fafafc, var(--panel));
}

.intro .container {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 1024px) {
  .intro .container {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }
}

.intro p {
  margin: 0;
  max-width: 42rem;
  font-size: 1.125rem;
  color: var(--text-body);
  line-height: 1.65;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.stats strong {
  display: block;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  font-weight: 600;
}

.stats span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.section {
  border-top: 1px solid var(--border);
}

.section .container {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 1024px) {
  .section .container {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

.section h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 600;
}

.section p {
  margin: 0 0 1rem;
  max-width: 42rem;
  color: var(--text-body);
  line-height: 1.65;
}

.section p:last-child {
  margin-bottom: 0;
}

.text-block p + p {
  margin-top: 1.25rem;
}

.visual-frame {
  overflow: hidden;
  background: transparent;
}

.visual-frame--cinema {
  aspect-ratio: 21 / 9;
}

.visual-frame--wide {
  aspect-ratio: 5 / 2;
}

.visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.caption {
  margin: 1rem 0 0;
  max-width: 42rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }

  .split--image-right .split__text {
    order: 1;
  }

  .split--image-right .split__media {
    order: 2;
  }

  .split--image-left .split__text {
    order: 2;
  }

  .split--image-left .split__media {
    order: 1;
  }
}

.split__media {
  aspect-ratio: 4 / 5.25 ;
  overflow: hidden;
  background: transparent;
}

.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.bullets {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.bullets li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-body);
}

.bullets li::before {
  content: "";
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--cta);
}

.callout {
  background: linear-gradient(to right, #ede8f7, #e3eef9);
}

.callout blockquote {
  margin: 0;
  max-width: 56rem;
}

.callout p {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--surface);
}

.callout footer {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: transparent;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.outcome-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .outcome-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.outcome-cards li {
  border: 1px solid var(--border);
  background: #fff;
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .outcome-cards li {
    padding: 1.75rem;
  }
}

.outcome-cards h3 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.outcome-cards p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
}

/* More work — carousel */
.work-carousel {
  border-top: 1px solid var(--border);
  background: var(--page);
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 1024px) {
  .work-carousel {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

.work-carousel__header {
  margin-bottom: 2rem;
}

.work-carousel__header h2 {
  margin: 0;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  font-weight: 600;
}

.work-carousel__header p {
  margin: 0.5rem 0 0;
  max-width: 36rem;
  color: var(--text-body);
}

.work-carousel__viewport {
  position: relative;
}

.work-carousel__track-wrap {
  overflow: hidden;
}

.work-carousel__track {
  display: flex;
  gap: var(--carousel-gap);
  padding-left: 1rem;
  will-change: transform;
  transition: transform 0.5s ease-out;
}

@media (min-width: 640px) {
  .work-carousel__track {
    padding-left: 1.5rem;
  }
}

@media (min-width: 768px) {
  .work-carousel__track {
    padding-left: 2rem;
  }
}

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

.work-carousel__slide {
  flex: 0 0 min(60rem, calc(100vw - 5rem));
  width: min(60rem, calc(100vw - 5rem));
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--surface);
  box-shadow: 0 4px 12px rgba(8, 7, 31, 0.08);
  cursor: pointer;
}

.carousel-btn:hover {
  color: var(--cta);
}

.carousel-btn--prev {
  left: 0.5rem;
}

.carousel-btn--next {
  right: 0.5rem;
}

.carousel-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.work-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.work-carousel__dots li {
  display: flex;
}

.work-carousel__dots button {
  width: 0.625rem;
  height: 0.625rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: #d1d5db;
  cursor: pointer;
}

.work-carousel__dots button:hover {
  background: #9ca3af;
}

.work-carousel__dots button[aria-current="true"] {
  background: var(--surface);
}

/* Portfolio card (matches React WorkCard layout) */
.portfolio-card {
  display: block;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 8px 30px rgba(8, 7, 31, 0.06);
  transition: box-shadow 0.3s ease;
}

.portfolio-card:hover {
  box-shadow: 0 12px 40px rgba(8, 7, 31, 0.09);
}

.portfolio-card__grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .portfolio-card__grid {
    grid-template-columns: 1fr 1fr;
    min-height: 22rem;
  }
}

.portfolio-card__media {
  position: relative;
  min-height: 12rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .portfolio-card__media {
    min-height: 22rem;
  }
}

.portfolio-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.portfolio-card__body {
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .portfolio-card__body {
    min-height: 22rem;
    padding: 2rem 2.5rem;
  }
}

.portfolio-card__copy {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .portfolio-card__copy {
    margin-top: auto;
    margin-bottom: 1.5rem;
  }
}

.portfolio-card__copy h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 1024px) {
  .portfolio-card__copy h3 {
    font-size: 1.75rem;
  }
}

.portfolio-card__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.portfolio-card__desc {
  margin: 0.75rem 0 0;
  min-height: 4.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
}

.portfolio-card__footer {
  flex-shrink: 0;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
}

.portfolio-card__footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .portfolio-card__footer-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.portfolio-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 0;
}

.portfolio-card__stats div {
  margin: 0;
}

.portfolio-card__stats strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

.portfolio-card__stats span {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
}

.portfolio-card__cta {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.portfolio-card:hover .portfolio-card__cta {
  color: var(--cta);
}

.page-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.page-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .page-footer .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.page-footer__label {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.page-footer__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn--ghost {
  border: 1px solid var(--cta);
  color: var(--surface);
}

.btn--ghost:hover {
  background: rgba(80, 162, 255, 0.08);
}

.btn--primary {
  background: var(--cta);
  color: #fff;
}

.btn--primary:hover {
  background: var(--cta-hover);
}

/* Intro + scroll animations — see js/case-study-intro.js */
@media (prefers-reduced-motion: no-preference) {
  /* Hidden until JS adds cs-animate-ready; hands off to .cs-reveal animations */
  html:not(.cs-animate-ready) [data-cs-animate="hero"] .eyebrow,
  html:not(.cs-animate-ready) [data-cs-animate="hero"] h1,
  html:not(.cs-animate-ready) [data-cs-animate="hero"] .split-hero__subtitle,
  html:not(.cs-animate-ready) [data-cs-animate="hero"] .meta > div,
  html:not(.cs-animate-ready) [data-cs-animate="intro"] > .container > p,
  html:not(.cs-animate-ready) [data-cs-animate="intro"] .stats {
    opacity: 0;
  }

  /* Hero image: stay hidden until loaded, then one transition (not keyframed) */
  .split-hero__media img {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .split-hero__media.cs-media-ready img {
    opacity: 1;
  }

  html.cs-animate-ready .cs-reveal.cs-fade-up {
    opacity: 0;
    animation: cs-fade-up var(--cs-duration, 0.55s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--cs-delay, 0s);
  }

  html.cs-animate-ready .cs-reveal.cs-fade-up-soft {
    opacity: 0;
    animation: cs-fade-up-soft var(--cs-duration, 0.5s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--cs-delay, 0s);
  }

  [data-cs-animate="callout"]:not(.cs-inview) .cs-reveal {
    opacity: 0;
  }

  [data-cs-animate="callout"].cs-inview .cs-reveal.cs-fade-up-soft {
    opacity: 0;
    animation: cs-fade-up-soft var(--cs-duration, 0.5s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--cs-delay, 0s);
  }
}

@keyframes cs-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cs-fade-up-soft {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
