/* ==========================================================================
   Case study v2: layouts and animations
   Used by case study pages exported from 04 Tools/case-study-builder.
   Loads after styles.css. Mobile-first: 768 tablet, 1024 desktop, 1440 large desktop.
   Animations only run when case-study-v2.js adds .cs2-js to <html>,
   so without JavaScript everything shows in its final state.

   The layouts were first written for the previous site. Section 0 maps
   their token names onto this site's tokens (00 Context/visual-direction.md),
   so every color, font and radius below comes from styles.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Bridge to the site tokens
   -------------------------------------------------------------------------- */

:root {
  --header-h: 65px;

  /* surfaces: cream page, sand panels, ink bands */
  --bg-page: var(--bg);
  --bg-surface: var(--bg);
  --bg-gray-panel: var(--surface);
  --bg-warm: var(--surface);
  --bg-warm-strong: var(--surface);
  --bg-dark: var(--ink);

  /* text */
  --text-headline: var(--text);
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-disabled: var(--line);
  --text-on-dark: var(--cream);
  --hairline: var(--line);

  /* --accent drew decoration in the old layouts. Violet is for interactive
     elements only, so decoration is ink; links and focus rings use
     --interactive (see section 99 at the end of this file). */
  --accent: var(--text);
  --accent-light: var(--sand);

  /* type: Schibsted Grotesk for headings, Satoshi for everything else */
  --font-heading: var(--font-head);
  --font-label: var(--font-body);
  --h5: 20px;
  --p-large: var(--lead);
  --p-small: var(--small);
  --label: var(--caption);

  /* spacing (old 4px scale, same values) */
  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 32px;
  --s-6: 48px; --s-7: 64px; --s-8: 96px; --s-9: 120px;

  --max-width: var(--max);
  --section-pad: var(--section);
  --r-small: var(--radius);
  --r-large: var(--radius);
  --dur-fast: var(--fast);
  --dur: 500ms;
}
:root[data-theme="dark"] {
  --bg-dark: #2E2B29;
  --accent-light: #3A3633;
}
@media (min-width: 768px) {
  :root { --header-h: 73px; }
}
@media (min-width: 1024px) {
  :root { --h5: 24px; }
}

/* Type helpers the layouts expect */
.h1 { font-size: var(--h1); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.h2 { font-size: var(--h2); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.h3 { font-size: var(--h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.h4, .h5 { font-size: var(--h4); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.h5 { font-size: var(--h5); }
.cs2-sec h5 { font-family: var(--font-head); font-weight: 600; font-size: var(--h5); line-height: 1.3; letter-spacing: -0.01em; color: var(--text); }
.p-large { font-size: var(--lead); line-height: 1.55; }
.p-small { font-size: var(--small); line-height: 1.5; }
.text-secondary { color: var(--text-2); }

/* eyebrow and label: the site's caption style, text primary */
.eyebrow, .label {
  display: block;
  font-family: var(--font-body); font-weight: 700; font-size: var(--caption);
  line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text);
}
.label { display: inline; }
.eyebrow--rule { padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7, .mt-8 { margin-top: var(--s-7); }

/* the old italic violet phrase becomes the site's highlighter band */
.cs2-sec :is(h1, h2, h3, h4, h5) em {
  font-style: normal; color: inherit;
  background-image: linear-gradient(var(--amber), var(--amber));
  background-repeat: no-repeat; background-position: 0 90%; background-size: 100% 34%;
  padding: 0 0.04em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:root[data-theme="dark"] .cs2-sec :is(h1, h2, h3, h4, h5) em { background-size: 100% 100%; color: var(--ink); }
.cs2-sec p { max-width: none; }


/* --------------------------------------------------------------------------
   1. Sections: full width, three tones
   -------------------------------------------------------------------------- */

.cs2-sec {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--bg-page);
  overflow-x: clip;
}

.cs2-sec--white { background: var(--bg-surface); }

/* A section that is only a full-width band: no padding, so it touches its neighbors */
.cs2-sec--flush { padding-block: 0; }

.cs2-sec--dark {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.8);
}

.cs2-sec--dark :is(h1, h2, h3, h4, h5, .cs2-serif) { color: var(--text-on-dark); }
.cs2-sec--dark :is(.eyebrow, .label) { color: var(--accent-light); }
.cs2-sec--dark .eyebrow--rule { border-color: rgba(255, 255, 255, 0.16); }

/* Zero-specificity resets, so spacing classes like .mt-5 still apply */
:where(.cs2-sec) :where(figure, blockquote, dl, dd) { margin: 0; }
:where(.cs2-sec) :where(ol, ul) { margin: 0; padding: 0; list-style: none; }

/* --------------------------------------------------------------------------
   2. Type helpers
   -------------------------------------------------------------------------- */

.cs2-serif {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.01em;
  color: var(--text-headline);
}

.cs2-headline { max-width: 22ch; }
.cs2-measure { max-width: 46rem; }
.cs2-center { text-align: center; }
.cs2-mx-auto { margin-inline: auto; }
.cs2-block { display: block; }

.cs2-num {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--h4);
  line-height: 1;
  color: var(--accent);
}

.cs2-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
}

.cs2-list > li {
  position: relative;
  padding-left: var(--s-4);
}

.cs2-list > li + li { margin-top: var(--s-3); }

.cs2-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.cs2-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   3. Grids and splits
   -------------------------------------------------------------------------- */

.cs2-grid {
  display: grid;
  gap: var(--s-4);
}

.cs2-split {
  display: grid;
  gap: var(--s-6);
  align-items: start;
}

.cs2-stack-lg > * + * { margin-top: var(--s-7); }

.cs2-rows {
  display: grid;
  gap: var(--s-7);
}

.cs2-center-x {
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .cs2-grid--2,
  .cs2-grid--3,
  .cs2-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .cs2-grid { gap: var(--s-5); }
  .cs2-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs2-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .cs2-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-8);
  }
  .cs2-split--label { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .cs2-split--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .cs2-split--center { align-items: center; }
  .cs2-split--reverse > :first-child { order: 2; }

  .cs2-rows { gap: var(--s-8); }

  .cs2-sticky {
    position: sticky;
    top: calc(var(--header-h, 65px) + var(--s-5));
  }
}

/* --------------------------------------------------------------------------
   4. Cards and meta
   -------------------------------------------------------------------------- */

.cs2-card {
  padding: var(--s-5);
  border-radius: var(--r-large);
  background: var(--bg-surface);
}

.cs2-sec--white .cs2-card { border: 1px solid var(--hairline); }

/* Sand goes on white sections only (visual direction) */
.cs2-sec--white .cs2-card--sand {
  border-color: transparent;
  background: var(--bg-warm);
}

.cs2-card--dark,
.cs2-sec--white .cs2-card--dark {
  border-color: transparent;
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.8);
}

.cs2-card--dark .label { color: var(--accent-light); }

.cs2-insight-card { padding: var(--s-5); }

@media (min-width: 1024px) {
  .cs2-card { padding: var(--s-6); }
  .cs2-insight-card { padding: var(--s-8); }
}

.cs2-meta {
  display: grid;
  gap: var(--s-4);
}

.cs2-meta > div {
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
}

.cs2-meta dt { margin-bottom: var(--s-1); }

.cs2-meta dd {
  color: var(--text-headline);
  font-weight: 500;
  font-size: var(--small); /* 14px, the same as the home facts row */
}

@media (min-width: 768px) {
  .cs2-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs2-meta--stack { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  .cs2-meta--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* White card lifted by a soft shadow (asked for on the Afterwish Problem cards) */
.cs2-card--lift,
.cs2-sec .cs2-card--lift {
  border-color: transparent;
  background: var(--bg-surface);
  box-shadow:
    0 1px 2px rgba(31, 27, 15, 0.04),
    0 12px 32px -12px rgba(31, 27, 15, 0.14);
}

/* Coral for the fragile assumption, homepage lilac for what I found */
.cs2-assume-pair {
  display: grid;
  gap: var(--s-3);
}

.cs2-card--muted,
.cs2-sec .cs2-card--muted {
  border-color: transparent;
  background: var(--coral);
}

/* On full coral the violet label fails contrast, so text goes dark */
.cs2-card--muted :is(.label, p) { color: var(--text-headline); }

.cs2-card--tint,
.cs2-sec .cs2-card--tint {
  border-color: transparent;
  background: rgba(34, 32, 31, 0.06);
}

/* Swap: two things in one place. Below 1024px they simply stack.
   From 1024px the first shows until the page marks it done,
   then it fades out and the second fades in where it was. */
.cs2-swap {
  display: grid;
  gap: var(--s-6);
}

@media (min-width: 1024px) {
  .cs2-swap {
    gap: 0;
    align-items: center;
  }

  .cs2-swap > * {
    grid-area: 1 / 1;
    transition: opacity 0.8s var(--ease), visibility 0s linear 0.8s;
  }

  .cs2-swap__then { opacity: 0; visibility: hidden; }

  .cs2-swap.is-done .cs2-swap__first { opacity: 0; visibility: hidden; }

  .cs2-swap.is-done .cs2-swap__then {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
}

/* A bare product screen: no device frame, rounded corners and a soft shadow */
.cs2-screen {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--r-large);
  background: var(--bg-surface);
  box-shadow:
    0 0 0 1px rgba(31, 27, 15, 0.06),
    0 2px 6px rgba(31, 27, 15, 0.06),
    0 24px 48px -20px rgba(31, 27, 15, 0.22);
}

.cs2-screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* Icon tile beside a card title: line icon in accent on the homepage lilac tint */
.cs2-icon-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.cs2-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-small);
  background: rgba(34, 32, 31, 0.06);
  color: var(--accent);
}

.cs2-icon svg { width: 24px; height: 24px; }

/* Me / AI: who did what, side by side in one panel (Figma: PORTFOLIO, node 137:18422).
   A coral-to-violet tint over the section color, inside a border in the same gradient.
   Me and AI sit in small gradient tiles; the AI line is set in a monospace font. */
