/* ============================================================
   casestudy.css — full styles for fintech.html + wander.html
   ============================================================ */

body {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100dvh;
}

#bottom-bar {
  position: sticky;
  bottom: 0;
}

/* ── HERO SECTION ──────────────────────────────────────────── */
.cs-hero-section {
  height: auto;
  display: flex;
  flex-direction: column;
}

/* clickable full-bleed hero image wrapper */
.cs-hero-bg-wrap {
  height: 80vh;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: zoom-in;
  max-width: var(--content-max);
  margin-inline: auto;
  width: 100%;
}

.cs-hero-bg-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* blur-to-sharp load animation */
.cs-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: zoom-in;
  -webkit-user-drag: none;
  animation: csBlurToSharp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* hover hint */
.cs-hero-zoom-hint {
  position: absolute;
  bottom: 16px;
  right: 20px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cs-hero-bg-wrap:hover .cs-hero-zoom-hint {
  opacity: 1;
}

/* text below the hero image — no horizontal padding on the strip so
   cs-hero-text-inner shares the same centering box as cs-content-col */
.cs-hero-text-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  padding: 20px 0 8px;
  max-width: var(--content-max);
  margin-inline: auto;
  width: 100%;
}

/* Match .cs-content-col exactly so headline lines up with body text */
.cs-hero-text-inner {
  width: 60%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* kicker above h1 */
.cs-mono-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  transition: color var(--speed);
}

/* main hero heading */
.cs-h1 {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1;
  color: var(--text1);
  margin-bottom: 12px;
  transition: color var(--speed);
}

/* confidentiality note — uses same tokens as the footer panel */
.cs-confidential-banner {
  margin-top: 20px;
  background: var(--nav-blur-bg);      /* matches #bottom-bar background */
  border: 0.5px solid var(--nav-border); /* matches #bottom-bar border token */
  border-radius: 2px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  line-height: 1.5;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  color: var(--text2);
  transition: background var(--speed), color var(--speed), border-color var(--speed);
}

.cs-confidential-banner strong {
  color: var(--text1);
  font-weight: 500;
}

/* ── 2-COLUMN LAYOUT ─────────────────────────────────────── */
.cs-content-section {
  min-height: 100vh;
  max-width: var(--content-max);
  margin-inline: auto;
}

.cs-content-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  align-items: start;
}

/* ── TOC (sticky left column) ──────────────────────────────── */
.cs-toc {
  position: sticky;
  top: 68px;
  z-index: 60; /* below nav (z-index: 100) so Work dropdown appears on top */
  align-self: start;
  width: 220px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 32px 24px 48px 32px;
  background: transparent; /* sits directly on page background */
}

.cs-toc::-webkit-scrollbar { display: none; }

.cs-toc-header {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 24px;
  transition: color var(--speed);
}

.cs-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-toc-item a {
  display: flex;
  flex-direction: column;
  padding: 7px 0 7px 12px;
  text-decoration: none;
  color: var(--text2);
  border-left: 2px solid transparent;
  transition: color var(--speed), border-color 0.25s ease;
}

.cs-toc-item a:hover { color: var(--text1); }

.cs-toc-item.active a {
  color: var(--accent);
  border-left-color: var(--accent);
}

.cs-toc-num {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: inherit;
  opacity: 0.7;
  margin-bottom: 2px;
}

.cs-toc-title {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-base);
  line-height: 1.1;
  color: inherit;
}

.cs-toc-item a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}

/* Trigger button — hidden on desktop, shown on mobile via @media below */
.cs-toc-trigger {
  display: none;
}

/* ── RIGHT CONTENT COLUMN ─────────────────────────────────── */
.cs-j-content {
  padding-top: 32px;
  padding-bottom: 140px;
  width: calc(100% + 220px);
  margin-left: -220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  z-index: 0;
}

/* 60% centered column inside jContent */
.cs-content-col {
  width: 60%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── OVERVIEW ─────────────────────────────────────────────── */
.cs-j-overview {
  margin-bottom: 0;
}

.cs-challenge {
  padding: 0 0 60px;
}

/* large intro paragraph */
.cs-hero-subtitle {
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text2);
  margin-bottom: 28px;
  transition: color var(--speed);
}

