/* ─── Case Study Layout ─────────────────────────────────────────── */
.case-study {
  padding-top: 152px;
  padding-bottom: 80px;
}

.cs-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 108px;
}

/* ─── Header ────────────────────────────────────────────────────── */
.cs-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-30);
  margin-bottom: 24px;
}

.cs-dates {
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gray-95);
}

.cs-label {
  font-size: 20px;
  font-weight: 500;
  color: #5362d2;
}

.cs-title {
  font-size: 42px;
  font-weight: 500;
  line-height: 60px;
  color: var(--gray-95);
}

/* ─── Content Sections ──────────────────────────────────────────── */
.cs-content {
  display: flex;
  flex-direction: column;
}

/* Default spacing between siblings */
.cs-content > * + * {
  margin-top: 24px;
}

/* Section headings — more space above */
.cs-content h2 {
  font-size: 30px;
  font-weight: 500;
  line-height: 48px;
  color: var(--gray-95);
  margin-top: 40px;
}

.cs-content > h2:first-child {
  margin-top: 0;
}

.cs-content h2.cs-section-heading {
  font-size: 28px;
  line-height: 42px;
  margin-top: 40px;
}

/* Tight heading-to-content spacing */
.cs-content h2 + p,
.cs-content h2 + ul,
.cs-content h3 + p,
.cs-content h3 + ul {
  margin-top: 8px;
}

.cs-content p {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--gray-95);
}

.cs-content ul {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-content li {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--gray-95);
}

.cs-link {
  color: #077bb3;
  word-break: break-all;
}
.cs-link:hover {
  text-decoration: underline;
}

/* ─── Info Cards ────────────────────────────────────────────────── */
.cs-cards-row {
  display: flex;
  gap: 54px;
  padding: 24px 0;
  margin: 32px 0;
}

.cs-info-card {
  flex: 1;
  border-radius: 24px;
  box-shadow: 8px 8px 24px 0px rgba(0, 0, 0, 0.2);
  padding: 32px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-image: linear-gradient(140deg, rgb(228, 231, 252) 7%, rgb(255, 255, 255) 76%);
  opacity: 0.8;
}

.cs-info-card__title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  color: #1327be;
}

.cs-info-card__text {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--gray-95);
}

/* ─── Phone Screenshot Rows ─────────────────────────────────────── */
.cs-phones-row {
  display: flex;
  gap: 64px;
  padding-bottom: 64px;
}

.cs-phone-btn {
  position: relative;
  width: 300px;
  cursor: pointer;
  overflow: hidden;
  border: none;
  padding: 0;
  background: none;
}

.cs-phone-btn img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.cs-phone-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #238bbf;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.cs-phone-btn:hover img {
  transform: scale(1.05);
}

.cs-phone-btn:hover::after {
  opacity: 0.2;
}

/* ─── Accessibility Images ──────────────────────────────────────── */
.cs-a11y-row {
  display: flex;
  gap: 64px;
  padding-bottom: 32px;
  margin-top: 40px;
}

.cs-a11y-row + .cs-a11y-row {
  margin-top: 0;
  gap: 32px;
  padding-bottom: 48px;
}

.cs-a11y-img img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-a11y-img--narrow {
  flex: 0 0 173px;
}

.cs-a11y-img--wide {
  flex: 1;
}

/* ─── Modal ─────────────────────────────────────────────────────── */
.cs-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cs-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.cs-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.cs-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.25);
  padding: 12px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 795px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96);
  transition: transform 0.5s ease;
}

.cs-modal.is-open .cs-modal__panel {
  transform: scale(1);
}

.cs-modal__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
}

.cs-modal__nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
  height: 44px;
}

.cs-modal__arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-95);
  padding: 0;
}

.cs-modal__arrow:disabled {
  cursor: default;
  opacity: 0.4;
}

.cs-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.cs-modal__close img {
  width: 20px;
  height: 20px;
}

.cs-modal__body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.cs-modal__body.slide-out-left {
  opacity: 0;
  transform: translateX(-100%);
}