.cs2-credit {
  --credit-under: var(--bg-surface);
  display: grid;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 2px solid transparent;
  border-radius: var(--r-small);
  background:
    linear-gradient(90deg, rgba(228, 220, 201, 0.6), rgba(228, 220, 201, 0.6)) padding-box,
    linear-gradient(var(--credit-under), var(--credit-under)) padding-box,
    linear-gradient(90deg, var(--line-strong), var(--line-strong)) border-box;
}

.cs2-sec--gray .cs2-credit { --credit-under: var(--bg-page); }
.cs2-sec--dark .cs2-credit { --credit-under: var(--bg-dark); }

/* Tile on the left, text beside it */
.cs2-credit > div {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.cs2-credit > div > p { margin-top: 0; }

.cs2-credit .label {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-small);
  background: var(--bg-dark);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text-on-dark);
}

/* Numbered next steps: a small number beside each line, hairline between rows */
.cs2-todo {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs2-todo > li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-top: 1px solid var(--hairline);
}

.cs2-todo > li .label { line-height: inherit; }

.cs2-credit p {
  font-size: 16px;
  font-weight: 400;
  line-height: 27px;
  color: var(--text-headline);
}

.cs2-sec--dark .cs2-credit p { color: var(--text-on-dark); }

@media (min-width: 768px) {
  .cs2-credit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-4);
    padding: var(--s-5);
  }

  .cs2-credit > div { gap: var(--s-4); }
}

/* Compact row: one hairline across, label above a plain value */
.cs2-meta--row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cs2-meta--row > div {
  padding-top: 0;
  border-top: 0;
}

.cs2-meta--row dd {
  color: var(--text-primary);
  font-weight: 400;
}

@media (min-width: 768px) {
  .cs2-meta--row.cs2-meta--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cs2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.cs2-chip {
  padding: 6px 12px;
  border-radius: var(--r-small);
  background: var(--bg-surface);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-headline);
}

.cs2-phase {
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
}

.cs2-decision__rows > div {
  padding-block: var(--s-3);
  border-top: 1px solid var(--hairline);
}

.cs2-decision__rows dd { color: var(--text-headline); }

/* --------------------------------------------------------------------------
   5. Placeholders, frames, wide media
   -------------------------------------------------------------------------- */

.cs2-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 160px;
  padding: var(--s-3);
  background: var(--bg-gray-panel);
  color: var(--text-secondary);
  font-size: var(--p-small);
  line-height: 1.4;
  text-align: center;
}

.cs2-ph--violet {
  background: var(--accent-light);
  color: var(--text-headline);
}

.cs2-sec--dark .cs2-ph {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.cs2-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-large);
  background: var(--bg-gray-panel);
}

.cs2-frame > .cs2-ph {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.cs2-r-16x9 { aspect-ratio: 16 / 9; }
.cs2-r-16x10 { aspect-ratio: 16 / 10; }

/* An embedded animation fills its frame */
.cs2-frame > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.cs2-r-4x3 { aspect-ratio: 4 / 3; }
.cs2-r-4x5 { aspect-ratio: 4 / 5; }
.cs2-r-3x4 { aspect-ratio: 3 / 4; }
.cs2-r-cover { aspect-ratio: 4 / 5; }

@media (min-width: 768px) {
  .cs2-r-cover { aspect-ratio: 16 / 9; }
}

@media (min-width: 1024px) {
  .cs2-r-cover { aspect-ratio: 21 / 9; }
}

/* A wide banner illustration (4:1): shown whole from tablet up, center-cropped on phones */
.cs2-r-banner { aspect-ratio: 2 / 1; }
.cs2-r-banner > img { object-position: center; }

@media (min-width: 768px) {
  .cs2-r-banner { aspect-ratio: 4 / 1; }
}

/* Wider than the text column, still with rounded corners */
.cs2-wide {
  margin-inline: max(var(--s-3), calc((100% - 1680px) / 2));
}

@media (min-width: 768px) {
  .cs2-wide { margin-inline: max(var(--s-4), calc((100% - 1680px) / 2)); }
}

/* Parallax layer: 20% taller than its frame, moved by JS */
.cs2-parallax {
  position: absolute;
  left: 0;
  right: 0;
  top: -10%;
  height: 120%;
  will-change: transform;
}

.cs2-parallax > .cs2-ph {
  height: 100%;
  min-height: 0;
}

/* Gallery: one large image and two stacked */
.cs2-gallery {
  display: grid;
  gap: var(--s-3);
}

.cs2-gallery > .cs2-frame { aspect-ratio: 4 / 3; }

@media (min-width: 768px) {
  .cs2-gallery {
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--s-4);
    height: clamp(420px, 55vw, 760px);
  }
  .cs2-gallery > .cs2-frame { aspect-ratio: auto; }
  .cs2-gallery > :first-child { grid-row: span 2; }
}

.cs2-portrait { max-width: 320px; }

/* --------------------------------------------------------------------------
   6. Phone mockup
   -------------------------------------------------------------------------- */

.cs2-phone {
  flex: none;
  width: 200px;
  aspect-ratio: 9 / 19.5;
  padding: 8px;
  border-radius: 36px;
  background: var(--bg-dark);
}

.cs2-phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: var(--bg-surface);
}

.cs2-phone__screen > .cs2-ph {
  position: absolute;
  inset: 0;
  min-height: 0;
}

@media (min-width: 1024px) {
  .cs2-phone { width: 240px; }
  .cs2-phone--lg { width: 280px; }
}

/* Three phones moving at different speeds */
.cs2-phones3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4%;
  padding-block: var(--s-6);
}

.cs2-phones3 .cs2-phone {
  width: 28%;
  max-width: 280px;
  padding: 1.2%;
  border-radius: clamp(14px, 3.6vw, 40px);
}

.cs2-phones3 .cs2-phone__screen { border-radius: clamp(10px, 3vw, 32px); }

/* Phones fanning out */
.cs2-fan {
  display: grid;
  justify-items: center;
  padding-block: var(--s-5);
}

.cs2-fan > .cs2-phone {
  grid-area: 1 / 1;
  width: 150px;
  transition: transform 1.1s var(--ease);
}

.cs2-fan > :nth-child(2) { z-index: 1; }

.cs2-fan.is-in > :nth-child(1),
html:not(.cs2-js) .cs2-fan > :nth-child(1) { transform: translateX(-50%) rotate(-8deg); }

.cs2-fan.is-in > :nth-child(3),
html:not(.cs2-js) .cs2-fan > :nth-child(3) { transform: translateX(50%) rotate(8deg); }

@media (min-width: 768px) {
  .cs2-fan > .cs2-phone { width: 220px; }
  .cs2-fan.is-in > :nth-child(1) { transform: translateX(-72%) rotate(-8deg); }
  .cs2-fan.is-in > :nth-child(3) { transform: translateX(72%) rotate(8deg); }
}

@media (min-width: 1024px) {
  .cs2-fan > .cs2-phone { width: 250px; }
  .cs2-fan.is-in > :nth-child(1) { transform: translateX(-85%) rotate(-8deg); }
  .cs2-fan.is-in > :nth-child(3) { transform: translateX(85%) rotate(8deg); }
}

/* --------------------------------------------------------------------------
   7. Endless horizontal slider (marquee)
   -------------------------------------------------------------------------- */

.cs2-marquee {
  overflow: hidden;
  padding-block: var(--s-2);
}

.cs2-marquee__track {
  display: flex;
  width: max-content;
}

.cs2-marquee__track > * { margin-right: var(--s-4); }

.cs2-js .cs2-marquee__track {
  animation: cs2-marquee var(--dur, 40s) linear infinite;
}

.cs2-marquee--reverse .cs2-marquee__track { animation-direction: reverse; }

.cs2-marquee:hover .cs2-marquee__track { animation-play-state: paused; }

@keyframes cs2-marquee {
  to { transform: translate3d(-50%, 0, 0); }
}

/* Phone slider: a light band with white, softly shaded phones.
   Sand on white sections; on gray sections the band is white (no sand on gray). */
.cs2-marquee--phones {
  padding-block: var(--s-6);
  background: var(--bg-warm);
}

.cs2-sec--gray .cs2-marquee--phones { background: var(--bg-surface); }

.cs2-marquee--phones .cs2-phone {
  padding: 10px;
  border: 1px solid rgba(31, 27, 15, 0.08);
  background: linear-gradient(145deg, #FFFFFF 0%, #FFFFFF 55%, #F2EFE8 100%);
  box-shadow:
    inset 0 0 0 2px #FFFFFF,
    inset -3px -4px 8px rgba(31, 27, 15, 0.06),
    0 2px 4px rgba(31, 27, 15, 0.06),
    0 16px 32px -12px rgba(31, 27, 15, 0.22);
}

.cs2-marquee--phones .cs2-phone__screen {
  box-shadow: 0 0 0 1px rgba(31, 27, 15, 0.1);
}

@media (min-width: 1024px) {
  .cs2-marquee--phones { padding-block: var(--s-7); }
}

.cs2-artifact {
  flex: none;
  width: 280px;
}

@media (min-width: 1024px) {
  .cs2-artifact { width: 360px; }
}

/* --------------------------------------------------------------------------
   8. Drag-to-scroll strip
   -------------------------------------------------------------------------- */

.cs2-drag {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: max(var(--gutter), calc((100% - var(--max-width)) / 2));
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--max-width)) / 2));
  padding-bottom: var(--s-3);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  cursor: grab;
}

.cs2-drag.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.cs2-drag > * {
  flex: 0 0 82%;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .cs2-drag > * { flex-basis: 48%; }
}

@media (min-width: 1024px) {
  .cs2-drag { gap: var(--s-4); }
  .cs2-drag > * { flex-basis: 38%; }
}

/* --------------------------------------------------------------------------
   9. Before / after
   -------------------------------------------------------------------------- */

.cs2-ba {
  --pos: 50%;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-large);
  background: var(--bg-gray-panel);
  user-select: none;
}

@media (min-width: 768px) {
  .cs2-ba { aspect-ratio: 16 / 9; }
}

.cs2-ba__img {
  position: absolute;
  inset: 0;
}

.cs2-ba__img > .cs2-ph {
  min-height: 0;
  place-items: end start;
  padding: var(--s-4);
}

