/*--------------------------------------------*/
/*  case study pages                           */
/*  builds on home.css (colors, fonts, nav,    */
/*  footer, iced/hot theme)                    */
/*--------------------------------------------*/

.cs {
  --col: 760px;
  --cs-pad: max(var(--gutter), calc((100% - var(--col)) / 2));
  padding-top: clamp(40px, 7vh, 80px);
}

.cs img {
  max-width: 100%;
  height: auto;
}

/* ----- type ----- */

.cs h1 {
  font-size: clamp(36px, 4.6vw, 56px) !important;
  font-weight: 600;
  line-height: 1.05 !important;
  letter-spacing: -0.035em;
}

.cs h2 {
  margin: 0 0 20px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.cs h3 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cs h4 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.cs h5,
.cs h6 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.cs p,
.cs li {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.cs p + p {
  margin-top: 14px;
}

.cs b,
.cs strong {
  font-weight: 600;
  color: var(--ink);
}

.cs ul {
  list-style: disc;
  margin: 12px 0 0;
  padding-left: 22px;
}

.cs ul ul {
  list-style: circle;
  margin-top: 4px;
}

.cs li + li {
  margin-top: 6px;
}

.cs a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cs a:hover {
  color: var(--accent);
}

.cs hr,
.cs hr.solid {
  height: 0;
  margin: 8px 0;
  border: 0;
  border-top: 1px solid var(--ink-faint);
}

/* colored "tag" highlights inside the copy stay readable in hot mode too */
.cs span[style*="background-color"] {
  padding: 1px 6px;
  border-radius: 4px;
  color: #1C1D22;
}

/* ----- hero ----- */

.cs > .container {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto 48px !important;
  padding-inline: var(--gutter);
}

.cs .intro {
  max-width: 34ch;
  margin-top: 14px;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}

.cs > .container .row {
  max-width: none !important;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-faint);
}

.cs > .container .row b {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
}

.cs .casestudy-details {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

/* hero image runs edge to edge, as before */
.cs > img {
  display: block;
  width: 100%;
}

/* ----- sections ----- */

.casestudy-container {
  padding: clamp(48px, 6vw, 80px) var(--cs-pad);
}

.casestudy-container.is-alt {
  background: var(--paper-raised);
  border-block: 1px solid var(--ink-faint);
}

.casestudy-container h2 + h4 {
  margin-top: 20px;
}

.caption,
.gif-caption {
  margin: 12px 0 48px !important;
  font-family: var(--font-mono);
  font-size: 13px !important;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-soft);
}

.caption b,
.gif-caption b {
  font-size: 13px;
  font-weight: 500 !important;
}

/* ----- grid (replaces bootstrap's) ----- */

.cs .row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -12px;
}

.cs [class*="col-sm-"] {
  width: 100%;
  padding-inline: 12px;
}

@media (min-width: 768px) {
  .cs .col-sm-2  { width: 16.666%; }
  .cs .col-sm-3  { width: 25%; }
  .cs .col-sm-4  { width: 33.333%; }
  .cs .col-sm-6  { width: 50%; }
  .cs .col-sm-8  { width: 66.666%; }
  .cs .col-sm-10 { width: 83.333%; }
}

@media (max-width: 767px) {
  .cs > .container .row [class*="col-sm-"] {
    width: 50%;
    margin-bottom: 16px;
  }
}

/* ----- page-specific bits carried over from the old styles ----- */

.phone-gif {
  width: 100%;
  padding: 32px 48px 8px;
  border-radius: 110px;
}

.checklist p {
  font-size: 14px;
  line-height: 1.6;
}

.search-gif {
  display: flex;
  justify-content: center;
  gap: 32px;
}

#priority-map {
  max-width: min(650px, 100%);
}

#takeaway5 {
  max-width: min(500px, 100%);
  margin-bottom: 32px;
}

/* expandable rows (five to nine) */
.accordion {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 32px 14px 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--ink-faint);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.accordion::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink-soft);
}

.accordion.activate::after {
  content: "–";
}

.panel {
  display: none;
  overflow: hidden;
  padding: 0 0 16px;
  background: none;
  border: 0;
  box-shadow: none;
}

/* before / after toggles (credible hub) */
.buttonstyle {
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.buttonstyle:hover {
  background: var(--ink);
  color: var(--paper);
}

/* "check out some other projects" */
#more-projects,
#more-projects-gray {
  row-gap: 12px;
  margin-top: 16px;
}

#more-projects button,
#more-projects-gray button {
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--ink-faint);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}

#more-projects button:hover,
#more-projects-gray button:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  #more-projects [class*="col-sm-"],
  #more-projects-gray [class*="col-sm-"] {
    width: 50%;
  }

  .phone-gif {
    padding: 24px 12px 8px;
  }

  .search-gif {
    flex-direction: column;
  }
}

/* ----- password page ----- */

.gate {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 160px);
  padding: 48px var(--gutter);
}

.gate-card {
  width: min(100%, 460px);
  text-align: center;
}

.gate-card h1 {
  margin-top: 8px;
  text-wrap: balance;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cs .gate-card h1 {
  font-size: 32px !important;
  line-height: 1.15 !important;
}

.gate-card .btn:disabled {
  opacity: .6;
  cursor: progress;
}

.gate-card p {
  margin-top: 10px;
  color: var(--ink-soft);
}

.gate-form {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.gate-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.gate-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gate-error {
  min-height: 24px;
  margin-top: 12px;
  font-size: 14px;
  color: #B4423A;
}

.gate-form .btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}
