/* ==========================================================================
   Case Studies — LISTING page (V2)
   Loads after css/home_v2.css + css_v2/base/variable.css (main/v2/base.html).
   Only what those / Bootstrap do NOT already provide.
   ========================================================================== */
:root { --font-heading: "Montserrat", sans-serif; }

/* home_v2.css gives .btn-flat svg a green disc; the arrows here use
   stroke="currentColor", so force the stroke white like the homepage markup */
.btn-flat svg { color: #fff; }

/* -------------------------------------------------------------- hero */
.cs-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 460px at 84% -10%, var(--brand-green-light) 0%, rgba(242, 248, 244, 0) 64%),
    linear-gradient(180deg, #fbfdfb, #fff);
}
.cs-hero__orb,
.cs-hero__dots {
  position: absolute;
  pointer-events: none;
}
.cs-hero__orb {
  border-radius: 50%;
  filter: blur(6px);
}
.cs-hero__orb--a {
  top: -150px;
  right: -120px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle at 34% 30%, rgba(39, 93, 43, .22), rgba(39, 93, 43, .04) 62%, transparent 72%);
  animation: csDrift 24s ease-in-out infinite;
}
.cs-hero__orb--b {
  bottom: -180px;
  left: -140px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 60% 40%, rgba(126, 223, 166, .3), rgba(126, 223, 166, 0) 68%);
  animation: csDrift 30s ease-in-out infinite reverse;
}
.cs-hero__dots {
  inset: 0;
  background-image: radial-gradient(rgba(39, 93, 43, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(680px 380px at 86% 4%, #000 0%, transparent 70%);
  mask-image: radial-gradient(680px 380px at 86% 4%, #000 0%, transparent 70%);
}
.cs-hero__inner { position: relative; }

.cs-hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.4vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  max-width: 20ch;
}
.cs-hero h1 span { color: var(--brand-green); }
.cs-hero__lead {
  max-width: 52ch;
  color: var(--text-muted);
  font-size: clamp(.95rem, 1.15vw, 1.075rem);
  line-height: 1.65;
}

/* search pill (hero + filter bar) */
.cs-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .25rem .35rem .25rem 1rem;
  border: 1.5px solid #dde7e0;
  border-radius: 40px;
  background: #fff;
  min-width: 0;
}
.cs-search--hero {
  max-width: 520px;
  box-shadow: 0 12px 30px rgba(31, 111, 67, .08);
}
.cs-search .form-control {
  border: 0;
  box-shadow: none;
  padding: .55rem 0;
  background: transparent;
  min-width: 0;
}
.cs-search .form-control:focus { box-shadow: none; }
.cs-search svg { flex: 0 0 auto; stroke: var(--text-muted); }
.cs-search .btn-brand { padding: .5rem 1.1rem; }

/* floating project cards in the hero */
.cs-visual {
  position: relative;
  min-height: clamp(300px, 34vw, 430px);
}
.cs-float {
  position: absolute;
  top: 6%;
  left: 4%;
  width: 72%;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid #e7f3ec;
  border-radius: 14px;
  box-shadow: 0 22px 50px rgba(31, 111, 67, .16);
  animation: csFloatA 9s ease-in-out infinite;
}
.cs-float__art {
  position: relative;
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
}
.cs-float__title {
  margin-top: .5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--black);
}
.cs-float__bar {
  margin-top: .6rem;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-green-light);
  overflow: hidden;
}
.cs-float__bar i {
  display: block;
  height: 100%;
  width: 72%;
  background: #3faf68;
}
.cs-float-dark {
  position: absolute;
  right: 2%;
  bottom: 2%;
  width: 58%;
  padding: 1.1rem;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(120deg, #0f3d22, #1f6f43);
  box-shadow: 0 24px 54px rgba(15, 61, 34, .3);
  animation: csFloatB 11s ease-in-out infinite;
}
.cs-float-dark__val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  line-height: 1.1;
}
.cs-float-chip {
  position: absolute;
  padding: .55rem 1rem;
  background: #fff;
  border: 1px solid #e7f3ec;
  border-radius: 40px;
  box-shadow: 0 12px 28px rgba(31, 111, 67, .14);
  font-size: .8rem;
  font-weight: 600;
  color: var(--brand-green);
}
.cs-float-chip--1 { top: 44%; right: -2%; animation: csFloatA 7.5s ease-in-out infinite; }
.cs-float-chip--2 { top: 24%; left: -2%; animation: csFloatB 8.5s ease-in-out infinite; }

/* --------------------------------------------------------- filter bar */
.cs-filterbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid #e7f3ec;
  border-bottom: 1px solid #e7f3ec;
}
/* sits under the site's own sticky header */
.site-header-wrap ~ * .cs-filterbar,
.cs-filterbar--below-header { top: var(--cs-header-h, 84px); }