.cs2-ba__after > .cs2-ph { justify-items: end; }

.cs2-ba__after { clip-path: inset(0 0 0 var(--pos)); }

.cs2-ba__tag {
  position: absolute;
  top: var(--s-3);
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--r-small);
  background: var(--bg-surface);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-headline);
}

.cs2-ba__tag--before { left: var(--s-3); }
.cs2-ba__tag--after { right: var(--s-3); }

.cs2-ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--bg-surface);
  pointer-events: none;
}

.cs2-ba__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: 16px;
}

.cs2-ba__range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.cs2-ba:focus-within .cs2-ba__knob {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Toggle version: crossfade instead of a divider */
.cs2-ba--fade .cs2-ba__after {
  clip-path: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.cs2-ba--fade[data-show="after"] .cs2-ba__after { opacity: 1; }
.cs2-ba--fade .cs2-ba__tag--after { right: auto; left: var(--s-3); opacity: 0; transition: opacity 0.6s var(--ease); }
.cs2-ba--fade[data-show="after"] .cs2-ba__tag--after { opacity: 1; }
.cs2-ba--fade[data-show="after"] .cs2-ba__tag--before { opacity: 0; }

.cs2-seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-small);
  background: var(--bg-gray-panel);
}

.cs2-seg button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: 500 14px/1 var(--font-body);
  color: var(--text-primary);
  cursor: pointer;
}

.cs2-seg button[aria-pressed="true"] {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

/* Scroll version: the page scroll moves the divider */
.cs2-scrollwipe { height: 220vh; }

.cs2-scrollwipe__sticky {
  position: sticky;
  top: calc(var(--header-h, 65px) + var(--s-5));
}

.cs2-scrollwipe .cs2-ba {
  --pos: calc((1 - var(--p, 0)) * 100%);
  max-height: calc(100vh - var(--header-h, 65px) - var(--s-7));
  width: 100%;
}

/* Inside a phone */
.cs2-phone .cs2-ba {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 28px;
}

/* --------------------------------------------------------------------------
   10. Pinned media with scrolling steps
   -------------------------------------------------------------------------- */

.cs2-pin {
  display: grid;
  gap: var(--s-6);
}

.cs2-pin__steps {
  display: grid;
  gap: var(--s-7);
}

.cs2-pin__step {
  display: grid;
  gap: var(--s-3);
}

.cs2-pin__inline { margin-top: var(--s-3); }
.cs2-pin__media { display: none; }

@media (min-width: 1024px) {
  .cs2-pin {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--s-8);
    align-items: start;
  }

  .cs2-pin--phone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs2-pin--phone .cs2-pin__media { order: -1; }

  .cs2-pin__steps {
    gap: 0;
    padding-block: 10vh;
  }

  .cs2-pin__step {
    min-height: 70vh;
    align-content: center;
    opacity: 0.3;
    transition: opacity 0.5s var(--ease);
  }

  .cs2-pin__step.is-active { opacity: 1; }
  .cs2-pin__inline { display: none; }

  .cs2-pin__media {
    display: block;
    position: sticky;
    top: calc(var(--header-h, 65px) + 12vh);
    height: 66vh;
  }

  .cs2-pin--phone .cs2-pin__media {
    display: flex;
    justify-content: center;
  }

  .cs2-pin--phone .cs2-pin__media .cs2-phone {
    width: auto;
    height: 100%;
  }

  .cs2-pin__screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }

  .cs2-pin__screen > .cs2-ph { height: 100%; min-height: 0; }

  .cs2-pin__screen.is-active {
    opacity: 1;
    transform: none;
  }
}

/* Pinned flow on a flat panel: the screen loses its device frame and
   sits on the sand surface (dark surface in dark mode). No shadows.
   The screen keeps 24px corners, like .cs-phone, because it is a phone screen. */
.cs2-pin--panel { margin-top: var(--s-5); }

.cs2-pin--panel .cs2-phone {
  padding: 0;
  border-radius: 24px;
  background: var(--bg);
}

.cs2-pin--panel .cs2-phone__screen { border-radius: 24px; background: var(--bg); }

.cs2-pin--panel .cs2-pin__step h4 { margin: 0; }
.cs2-pin--panel .cs2-pin__step p:not(.caption) { color: var(--text-2); max-width: 65ch; }

.cs2-pin--panel .cs2-pin__inline {
  display: flex;
  justify-content: center;
  padding: var(--s-5) var(--s-3);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 1024px) {
  .cs2-pin--panel { gap: var(--s-6); }
  .cs2-pin--panel .cs2-pin__inline { display: none; }

  /* Before the script runs (or without it) every step stays readable */
  html:not(.cs2-js) .cs2-pin--panel .cs2-pin__step { opacity: 1; }

  .cs2-pin--panel .cs2-pin__media {
    height: 76vh;
    padding: var(--s-4);
    align-items: center;
    border-radius: var(--radius);
    background: var(--surface);
    container-type: size;
  }

  /* The phone fits the panel by height or by width, whichever runs out first */
  .cs2-pin--panel .cs2-pin__media .cs2-phone {
    height: min(100cqh, 100cqw * 19.5 / 9);
  }
}

/* Afterwish flow: the panel behind the phone uses the same drifting gradient
   as the screen carousel (--sc-band and @keyframes sc-band live in styles.css). */
.aw-flow.cs2-pin--panel .cs2-pin__inline,
.aw-flow.cs2-pin--panel .cs2-pin__media {
  background: var(--sc-band);
  background-size: 300% 300%;
  animation: sc-band 24s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .aw-flow.cs2-pin--panel .cs2-pin__inline,
  .aw-flow.cs2-pin--panel .cs2-pin__media { animation: none; }
}

/* --------------------------------------------------------------------------
   11. Numbers
   -------------------------------------------------------------------------- */

.cs2-stat {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
}

.cs2-sec--dark .cs2-stat { border-color: rgba(255, 255, 255, 0.16); }

.cs2-stat__num,
.cs2-bignum {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: tabular-nums;
  color: var(--text-headline);
}

.cs2-stat__num {
  font-size: var(--h2);
  line-height: 1;
}

.cs2-bignum {
  font-size: clamp(72px, 14vw, 160px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.cs2-sec--dark :is(.cs2-stat__num, .cs2-bignum),
.cs2-card--dark :is(.cs2-stat__num, .cs2-bignum) { color: var(--text-on-dark); }

.cs2-bignum--coral,
.cs2-sec--dark .cs2-bignum--coral { color: var(--coral); }

.cs2-bars {
  display: grid;
  gap: var(--s-5);
}

.cs2-bar__head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
  color: var(--text-headline);
  font-weight: 500;
}

.cs2-bar__track {
  height: 16px;
  overflow: hidden;
  border-radius: var(--r-small);
  background: var(--bg-gray-panel);
}

.cs2-bar__fill {
  width: var(--v);
  height: 100%;
  border-radius: var(--r-small);
  background: var(--accent);
}

.cs2-js .cs2-bar__fill {
  width: 0;
  transition: width 1.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 150ms);
}

.cs2-js .cs2-bars.is-in .cs2-bar__fill { width: var(--v); }

/* --------------------------------------------------------------------------
   12. Quotes
   -------------------------------------------------------------------------- */

.cs2-quote blockquote p {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: var(--h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-headline);
}

.cs2-quote figcaption {
  display: block;
  margin-top: var(--s-4);
}

.cs2-quote--center {
  max-width: 60rem;
  margin-inline: auto;
  text-align: center;
}

.cs2-quote--card {
  max-width: 56rem;
  margin-inline: auto;
}

.cs2-quote--small blockquote p {
  font-size: var(--h5);
  line-height: 1.3;
}

.cs2-quote__mark {
  display: block;
  height: 0.55em;
  font-family: var(--font-heading);
  font-size: 120px;
  line-height: 1;
  color: var(--accent);
}

.cs2-notes {
  display: grid;
  gap: var(--s-4);
}

.cs2-note {
  padding: var(--s-5);
  border-radius: var(--r-large);
  background: var(--bg-warm);
}

.cs2-note:nth-child(4n + 1) { --to: rotate(-1.2deg); }
.cs2-note:nth-child(4n + 2) { --to: rotate(0.8deg); }
.cs2-note:nth-child(4n + 3) { --to: rotate(1.2deg); }
.cs2-note:nth-child(4n + 4) { --to: rotate(-0.6deg); }

html:not(.cs2-js) .cs2-note { transform: var(--to); }

@media (min-width: 768px) {
  .cs2-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
}

/* Quotes as a conversation */
.cs2-chat {
  display: grid;
  gap: var(--s-4);
  max-width: 760px;
  margin-inline: auto;
}

.cs2-chat > * { max-width: 88%; }
.cs2-chat > :nth-child(even) { justify-self: end; }

/* --------------------------------------------------------------------------
   13. Process
   -------------------------------------------------------------------------- */

.cs2-timeline {
  position: relative;
  display: grid;
  gap: var(--s-5);
  padding-left: 40px;
}

.cs2-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  transform-origin: top;
}

.cs2-js .cs2-timeline::before {
  transform: scaleY(0);
  transition: transform 1.6s var(--ease);
}

.cs2-js .cs2-timeline.is-in::before { transform: none; }

.cs2-timeline__step { position: relative; }

.cs2-timeline__step::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg-surface);
}

@media (min-width: 1024px) {
  .cs2-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-5);
    padding-left: 0;
    padding-top: 40px;
  }

  .cs2-timeline::before {
    left: 8px;
    right: 8px;
    top: 7px;
    bottom: auto;
    width: auto;
    height: 2px;
    transform-origin: left;
  }

  .cs2-js .cs2-timeline::before { transform: scaleX(0); }

  .cs2-timeline__step::before {
    left: 0;
    top: -40px;
  }
}

.cs2-steps {
  position: relative;
  padding-left: 48px;
}

.cs2-steps__line {
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hairline);
}

.cs2-steps__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--p, 1));
}

.cs2-steps ol {
  display: grid;
  gap: var(--s-7);
}

.cs2-steps li { position: relative; }