/* project meta row — equal-width 3-column table layout */
.cs-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 32px;
  padding: 18px 0;
  margin-bottom: 28px;
  border-top: 0.5px solid var(--card-border);
  border-bottom: 0.5px solid var(--card-border);
  transition: border-color var(--speed);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-meta-key {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text3);
  transition: color var(--speed);
}

.cs-meta-val {
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.25;
  transition: color var(--speed);
}

/* challenge label + heading */
.cs-section-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
  transition: color var(--speed);
}

.cs-section-heading {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text1);
  margin-bottom: 20px;
  line-height: 1.15;
  transition: color var(--speed);
}

/* stats grid */
.cs-stats-section {
  padding: 0;
  margin-bottom: 60px;
}

/* add breathing room when stats follow an insight callout */
.cs-cb-insight + .cs-stats-section {
  margin-top: 10px;
}

.cs-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.cs-stats-row-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 420px;
}

.cs-stats-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cs-stat-card {
  padding: 16px 12px;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  transition: background var(--speed), border-color var(--speed);
}

.cs-stat-number {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xl);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 5px;
  transition: color var(--speed);
}

.cs-stat-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  color: var(--text3);
  transition: color var(--speed);
}

/* ── JOURNEY PHASES ─────────────────────────────────────── */
.cs-j-phase {
  padding-bottom: 60px;
}

.cs-j-phase:last-of-type {
  padding-bottom: 20px;
}

.cs-j-phase-num {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
  margin-bottom: 6px;
  transition: color var(--speed);
}

.cs-j-phase-title {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text1);
  margin-bottom: 24px;
  transition: color var(--speed);
}

/* ── CONTENT BLOCKS ─────────────────────────────────────── */
.cs-cb { margin-bottom: 32px; }

/* serif section intro (long italic heading) */
.cs-cb-section-heading {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text1);
  margin-bottom: 24px;
  transition: color var(--speed);
}

/* all-caps mono sub-heading */
.cs-cb-heading {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
  transition: color var(--speed);
}

/* body paragraph */
.cs-cb-p {
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text2);
  margin-bottom: 16px;
  transition: color var(--speed);
}

/* bulleted / numbered findings inside content blocks
   Overrides the global `ul, ol { list-style: none }` reset in style.css */
.cs-cb-findings {
  list-style-type: disc;
  list-style-position: outside;
  margin: 0 0 16px;
  padding-left: 1.35em;
}

ol.cs-cb-findings {
  list-style-type: decimal;
}

.cs-cb-findings li {
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text2);
  margin-bottom: 10px;
  padding-left: 0.25em;
  transition: color var(--speed);
}

.cs-cb-findings li::marker {
  color: var(--text3);
}

.cs-cb-findings li:last-child {
  margin-bottom: 0;
}

/* zoomable image */
.cs-cb-img {
  margin: 16px 0 0;
  border-radius: 2px;
  overflow: hidden;
  cursor: zoom-in;
}

.cs-cb-img:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cs-cb-img img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  -webkit-user-drag: none;
}

/* 2/3 text + 1/3 image split block */
.cs-cb-split-body {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  align-items: start;
}

.cs-cb-split-body > .cs-cb-p,
.cs-cb-split-body > .cs-cb-split-text {
  grid-column: 1;
  margin-top: 0;
}

.cs-cb-split-body > .cs-cb-split-text > .cs-cb-p:last-child {
  margin-bottom: 0;
}

.cs-cb-split-body > .cs-cb-img,
.cs-cb-split-body > .cs-cb-qr {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
  align-self: start;
}

/* Compact QR block — stays small, scannable, not full-bleed */
.cs-cb-qr {
  margin: 0;
  max-width: 140px;
  width: 100%;
  justify-self: end;
}

.cs-cb-qr img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.cs-cb-qr .cs-cb-caption {
  text-align: center;
  margin-top: 8px;
}

/* Live prototype external link */
.cs-prototype-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--speed);
}

.cs-prototype-link:hover {
  opacity: 0.75;
}

.cs-prototype-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Star mode only: subtle white backing for Lila image */
body:not(.shore) .cs-cb-img-lila {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 8px;
}