.cs-modal__body.slide-out-right {
  opacity: 0;
  transform: translateX(100%);
}

.cs-modal__body.slide-in-left {
  transition: none;
  opacity: 0;
  transform: translateX(100%);
}

.cs-modal__body.slide-in-right {
  transition: none;
  opacity: 0;
  transform: translateX(-100%);
}

.cs-modal__left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-modal__screen-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 42px;
  color: var(--gray-95);
}

.cs-modal__phone {
  width: 320px;
  flex-shrink: 0;
}

.cs-modal__phone img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-modal__right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 48px;
  width: 379px;
  min-height: 702px;
  overflow: hidden;
  position: relative;
}

.cs-modal__comp-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 32px;
  color: var(--gray-95);
  padding-left: 24px;
  margin-bottom: 10px;
}

.cs-modal__comp-desc {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--gray-95);
  padding-left: 24px;
}

.cs-modal__detail-wrap {
  position: absolute;
}

.cs-modal__detail-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Title Row (title + button side by side) ──────────────────── */
.cs-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.cs-title-row .cs-title {
  flex: 1;
}

/* ─── Demo Button ──────────────────────────────────────────────── */
.cs-btn-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 226px;
  flex-shrink: 0;
  padding: 12px;
  border-radius: 24px;
  background: var(--blue-60, #077bb3);
  border: 1px solid var(--blue-60, #077bb3);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cs-btn-demo:hover {
  opacity: 0.85;
}

/* ─── Two-column Layout ────────────────────────────────────────── */
.cs-two-col {
  display: flex;
  gap: 24px;
}

.cs-two-col__main {
  flex: 1;
}

.cs-two-col__sidebar {
  width: 320px;
  flex-shrink: 0;
}

/* ─── Heading with Button ──────────────────────────────────────── */
.cs-heading-with-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cs-heading-with-btn .cs-section-heading {
  margin-top: 0;
  margin-bottom: 0;
}

/* ─── Flow Label ───────────────────────────────────────────────── */
.cs-flow-label {
  font-size: 24px;
  font-weight: 600;
  line-height: 42px;
  color: var(--gray-95);
  margin: 24px 0;
}

/* ─── Subsection Heading ───────────────────────────────────────── */
.cs-subsection-heading {
  font-size: 20px;
  font-weight: 500;
  line-height: 32px;
  color: var(--gray-95);
}

/* ─── Image Rows ───────────────────────────────────────────────── */
.cs-img-row {
  display: flex;
  gap: 64px;
  align-items: flex-start;
  margin-top: 24px;
}

.cs-img-row--pb {
  padding-bottom: 24px;
}


.cs-img-row__item {
  flex: none;
  width: 300px;
}

.cs-img-row__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Info Card List ───────────────────────────────────────────── */
.cs-info-card__list {
  padding-left: 21px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-info-card__list li {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--gray-95);
}

/* ─── Image Row Buttons ────────────────────────────────────────── */
.cs-img-row__btn {
  position: relative;
  flex: none;
  width: 300px;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  overflow: hidden;
}

.cs-img-row__btn img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.cs-img-row__btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #238bbf;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.cs-img-row__btn:hover img {
  transform: scale(1.05);
}

.cs-img-row__btn:hover::after {
  opacity: 0.2;
}

/* ─── Wireframe Modal ──────────────────────────────────────────── */
.wf-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.wf-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.wf-modal__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 1440px;
  height: 100%;
  padding: 12px 32px 24px;
  overflow-y: auto;
}

.wf-modal__close-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  padding-top: 12px;
}

.wf-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.wf-modal__close img {
  width: 20px;
  height: 20px;
}

.wf-modal__title-wrap {
  text-align: left;
  width: 670px;
  max-width: 100%;
  padding-bottom: 20px;
  align-self: center;
}

.wf-modal__title {
  font-size: 30px;
  font-weight: 500;
  line-height: 48px;
  color: var(--gray-95);
  margin: 0;
}