.cs2-steps__dot {
  position: absolute;
  left: -48px;
  top: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg-page);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
}

@media (min-width: 1024px) {
  .cs2-steps ol { gap: var(--s-8); }
}

/* --------------------------------------------------------------------------
   14. Next project
   -------------------------------------------------------------------------- */

.cs2-next {
  display: grid;
  overflow: hidden;
  border-radius: var(--r-large);
  background: var(--bg-surface);
  color: inherit;
  text-decoration: none;
}

.cs2-next:hover { color: inherit; }
.cs2-next:hover h3 { color: var(--accent); }

.cs2-next__media { border-radius: 0; }

.cs2-next__media .cs2-ph { transition: transform 0.8s var(--ease); }
.cs2-next:hover .cs2-next__media .cs2-ph { transform: scale(1.04); }

.cs2-next__body {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-5);
}

.cs2-next__body h3 { transition: color var(--dur-fast) var(--ease); }

.cs2-next__cta {
  margin-top: var(--s-2);
  color: var(--accent);
  font-weight: 500;
}

.cs2-arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}

:is(.cs2-next, .cs2-biglink):hover .cs2-arrow { transform: translateX(8px); }
:is(.cs2-next, .cs2-biglink):hover .cs2-arrow--back { transform: translateX(-8px); }

@media (min-width: 1024px) {
  .cs2-next__body { padding: var(--s-6); }
  .cs2-next--row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }
}

.cs2-biglink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-6);
  border-block: 1px solid var(--hairline);
  color: var(--text-headline);
  text-decoration: none;
}

.cs2-biglink:hover,
.cs2-biglink:hover .cs2-serif { color: var(--accent); }

.cs2-biglink .cs2-serif { transition: color var(--dur-fast) var(--ease); }

/* Hero C: the cover runs edge to edge and touches the top bar. Its height follows the screen,
   so the eyebrow and the title of the card stay above the fold. */
.cs2-sec--hero-c { padding-top: 0; }
.cs2-hero-c__cover .cs2-frame {
  aspect-ratio: auto;
  height: clamp(220px, 100svh - 65px - 380px, 720px);
  border-radius: 0;
}

@media (min-width: 768px) {
  .cs2-hero-c__cover .cs2-frame { height: clamp(240px, 100svh - 73px - 360px, 720px); }
}

@media (min-width: 1024px) {
  .cs2-hero-c__cover .cs2-frame { height: clamp(280px, 100svh - 73px - 320px, 760px); }
}

/* Hero C with a wide banner illustration: the image stops where the card starts to overlap,
   and the frame continues in the banner's own ground color, so the card covers no figures */
.cs2-hero-c__cover--banner .cs2-frame { background: #fcfcfc; }
.cs2-hero-c__cover--banner .cs2-frame > img { height: 100%; object-position: center bottom; }

@media (min-width: 768px) {
  .cs2-hero-c__cover--banner .cs2-frame > img { height: calc(100% - 96px); }
}

@media (min-width: 1024px) {
  .cs2-hero-c__cover--banner .cs2-frame > img { height: calc(100% - 160px); }
}

/* Hero C: the card overlaps the bottom of the cover */
.cs2-overlap {
  position: relative;
  z-index: 1;
  margin-top: var(--s-4);
}

@media (min-width: 768px) {
  .cs2-overlap {
    max-width: 760px;
    margin-top: -96px;
  }
}

@media (min-width: 1024px) {
  .cs2-overlap {
    max-width: 860px;
    margin-top: -160px;
  }
}

/* --------------------------------------------------------------------------
   15. Animations (run only with .cs2-js on <html>)
   -------------------------------------------------------------------------- */

/* Fade up */
.cs2-js [data-cs2-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 100ms);
}

.cs2-js [data-cs2-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Word by word */
.cs2-w { display: inline-block; }

.cs2-js [data-cs2-words] .cs2-w {
  opacity: 0;
  transform: translateY(0.45em);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 45ms);
}

.cs2-js [data-cs2-words].is-in .cs2-w {
  opacity: 1;
  transform: none;
}

/* Line by line, and children one after another */
[data-cs2-lines] > * { display: block; }

.cs2-js :is([data-cs2-lines], [data-cs2-stagger]) > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 140ms);
}

.cs2-js :is([data-cs2-lines], [data-cs2-stagger]).is-in > * {
  opacity: 1;
  transform: var(--to, none);
}

/* Highlight sweep behind a phrase */
.cs2-mark {
  background-image: linear-gradient(var(--accent-light), var(--accent-light));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 100% 38%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.cs2-js .cs2-mark {
  background-size: 0% 38%;
  transition: background-size 1.1s var(--ease) 0.4s;
}

.cs2-js .cs2-mark.is-in { background-size: 100% 38%; }

/* Hand-drawn underline that draws itself */
.cs2-underline {
  position: relative;
  white-space: nowrap;
}

.cs2-underline svg {
  position: absolute;
  left: -2%;
  bottom: -0.3em;
  width: 104%;
  height: 0.4em;
  overflow: visible;
}

.cs2-underline path {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.cs2-js .cs2-draw path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s var(--ease) 0.4s;
}

.cs2-js .cs2-draw.is-in path { stroke-dashoffset: 0; }

/* From → to */
.cs2-fromto {
  display: grid;
  gap: var(--s-4);
}

.cs2-fromto__arrow {
  font-family: var(--font-heading);
  font-size: var(--h3);
  line-height: 1;
  color: var(--accent);
  transform: rotate(90deg);
  justify-self: start;
}

.cs2-strike {
  background-image: linear-gradient(var(--coral), var(--coral));
  background-repeat: no-repeat;
  background-position: 0 55%;
  background-size: 100% 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.cs2-fromto__old { color: var(--text-secondary); }

html:not(.cs2-js) .cs2-fromto__old .cs2-serif { opacity: 0.5; }

.cs2-js .cs2-strike {
  background-size: 0% 2px;
  transition: background-size 0.8s var(--ease) 0.3s;
}

.cs2-js .cs2-fromto__old .cs2-serif { transition: opacity 0.8s var(--ease) 0.9s; }

.cs2-js .cs2-fromto.is-in .cs2-strike { background-size: 100% 2px; }
.cs2-js .cs2-fromto.is-in .cs2-fromto__old .cs2-serif { opacity: 0.5; }

.cs2-js :is(.cs2-fromto__arrow, .cs2-fromto__new) {
  opacity: 0;
  transition: opacity 0.8s var(--ease) 1.1s, translate 0.8s var(--ease) 1.1s;
  translate: 0 16px;
}

.cs2-js .cs2-fromto.is-in :is(.cs2-fromto__arrow, .cs2-fromto__new) {
  opacity: 1;
  translate: 0 0;
}

@media (min-width: 1024px) {
  .cs2-fromto {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--s-6);
  }
  .cs2-fromto__arrow { transform: none; }
}

/* Image wipes in from the bottom. The wrapper is what gets watched:
   a fully clipped element never counts as visible. */
.cs2-js .cs2-clipbox .cs2-clip {
  clip-path: inset(100% 0 0 0 round var(--r-large));
  transition: clip-path 1.3s var(--ease);
}

.cs2-js .cs2-clipbox.is-in .cs2-clip { clip-path: inset(0 0 0 0 round var(--r-large)); }

/* Card that slides up and settles */
.cs2-js .cs2-rise {
  opacity: 0;
  transform: translateY(80px) scale(0.94);
  transform-origin: top center;
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}

.cs2-js .cs2-rise.is-in {
  opacity: 1;
  transform: none;
}

/* Typewriter */
.cs2-tw {
  position: relative;
  display: block;
}

.cs2-tw__ghost { visibility: hidden; }

.cs2-tw__live {
  position: absolute;
  inset: 0;
}

.cs2-tw.is-typing .cs2-tw__live::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.08em;
  animation: cs2-blink 1s steps(1) infinite;
}

@keyframes cs2-blink {
  50% { opacity: 0; }
}

.cs2-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Reduced motion: no movement, final states only */
@media (prefers-reduced-motion: reduce) {
  .cs2-js .cs2-marquee__track { animation: none; }
  .cs2-marquee { overflow-x: auto; }
  .cs2-parallax { transform: none !important; }
}

/* --------------------------------------------------------------------------
   16. Optional block headline
   -------------------------------------------------------------------------- */

.cs2-block-head { margin-bottom: var(--s-6); }
.cs2-head-gap { margin-bottom: var(--s-4); }

@media (min-width: 1024px) {
  .cs2-block-head { margin-bottom: var(--s-7); }
}

/* --------------------------------------------------------------------------
   17. Design system
   -------------------------------------------------------------------------- */

.cs2-ds-gap { display: block; margin-top: var(--s-7); }

/* A: swatches and type scale */
.cs2-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-3);
}

.cs2-swatch { display: grid; gap: var(--s-1); }

.cs2-swatch__chip {
  aspect-ratio: 4 / 3;
  margin-bottom: var(--s-2);
  border-radius: var(--r-large);
  background: var(--sw);
  border: 1px solid var(--hairline);
}

.cs2-swatch__name { color: var(--text-headline); font-weight: 600; }
.cs2-swatch__hex { color: var(--text-secondary); font-size: var(--p-small); }

@media (min-width: 768px) {
  .cs2-swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .cs2-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.cs2-typescale > li {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-4);
  border-top: 1px solid var(--hairline);
  color: var(--text-headline);
}

.cs2-typescale > li > span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .cs2-typescale > li {
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: baseline;
    gap: var(--s-4);
  }
}

/* B: component sheet */
.cs2-components { display: grid; gap: var(--s-5) var(--s-4); }

@media (min-width: 768px) {
  .cs2-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs2-component:first-child { grid-column: 1 / -1; }
  .cs2-component:first-child .cs2-frame { aspect-ratio: 16 / 9; }
}

