/* ==========================================================================
   Case study — shared layout template
   Builds on style-guide/styles.css. Reused across every case study page.
   ========================================================================== */

:root {
  --col: 780px;
}

/* ----- Brand fruit cycler (shared with home) ----------------------------- */
.px-fruit {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
}
.px-fruit svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: px-fruit-cycle 5.6s steps(1) infinite;
}
.px-fruit svg:nth-child(1) { animation-delay: 0s; }
.px-fruit svg:nth-child(2) { animation-delay: -0.8s; }
.px-fruit svg:nth-child(3) { animation-delay: -1.6s; }
.px-fruit svg:nth-child(4) { animation-delay: -2.4s; }
.px-fruit svg:nth-child(5) { animation-delay: -3.2s; }
.px-fruit svg:nth-child(6) { animation-delay: -4.0s; }
.px-fruit svg:nth-child(7) { animation-delay: -4.8s; }
@keyframes px-fruit-cycle {
  0%, 14.28%   { opacity: 1; }
  14.29%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .px-fruit svg { animation: none; }
  .px-fruit svg:nth-child(1) { opacity: 1; }
}

/* ----- Brand mark (sun, spins on hover) ---------------------------------- */
.brand-mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  color: var(--ipe);
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 200ms var(--ease-back, cubic-bezier(.34,1.56,.64,1));
}
.brand:hover .brand-mark svg,
.brand:focus-visible .brand-mark svg {
  animation: sun-spin 800ms steps(8, end) 1;
}

/* ----- Footer socials (shared with home) --------------------------------- */
.foot-socials {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.foot-socials a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-1);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.foot-socials a:hover { color: var(--bougainvillea-strong); }

/* ----- Breadcrumb / Back link ------------------------------------------- */
.cs-breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-1);
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}
.cs-breadcrumb a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-fast) var(--ease), gap var(--t-fast) var(--ease);
}
.cs-breadcrumb a:hover { color: var(--bougainvillea-strong); gap: 10px; }
.cs-breadcrumb a .arrow { display: inline-block; transition: transform var(--t-fast) var(--ease); }
.cs-breadcrumb a:hover .arrow { transform: translateX(-2px); }

/* ----- Hero -------------------------------------------------------------- */
.cs-hero {
  margin-bottom: 32px;
}
.cs-title {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 12px;
}
.cs-lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 28px;
}

/* Hero stats — equal-height tiles laid out in a grid */
.cs-section .cs-hero-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  max-width: none;
  list-style: none;
}
.cs-section .cs-hero-stats .cs-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 88px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 16px 12px;
  background: transparent;
  text-align: center;
  box-sizing: border-box;
}
.cs-stat--accent {
  border-color: var(--ipanema-strong);
}
.cs-stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.cs-stat--accent .cs-stat-value { color: var(--ipanema-strong); }
.cs-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-1);
}
.cs-stat--accent .cs-stat-label { color: var(--ipanema-strong); }

@media (max-width: 720px) {
  .cs-hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .cs-hero-stats { grid-template-columns: 1fr; }
}

/* Hero outcomes — small mono pills, matched to home page */
.outcomes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.outcome {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--ipanema-50);
  color: var(--ipanema-strong);
  white-space: nowrap;
}

/* ----- Summary card (Context · Role · Solution · Outcome) ---------------- */
.cs-summary {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
}
.cs-summary-block h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--ink-1);
  font-weight: 500;
}
.cs-summary-block--outcome h3 { color: var(--ink-1); }
.cs-summary-block p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}
.cs-meta {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-1);
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* ----- Hero shot --------------------------------------------------------- */
.cs-hero-shot {
  margin-top: 48px;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-1);
  border: 1px dashed var(--line-2);
  background:
    repeating-linear-gradient(45deg,
      var(--bg) 0 8px,
      color-mix(in srgb, var(--bg) 70%, var(--line)) 8px 16px);
}
.cs-hero-shot img,
.cs-hero-shot video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* When an image is present, drop the placeholder treatment */
.cs-hero-shot--filled {
  aspect-ratio: auto;
  background: var(--bg);
  border: 0;
  padding: 0;
  overflow: hidden;
  display: block;
}
.cs-hero-shot--browser {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.cs-hero-shot--filled img,
.cs-hero-shot--filled video {
  height: auto;
  object-fit: contain;
}

.cs-browser-chrome {
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  position: relative;
  z-index: 2;
}
.cs-browser-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
}
.cs-browser-dots {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}
.cs-browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cs-browser-url {
  flex: 1 1 auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  text-align: center;
}
.cs-browser-tabs {
  display: flex;
  padding: 0 14px 8px;
}
.cs-browser-tab {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--ink);
}
.cs-hero-shot-caption {
  margin-top: 12px;
  font-size: 13px;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  font-style: italic;
  text-align: center;
}

.cs-video-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 16px auto 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: max-content;
}
.cs-hero-shot--filled video.is-hidden {
  display: none;
}

/* Crop a baked-in browser chrome out of the top of a video by shifting it up
   inside the overflow-hidden hero shot container. Tune --crop-top per video. */
.cs-hero-shot--browser {
  overflow: hidden;
}
.cs-hero-shot--filled video.cs-video-cropped {
  --crop-top: 40px;
  margin-top: calc(var(--crop-top) * -1);
}
.cs-video-toggle-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 120ms ease, color 120ms ease;
}
.cs-video-toggle-btn:hover {
  color: var(--ink);
}
.cs-video-toggle-btn.is-active {
  background: var(--ink);
  color: var(--bg);
}
.cs-video-toggle-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.7;
}
.cs-video-toggle-btn:focus-visible {
  outline: 2px solid var(--tijuca);
  outline-offset: 2px;
}

