/* =========================================================
   Case study — shared layout across all case-study pages
   ========================================================= */

/* ---------- Study hero ---------- */
.cs-hero {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 84px var(--gutter) 0;
}
.cs-hero__eyebrow {
  font-family: var(--font-accent);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
}
.cs-hero__eyebrow--accent { color: var(--accent); }

.cs-hero__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(38px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.cs-hero__subtitle {
  margin: 24px 0 0;
  font-size: clamp(21px, 2.7vw, 32px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 600;
  max-width: 34ch;
  color: var(--ink);
}
.cs-hero__lede {
  margin: 24px 0 0;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 58ch;
}

/* Meta row */
.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  margin: 50px 0 56px;
}
.cs-meta__label {
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.cs-meta__value { font-size: 15.5px; font-weight: 600; }
.cs-meta__value--accent { color: var(--accent); }

/* Hero image container */
.cs-hero__image {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px rgba(20, 16, 12, 0.16);
  background: #F4E3C8;
}
.cs-hero__image img { width: 100%; height: auto; display: block; }

/* Browser chrome */
.browser-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px rgba(20, 16, 12, 0.16);
  background: #fff;
}
.browser-frame__bar {
  height: 40px;
  background: #F1EEE7;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
}
.browser-frame__dot { width: 11px; height: 11px; border-radius: 50%; }
.browser-frame__dot--red    { background: #E5685C; }
.browser-frame__dot--yellow { background: #E8B84B; }
.browser-frame__dot--green  { background: #4FB06A; }
.browser-frame__url {
  margin-left: 16px;
  flex: 1;
  max-width: 340px;
  height: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex; align-items: center;
  padding: 0 14px;
  font-family: var(--font-accent);
  font-size: 11px;
  color: var(--ink-faint);
}
.browser-frame__image { width: 100%; display: block; cursor: zoom-in; }

/* Two-column section (label + content) */
.cs-sec {
  max-width: var(--study-max);
  margin: 0 auto;
  padding: 104px var(--gutter) 0;
}
.cs-sec--compact { padding-top: 96px; }
.cs-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 50px;
  align-items: start;
}

/* Generic 2-column and 3-column layouts */
.cs-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cs-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Typography helpers */
.cs-h2 {
  margin: 0 0 22px;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.02;
  max-width: 20ch;
}
.cs-h2--sm {
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 24ch;
  margin-bottom: 18px;
}
.cs-p {
  margin: 0 0 26px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-secondary);
  max-width: 60ch;
}
.cs-quote {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
  max-width: 34ch;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

/* Numbered problem/friction cards */
.point-card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
}
.point-card--lg { padding: 26px 28px; }
.point-card__num {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}
.point-card__title { font-size: 16px; font-weight: 700; }
.point-card__title--lg { font-size: 17px; margin-bottom: 6px; }
.point-card__desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.point-card--danger .point-card__num { color: var(--danger); }

/* Reflection block (light) */
.reflection {
  margin-top: 104px;
  background: var(--bg);
  color: var(--ink);
  border-top: 1px solid var(--border);
}
.reflection__inner {
  max-width: var(--study-max);
  margin: 0 auto;
  padding: 96px var(--gutter);
}
.reflection__eyebrow {
  font-family: var(--font-accent);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 30px;
}
.reflection__title {
  margin: 0 0 26px;
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.reflection p {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-secondary);
  max-width: 62ch;
}
.reflection p:last-child { margin-bottom: 0; }

/* Results block (light) */
.results {
  background: var(--bg-alt);
  color: var(--ink);
  border-top: 1px solid var(--border);
}
.results__inner {
  max-width: var(--study-max);
  margin: 0 auto;
  padding: 96px var(--gutter);
}
.results__eyebrow {
  font-family: var(--font-accent);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 40px;
}
.results__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
}
.review-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 30px 28px;
}
.review-card__stars {
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 14px;
}
.review-card__quote {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
}