@media (min-width: 1024px) {
  .cs2-components { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cs2-component:first-child { grid-column: 1 / 3; grid-row: span 2; }
  .cs2-component:first-child .cs2-frame { aspect-ratio: auto; height: calc(100% - 36px); }
}

.cs2-component .label { display: block; }

/* C: type specimen */
.cs2-specimen { display: grid; align-content: start; }

.cs2-specimen__aa {
  margin-block: var(--s-5) var(--s-4);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(6rem, 4rem + 8vw, 10rem);
  line-height: 0.9;
  color: var(--accent);
}

.cs2-specimen__aa--serif { font-family: var(--font-heading); font-weight: 600; }

.cs2-specimen__abc {
  font-size: var(--p-large);
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--text-headline);
  overflow-wrap: anywhere;
}

.cs2-specimen__abc.cs2-specimen__aa--serif { font-family: var(--font-heading); }

/* D: spacing and radius on dark */
.cs2-chips--dark .cs2-chip {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-on-dark);
}

.cs2-spacing { display: grid; gap: var(--s-3); }

.cs2-spacing > li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
}

.cs2-spacing__val { font-size: var(--p-small); color: var(--text-on-dark); }

.cs2-spacing__bar {
  width: calc(var(--w) * 3);
  max-width: 100%;
  height: 16px;
  border-radius: 4px;
  background: var(--accent-light);
}

.cs2-radii {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

.cs2-radius { display: grid; gap: var(--s-2); color: var(--text-on-dark); }

.cs2-radius__tile {
  aspect-ratio: 1;
  border: 2px solid var(--accent-light);
  border-radius: var(--r);
  background: rgba(242, 239, 232, 0.08);
}

@media (min-width: 768px) {
  .cs2-radii { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Real images inside frames, phones and pinned screens
   -------------------------------------------------------------------------- */

.cs2-frame > img,
.cs2-parallax > img,
.cs2-phone__screen > img,
.cs2-pin__screen > img,
.cs2-ba__img > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.cs2-parallax > img { object-position: center 40%; }

.cs2-next__media > img { transition: transform 0.8s var(--ease); }
.cs2-next:hover .cs2-next__media > img { transform: scale(1.04); }

/* Assumed / found card */
.cs2-assume__rule {
  margin-block: var(--s-5);
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* --------------------------------------------------------------------------
   17. Design system block
   Sample components loop a short micro animation once the block is on
   screen (.cs2-ds.is-in). Without JS, or with reduced motion, they show
   their resting state. Swap the samples for the real components.
   -------------------------------------------------------------------------- */

.cs2-ds-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: var(--s-4);
  border-radius: var(--r-large);
  background: var(--bg-page);
}

.cs2-sec--gray .cs2-ds-stage { background: var(--bg-page); }

/* Button: press → loading → done */
.ds-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 150px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-small);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font: 500 14px/1 var(--font-body);
  white-space: nowrap;
}

.ds-btn > * {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ds-btn__b,
.ds-btn__c { opacity: 0; }

.ds-spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-on-dark);
  border-radius: 50%;
  animation: cs2-ds-spin 0.8s linear infinite;
}

.cs2-ds.is-in .ds-btn--demo { animation: cs2-ds-press 4s var(--ease) infinite; }
.cs2-ds.is-in .ds-btn--demo .ds-btn__a { animation: cs2-ds-a 4s linear infinite; }
.cs2-ds.is-in .ds-btn--demo .ds-btn__b { animation: cs2-ds-b 4s linear infinite; }
.cs2-ds.is-in .ds-btn--demo .ds-btn__c { animation: cs2-ds-c 4s linear infinite; }

@keyframes cs2-ds-spin { to { transform: rotate(360deg); } }
@keyframes cs2-ds-press {
  0%, 20% { transform: scale(1); }
  25% { transform: scale(0.94); }
  32%, 100% { transform: scale(1); }
}
@keyframes cs2-ds-a {
  0%, 26% { opacity: 1; }
  30%, 94% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes cs2-ds-b {
  0%, 28% { opacity: 0; }
  32%, 56% { opacity: 1; }
  60%, 100% { opacity: 0; }
}
@keyframes cs2-ds-c {
  0%, 58% { opacity: 0; }
  62%, 90% { opacity: 1; }
  94%, 100% { opacity: 0; }
}

/* Toggle: switches on and off */
.ds-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--text-disabled);
}

.ds-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
}

.cs2-ds.is-in .ds-toggle { animation: cs2-ds-track 3.2s var(--ease) infinite; }
.cs2-ds.is-in .ds-toggle::after { animation: cs2-ds-knob 3.2s var(--ease) infinite; }

@keyframes cs2-ds-track {
  0%, 35%, 100% { background: var(--text-disabled); }
  45%, 85% { background: var(--accent); }
}
@keyframes cs2-ds-knob {
  0%, 35%, 100% { transform: none; }
  45%, 85% { transform: translateX(20px); }
}

/* Input: focus ring, then text types in */
.ds-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 230px);
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-small);
  background: var(--bg-surface);
  outline: 2px solid transparent;
  outline-offset: 2px;
  font-size: 14px;
  color: var(--text-headline);
}

.ds-input svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.ds-input__text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}

.ds-input__caret {
  width: 1.5px;
  height: 18px;
  margin-left: -6px;
  background: var(--accent);
  opacity: 0;
}

.cs2-ds.is-in .ds-input { animation: cs2-ds-focus 5s linear infinite; }
.cs2-ds.is-in .ds-input__text { animation: cs2-ds-type 5s steps(13, end) infinite; }
.cs2-ds.is-in .ds-input__caret { animation: cs2-ds-caret 5s linear infinite; }

@keyframes cs2-ds-focus {
  0%, 10%, 95%, 100% { outline-color: transparent; }
  14%, 90% { outline-color: var(--accent); }
}
@keyframes cs2-ds-type {
  0%, 18% { max-width: 0; }
  55%, 92% { max-width: 100px; }
  100% { max-width: 0; }
}
@keyframes cs2-ds-caret {
  0%, 12% { opacity: 0; }
  14%, 20%, 28%, 60%, 70%, 80%, 90% { opacity: 1; }
  24%, 65%, 75%, 85% { opacity: 0; }
  92%, 100% { opacity: 0; }
}

/* Checkbox: fills and the tick draws itself */
.ds-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-headline);
}

.ds-check__box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-disabled);
  border-radius: 6px;
  background: var(--bg-surface);
}

.ds-check__box svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-on-dark);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.cs2-ds.is-in .ds-check__box { animation: cs2-ds-box 3.6s var(--ease) infinite; }
.cs2-ds.is-in .ds-check__box svg { animation: cs2-ds-tick 3.6s var(--ease) infinite; }

@keyframes cs2-ds-box {
  0%, 30%, 92%, 100% { background: var(--bg-surface); border-color: var(--text-disabled); }
  36%, 86% { background: var(--accent); border-color: var(--accent); }
}
@keyframes cs2-ds-tick {
  0%, 36% { stroke-dashoffset: 1; }
  50%, 86% { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 1; }
}

/* Chips: the selection moves along */
.ds-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ds-chip {
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-small);
  background: var(--bg-surface);
  font-size: 14px;
  line-height: 1;
  color: var(--text-headline);
}

.ds-chip:first-child {
  border-color: var(--bg-dark);
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.cs2-ds.is-in .ds-chip { animation: cs2-ds-chip 4s linear infinite; }
.cs2-ds.is-in .ds-chip:nth-child(2) { animation-delay: -2.667s; }
.cs2-ds.is-in .ds-chip:nth-child(3) { animation-delay: -1.333s; }

@keyframes cs2-ds-chip {
  0%, 30% { border-color: var(--bg-dark); background: var(--bg-dark); color: var(--text-on-dark); }
  34%, 100% { border-color: var(--hairline); background: var(--bg-surface); color: var(--text-headline); }
}

/* Progress bar fills up */
.ds-progress {
  display: grid;
  gap: 8px;
  width: min(100%, 230px);
  font-size: 14px;
  color: var(--text-headline);
}

.ds-progress__track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-small);
  background: var(--bg-gray-panel);
}

.ds-progress__bar {
  width: 72%;
  height: 100%;
  border-radius: var(--r-small);
  background: var(--accent);
}

.cs2-ds.is-in .ds-progress__bar { animation: cs2-ds-fill 4s var(--ease) infinite; }

@keyframes cs2-ds-fill {
  0% { width: 0; }
  70%, 92% { width: 100%; }
  100% { width: 0; }
}

/* Foundations: colors, type, spacing */
.ds-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3) var(--s-2);
}

.ds-swatch {
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
}

.ds-swatch::before {
  content: "";
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hairline);
  border-radius: var(--r-small);
  background: var(--c);
}

.ds-type > * + * { margin-top: var(--s-3); }

.ds-type__aa {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 88px;
  line-height: 1;
  color: var(--text-headline);
}

.ds-type__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-2);
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}

.ds-type__row span:last-child { color: var(--text-secondary); }

.ds-space {
  display: grid;
  gap: 10px;
}

.ds-space__row {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: var(--s-2);
  font-size: 12px;
  color: var(--text-secondary);
}

.ds-space__bar {
  width: calc(var(--v) * 3px);
  max-width: 100%;
  height: 12px;
  border-radius: 4px;
  background: var(--accent-light);
  transform-origin: left;
}

.cs2-js .cs2-ds :is(.ds-swatch, .ds-type__row, .ds-space__bar) {
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(0.3s + var(--i, 0) * 80ms);
}

.cs2-js .cs2-ds:not(.is-in) .ds-swatch { opacity: 0; transform: scale(0.7); }
.cs2-js .cs2-ds:not(.is-in) .ds-type__row { opacity: 0; transform: translateX(-16px); }
.cs2-js .cs2-ds:not(.is-in) .ds-space__bar { transform: scaleX(0); }

.cs2-ds.is-in .ds-type__aa { animation: cs2-ds-aa 4s var(--ease) infinite; }

@keyframes cs2-ds-aa {
  0%, 40%, 100% { color: var(--text-headline); }
  50%, 90% { color: var(--accent); }
}

/* Anatomy: a sample card with numbered callouts */
.ds-anatomy {
  display: grid;
  place-items: center;
  padding: var(--s-6) var(--s-4);
}

.ds-sample {
  position: relative;
  width: min(100%, 340px);
  padding: var(--s-4);
  border-radius: 16px;
  background: var(--bg-surface);
}