.cs-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1.1rem;
  border: 1.5px solid #e7f3ec;
  border-radius: 40px;
  background: #fff;
  color: var(--black);
  font-weight: 500;
  font-size: .9rem;
}
.cs-filter-toggle:hover,
.cs-filter-toggle.is-active {
  background: var(--brand-green-light);
  border-color: #cfe0d4;
  color: var(--brand-green);
}
.cs-filter-toggle .cs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 40px;
  background: var(--brand-green);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

/* option pills (filter panel + offcanvas) */
.cs-opt {
  border: 1.5px solid #e7f3ec;
  border-radius: 40px;
  background: #fff;
  padding: .45rem .8rem;
  font-size: .82rem;
  font-weight: 500;
  color: #3c4f45;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.cs-opt:hover { border-color: var(--brand-green); transform: translateY(-2px); }
.cs-opt[aria-pressed="true"] {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}
.cs-group-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--black);
}

/* pill usage count + zero-result dimming */
.cs-opt .cs-opt__n {
  margin-left: .4rem;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
}
.cs-opt[aria-pressed="true"] .cs-opt__n { color: rgba(255, 255, 255, .75); }
.cs-opt.is-empty { opacity: .45; }
.cs-opt.is-empty:hover { opacity: .8; }

/* "+N more" / "Show less" ghost pill */
.cs-opt--more {
  border-style: dashed;
  background: transparent;
  color: var(--brand-green);
}
.cs-opt--more:hover { background: var(--brand-green-light); }

/* inline type-ahead inside a large group */
.cs-find {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .7rem;
  border: 1.5px solid #e7f3ec;
  border-radius: 40px;
  background: #fff;
  color: var(--text-muted);
  min-width: 190px;
}
.cs-find:focus-within { border-color: var(--brand-green); }
.cs-find input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .8rem;
  width: 100%;
  min-width: 0;
  color: var(--black);
}
.cs-find input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* full-width row for groups with many options */
.cs-group--wide {
  border-top: 1px solid #f0f5f1;
  padding-top: 1.25rem !important;
  margin-top: .25rem;
}

/* mobile sheet accordion */
.cs-acc { border-bottom: 1px solid #f0f5f1; }
.cs-acc__head {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .9rem 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.cs-acc__head .cs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 40px;
  background: var(--brand-green);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}
.cs-acc__chev { color: var(--text-muted); transition: transform .25s ease; }
.cs-acc.is-open .cs-acc__chev { transform: rotate(180deg); }
.cs-acc__body { padding: 0 0 1rem; }

/* active filter chips */
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 0;
  border-radius: 40px;
  background: var(--brand-green-light);
  color: var(--black);
  padding: .4rem .7rem;
  font-size: .8rem;
  font-weight: 500;
}
.cs-chip:hover { background: #e3f0e7; }
.cs-chip small {
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-panel {
  background: #fff;
  border: 1px solid #e7f3ec;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(31, 111, 67, .08);
}

/* --------------------------------------------------------- card art */
.cs-art {
  position: absolute;
  inset: 0;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.cs-art__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .34) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: .5;
}
.cs-art__ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .3);
}
.cs-art__ring--1 { top: -50px; right: -40px; width: 200px; height: 200px; }
.cs-art__ring--2 { bottom: -70px; left: -30px; width: 190px; height: 190px; border-color: rgba(255, 255, 255, .2); }
.cs-art__mono {
  position: absolute;
  left: 1.25rem;
  bottom: .75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 3.25rem;
  line-height: 1;
  letter-spacing: -.04em;
  color: rgba(255, 255, 255, .2);
}
.cs-art__badge {
  position: absolute;
  top: .85rem;
  left: 1rem;
  padding: .35rem .7rem;
  border-radius: 40px;
  background: rgba(255, 255, 255, .93);
  color: #0f3d22;
  font-size: .7rem;
  font-weight: 600;
}
.cs-art__badge--right {
  left: auto;
  right: 1rem;
  background: rgba(15, 61, 34, .55);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ------------------------------------------------------ result cards */
.cs-card { overflow: hidden; }
.cs-card__art { position: relative; height: 190px; overflow: hidden; }
.cs-card__scrim {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
  background: linear-gradient(180deg, rgba(9, 32, 19, 0), rgba(9, 32, 19, .5));
}
.cs-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(31, 111, 67, .16); }
.cs-card:hover .cs-art { transform: scale(1.08); }
.cs-card:hover .cs-card__scrim { opacity: 1; }
.cs-card:hover .cs-arrow { transform: translateX(4px); }
.cs-card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--black);
}
.cs-kicker {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-green);
}
.cs-metric {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f3d22;
}
.cs-tech {
  padding: .3rem .65rem;
  border: 1px solid #e7f3ec;
  border-radius: 40px;
  background: var(--brand-green-light);
  color: #3c4f45;
  font-size: .72rem;
  font-weight: 500;
}
.cs-arrow { display: inline-block; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }

