/* Case-study pages: shared layout, type and motion.
   Each page sets its palette in assets/css/pages/case-<slug>.css through
   the --cs-* tokens below and the --accent brand colour. */

:root {
  --accent: var(--blue);
  --cs-ink: var(--ink);
  --cs-muted: #55524a;
  --cs-faint: #8a877e;
  --cs-line: rgb(17 17 17 / 12%);
  --cs-bg: var(--paper);
  --cs-dark: #111;
  --cs-dark-card: #1d1d1d;
  --cs-dot: var(--accent);
  --cs-dot-dark: var(--accent);
  --cs-dot-radius: 50%;
}

body { background: var(--cs-bg); color: var(--cs-ink); }
#main { overflow-x: clip; }

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

.cs-s { position: relative; padding: 112px var(--gutter); }
.cs-s--120 { padding-block: 120px; }
.cs-s--96 { padding-block: 96px; }
.cs-s.cs-s--flush-top { padding-top: 0; }
.cs-s.cs-s--flush-bottom { padding-bottom: 0; }
.cs-s--clip { overflow: clip; }
.cs-s--dark { background: var(--cs-dark); color: var(--white); }
.cs-inner { position: relative; max-width: var(--maxw); margin: 0 auto; width: 100%; }
.cs-col { display: flex; flex-direction: column; gap: 56px; }
.cs-col--48 { gap: 48px; }
.cs-col--40 { gap: 40px; }

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

.cs-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--cs-faint);
}
.cs-kicker::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: var(--cs-dot-radius); background: var(--cs-dot); }
.cs-kicker--plain::before { display: none; }
.cs-kicker--center { justify-content: center; }
.cs-kicker--flat { margin-bottom: 0; }
.cs-s--dark .cs-kicker,
.cs-kicker--on-dark { color: rgb(255 255 255 / 60%); }
.cs-s--dark .cs-kicker::before,
.cs-kicker--on-dark::before { background: var(--cs-dot-dark); }

.cs-h2 { font-weight: 600; font-size: clamp(30px, 3.2vw, 52px); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.cs-h2--lg { font-size: clamp(32px, 3.8vw, 64px); line-height: 1.02; letter-spacing: -.04em; }
.cs-h3 { font-weight: 600; font-size: clamp(28px, 2.8vw, 44px); line-height: 1.06; letter-spacing: -.035em; }
.cs-lead { max-width: 560px; font-size: 17px; line-height: 1.65; color: var(--cs-muted); }
.cs-lead--wide { max-width: none; }
.cs-s--dark .cs-lead { color: rgb(255 255 255 / 70%); }
.cs-accent { color: var(--accent); }
.cs-serif { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.02em; }

/* ---------- layout ---------- */

.cs-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 96px; align-items: end; }
.cs-head--stack { display: block; max-width: 820px; }
.cs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 96px; align-items: center; }
.cs-2--80 { column-gap: 80px; }
.cs-stack { display: flex; flex-direction: column; gap: 22px; }
.cs-stack--narrow { max-width: 560px; }
.cs-stack--540 { max-width: 540px; }
.cs-stack .cs-kicker { margin-bottom: 0; }
.cs-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; }

/* ---------- small components ---------- */

.cs-meta { display: flex; flex-wrap: wrap; gap: 20px 44px; margin: 0; font-size: 14px; }
.cs-meta dt { margin-bottom: 4px; color: var(--cs-faint); }
.cs-meta dd { margin: 0; font-weight: 500; }
.cs-meta--rule { padding-top: 24px; border-top: 1px solid var(--cs-line); }
.cs-meta--inline div { display: flex; gap: 6px; }
.cs-meta--inline dt { margin: 0; }

.cs-points { display: flex; flex-direction: column; border-top: 1px solid var(--cs-line); }

.cs-points li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--cs-line);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.5;
}
.cs-points li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: var(--cs-dot-radius); background: var(--cs-dot); transform: translateY(-2px); }

.cs-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.cs-pill { padding: 10px 18px; border-radius: 999px; background: var(--white); box-shadow: 0 0 0 1px var(--cs-line); font-size: 14px; }