.ds-sample__media {
  position: relative;
  height: 120px;
  border-radius: 12px;
  background: var(--bg-gray-panel);
}

.ds-sample__title { position: relative; display: inline-block; }
.ds-sample .ds-btn { min-width: 0; height: 40px; }

.ds-dot {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  color: var(--text-on-dark);
}

.ds-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.ds-dot--tl { top: -12px; left: -12px; }
.ds-dot--tr { top: -12px; right: -12px; }
.ds-dot--r { top: 50%; right: -32px; margin-top: -12px; }

.cs2-js .cs2-ds .ds-dot {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(0.4s + var(--i, 0) * 180ms);
}

.cs2-js .cs2-ds:not(.is-in) .ds-dot { transform: scale(0); }

.cs2-ds.is-in .ds-dot::after {
  animation: cs2-ds-ping 2.4s var(--ease) infinite;
  animation-delay: calc(1.2s + var(--i, 0) * 300ms);
}

@keyframes cs2-ds-ping {
  0% { opacity: 0.8; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.9); }
}

.ds-legend { counter-reset: ds; }

.ds-legend li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-top: 1px solid var(--hairline);
}

.ds-legend li::before {
  counter-increment: ds;
  content: counter(ds);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-on-dark);
}

/* States: one button, every state */
.ds-state .cs2-ds-stage { min-height: 140px; }

.ds-btn--hover,
.ds-btn--pressed { overflow: visible; }

.ds-btn--disabled {
  background: var(--text-disabled);
  color: var(--text-on-dark);
}

.ds-btn--focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ds-cursor {
  position: absolute;
  right: 18%;
  bottom: -6px;
  width: 18px;
  height: 18px;
  fill: var(--bg-dark);
  stroke: var(--bg-surface);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.cs2-ds.is-in .ds-btn--hover { animation: cs2-ds-hover 3s var(--ease) infinite; }
.cs2-ds.is-in .ds-btn--pressed { animation: cs2-ds-press2 3s var(--ease) infinite; }
.cs2-ds.is-in .ds-cursor { animation: cs2-ds-cursor 3s var(--ease) infinite; }
.cs2-ds.is-in .ds-btn--focus { animation: cs2-ds-ring 2s var(--ease) infinite; }

@keyframes cs2-ds-cursor {
  0%, 10% { transform: translate(28px, 28px); opacity: 0; }
  30%, 80% { transform: none; opacity: 1; }
  95%, 100% { transform: translate(28px, 28px); opacity: 0; }
}
@keyframes cs2-ds-hover {
  0%, 28%, 85%, 100% { background: var(--bg-dark); transform: none; }
  34%, 80% { background: var(--text-primary); transform: translateY(-2px); }
}
@keyframes cs2-ds-press2 {
  0%, 30%, 60%, 100% { transform: none; }
  40%, 50% { transform: scale(0.94); }
}
@keyframes cs2-ds-ring {
  0%, 100% { outline-offset: 3px; outline-color: var(--accent); }
  50% { outline-offset: 6px; outline-color: var(--accent-light); }
}

@media (prefers-reduced-motion: reduce) {
  .cs2-ds *,
  .cs2-ds *::after { animation: none !important; }
}

/* Design system collage: tiles of different sizes (layout B) */
.ds-collage {
  display: grid;
  gap: var(--s-3);
}

.ds-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 56px var(--s-4) var(--s-4);
  overflow: hidden;
  border-radius: var(--r-large);
  background: var(--bg-surface);
  transition: translate 0.4s var(--ease);
}

.ds-tile:hover { translate: 0 -4px; }

.ds-tile > .label {
  position: absolute;
  top: 20px;
  left: var(--s-4);
}

.ds-tile--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.ds-tile--dark > .label { color: var(--accent-light); }

.ds-tile--violet { background: var(--accent-light); }
.ds-tile--violet > .label { color: var(--text-headline); }

.ds-tile--type { place-items: end start; }

.ds-tile__aa {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(96px, 16vw, 200px);
  line-height: 0.85;
  color: var(--text-on-dark);
}

.ds-tile__font {
  margin-top: var(--s-3);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.cs2-ds.is-in .ds-tile__aa { animation: cs2-ds-aa-dark 4s var(--ease) infinite; }

@keyframes cs2-ds-aa-dark {
  0%, 40%, 100% { color: var(--text-on-dark); }
  50%, 90% { color: var(--accent-light); }
}

.ds-swatches--row {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ds-swatches--row .ds-swatch::before { aspect-ratio: 3 / 2; }

.ds-tile .ds-space { width: 100%; }

.ds-icons {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  gap: var(--s-4);
}

.ds-icons svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--text-headline);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs2-ds.is-in .ds-icons svg { animation: cs2-ds-icon 3.6s var(--ease) infinite; }
.cs2-ds.is-in .ds-icons svg:nth-child(2) { animation-delay: 0.3s; }
.cs2-ds.is-in .ds-icons svg:nth-child(3) { animation-delay: 0.6s; }
.cs2-ds.is-in .ds-icons svg:nth-child(4) { animation-delay: 0.9s; }
.cs2-ds.is-in .ds-icons svg:nth-child(5) { animation-delay: 1.2s; }
.cs2-ds.is-in .ds-icons svg:nth-child(6) { animation-delay: 1.5s; }

@keyframes cs2-ds-icon {
  0%, 20%, 100% { stroke: var(--text-headline); transform: none; }
  8% { stroke: var(--accent); transform: translateY(-4px); }
}

.ds-pair {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
}

@media (min-width: 768px) {
  .ds-collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
    gap: var(--s-4);
  }

  .ds-tile { min-height: 0; }
  .ds-tile--type { grid-row: span 2; }
  .ds-tile--wide { grid-column: span 2; }
  .ds-tile--tall { grid-row: span 2; }
  .ds-swatches--row { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .ds-collage {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 210px;
  }

  .ds-tile--type { grid-column: span 2; }
}

@media (min-width: 1440px) {
  .ds-collage { grid-auto-rows: 230px; }
}

.ds-tile--dark .ds-progress { color: var(--text-on-dark); }
.ds-tile--dark .ds-progress__track { background: rgba(255, 255, 255, 0.16); }
.ds-tile--dark .ds-progress__bar { background: var(--accent-light); }

/* Collage color tile: a 2×2 tile with a clean palette.
   Phone: chip left, name and hex right. Tablet up: 4 columns, chip on top. */
.ds-tile--color { place-items: center stretch; }

.ds-palette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  width: 100%;
}

.ds-pal {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-headline);
}

.ds-pal::before {
  content: "";
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-small);
  background: var(--c);
}

.ds-pal small {
  font-size: 12px;
  color: var(--text-secondary);
}

.cs2-js .cs2-ds .ds-pal {
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(0.3s + var(--i, 0) * 80ms);
}

.cs2-js .cs2-ds:not(.is-in) .ds-pal { opacity: 0; transform: scale(0.85); }

.ds-pair--inputs {
  width: 100%;
  justify-items: center;
}

@media (min-width: 768px) {
  .ds-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4) var(--s-3);
  }

  .ds-pal {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .ds-pal::before {
    grid-row: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-bottom: 8px;
  }
}

@media (min-width: 1024px) {
  .ds-tile--color { padding-inline: var(--s-5); }
}

/* Research metrics: white boxes, a colored top edge groups them.
   Light violet = what I collected, accent violet = what the synthesis kept. */
.cs2-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.cs2-metric,
.cs2-sec .cs2-metric {
  display: grid;
  align-content: start;
  gap: var(--s-2);
  padding: var(--s-4);
  border-top: 6px solid var(--accent-light);
}

.cs2-metric--synth,
.cs2-sec .cs2-metric--synth { border-top-color: var(--accent); }

.cs2-metric .cs2-stat__num { font-size: var(--h3); }

.cs2-metric__label {
  margin-top: var(--s-2);
  color: var(--text-headline);
  font-weight: 500;
  line-height: 1.35;
}

.cs2-metric__note {
  font-size: var(--p-small);
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .cs2-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
}

@media (min-width: 1024px) {
  .cs2-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cs2-metric .cs2-stat__num { font-size: var(--h2); }
}

/* Feature card (builder style): icon tile on top, roomy padding, title and text below */
.cs2-card--feature { padding: var(--s-5); }
.cs2-card--feature .cs2-icon svg { width: 26px; height: 26px; }

@media (min-width: 1024px) {
  .cs2-card--feature { padding: var(--s-6); }
}

/* --------------------------------------------------------------------------
   Afterwish · Research story: methods row, blockers, the question I chose
   -------------------------------------------------------------------------- */

.aw-methods {
  display: grid;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
}

.aw-methods li {
  display: grid;
  gap: var(--s-1);
  font-size: var(--p-small);
  color: var(--text-secondary);
}

.aw-assume { gap: var(--s-4); }

.aw-blockers { margin-top: var(--s-8); }

.aw-blockers__title {
  font-size: var(--h2); /* 48px on desktop, 32px at 900px and below, like the other big headlines */
  line-height: normal;
}

.aw-blockers__grid {
  display: grid;
  gap: var(--s-7);
  margin-top: var(--s-7);
}

/* Each blocker: a large outlined number sits behind the quote */
.aw-blocker {
  position: relative;
  padding-top: var(--s-6);
  isolation: isolate;
}

.aw-blocker__num {
  position: absolute;
  top: 0;
  left: -0.04em;
  z-index: -1;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(140px, 30vw, 240px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent-light);
  user-select: none;
}

.aw-blocker .label,
.aw-blocker blockquote { position: relative; }