/* image caption */
.cs-cb-caption {
  font-size: var(--text-sm);
  color: var(--text3);
  margin-top: 6px;
  margin-bottom: 20px;
  font-style: italic;
  transition: color var(--speed);
}

/* caption immediately followed by a block that opens with a section heading (e.g. Components) */
.cs-cb-caption + .cs-cb:has(> .cs-cb-heading:first-child) {
  padding-top: 20px;
}

/* bento image grid (2-up) */
.cs-cb-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.cs-cb-bento-item {
  border-radius: 2px;
  overflow: hidden;
  cursor: zoom-in;
}

.cs-cb-bento-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cs-cb-bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  -webkit-user-drag: none;
}

/* callout box — accent-tinted left-border, used for insights and challenge callouts */
.cs-cb-insight {
  padding: 16px 20px;
  background: var(--accent-dim);
  border-radius: 0 2px 2px 0;
  border-left: 3px solid var(--accent);
  margin: 18px 0;
  transition: background var(--speed), border-color var(--speed);
}

.cs-cb-insight h5 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text1);
  transition: color var(--speed);
}

.cs-cb-insight p {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text2);
  margin: 0;
  transition: color var(--speed);
}

/* ── FINTECH-SPECIFIC ─────────────────────────────────────── */

/* 3-mode learning grid */
.cs-j-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.cs-j-mode {
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--card-bg);
  transition: background var(--speed), border-color var(--speed);
}

.cs-j-mode .cs-cb-p {
  margin-bottom: 0;
}

/* 3-column outcomes grid */
.cs-cb-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.cs-cb-result {
  padding: 16px;
  text-align: center;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--card-bg);
  transition: background var(--speed), border-color var(--speed);
}

.cs-cb-result-num {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
  transition: color var(--speed);
}

.cs-cb-result-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  color: var(--text3);
  transition: color var(--speed);
}

/* ── WANDER-SPECIFIC ──────────────────────────────────────── */

/* research method cards (3-col) */
.cs-cb-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.cs-cb-method {
  padding: 16px 14px;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--card-bg);
  transition: background var(--speed), border-color var(--speed);
}

.cs-cb-method-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text1);
  transition: color var(--speed);
}

.cs-cb-method-desc {
  font-size: var(--text-sm);
  color: var(--text3);
  line-height: 1.25;
  transition: color var(--speed);
}

/* core flow cards (2-col) */
.cs-cb-flows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.cs-cb-flow {
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--accent-dim);
  transition: background var(--speed), border-color var(--speed);
}

.cs-cb-flow-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  transition: color var(--speed);
}

.cs-cb-flow-desc {
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.25;
  transition: color var(--speed);
}

/* Fogg B = MAP model display */
.cs-cb-fogg {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--accent-dim);
  transition: background var(--speed), border-color var(--speed);
}

.cs-fogg-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  transition: border-color var(--speed);
}

.cs-fogg-row:last-child { border-bottom: none; }

.cs-fogg-letter {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--accent);
  font-weight: 500;
  line-height: 1;
  padding-top: 4px;
  transition: color var(--speed);
}

.cs-fogg-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 3px;
  transition: color var(--speed);
}

.cs-fogg-text {
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.25;
  transition: color var(--speed);
}

/* GIF / video split layout */
.cs-gif-split {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.cs-gif-text-col {
  flex: 1 1 auto;
  min-width: 0;
}

.cs-cb-video {
  margin: 0;
  flex: 0 0 auto;
  border-radius: 2px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: background var(--speed), border-color var(--speed);
}

.cs-cb-video-gif {
  height: 50vh;
  width: auto;
  max-width: 46vw;
  display: block;
}

/* ── END ROW ──────────────────────────────────────────────── */
.cs-end-row {
  width: 60%;
  max-width: 720px;
  margin: 60px auto 20px;
  padding: 0 24px;
}

.cs-next-project-link {
  display: block;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  background: var(--card-bg);
  text-decoration: none;
  transition: background var(--speed), border-color var(--speed), box-shadow 0.25s;
}

.cs-next-project-link:hover {
  box-shadow: 0 4px 24px rgba(138, 90, 255, 0.15);
  border-color: var(--accent);
}

body.shore .cs-next-project-link:hover {
  box-shadow: 0 4px 24px rgba(30, 100, 220, 0.15);
}

.cs-next-project-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cs-next-label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text3);
  margin-bottom: 8px;
  transition: color var(--speed);
}