.cs-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; }
.cs-rules > li { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 1px solid var(--cs-line); }
.cs-rules h3 { font-weight: 600; font-size: 20px; }
.cs-rules p { font-size: 15px; line-height: 1.65; color: var(--cs-muted); }
.cs-s--dark .cs-rules > li { border-color: rgb(255 255 255 / 14%); }
.cs-s--dark .cs-rules p { color: rgb(255 255 255 / 65%); }



/* ---------- media ---------- */

.cs-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cs-zoom { overflow: hidden; }
.cs-zoom img { transition: transform 1.2s var(--ease); }
.cs-zoom:hover img { transform: scale(1.04); }

.cs-fade-edges {
  mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%), linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
  mask-composite: intersect;
}

.cs-video { display: block; width: 100%; height: auto; max-height: 100vh; object-fit: cover; }

/* ---------- marquee + tool chips ---------- */

@keyframes cs-marq {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-50% - var(--marq-gap, 16px) / 2), 0, 0); }
}

.cs-marquee { overflow: hidden; }
.cs-marquee--fade { mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.cs-marquee__track { display: flex; gap: var(--marq-gap, 16px); width: max-content; animation: cs-marq 40s linear infinite; }
.cs-marquee--rev .cs-marquee__track { animation-direction: reverse; animation-duration: 46s; }
.cs-marquee--pause .cs-marquee__track:hover { animation-play-state: paused; }

.cs-tool {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  padding: 16px 26px 16px 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 18px 40px -30px rgb(0 0 0 / 30%), 0 0 0 1px var(--cs-line);
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
}
.cs-tool img { width: 34px; height: 34px; object-fit: contain; }


/* ---------- accordion ([data-cs-acc]) ---------- */

.cs-acc__item button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.cs-acc__panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .5s var(--ease), visibility .5s; }
.cs-acc__panel > div { min-height: 0; overflow: hidden; }
.cs-acc__item.is-open .cs-acc__panel { grid-template-rows: 1fr; visibility: visible; }

.cs-acc__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  transition: all .3s ease;
}
.cs-acc__icon::before { content: '+'; }
.is-open .cs-acc__icon::before { content: '\2212'; }

/* ---------- motion (assets/js/pages/case-study.js) ---------- */

.rv-pending { opacity: 0; transform: translate3d(0, 32px, 0); transition: opacity .9s cubic-bezier(.4, 0, .2, 1), transform 1.1s var(--ease); }
.rv-pending.rv-card { transform: translate3d(0, 48px, 0) scale(.97); }
.rv-pending.rv-head { transform: translate3d(0, 44px, 0); filter: blur(8px); transition: filter 1s var(--ease), transform 1.2s var(--ease), opacity .9s ease; }
.rv-pending.rv-img { opacity: 1; clip-path: inset(10% 6% 10% 6% round 28px); transform: scale(1.06); transition: clip-path 1.3s var(--ease), transform 1.6s var(--ease); }
.rv-pending.rv-in { opacity: 1; transform: none; filter: none; clip-path: inset(0 0 0 0 round 0); }

@media (prefers-reduced-motion: reduce) {
  .cs-marquee__track { animation: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .cs-s { padding-block: 88px; }
}

@media (max-width: 1000px) {
  .cs-head,
  .cs-2 { grid-template-columns: 1fr; }
  .cs-2--rev > :first-child { order: 2; }
}

@media (max-width: 720px) {
  .cs-acc__item button { min-height: 44px; }
  .cs-meta:not(.cs-meta--inline) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
  .cs-meta:not(.cs-meta--inline) > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Scene images: a tighter crop (picture source) running edge to edge, with a softer fade. */
  main figure.cs-bleed-m { justify-self: stretch; width: calc(100% + 2 * var(--gutter)); max-width: none; margin-inline: calc(var(--gutter) * -1); }

  .cs-fade-edges {
    mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(180deg, transparent 0, #000 4%, #000 96%, transparent 100%);
  }

  .cs-s { padding-block: 64px; }
}