.aw-speaker {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* "And yet": one dark card under both blockers */
.aw-andyet { padding: var(--s-5); }
.cs2-quote.aw-andyet blockquote p { color: var(--text-on-dark); }
.aw-andyet .aw-speaker { color: rgba(255, 255, 255, 0.72); }

/* A thin line from the blockers down to the question (from tablet up) */
.aw-narrow { display: none; }

.aw-hmw {
  padding-top: var(--s-7);
  text-align: center;
}

.aw-hmw__problem {
  max-width: 40rem;
  margin-inline: auto;
  font-size: var(--p-small);
  color: var(--text-secondary);
}

.aw-hmw__q {
  max-width: 22ch;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .aw-methods { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
  .aw-assume { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aw-andyet { padding: var(--s-6); }

  .aw-narrow {
    display: block;
    width: 1px;
    height: var(--s-8);
    margin: var(--s-7) auto 0;
    background: var(--accent);
  }

  .aw-hmw { padding-top: var(--s-6); }
}

@media (min-width: 1024px) {
  .aw-blockers__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s-8);
    row-gap: var(--s-7);
  }

  /* Staggered: the second blocker starts lower */
  .aw-blocker--low { margin-top: var(--s-8); }

  .aw-andyet {
    grid-column: 1 / -1;
    padding: var(--s-7) var(--s-8);
  }
}

/* --------------------------------------------------------------------------
   Afterwish · Five concepts: a sideways track, all five in a row from 1024px
   -------------------------------------------------------------------------- */

.aw-rings {
  width: 40px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  flex: none;
}

.aw-concepts__mark { display: block; line-height: 0; }

.aw-concepts__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
}

.aw-concepts__nav {
  display: flex;
  gap: var(--s-2);
  flex: none;
}

.aw-concepts__btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-small);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: 18px;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease);
}

.aw-concepts__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.aw-concepts__btn:focus-visible,
.aw-concepts__track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Only the track scrolls sideways; the next card peeks in on phones */
.aw-concepts__track {
  position: relative; /* card positions are measured from here */
  display: flex;
  gap: var(--s-3);
  margin-inline: calc(var(--gutter) * -1);
  padding: var(--s-1) var(--gutter) var(--s-3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  list-style: none;
}

.aw-concepts__track::-webkit-scrollbar { display: none; }

.aw-concept {
  position: relative;
  flex: 0 0 78%;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 200px;
  padding: var(--s-5) var(--s-4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-large);
  background: transparent;
  scroll-snap-align: center;
}

.aw-concept__lens {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.aw-concept__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: var(--h5);
  line-height: 1.15;
  color: var(--text-secondary);
}

.aw-concept__code {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 0.7em;
  color: var(--text-secondary);
}

/* C2 was folded into C3: a tag, and an arrow that crosses onto C3 */
.aw-concept__merge {
  margin-top: auto;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--r-small);
  background: var(--bg-surface);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-headline);
}

.aw-concept--merged::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--accent);
  font-size: 16px;
  transform: translate(calc(50% + var(--s-3) / 2), -50%);
}

/* The selected concept: dark card, full-strength text, filled marker */
.aw-concept--selected {
  border-color: transparent;
  background: var(--bg-dark);
}

.aw-concept--selected .aw-concept__lens { color: var(--accent-light); }
.aw-concept--selected :is(.aw-concept__name, .aw-concept__code) { color: var(--text-on-dark); }

.aw-concept__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: auto;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--r-small);
  background: var(--accent-light);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-headline);
}

.aw-concept__pill .aw-rings {
  width: 30px;
  height: 10px;
  fill: var(--text-headline);
  stroke: var(--text-headline);
}

.aw-concepts__why { max-width: 46rem; }

@media (min-width: 768px) {
  .aw-concept { flex-basis: 42%; padding: var(--s-5); }
}

@media (min-width: 1024px) {
  .aw-concepts__nav { display: none; }

  .aw-concepts__track {
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .aw-concept {
    flex: 1 1 0;
    min-width: 0;
    min-height: 240px;
    padding: var(--s-4);
  }

  .aw-concept__name { font-size: 22px; }
}

@media (min-width: 1440px) {
  .aw-concept { padding: var(--s-5); }
  .aw-concept__name { font-size: var(--h5); }
}

/* Afterwish Research, builder layout D: the "And yet" note is dark and spans both columns */
.cs2-note.aw-note--dark { background: var(--bg-dark); }
.aw-note--dark blockquote p { color: var(--text-on-dark); }
.aw-note--dark .label { color: var(--accent-light); }

@media (min-width: 768px) {
  .aw-notes .aw-note--dark { grid-column: 1 / -1; }
}

/* Afterwish Research: what I assumed and what I found (Figma: PORTFOLIO, node 138:18441).
   A gray band across the full width, with one white card inside it.
   Labels sit on one row and the statements on the next, 24px apart, so both columns line up. */
.aw-found-band {
  margin-inline: calc(50% - 50vw);
  padding: 52px calc(50vw - 50%);
  background: var(--bg-page);
}

.aw-found {
  display: grid;
  row-gap: 40px;
  padding: 48px 24px;
  border-radius: 20px;
  background: var(--bg-surface);
}

.aw-found > div {
  display: grid;
  row-gap: 24px;
  align-content: start;
}

.aw-found__label {
  font-size: 20px;
  line-height: 34px;
  color: var(--text-headline);
}

.aw-found__text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 32px;
  line-height: normal;
  color: var(--text-headline);
}

@media (min-width: 768px) {
  .aw-found {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: 40px;
    row-gap: 24px;
    padding: 80px 40px;
  }

  .aw-found > div {
    grid-row: span 2;
    grid-template-rows: subgrid;
  }
}

/* Afterwish Research: the two blockers and "And yet" (Figma: PORTFOLIO, node 138:18441).
   Where Figma and the styleguide differ, the styleguide wins: 24px panel corners,
   the hairline token for borders, the secondary text color for the speakers. */
.aw-blockers2 {
  display: grid;
  gap: 24px;
  align-items: stretch;
  margin-top: 80px;
}

.aw-blocker2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-large);
}

.aw-blocker2--dark {
  border-color: transparent;
  background: var(--bg-dark);
}

/* Captions: the site's label style (Manrope 14, uppercase, 0.04em), violet on the light cards, coral on the dark one */
.aw-blocker2__label,
.aw-blocker2__who {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: var(--label);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.aw-blocker2 blockquote { margin: 0; }

.aw-blocker2__quote {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--h5); /* 26px, H5 in the styleguide */
  line-height: normal;
  color: var(--text-headline);
}

.aw-blocker2--dark :is(.aw-blocker2__label, .aw-blocker2__who) { color: var(--coral); }
.aw-blocker2--dark .aw-blocker2__quote { color: var(--text-on-dark); }

@media (min-width: 768px) {
  .aw-blockers2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
    row-gap: 40px;
  }

  .aw-blocker2--dark { grid-column: 1 / -1; }
}

/* Afterwish Problem: headline left, three short points right (Figma: PORTFOLIO, node 140:18595) */
.aw-problem {
  display: grid;
  gap: var(--s-4);
  align-items: start;
}

.aw-problem__title {
  padding: 32px 0 16px;
  font-size: var(--h2); /* 48px on desktop, 32px at 900px and below */
  line-height: normal;
}

.aw-problem__list {
  display: grid;
  gap: 10px;
}

.aw-problem__item {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  line-height: 46px;
  color: var(--text-primary);
}

.aw-problem__list p {
  font-size: 16px;
  line-height: 27px;
  color: var(--text-primary);
}

@media (min-width: 1024px) {
  .aw-problem {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 50px;
  }
}

/* Afterwish Research, top part (Figma: PORTFOLIO, node 138:18441):
   two-line headline with the assumption in violet, methods left, Me/AI stacked right, then what I found. */
.aw-research__title {
  padding: 32px 0 40px;
  font-size: var(--h2); /* 48px on desktop, 32px at 900px and below */
  line-height: normal;
}

.aw-research__accent { color: var(--accent); }

.aw-research__row {
  display: grid;
  gap: var(--s-5);
  align-items: start;
  margin-top: 40px;
}

/* Same type as the three points in 01 Problem: Fraunces titles, Inter text */
.aw-research__methods {
  display: grid;
  gap: 10px;
}

.aw-research__label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.01em;
  line-height: 46px;
  color: var(--text-primary);
}

.aw-research__methods p,
.aw-research__found-text {
  font-size: 16px;
  line-height: 27px;
  color: var(--text-primary);
}

.aw-research__found {
  margin-top: 80px;
  font-size: var(--h2); /* 48px on desktop, 32px at 900px and below */
  line-height: normal;
}

.aw-research__found-text strong { font-weight: 600; color: var(--text-headline); }

.aw-research__found-text {
  margin-top: 10px;
  font-size: 20px;
  line-height: 34px;
}

/* Me / AI stacked: one row under the other, 24px apart */
.cs2-credit.cs2-credit--stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

@media (min-width: 768px) {
  .cs2-credit.cs2-credit--stack { padding: 32px; }
}

.cs2-credit--stack p { line-height: 34px; }

@media (min-width: 1024px) {
  .aw-research__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 85px;
  }
}

/* Problem points: a slower, longer rise, one clearly after the other */
.cs2-js .aw-problem__list > [data-cs2-reveal] {
  transform: translateY(48px);
  transition-duration: 1.1s;
  transition-delay: calc(var(--i, 0) * 450ms);
}

.cs2-js .aw-problem__list > [data-cs2-reveal].is-in { transform: none; }

/* Afterwish Evaluation: What's next under the Me/AI box (dark section) */
.aw-next2__title {
  margin-top: var(--s-8);
  font-size: var(--h2); /* 48px on desktop, 32px at 900px and below */
  line-height: normal;
}

.aw-next2 { margin-top: var(--s-5); }
.aw-next2 > li { border-top-color: rgba(255, 255, 255, 0.16); }
.aw-next2 p { font-size: 16px; line-height: 27px; }

/* Afterwish: What it changed, centered, as wide as the question in Research */
.aw-changed {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

/* List titles in 01 Problem and 02 Research: Inter instead of Fraunces */
.aw-problem__item,
.aw-research__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-variation-settings: normal;
  letter-spacing: 0;
  line-height: 34px;
}

/* Five concepts: the first card is already in place, the other four slide in
   from the right, one after the other, when the row comes into view */
.cs2-js .aw-concepts__track[data-cs2-reveal] {
  opacity: 1;
  transform: none;
}

