/* Case studies: header link, cards, listing page and case study template.
   Uses the same tokens as site.css (colors, radii, spacing). */

/* Webflow only kept the logo from shrinking on the home page (.w--current);
   keep "George Peric" on one line on every page. */
.nav-logo-updated {
  flex: none;
}

/* width/height attributes only reserve space (aspect ratio, no layout shift);
   the size still comes from the existing CSS, exactly as before.
   :where() keeps this at zero specificity so every existing image rule wins. */
:where(img[width][height]) {
  width: auto;
  height: auto;
}

/* /book-a-call: the page title is an H1 for SEO but keeps the H2 look */
h1.cs-h1-as-h2 {
  font-size: var(--typography--h2);
}

@media screen and (max-width: 991px) {
  h1.cs-h1-as-h2 {
    font-size: var(--typography--h2-tablet);
  }
}

@media screen and (max-width: 767px) {
  h1.cs-h1-as-h2 {
    font-size: var(--typography--h2-mobile);
  }
}

/* Hero carousel: show the slides right away instead of waiting for Splide's JS
   (Splide hides the carousel until it mounts, which delayed the LCP image). */
.splide:not(.is-initialized) {
  visibility: visible;
}

/* ---------- Header link ---------- */
.cs-nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.cs-nav-link {
  color: #ffffffb3;
  white-space: nowrap;
  font-size: var(--typography--text-m);
  font-weight: 500;
  text-decoration: none;
  transition: color .25s;
}

.cs-nav-link:hover,
.cs-nav-link.is-current {
  color: var(--neutral--white);
}

/* ---------- Secondary button ---------- */
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 12.8125rem;
  padding: .85rem 2.25rem;
  border: .0625rem solid var(--color--border-color);
  border-radius: .625rem;
  background-color: #ffffff05;
  color: var(--neutral--white);
  font-size: var(--typography--text-m);
  font-weight: 500;
  line-height: var(--typography--line-height);
  text-decoration: none;
  transition: border-color .25s, background-color .25s;
}

.button-secondary:hover {
  color: var(--neutral--white);
  border-color: var(--color--button-color);
  background-color: #6139ff1f;
}

/* ---------- Placeholder images ---------- */
.cs-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---------- Cards ---------- */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--container--grid-gap-2rem);
}

.cs-grid.cs-grid--single {
  grid-template-columns: minmax(0, 26rem);
  justify-content: center;
}

.cs-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
  background-color: #ffffff05;
  color: var(--neutral--white);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.cs-card:hover {
  color: var(--neutral--white);
  transform: translateY(-.375rem);
  border-color: var(--color--button-color);
  box-shadow: 0 .75rem 2rem #6139ff33;
}

.cs-card-image {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid #ffffff1a;
}

.cs-card-image .cs-img {
  height: 100%;
}

.cs-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
}

.cs-tag {
  display: inline-block;
  padding: .25rem .75rem;
  border: .0625rem solid #6139ff66;
  border-radius: .25rem;
  background-color: #6139ff26;
  font-size: var(--typography--text-s);
  font-weight: 500;
}

.cs-metric {
  margin-top: 1.25rem;
  font-size: var(--typography--h2);
  font-weight: 700;
  line-height: 1;
}

.cs-metric-label {
  margin-top: .375rem;
  color: #ffffffa6;
  font-size: var(--typography--text-s);
}