.cs-next-title {
  font-family: var(--font-display), 'Apple Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: var(--text-xl);
  line-height: 1.25; /* matches cs-j-phase-title — same font, same role */
  color: var(--text1);
  transition: color var(--speed);
}

/* ── LIGHTBOX ─────────────────────────────────────────────── */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}

.cs-lightbox.open {
  display: flex;
}

.cs-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  cursor: default;
}

.cs-lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;

  transition: color 0.3s, border-color 0.3s;
}

/* Overlay is always dark — keep control labels light regardless of page theme */
.cs-lightbox-close:hover  { color: #f0ecf7; border-color: rgba(240, 236, 247, 0.45); }
.cs-lightbox-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── SCROLL ANIMATIONS ─────────────────────────────────────── */
@keyframes csBlurToSharp {
  from { filter: blur(10px); opacity: 0.3; }
  to   { filter: blur(0px);  opacity: 1;   }
}

@keyframes csHeldReveal {
  0%   { opacity: 0; transform: translateY(16px); }
  35%  { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0);    }
}

@keyframes csScanIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.cs-anim {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity   0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-anim.visible {
  opacity: 1;
  transform: translateY(0);
}

.cs-anim-held {
  opacity: 0;
  transform: translateY(16px);
}

.cs-anim-held.visible {
  animation: csHeldReveal 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.cs-anim-scan {
  opacity: 0;
  transform: translateY(10px);
}

.cs-anim-scan.visible {
  animation: csScanIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cs-anim-content {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity   0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.6s;
}

.cs-anim-content.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .cs-anim, .cs-anim-held, .cs-anim-scan, .cs-anim-content {
    opacity: 1; transform: none; transition: none; animation: none;
  }
  .cs-hero-bg { animation: none; }
  .cs-hero-zoom-hint { transition: none; }
}

/* ── BEFORE / AFTER SLIDER ────────────────────────────────── */
.cs-ba-slider {
  position: relative;
  margin: 16px 0 0;
  border-radius: 2px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* AFTER panel — sits at natural image size, drives the container height */
.cs-ba-after {
  position: relative;
  width: 100%;
  display: block;
}

.cs-ba-after img {
  width: 100%;
  display: block;
}

/* BEFORE panel — same footprint as after, reveal controlled by clip-path */
.cs-ba-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0); /* JS updates the right-side value */
}

.cs-ba-before img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top left;
  pointer-events: none;   /* all mouse events pass through to the slider container */
  -webkit-user-drag: none; /* Safari: disable native image drag */
}

.cs-ba-after img {
  pointer-events: none;
  -webkit-user-drag: none;
}

/* divider line */
.cs-ba-divider {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 5;
}

/* drag handle */
.cs-ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cs-ba-handle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #555;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.cs-ba-slider.is-dragging .cs-ba-handle {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.45), 0 0 0 5px rgba(167, 139, 250, 0.2);
  transform: translate(-50%, -50%) scale(1.08);
}

/* corner labels */
.cs-ba-label {
  position: absolute;
  top: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 4;
}

.cs-ba-label-before {
  left: 12px;
  background: rgba(0, 0, 0, 0.72);   /* Fix 5: darkened for legibility over any image */
  border: 1px solid rgba(167, 139, 250, 0.50);
  color: rgba(255, 255, 255, 0.90);
}

.cs-ba-label-after {
  right: 12px;
  background: rgba(0, 0, 0, 0.58);   /* Fix 5: darkened for legibility */
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.90);
}