.wf-modal__desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--gray-95);
  margin-top: 8px;
}

.wf-modal__img-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.wf-modal__img-wrap {
  width: 880px;
  max-width: 100%;
  flex-shrink: 0;
}

.wf-modal__img {
  width: 100%;
  height: auto;
  display: block;
}

.wf-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.wf-modal__body.slide-out-left {
  opacity: 0;
  transform: translateX(-100%);
}

.wf-modal__body.slide-out-right {
  opacity: 0;
  transform: translateX(100%);
}

.wf-modal__body.slide-in-left {
  transition: none;
  opacity: 0;
  transform: translateX(100%);
}

.wf-modal__body.slide-in-right {
  transition: none;
  opacity: 0;
  transform: translateX(-100%);
}

.wf-modal__arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-95);
  padding: 0;
}

#wfModalPrev {
  left: 32px;
}

#wfModalNext {
  right: 32px;
}

.wf-modal__arrow:disabled {
  cursor: default;
  opacity: 0.4;
}

/* ─── Subsection Heading (h3) ──────────────────────────────────── */
.cs-content h3.cs-subsection-heading {
  font-size: 24px;
  font-weight: 600;
  line-height: 42px;
  color: var(--gray-95);
}

/* ─── Inline Illustrations (Picture 1 / Picture 2) ────────────── */
.cs-illustrations {
  display: flex;
  gap: 64px;
  padding-left: 24px;
  margin: 8px 0;
  max-width: 645px;
}

.cs-illustration {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cs-illustration__img {
  position: relative;
  width: 97px;
  height: 72px;
  border: 1px solid #dfdfdf;
  background: #fff;
  overflow: hidden;
}

.cs-illustration__link-text {
  position: absolute;
  left: 8px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 26px;
  color: #000;
  white-space: nowrap;
}

.cs-illustration__link-text--top { top: 7px; }
.cs-illustration__link-text--bottom { top: 43px; }

.cs-illustration__icon-box {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-illustration__icon-box--square {
  width: 26px;
  height: 26px;
  left: 62px;
  top: 7px;
  border: 0.5px dashed #6423fc;
}

.cs-illustration__icon-box--square-bottom {
  width: 26px;
  height: 26px;
  left: 62px;
  top: 43px;
}

.cs-illustration__icon-box--trimmed {
  width: 14px;
  height: 26px;
  left: 61px;
  top: 7px;
  border: 0.5px dashed #6423fc;
}

.cs-illustration__icon-box--trimmed-bottom {
  height: 19px;
  left: 62px;
  top: 47px;
}

.cs-illustration__icon-box svg {
  width: 12px;
  height: 19px;
}

.cs-illustration__link-bbox {
  position: absolute;
  left: 8px;
  top: 7px;
  width: 51px;
  height: 26px;
  border: 0.5px dashed #6423fc;
}

.cs-illustration__caption {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-content .cs-illustration__label {
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--gray-95);
}

.cs-content .cs-illustration__desc {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--gray-95);
}

/* ─── Checklist ────────────────────────────────────────────────── */
.cs-checklist {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-checklist__item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.cs-checklist__icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 4px solid #7a86df;
  margin-top: 8px;
  transition: border-color 0.5s ease 0.6s;
}

.cs-checklist__icon img {
  position: absolute;
  top: 25%;
  left: 16%;
  width: 68%;
  height: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s ease 0.7s, transform 0.4s ease 0.7s;
}

/* Checked state — triggered when item scrolls into view */
.cs-checklist__item.is-visible .cs-checklist__icon {
  border-color: #3345c9;
}

.cs-checklist__item.is-visible .cs-checklist__icon img {
  opacity: 1;
  transform: scale(1);
}

.cs-checklist__body {
  flex: 1;
}

.cs-checklist__title {
  font-size: 24px;
  font-weight: 600;
  line-height: 42px;
  color: var(--gray-95);
}

.cs-checklist__body p {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--gray-95);
}