.cs-card-title {
  width: 100%;
  margin-top: 1.25rem;
  overflow: hidden;
  font-size: var(--typography--h6);
  font-weight: 700;
  line-height: var(--typography--line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-card-text {
  display: -webkit-box;
  margin-top: .5rem;
  overflow: hidden;
  color: #ffffffbf;
  font-size: var(--typography--text-m);
  line-height: 1.5em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cs-card-link {
  margin-top: auto;
  padding-top: 1.25rem;
  color: #a58fff;
  font-weight: 500;
}

.cs-card:hover .cs-card-link {
  color: var(--neutral--white);
}

.cs-more {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* Home page section: own tone so it doesn't blend into the hero above
   or the bg-secondary section below */
.section.cs-section {
  border-top: 1px solid #ffffff14;
  background: radial-gradient(60% 45% at 50% 0%, #6139ff2e 0%, #6139ff00 100%), #0d0a2c;
}

/* ---------- Listing page hero ---------- */
.section.hero.cs-hero {
  padding-bottom: 4rem;
}

.section.cs-listing {
  padding-top: 0;
}

/* ---------- Case study template ---------- */
.section.cs-detail-hero {
  padding-top: 10rem;
  padding-bottom: 4rem;
}

.cs-back {
  display: block;
  width: max-content;
  margin-bottom: 2rem;
  color: #ffffffb3;
  text-decoration: none;
  transition: color .25s;
}

.cs-back:hover {
  color: var(--neutral--white);
}

.cs-detail-title {
  max-width: var(--size--max-784px);
  margin-top: 1.25rem;
}

.cs-intro {
  max-width: var(--size--max-784px);
  margin-top: 1.5rem;
  color: #ffffffbf;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--container--grid-gap-2rem);
  margin-top: 3rem;
}

.cs-stat {
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
  background-color: #ffffff05;
}

.cs-stat .cs-metric {
  margin-top: 0;
}

.cs-stat-change {
  margin-top: .875rem;
  padding-top: .875rem;
  border-top: 1px solid #ffffff1a;
  color: #ffffffbf;
  font-size: var(--typography--text-s);
  font-variant-numeric: tabular-nums;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--container--grid-gap-2rem);
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid #ffffff1a;
  border-bottom: 1px solid #ffffff1a;
}

.cs-meta-label {
  margin-bottom: .375rem;
  color: #ffffff99;
  font-size: var(--typography--text-s);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cs-meta-value {
  font-weight: 500;
}

.cs-hero-image {
  margin-top: 3rem;
  overflow: hidden;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
}

.section.cs-body {
  padding-top: 2rem;
}

.cs-block {
  max-width: var(--size--max-784px);
  margin: 0 auto 4.5rem;
}

.cs-block h2 {
  margin-bottom: 1.25rem;
  font-size: var(--typography--h4);
}

.cs-block p,
.cs-block li {
  color: #ffffffbf;
  font-size: var(--size--paragraph-m);
  line-height: 1.6em;
}

.cs-block p + p {
  margin-top: 1rem;
}

.cs-block ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.cs-block li + li {
  margin-top: .5rem;
}

/* Phone frame, same look as the phones in the home page carousel:
   thin purple outline, silver bezel, rounded screen. */
.cs-phone {
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
  padding: .5rem;
  border: .125rem solid var(--color--button-color);
  border-radius: 3rem;
  background: linear-gradient(145deg, #c9c9cd 0%, #a3a3a9 100%);
  box-shadow: 0 1.5rem 3rem #0000008c;
}

.cs-phone-screen {
  position: relative;
  overflow: hidden;
  border-radius: 2.5rem;
  background-color: #000;
  aspect-ratio: 780 / 1688;
}

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

.cs-phone.cs-phone--sm {
  padding: .3rem;
  border-radius: 1.75rem;
  box-shadow: 0 1rem 2rem #00000080;
}

.cs-phone--sm .cs-phone-screen {
  border-radius: 1.45rem;
}

/* Card cover with a phone peeking up from the bottom */
.cs-cover {
  position: relative;
  overflow: hidden;
  background: radial-gradient(70% 60% at 50% 100%, #6139ff59 0%, #6139ff00 100%), #0d0a2c;
}

.cs-cover .cs-phone {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 46%;
  transform: translateX(-50%);
  transition: transform .3s ease;
}

.cs-card:hover .cs-cover .cs-phone {
  transform: translate(-50%, -3%);
}

/* Two phones fanned out: control behind on the left, variant in front on the right.
   Used for card covers (.cs-duo) and the big case study hero (.cs-duo--hero). */
.cs-duo {
  position: relative;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(55% 70% at 50% 100%, #6139ff66 0%, #6139ff00 100%),
    radial-gradient(40% 40% at 15% 10%, #657cff26 0%, #657cff00 100%),
    #0d0a2c;
}

.cs-duo-phone {
  position: absolute;
  top: 14%;
  width: 40%;
  transition: transform .35s ease;
}

.cs-duo-phone.is-control {
  left: 11%;
  transform: rotate(-7deg);
}

.cs-duo-phone.is-control .cs-phone {
  filter: brightness(.7) saturate(.8);
}

.cs-duo-phone.is-variant {
  right: 11%;
  z-index: 2;
  transform: rotate(5deg) translateY(-4%);
}

.cs-duo-label {
  position: absolute;
  top: -.75rem;
  left: 50%;
  z-index: 3;
  padding: .2rem .55rem;
  border-radius: .3rem;
  background-color: var(--color--button-color);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.cs-duo-label.control {
  background-color: #e80000;
}

.cs-card:hover .cs-duo-phone.is-control {
  transform: rotate(-9deg) translateX(-4%);
}

.cs-card:hover .cs-duo-phone.is-variant {
  transform: rotate(6deg) translate(3%, -7%);
}

/* Big version on the case study page */
.cs-duo--hero {
  aspect-ratio: 16 / 9;
  height: auto;
}

.cs-duo--hero .cs-duo-phone {
  top: 12%;
  width: 22%;
}

.cs-duo--hero .cs-duo-phone.is-control {
  left: 27%;
}

.cs-duo--hero .cs-duo-phone.is-variant {
  right: 27%;
}

.cs-duo--hero .cs-phone.cs-phone--sm {
  padding: .45rem;
  border-radius: 2.6rem;
}

.cs-duo--hero .cs-phone--sm .cs-phone-screen {
  border-radius: 2.2rem;
}

.cs-duo--hero .cs-duo-label {
  top: -1.1rem;
  padding: .35rem .85rem;
  font-size: var(--typography--text-s);
}

/* Control / Variant slider (see assets/js/before-after.js) */
.cs-ba {
  --pos: 50%;
  position: relative;
  max-width: 56rem;
  aspect-ratio: 4 / 3;
  margin: 0 auto 1rem;
  overflow: hidden;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
  background-color: #ffffff05;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.cs-ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.cs-ba-control {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.cs-ba-label {
  position: absolute;
  top: 1rem;
  z-index: 2;
  padding: .375rem .875rem;
  border-radius: .375rem;
  background-color: var(--color--button-color);
  font-size: var(--typography--text-s);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  pointer-events: none;
}

.cs-ba-label.control {
  left: 1rem;
  background-color: #e80000;
}

.cs-ba-label.variant {
  right: 1rem;
}

.cs-ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 2px;
  margin-left: -1px;
  background-color: var(--neutral--white);
  box-shadow: 0 0 .75rem #00000080;
  pointer-events: none;
}

.cs-ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid var(--neutral--white);
  border-radius: 50%;
  background-color: var(--color--button-color);
  box-shadow: 0 .25rem 1rem #6139ff80;
  color: var(--neutral--white);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: transform .15s ease;
}

.cs-ba.is-dragging .cs-ba-knob {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Visually hidden range input: keyboard + screen reader access */
.cs-ba-range {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cs-ba:has(.cs-ba-range:focus-visible) .cs-ba-knob {
  outline: 3px solid #a58fff;
  outline-offset: 3px;
}

/* Slider inside a phone frame */
.cs-ba-wrap {
  max-width: 20rem;
  margin: 0 auto 1rem;
}

.cs-ba-wrap .cs-phone {
  max-width: none;
}

.cs-ba-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cs-ba-labels .cs-ba-label {
  position: static;
}

.cs-ba.cs-ba--phone {
  max-width: none;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
}

.cs-ba-hint {
  max-width: var(--size--max-784px);
  margin: 0 auto 4.5rem;
  color: #ffffff99;
  font-size: var(--typography--text-s);
  text-align: center;
}

/* ---------- Results table ---------- */
.cs-results {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem 1.25rem;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
  background-color: #ffffff05;
}

.cs-results-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.cs-results-table caption {
  margin-bottom: 1rem;
  color: #ffffff99;
  font-size: var(--typography--text-s);
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.cs-results-table th,
.cs-results-table td {
  padding: .875rem .75rem;
  border-bottom: 1px solid #ffffff1a;
  text-align: left;
  vertical-align: middle;
}

.cs-results-table th:first-child,
.cs-results-table td:first-child {
  padding-left: 0;
}

.cs-results-table thead th {
  padding-top: 0;
  color: #ffffff99;
  font-size: var(--typography--text-s);
  font-weight: 500;
}

.cs-results-table tbody th {
  font-weight: 500;
}

.cs-results-table tbody td {
  color: #ffffffbf;
  white-space: nowrap;
}

.cs-results-table tbody tr:last-child th,
.cs-results-table tbody tr:last-child td {
  border-bottom: 0;
}

.cs-results-table tbody tr {
  transition: background-color .2s;
}

.cs-results-table tbody tr:hover {
  background-color: #ffffff08;
}

.cs-results-table tr.is-primary th,
.cs-results-table tr.is-primary td {
  color: var(--neutral--white);
  font-weight: 700;
}

.cs-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .125rem .5rem;
  border: 1px solid #ffffff33;
  border-radius: .25rem;
  color: #ffffffbf;
  font-size: .75rem;
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

.cs-badge.is-primary {
  border-color: #6139ff99;
  background-color: #6139ff33;
  color: var(--neutral--white);
}

.cs-lift {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 11rem;
}

.cs-lift-track {
  flex: 1;
  height: .5rem;
  overflow: hidden;
  border-radius: .25rem;
  background-color: #ffffff12;
}

.cs-lift-bar {
  display: block;
  height: 100%;
  border-radius: 0 .25rem .25rem 0;
  background-color: var(--color--button-color);
}

.cs-lift-value {
  min-width: 3.75rem;
  color: var(--neutral--white);
  font-weight: 700;
  text-align: right;
}

.cs-lift-icon {
  margin-right: .25rem;
  color: var(--system--success);
  font-size: .625rem;
  vertical-align: .1em;
}

.cs-results-note {
  margin-top: 1rem;
}

.cs-block .cs-results-note {
  color: #ffffff80;
  font-size: var(--typography--text-s);
}

.cs-quote {
  max-width: var(--size--max-784px);
  margin: 0 auto 4.5rem;
}

.cs-quote .testimonial-card {
  max-width: none;
  background-color: #ffffff05;
}

.cs-quote .quote-text {
  font-size: var(--size--paragraph-l);
}

.cs-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--size--max-784px);
  margin: 0 auto;
  padding: 1.75rem 2rem;
  border: 1px solid var(--color--border-color);
  border-radius: 1.25rem;
  background-color: #ffffff05;
  color: var(--neutral--white);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.cs-next:hover {
  color: var(--neutral--white);
  transform: translateY(-.25rem);
  border-color: var(--color--button-color);
  box-shadow: 0 .75rem 2rem #6139ff33;
}

.cs-next-label {
  color: #ffffff99;
  font-size: var(--typography--text-s);
}

.cs-next-title {
  margin-top: .375rem;
  font-size: var(--typography--h6);
  font-weight: 700;
}

.cs-next-arrow {
  flex: none;
  color: #a58fff;
  font-size: var(--typography--h5);
}

/* ---------- Responsive (basic; final mobile pass later) ---------- */
@media screen and (max-width: 991px) {
  .cs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .cs-duo--hero {
    aspect-ratio: 4 / 3;
  }

  .cs-duo--hero .cs-duo-phone {
    width: 34%;
  }

  .cs-duo--hero .cs-duo-phone.is-control {
    left: 14%;
  }

  .cs-duo--hero .cs-duo-phone.is-variant {
    right: 14%;
  }

  .cs-duo--hero .cs-duo-label {
    top: -.75rem;
    padding: .2rem .55rem;
    font-size: .625rem;
  }

  /* Results table: one card-like block per metric */
  .cs-results {
    padding: 1.25rem;
  }

  .cs-results-table thead {
    display: none;
  }

  .cs-results-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #ffffff1a;
  }

  .cs-results-table tbody tr:last-child {
    border-bottom: 0;
  }

  .cs-results-table tbody th,
  .cs-results-table tbody td {
    padding: 0;
    border: 0;
  }

  .cs-results-table tbody th {
    grid-column: 1 / -1;
    margin-bottom: .375rem;
  }

  .cs-results-table tbody td::before {
    content: attr(data-label) ": ";
    color: #ffffff80;
    font-weight: 400;
  }

  .cs-results-table tbody td[data-label="Change"] {
    grid-column: 1 / -1;
    margin-top: .5rem;
  }

  .cs-results-table tbody td[data-label="Change"]::before {
    content: none;
  }

  .cs-grid,
  .cs-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-nav-right {
    gap: 1rem;
  }

  .cs-nav-link {
    font-size: var(--typography--text-s);
  }

  .cs-metric {
    font-size: var(--typography--h2-mobile);
  }

  .section.cs-detail-hero {
    padding-top: 8rem;
  }
}

@media screen and (max-width: 479px) {
  /* Not enough room for avatar + name + link + button: keep the avatar only */
  .dtc-nav .nav-logo-updated .column {
    display: none;
  }

  .cs-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .cs-next {
    padding: 1.5rem;
  }
}