.stats-row {
  margin-top: 46px;
  display: flex; flex-wrap: wrap;
  gap: 30px 64px; align-items: baseline;
}
.stat__number {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat__number--accent { color: var(--accent); }
.stat__label {
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 10px;
}

/* -----------------------------------------------------------
   Case-study bottom navigation — prev/next links.

   Layout uses flexbox; if only one link exists, it aligns to
   its natural side (prev → left, next → right via margin-left:auto).
   ----------------------------------------------------------- */
.case-nav {
  max-width: var(--study-max);
  margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.case-nav__link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 12px;
  transition: background 0.18s;
  flex: 1 1 0;
  min-width: 0;
}
.case-nav__link:hover { background: var(--bg-warm); }
.case-nav__link--next {
  margin-left: auto;
  justify-content: flex-end;
  text-align: right;
}
.case-nav__body { min-width: 0; }
.case-nav__eyebrow {
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.case-nav__title {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.case-nav__arrow {
  font-size: 34px;
  color: var(--accent);
  flex: none;
  line-height: 1;
}

@media (max-width: 640px) {
  .case-nav {
    flex-direction: column;
    gap: 12px;
    padding: 32px 18px;
  }
  .case-nav__link {
    padding: 18px 20px;
    border: 1px solid var(--border);
  }
  .case-nav__link--next { margin-left: 0; }
}

/* Phone-frame mock */
.phone-frame {
  position: relative;
  aspect-ratio: 1350/2760;
  flex: none;
}
.phone-frame__img {
  position: absolute;
  top: 2.6%; left: 5%;
  width: 90%; height: 94.8%;
  object-fit: cover;
  border-radius: 11% / 5.4%;
  cursor: zoom-in;
}
.phone-frame__overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Before / After compare boxes */
.compare-box {
  border-radius: 12px;
  padding: 26px 24px;
  border: 1px solid;
}
.compare-box--before {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.compare-box--after {
  background: var(--success-bg);
  border-color: var(--success-border);
}
.compare-box__label {
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.compare-box--before .compare-box__label { color: var(--danger); }
.compare-box--after  .compare-box__label { color: var(--success); }

.step-caption {
  margin-top: 10px;
  font-family: var(--font-accent);
  font-size: 10.5px;
  text-align: center;
}
.step-caption--before { color: #9A5A50; }
.step-caption--after  { color: #5E7A60; }

/* Dark showcase box */
.dark-box {
  border-radius: 12px;
  background: var(--dark-deep);
  border: 1px solid var(--dark-border);
  padding: 38px 34px 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.dark-box__caption {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--dark-text-faint);
  text-align: center;
  max-width: 26ch;
}
.dark-box__caption--strong { color: var(--dark-text-mute); }
.dark-box__footer {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-accent);
  font-size: 11.5px;
  color: #8C8476;
  letter-spacing: 0.04em;
  padding-top: 6px;
  border-top: 1px solid #242426;
}

/* Dark mode / gamification card */
.mode-card {
  background: var(--dark-deep);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 30px 28px;
}
.mode-card--sm { padding: 28px 22px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.mode-card__row { display: flex; gap: 24px; align-items: center; }
.mode-card__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--bg); }
.mode-card__title--sm { font-size: 18px; margin-bottom: 6px; }
.mode-card__desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--dark-text-faint); }
.mode-card__desc--sm { font-size: 13.5px; line-height: 1.55; text-align: center; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 8, 5, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.lightbox__btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.18s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox__btn--prev { left: 24px; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 28px; }
.lightbox__btn--next { right: 24px; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 28px; }
.lightbox__btn--close { top: 22px; right: 26px; width: 42px; height: 42px; font-size: 18px; }

/* Password gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate.is-unlocked { display: none; }
.cs-gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 40px 90px rgba(20, 16, 12, 0.2);
  padding: 46px 42px;
  text-align: center;
}
.gate__lock {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--dark-deep);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 22px;
}
.gate__eyebrow {
  font-family: var(--font-accent);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.gate__title {
  margin: 0 0 12px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.gate__desc {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.gate__input {
  width: 100%;
  padding: 15px 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
  text-align: center;
  letter-spacing: 0.04em;
  font-family: inherit;
}
.gate__input:focus { border-color: var(--accent); }
.gate__error {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--danger);
  font-family: var(--font-accent);
  display: none;
}
.gate__error.is-visible { display: block; }
.gate__btn {
  margin-top: 20px;
  width: 100%;
  cursor: pointer;
  background: var(--dark-deep);
  color: var(--bg);
  border: none;
  font-weight: 600;
  font-size: 16px;
  padding: 15px;
  border-radius: 10px;
  transition: background 0.18s;
}
.gate__btn:hover { background: #2A251F; }
.gate__link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.18s;
}
.gate__link:hover { color: var(--accent); }

/* Carousel */
.carousel {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(20, 16, 12, 0.12);
  background: #fff;
}
.carousel__track {
  display: flex;
  transition: transform 0.5s var(--ease-out);
}
.carousel__slide {
  width: 100%;
  flex: none;
  display: block;
  cursor: zoom-in;
}
.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.carousel-header__eyebrow {
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.carousel-controls { display: flex; align-items: center; gap: 14px; }
.carousel-label {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.carousel-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.18s, border-color 0.18s;
}
.carousel-btn:hover { background: var(--bg); border-color: var(--accent); }
.carousel-btn--primary {
  border-color: var(--ink);
  background: var(--dark-deep);
  color: var(--bg);
}
.carousel-btn--primary:hover { background: #2A251F; }

.carousel-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 18px;
}
.carousel-dot {
  height: 7px;
  width: 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--border-strong);
  border: none;
  padding: 0;
}
.carousel-dot.is-active {
  width: 22px;
  background: var(--dark-deep);
}

/* ---------- Responsive (mirrors the source design) ---------- */
@media (max-width: 900px) {
  .cs-hero {
    padding-left: 24px; padding-right: 24px;
    padding-top: 56px;
  }
  .cs-sec {
    padding-left: 24px; padding-right: 24px;
    padding-top: 64px;
  }
  .cs-sec2 { padding-left: 24px; padding-right: 24px; }
  .cs-row { grid-template-columns: 1fr; gap: 14px; }
  .cs-3col { grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .cs-hero {
    padding-left: 18px; padding-right: 18px;
    padding-top: 44px;
  }
  .cs-sec {
    padding-left: 18px; padding-right: 18px;
    padding-top: 48px;
  }
  .cs-sec2 { padding: 48px 18px; }
  .cs-2col { grid-template-columns: 1fr; gap: 16px; }
  .cs-3col { grid-template-columns: 1fr; gap: 16px; }
  .cs-meta { gap: 20px 32px; margin: 28px 0 36px; }
  .cs-innersplit { grid-template-columns: 1fr; }
  .lightbox { padding: 20px; }
  .cs-gate-card { padding: 32px 22px; }
  .dark-box { padding: 22px 18px; grid-template-columns: 1fr; }

  /* Horizontal-scroll fallback for phone-frame flows */
  .cs-flow-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .cs-flow-scroll > div { flex: 0 0 auto; }
  .cs-hscroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .cs-hscroll > div {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
}