.cs-checklist__body ul {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.cs-checklist__body li {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--gray-95);
}

.cs-checklist__body ul ul {
  margin-top: 4px;
}

/* ─── Dark Mode ─────────────────────────────────────────────────── */
body.dark-mode .cs-label {
  color: #8b9cf7;
}

body.dark-mode .cs-link {
  color: var(--blue-40);
}

body.dark-mode .cs-info-card {
  background-image: linear-gradient(140deg, rgba(228, 231, 252, 0.1) 7%, rgba(30, 30, 30, 1) 76%);
  box-shadow: 8px 8px 24px 0px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cs-info-card__title {
  color: #8b9cf7;
}

body.dark-mode .cs-modal__panel {
  background: #1a1a1a;
}

body.dark-mode .cs-modal__close img {
  filter: invert(1);
}

body.dark-mode .wf-modal {
  background: #1a1a1a;
}

body.dark-mode .wf-modal__close img {
  filter: invert(1);
}

body.dark-mode .cs-checklist__icon {
  border-color: rgba(139, 156, 247, 0.5);
}

body.dark-mode .cs-checklist__item.is-visible .cs-checklist__icon {
  border-color: #8b9cf7;
}

body.dark-mode .cs-checklist__icon img {
  filter: brightness(1.4);
}

body.dark-mode .cs-illustration__img {
  background: #2a2a2a;
  border-color: #444;
}

body.dark-mode .cs-illustration__link-text {
  color: #fff;
}

body.dark-mode .cs-illustration__icon-box svg path {
  stroke: #fff;
}


/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cs-inner { padding: 0 48px; }
  .cs-cards-row { gap: 24px; }
  .cs-phones-row { gap: 32px; }
  .cs-phone-btn { width: auto; flex: 1; }
}

@media (max-width: 768px) {
  .case-study { padding-top: 110px; }
  .cs-inner { padding: 0 16px; }

  .cs-title { font-size: 28px; line-height: 40px; }
  .cs-content h2 { font-size: 22px; line-height: 32px; }

  .cs-cards-row { flex-direction: column; gap: 16px; }
  .cs-phones-row { flex-direction: column; gap: 24px; align-items: center; }
  .cs-phone-btn { width: 280px; }

  .cs-a11y-row { flex-direction: column; gap: 24px; }
  .cs-a11y-img--narrow { flex: none; width: 173px; }

  .cs-modal__panel { width: 100%; max-width: 100vw; border-radius: 16px; padding: 12px 16px 24px; }
  .cs-modal__body { flex-direction: column; }
  .cs-modal__left { flex-shrink: 1; }
  .cs-modal__phone { width: 100%; max-width: 280px; }
  .cs-modal__right { width: 100%; max-height: none; position: static; min-height: auto; }
  .cs-modal__detail-wrap { position: static; width: 100% !important; left: auto !important; }
  .cs-modal__detail-img { object-fit: contain; }
  .cs-modal__close { width: auto; }

  .cs-title-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cs-btn-demo { width: 100%; }
  .cs-two-col { flex-direction: column; }
  .cs-two-col__sidebar { width: 100%; }
  .cs-img-row { flex-direction: column; gap: 24px; }
  .cs-img-row__btn { width: 100%; }
  .cs-heading-with-btn { flex-direction: column; align-items: flex-start; gap: 16px; }

  .cs-illustrations { flex-direction: column; gap: 32px; padding-left: 0; }
  .cs-checklist__item { gap: 16px; }
  .cs-checklist__title { font-size: 20px; line-height: 32px; }
  .cs-content h3.cs-subsection-heading { font-size: 20px; line-height: 32px; }

  .wf-modal__panel { padding: 12px 16px 24px; }
  .wf-modal__title { font-size: 22px; line-height: 32px; }
  .wf-modal__img-row { position: relative; }
  .wf-modal__img-wrap { flex-shrink: 1; width: 100%; }
  #wfModalPrev { left: 16px; }
  #wfModalNext { right: 16px; }
}