/* card footer: keep the CTA on one line and let a long metric label truncate */
.cs-card .btn-flat { white-space: nowrap; flex: 0 0 auto; }
.cs-card__metric { min-width: 0; }
.cs-card__metric .text-muted-custom {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* featured */
.cs-featured {
  background: #fff;
  border: 1px solid #e7f3ec;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(31, 111, 67, .1);
  overflow: hidden;
}
.cs-featured__art { position: relative; min-height: clamp(230px, 28vw, 400px); overflow: hidden; }
.cs-featured__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--black);
}
.cs-outcome-num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: #0f3d22;
  display: block;
}

/* ------------------------------------------------------ empty state */
.cs-empty {
  background: #fbfdfb;
  border: 1px dashed #d6e3da;
  border-radius: 18px;
}
.cs-empty__art { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.cs-empty__art i { position: absolute; border-radius: 50%; }
.cs-empty__art .r1 { inset: 0; border: 1.5px dashed #c7dcce; animation: csSpin 26s linear infinite; }
.cs-empty__art .r2 { inset: 16px; border: 1.5px solid #e1ede5; }
.cs-empty__art .core {
  inset: 32px;
  background: radial-gradient(circle at 34% 30%, #7edfa6, var(--brand-green));
  animation: csFloatA 6s ease-in-out infinite;
}

/* ------------------------------------------------------- pagination */
.pagination { --bs-pagination-border-radius: 40px; gap: .4rem; }
.page-link {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e7f3ec;
  border-radius: 40px;
  color: #3c4f45;
  font-weight: 500;
}
.page-link:hover { background: var(--brand-green-light); border-color: #cfe0d4; color: var(--brand-green); }
.page-item.active .page-link {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}
.page-item.disabled .page-link { background: var(--brand-green-light); color: #9aa8a0; }
.page-link--step { width: auto; padding: 0 1.1rem; gap: .4rem; color: var(--brand-green); }

/* ------------------------------------------------------------- keyframes */
@keyframes csDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(4%, -3%, 0) scale(1.07); }
  66% { transform: translate3d(-3%, 4%, 0) scale(.96); }
}
@keyframes csFloatA { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -14px, 0); } }
@keyframes csFloatB { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, 12px, 0); } }
@keyframes csSpin { to { transform: rotate(360deg); } }
@keyframes csFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* results swap animation */
#csResults { transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
#csResults.is-out { opacity: 0; transform: scale(.985); }

/* ------------------------------------------------------- responsive */
@media (max-width: 991.98px) {
  .cs-visual { min-height: 320px; }
  .cs-float { width: 68%; }
}
@media (max-width: 767.98px) {
  .cs-hero h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); max-width: none; }
  .cs-float-chip { display: none; }
  /* absolute layering overlaps and clips its own text at phone widths — stack instead */
  .cs-visual { min-height: 0; margin-top: 1.5rem; }
  .cs-float,
  .cs-float-dark {
    position: static;
    width: 100%;
    animation: none;
  }
  .cs-float-dark {
    max-width: 88%;
    margin: -.75rem 0 0 auto;
  }
  .cs-card__art { height: 165px; }
  .cs-card:hover { transform: none; box-shadow: 0 10px 35px rgba(31, 111, 67, .08); }
  .cs-card:hover .cs-art { transform: none; }
  .cs-search--hero .btn-brand { padding: .5rem .85rem; }
  .cs-art__mono { font-size: 2.5rem; }
  .page-link--step span { display: none; }
  .pagination { justify-content: center; }
}
@media (max-width: 575.98px) {
  .cs-search { padding-left: .85rem; }
  .cs-featured__art { min-height: 200px; }
  /* main.css makes .btn-brand full-width below 576px — keep the inline ones inline */
  .cs-search .btn-brand,
  .cs-inline-btn { width: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-hero__orb, .cs-float, .cs-float-dark, .cs-float-chip,
  .cs-empty__art i, .cs-art { animation: none !important; }
  #csResults, .cs-card, .cs-art { transition: none !important; }
}

/* ------------------------------------------------- image-backed card art */
.cs-art--img {
  background-size: cover;
  background-position: top center;   /* screenshots read from the top down */
  background-color: var(--brand-green-light);
}