/* ----- Long-form sections ------------------------------------------------ */
.cs-section {
  margin-top: 64px;
}
.cs-section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-1);
  margin: 0 0 10px;
}
.cs-section h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--ink);
}
.cs-section p {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 14px;
}
.cs-section ul {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 14px;
  padding-left: 20px;
}
.cs-section li + li { margin-top: 4px; }

/* ----- Key decisions (before / after, stacked) ------------------------- */
.cs-decision {
  margin-top: 56px;
}
.cs-decision:first-of-type { margin-top: 0; }
.cs-decision-title {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}
.cs-decision-why {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

.cs-ba-figure {
  margin: 0;
  padding: 0;
}
.cs-ba-figure + .cs-ba-figure {
  margin-top: 20px;
}
.cs-inline-figure {
  margin-top: 28px;
}
.cs-inline-figure img {
  cursor: zoom-in;
  border: 1px solid var(--line);
}
.cs-ba-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-1);
  margin: 0 0 10px;
}
.cs-ba-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  background: var(--bg);
}

/* Dashed placeholder while a screenshot is still pending */
.cs-ba-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-2);
  background:
    repeating-linear-gradient(45deg,
      var(--bg) 0 7px,
      color-mix(in srgb, var(--bg) 70%, var(--line)) 7px 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-1);
}
.cs-ba-placeholder--after {
  border-color: var(--ipanema-strong);
  color: var(--ipanema-strong);
  background:
    repeating-linear-gradient(45deg,
      var(--ipanema-50) 0 7px,
      color-mix(in srgb, var(--ipanema-50) 70%, var(--surface)) 7px 14px);
}

/* ----- Takeaways --------------------------------------------------------- */
.cs-takeaways {
  padding: 0 0 0 20px;
  margin: 16px 0 0;
}
.cs-takeaways li {
  padding: 6px 0;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink-2);
}

/* ----- Quotes / qualitative feedback ------------------------------------- */
.cs-quotes {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 20px;
}
.cs-quote {
  border-left: 3px solid var(--ipe);
  padding: 4px 0 4px 20px;
}
.cs-quote p {
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 8px;
}
.cs-quote cite {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ----- Press / external link list ---------------------------------------- */
.cs-press {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
}
.cs-press li {
  border-top: 1px solid var(--line);
}
.cs-press li:last-child {
  border-bottom: 1px solid var(--line);
}
.cs-press a {
  display: block;
  padding: 14px 0;
  color: var(--ink-1);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}
.cs-press a:hover {
  color: var(--bougainvillea-strong);
  padding-left: 6px;
}
.cs-press a span {
  margin-left: 6px;
  color: var(--ink-2);
}

/* ----- Press as cards ---------------------------------------------------- */
.cs-press-cards {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.cs-press-cards.cs-press-cards { padding-left: 0; }
.cs-press-cards li,
.cs-press-cards li + li {
  display: block;
  margin-top: 0;
}
.cs-press-cards a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  aspect-ratio: 2 / 1;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-1);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.cs-press-cards a:hover {
  color: var(--tijuca-strong);
  border-color: var(--tijuca);
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--tijuca);
}
.cs-press-cards a .cs-press-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cs-press-cards a .cs-press-title {
  text-decoration: underline dotted transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--t-med) var(--ease);
}
.cs-press-cards a:hover .cs-press-title {
  text-decoration-color: var(--tijuca-strong);
}
.cs-press-cards a .cs-press-arrow {
  align-self: flex-end;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.cs-press-cards a:hover .cs-press-arrow {
  color: var(--tijuca);
  transform: translate(2px, -2px);
}

@media (max-width: 720px) {
  .cs-press-cards {
    grid-template-columns: 1fr;
  }
  .cs-press-cards a {
    aspect-ratio: auto;
    min-height: 140px;
    gap: 16px;
  }
}

/* ----- Next link --------------------------------------------------------- */
.cs-next {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.cs-next-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-1);
}
.cs-next-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color var(--t-fast) var(--ease);
}
.cs-next-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background-image: linear-gradient(to right, var(--bougainvillea-strong) 50%, transparent 50%);
  background-size: 4px 2px;
  background-repeat: repeat-x;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-med) var(--ease);
}
.cs-next-link:hover { color: var(--bougainvillea-strong); }
.cs-next-link:hover::after { transform: scaleX(1); }

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  .cs-title { font-size: 28px; }
  .cs-lede { font-size: 16px; }
  .cs-hero-stats { grid-template-columns: 1fr; }
  .cs-summary { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .cs-section { margin-top: 48px; }
}

/* =========================================================
   Lightbox (zoomable images)
   ========================================================= */
.cs-lightbox {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 60px;
  background: var(--surface);
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  width: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  overflow: visible;
}
.cs-lightbox::backdrop {
  background: rgba(26, 20, 16, 0.72);
  backdrop-filter: blur(4px);
}
.cs-lightbox-img {
  display: block;
  max-width: min(calc(96vw - 120px), 1280px);
  max-height: calc(92vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-out;
}
.cs-lightbox-video {
  display: block;
  max-width: min(calc(96vw - 120px), 1280px);
  max-height: calc(92vh - 120px);
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #000;
}
.cs-lightbox-video[hidden] { display: none; }
.cs-lightbox-img[hidden] { display: none; }
.cs-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  background-clip: border-box;
  color: var(--ink-1);
  font-size: 22px;
  line-height: 1;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease;
}
.cs-lightbox-close:hover {
  transform: scale(1.08);
  border-color: var(--tijuca);
  color: var(--tijuca);
}
.cs-lightbox-close:focus-visible {
  outline: 2px solid var(--tijuca);
  outline-offset: 0;
}