/* zoom hint — fades in on hover, same pattern as cs-hero-zoom-hint */
.cs-ba-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 9px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cs-ba-slider:hover .cs-ba-zoom-hint {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .cs-ba-handle { transition: none; }
  .cs-ba-zoom-hint { transition: none; }
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
/* Raised from 900px → 1024px so tablets (768–1024px) get the   */
/* single-column layout instead of the cramped 220px+60% grid.  */
@media (max-width: 1024px) {
  .cs-content-grid    { grid-template-columns: 1fr; }
  .cs-j-content       { width: 100%; margin-left: 0; }
  .cs-content-col     { width: 90%; max-width: 100%; padding: 0 16px; }
  /* Remove the strip's horizontal padding so cs-hero-text-inner lines up
     with cs-content-col (same width:90%+margin:auto+padding:0 16px). */
  .cs-hero-text-strip { padding-left: 0; padding-right: 0; }
  .cs-hero-text-inner { width: 90%; max-width: 100%; padding: 0 16px; }
  .cs-stats-row       { grid-template-columns: repeat(2, 1fr); }
  .cs-cb-bento        { grid-template-columns: 1fr; }
  .cs-cb-methods      { grid-template-columns: 1fr; }
  .cs-cb-flows        { grid-template-columns: 1fr; }
  .cs-j-modes         { grid-template-columns: 1fr; }
  .cs-cb-results      { grid-template-columns: repeat(2, 1fr); }
  .cs-end-row         { width: 90%; max-width: 100%; padding: 0 16px; }

  /* TOC: switch from sticky sidebar to sticky dropdown bar */
  .cs-toc {
    position: sticky;
    top: var(--nav-height, 68px);
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding: 0;
    background: var(--nav-blur-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 0.5px solid var(--nav-border);
    z-index: 60;
    align-self: auto;
  }

  /* Hide the static "Contents" header — replaced by the trigger button */
  .cs-toc-header { display: none; }

  /* Fix 4B: more opaque background so TOC is visually distinct
     from content scrolling behind it. */
  .cs-toc {
    background: rgba(12, 15, 29, 0.92);
  }
  body.shore .cs-toc {
    background: rgba(245, 239, 230, 0.95);
  }

  /* Fix 3: TOC left edge aligns with cs-content-col text.
     cs-content-col is width:90% + margin:auto + padding:0 16px, so its
     text starts at calc(5% + 16px) from the left viewport edge. Match that. */
  /* Show the trigger button */
  .cs-toc-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0 calc(5% + 16px);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono), ui-monospace, monospace;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text2);
    transition: color var(--speed);
  }

  .cs-toc-trigger:hover { color: var(--text1); }

  .cs-toc-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  .cs-toc-trigger-label { color: var(--accent); }

  .cs-toc-trigger-arrow {
    font-size: 14px;
    color: var(--text3);
    transition: transform 0.2s ease;
  }

  .cs-toc.open .cs-toc-trigger-arrow {
    transform: rotate(180deg);
  }

  /* List is hidden until .open is toggled */
  .cs-toc-list {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px calc(5% + 16px) 12px;
    border-top: 0.5px solid var(--nav-border);
  }

  .cs-toc.open .cs-toc-list { display: flex; }

  /* Slightly compact list items inside dropdown */
  .cs-toc-item a {
    border-left: none;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--nav-border);
  }

  .cs-toc-item:last-child a { border-bottom: none; }

  .cs-toc-item.active a {
    border-left: none;
    color: var(--accent);
  }
}

@media (max-width: 768px) {
  /* Hero height is auto at all breakpoints; only image height changes on mobile */
  .cs-hero-bg-wrap    { height: 50vh; }
  .cs-gif-split       { flex-direction: column; }
  .cs-cb-video-gif    { height: auto; max-width: 100%; width: 100%; }
  .cs-cb-split-body   { grid-template-columns: 1fr; }
  .cs-cb-split-body > .cs-cb-img,
  .cs-cb-split-body > .cs-cb-qr {
    grid-column: 1;
    grid-row: auto;
    margin-top: 8px;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .cs-hero-text-strip { padding: 16px 0; }
  /* stack meta items vertically on small screens */
  .cs-meta-row {
    grid-template-columns: 1fr;
    gap: 16px 0;
  }
  /* Fix 4: make before/after handle easier to target on touch */
  .cs-ba-handle {
    width: 44px;
    height: 44px;
  }
  /* fluid tokens handle minimum sizes at all viewports */
}