.cs2-js .aw-concepts__track .aw-concept:not(:first-child) {
  opacity: 0;
  transform: translateX(120px);
  transition: opacity 1s var(--ease), transform 1.3s var(--ease);
}

.cs2-js .aw-concepts__track .aw-concept:nth-child(3) { transition-delay: 0.25s; }
.cs2-js .aw-concepts__track .aw-concept:nth-child(4) { transition-delay: 0.5s; }
.cs2-js .aw-concepts__track .aw-concept:nth-child(5) { transition-delay: 0.75s; }

.cs2-js .aw-concepts__track.is-in .aw-concept {
  opacity: 1;
  transform: none;
}

/* Insight animation: on laptops and larger it is sized to fit the screen below the
   menu bar and section tabs, centered, so the whole of it is in view while it plays */
@media (min-width: 1024px) {
  .aw-anim-big {
    width: min(100%, calc((100svh - var(--header-h) - 45px - 96px) * 1.6));
    margin-inline: auto;
  }
}

/* --------------------------------------------------------------------------
   Afterwish Insight: held animations (aw-pin)
   The headline and the privacy text scroll as normal. Each animation sits in
   a tall block; from 1024px, with motion allowed, the page JS adds .aw-pin-on
   to <html> and the animation holds on screen under the menu and section tabs,
   as big as the screen allows, and plays as the page scrolls.
   Phones and reduced motion: the animations simply sit in the flow.
   -------------------------------------------------------------------------- */

.aw-pin-sec {
  --pin-top: calc(var(--header-h) + 45px);
  --pin-h: calc(100svh - var(--pin-top));
}

.aw-pin { margin-top: var(--s-7); }
.aw-pin__fig { margin: 0; }
.aw-pin__text { margin-top: var(--s-8); }
.aw-pin__textcol { max-width: 46rem; }

@media (min-width: 1024px) {
  /* Both animations: one size, as big as fits the screen with the caption below */
  .aw-pin-sec { --pin-w: min(100%, calc((var(--pin-h) - 48px - 40px) * 1.6)); }

  .aw-pin__fig {
    width: var(--pin-w);
    margin-inline: auto;
  }
}

html.aw-pin-on .aw-pin {
  position: relative;
  height: 260vh;
  margin-top: 0;
}

html.aw-pin-on .aw-pin__stage {
  position: sticky;
  top: var(--pin-top);
  height: var(--pin-h);
  display: flex;
  align-items: center;
}

html.aw-pin-on .aw-pin__stage > .container { width: 100%; }

/* Full screen step: the navigation and section tabs slide away, and the stage
   grows into the freed space. */
html.aw-pin-on .site-header,
html.aw-pin-on .aw-tabs {
  transition: transform 0.35s var(--ease);
}

html.aw-pin-on .aw-pin__stage {
  transition: top 0.35s var(--ease), height 0.35s var(--ease);
}

html.aw-nav-hidden .site-header { transform: translateY(-100%); }
html.aw-nav-hidden .aw-tabs { transform: translateY(calc(-100% - var(--header-h))); }

html.aw-nav-hidden .aw-pin-sec {
  --pin-top: 0px;
  --pin-h: 100svh;
}
html.aw-pin-on .aw-pin__fig { will-change: transform, opacity; }
html.aw-pin-on .aw-pin__text { margin-top: 0; }

/* Me / AI closed: only the AI tile, as a button (opens the full box).
   Same 8px corner as the tiles and the open box. */
.cs2-credit__open {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-small);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.cs2-credit__open:hover { transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(34, 32, 31, 0.3); }
.cs2-credit__open[hidden] { display: none; }

/* The AI tile inside the open box closes it */
.cs2-credit__close {
  position: relative;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.cs2-credit__close::before { content: ""; position: absolute; inset: -2px; } /* 44px touch area */

:is(.cs2-credit__open, .cs2-credit__close):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Opening: the box grows out from the top-left corner */
.cs2-credit-wrap .cs2-credit {
  opacity: 0;
  clip-path: inset(0 calc(100% - 72px) calc(100% - 72px) 0 round var(--r-small));
  transition: clip-path 0.5s var(--ease), opacity 0.3s var(--ease);
}

.cs2-credit-wrap .cs2-credit.is-shown {
  opacity: 1;
  clip-path: inset(0 round var(--r-small));
}

.cs2-credit[hidden] { display: none; }

/* Pointer next to the closed AI tile: it moves in and taps, then rests, on a loop.
   Hidden once the box has been opened, and still with reduced motion. */
.cs2-credit__open { position: relative; overflow: visible; }

.cs2-credit__hint {
  position: absolute;
  left: 30px;
  top: 28px;
  width: 26px;
  height: 26px;
  fill: var(--bg-surface);
  stroke: var(--text-headline);
  stroke-width: 1.6;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(31, 27, 15, 0.25));
  pointer-events: none;
  transform-origin: 4px 2.5px;
  animation: cs2-hint-tap 2.6s var(--ease) infinite;
}

.cs2-credit-wrap.was-opened .cs2-credit__hint { display: none; }

@keyframes cs2-hint-tap {
  0%   { transform: translate(18px, 16px); opacity: 0; }
  20%  { transform: translate(18px, 16px); opacity: 1; }
  45%  { transform: translate(0, 0); }
  52%  { transform: translate(0, 0) scale(0.82); }
  60%  { transform: translate(0, 0) scale(1); }
  80%  { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(6px, 6px); opacity: 0; }
}

/* The tile answers the tap with a small press */
.cs2-credit-wrap:not(.was-opened) .cs2-credit__open > span[aria-hidden] {
  animation: cs2-hint-press 2.6s var(--ease) infinite;
}

@keyframes cs2-hint-press {
  0%, 48%, 64%, 100% { transform: scale(1); }
  54% { transform: scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .cs2-credit__hint { animation: none; transform: none; }
  .cs2-credit-wrap .cs2-credit__open > span[aria-hidden] { animation: none; }
}

.cs2-credit__open > span[aria-hidden] { display: inline-block; }

/* The open box closes on click, so it shows the hand cursor */
.cs2-credit-wrap .cs2-credit { cursor: pointer; }

/* Five concepts: the code (C1 to C5) in Fraunces at 28px, the name under it in Inter at 18px.
   Set last, so it wins over the earlier sizes at every width. */
.aw-concept__name {
  font-family: var(--font-body);
  font-weight: 400;
  font-variation-settings: normal;
  letter-spacing: 0;
  font-size: 18px;
  line-height: 27px;
}

.aw-concept__code {
  margin-bottom: var(--s-2);
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: 28px;
  line-height: normal;
  letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
  .aw-concept__name { font-size: 18px; }
}

@media (min-width: 1440px) {
  .aw-concept__name { font-size: 18px; }
}

/* Problem points and Research methods: the same coral dot as the Evaluation list,
   centered on the first line of each title */
.aw-problem__list > div,
.aw-research__methods > li {
  position: relative;
  padding-left: var(--s-4);
}

.aw-problem__list > div::before,
.aw-research__methods > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

/* Problem: side by side, the headline starts level with the first point */
@media (min-width: 1024px) {
  .aw-problem__title { padding-top: 0; margin-top: -6px; } /* -6px lines up the tops of the letters, not just the boxes */
}

/* "And yet": a 640px card, centered on the page under the two blockers */
.aw-blocker2--dark {
  width: 100%;
  max-width: 640px;
  justify-self: center;
}

/* Blockers and "And yet": the title in Fraunces 32px, the quote in Inter italic 18px,
   the speaker in the site's violet label. No coral. "And yet" sits on the same
   light violet as the icon tiles. */
.aw-blocker2__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-headline);
}

.aw-blocker2__quote {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: normal;
  font-size: 18px;
  line-height: 29px;
  color: var(--text-primary);
}

.aw-blocker2__who { color: var(--accent); }

.aw-blocker2--dark {
  border-color: transparent;
  background: rgba(34, 32, 31, 0.06);
}

.aw-blocker2--dark .aw-blocker2__label { color: var(--text-headline); }
.aw-blocker2--dark .aw-blocker2__quote { color: var(--text-primary); }
.aw-blocker2--dark .aw-blocker2__who { color: var(--accent); }


/* --------------------------------------------------------------------------
   99. Interactive elements stay violet
   -------------------------------------------------------------------------- */

.cs2-sec a { color: var(--interactive); }
.cs2-next:hover h3,
.cs2-biglink:hover .cs2-serif { color: var(--interactive); }
.cs2-sec :focus-visible,
.cs2-credit__open:focus-visible { outline-color: var(--interactive); }
.cs2-credit__open { background: var(--interactive); color: var(--on-interactive); }
.cs2-ba__range:focus-visible + .cs2-ba__handle .cs2-ba__knob,
.cs2-ba__knob { color: var(--text); }

/* Highlighted words use the site's amber highlighter band */
.cs2-mark { background-image: linear-gradient(var(--amber), var(--amber)); }
:root[data-theme="dark"] .cs2-mark { color: var(--ink); }
:root[data-theme="dark"] .cs2-js .cs2-mark.is-in { background-size: 100% 100%; }

/* --------------------------------------------------------------------------
   Overview: summary header with reading time, optional key numbers
   -------------------------------------------------------------------------- */

.cs2-ov-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
}

.cs2-readtime {
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-small);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-headline);
  white-space: nowrap;
}

.cs2-sec--dark .cs2-readtime {
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--text-on-dark);
}

/* Key numbers: a strong rule, a big number counting up, one small line */
.cs2-keynums {
  display: grid;
  gap: var(--s-6) var(--s-4);
  margin: var(--s-7) 0 0;
  padding: 0;
  list-style: none;
}

.cs2-keynum {
  display: grid;
  align-content: start;
  gap: var(--s-3);
  padding-top: var(--s-5);
  border-top: 2px solid var(--text-headline);
}

.cs2-keynum .cs2-stat__num {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cs2-keynum > span:last-child {
  font-size: var(--p-small);
  line-height: 1.6;
  color: var(--text-secondary);
}

.cs2-sec--dark .cs2-keynum { border-color: var(--text-on-dark); }

@media (min-width: 768px) {
  .cs2-keynums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .cs2-keynums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
