/* Tandm case study: visual sizing and placement, matched to the uxfolio layout */

/* Full content-width visuals sitting under their text (problem, solution, prototype) */
.cs section figure.full { margin: 40px 0 0; }

/* Break out wider than the text column, like the full-bleed flows and wireframes */
.cs section figure.bleed {
  width: min(calc(100vw - 32px), 1280px);
  position: relative; left: 50%; translate: -50% 0;
  margin-top: 48px;
}
.cs section figure.bleed figcaption {
  text-align: center; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); color: var(--text); margin: 0 0 16px;
}
.cs section figure.bleed { display: flex; flex-direction: column-reverse; }

/* Medium, centred visual */
.cs section figure.mid { max-width: 780px; margin: 48px auto 0; }

/* Features: every screen shown large, one after another */
.feature-stack { display: grid; gap: 56px; margin-top: 32px; }
.feature-stack figure { margin: 0 !important; }
.feature-stack figcaption { margin: 0 0 12px; font-size: var(--fs-card); color: var(--muted); }
.feature-stack figcaption b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); color: var(--text); margin-bottom: 4px; }

/* Text beside a visual: centred vertically, visual first on the left */
.cs .split.media-first, .cs .split.rev { align-items: center; }
.cs .split.media-first { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.cs #design-problems .split { margin-top: 64px; }
.cs #design-problems .split .hmw { margin: 0 0 8px; }
.cs #design-problems .split h3 { font-size: var(--fs-h3); line-height: 1.35; }
.cs #final .split .eyebrow { margin-bottom: 8px; }

@media (max-width: 760px) {
  .cs .split.media-first { grid-template-columns: 1fr; }
  .cs .split.media-first > figure { order: 2; }
  .cs .split.rev > figure { order: 2; }
  .feature-stack { gap: 40px; }
}

/* Hero: full-screen textured band; copy lines up with the nav, prototype runs wide to the right */
html { overflow-x: clip; }
.cs.page { padding-top: 0; }
.hero-band {
  --edge: max(var(--gutter), calc(50vw - var(--max) / 2 + var(--gutter)));
  position: relative; isolation: isolate;
  margin-inline: calc(50% - 50vw);
  padding: 20px max(var(--gutter), calc(50vw - 680px)) 56px var(--edge);
  min-height: calc(100svh - var(--nav-h, 84px));
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at 78% 45%, rgba(255, 255, 255, .5), transparent 65%),
    var(--band, var(--card-sky));
}
/* paper-like grain so the empty space around the prototype doesn't feel flat */
.hero-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .35 0 0 0 0 .45 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .45 0 0 0 0 .55 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .hero-band::before { mix-blend-mode: screen; opacity: .18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-band::before { mix-blend-mode: screen; opacity: .18; } }
:root[data-theme="dark"] .hero-band { background: var(--band, var(--card-sky)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-band { background: var(--band, var(--card-sky)); } }
.hero-band .crumbs { margin: 0; }
.hero-intro {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 4.5vw, 72px); align-items: center; padding-block: 32px 8px;
}
.hero-intro .hero-proto { margin: 0; }
.hero-intro .hero-proto video {
  display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .3);
}
.hero-intro .tag { display: inline-block; margin-bottom: 16px; }
.hero-intro h1 { margin: 0 0 12px; font-size: var(--fs-h1); }
.hero-intro .hero-sub { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.4; margin: 0 0 16px; color: var(--text); }
.hero-intro .lede { margin: 0; max-width: 34ch; }
.cs-hero .role-cards { margin: 64px 0 56px; }
@media (max-width: 860px) {
  .hero-band { min-height: 0; padding: 20px var(--gutter) 40px; }
  .hero-intro { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .cs-hero .role-cards { margin: 40px 0; }
}

/* One media style across the case study: same corner radius everywhere */
.cs figure img, .cs figure video.anim, .cs .gallery img, .cs-hero .cover, .cs .problem-art { border-radius: 10px; }

/* Small labels use the same muted eyebrow color everywhere */
.cs .hmw { color: var(--muted) !important; }

/* Retailer / seller problem illustrations: each column is one block, art and text the same width,
   so the edges line up; the two blocks sit centred as a balanced pair */
.cs .problems { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: clamp(40px, 8vw, 104px); }
.cs .problems .problem-art { width: 100%; max-width: none; }
.cs .problems dl { margin-top: 20px; }
@media (max-width: 720px) {
  .cs .problems { grid-template-columns: minmax(0, 320px); }
}

/* ---------- Hero: four finished screens, crossfading in one frame ---------- */
.hero-show { display: grid; gap: 14px; }
.hs-screen {
  position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; isolation: isolate;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(10, 40, 60, .45), 0 4px 14px -8px rgba(10, 40, 60, .2);
}
.hs-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* the image is wider-than-tall inside a 16:10 frame, so it only ever moves up and down */
  object-fit: cover; object-position: 50% 0%;
  border: 0 !important; border-radius: 0 !important; opacity: 0;
  transition: opacity .8s ease;
}
.hs-slide.on { opacity: 1; }
/* the screen on show scrolls slowly down the page, holding at the top and bottom */
.hs-slide.on { animation: hs-scroll var(--dur, 7s) cubic-bezier(.4, 0, .5, 1) both; }
@keyframes hs-scroll {
  0%, 14% { object-position: 50% 0%; }
  86%, 100% { object-position: 50% 100%; }
}

/* caption and progress sit under the frame, not over the screen */
.hs-bar { display: flex; align-items: center; gap: 20px; min-height: 22px; }
.hs-caps { position: relative; flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.hs-cap {
  position: absolute; left: 0; top: 0; width: 100%; opacity: 0; translate: 0 6px;
  transition: opacity .45s ease, translate .45s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hs-cap.on { opacity: 1; translate: 0 0; }
.hs-cap b { font-family: var(--font-display); font-weight: 500; color: var(--text); margin-right: 6px; }
.hs-dots { flex: none; display: flex; gap: 6px; }
.hs-dots button { width: 30px; height: 16px; padding: 6px 0; border: 0; background: none; cursor: pointer; }
.hs-dots i { display: block; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text) 18%, transparent); position: relative; overflow: hidden; }
.hs-dots button:hover i { background: color-mix(in srgb, var(--text) 32%, transparent); }
.hs-dots i::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--text); transform-origin: left; scale: 0 1; }
.hs-dots button[aria-current="true"] i::after { animation: hs-fill var(--dur, 5s) linear forwards; }
.hs-dots button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }
@keyframes hs-fill { from { scale: 0 1; } to { scale: 1 1; } }
@media (max-width: 860px) {
  .hs-bar { flex-wrap: wrap; gap: 10px; }
  .hs-caps { flex: 1 0 100%; order: 2; }
  .hs-cap { position: static; display: none; white-space: normal; overflow: visible; }
  .hs-cap.on { display: block; }
  .hs-dots { order: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-slide, .hs-slide.on, .hs-cap { transition: none; animation: none; object-position: 50% 0%; }
  .hs-dots button[aria-current="true"] i::after { animation: none; scale: 1 1; }
}

/* ---------- Hero, Oct 29: top-aligned copy, one-line title, product video ---------- */
/* copy and video start on the same top line */
.hero-intro { align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
/* tag, title, subtitle and description share one left edge and one width */
.hero-intro .hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
.hero-intro .hero-copy > * { max-width: 100%; }
.hero-intro .lede { max-width: none; }
/* tag sized to sit with the 48px title, not shrink beside it */
.hero-intro .tag { margin: 0 0 20px; font-size: 13px; line-height: 1; letter-spacing: .05em; padding: 8px 14px; }
.hero-intro h1 { line-height: 1.05; margin: 0 0 14px; }
.hero-intro .hero-sub { margin: 0 0 14px; }
/* one line on desktop: the title scales with the column so it never spills into the gap */
@media (min-width: 861px) { .hero-intro h1 { white-space: nowrap; font-size: clamp(32px, 3.6vw, 48px); } }
/* phones and small tablets: back to one column, copy above the video */
@media (max-width: 860px) { .hero-intro { grid-template-columns: 1fr; } }
/* product video: never shown above its native 1148px, so it stays sharp */
.hero-intro .hero-proto.hero-video { width: 100%; max-width: 1148px; }
.hero-intro .hero-proto.hero-video video {
  aspect-ratio: 1148 / 990; object-fit: cover; border-radius: 12px;
  box-shadow: 0 30px 60px -30px rgba(10, 40, 60, .45), 0 4px 14px -8px rgba(10, 40, 60, .2);
}

/* shopping cart: sits bottom-left of the copy, level with the bottom of the video, to balance the hero */
.hero-intro { align-content: start; }
.hero-intro .hero-copy { align-self: stretch; }
.hero-cart { display: block; width: 148px; height: auto; margin-top: clamp(32px, 3.6vw, 52px); }
@media (max-width: 860px) { .hero-cart { display: none; } }

/* Balance: the copy column breathes to fill more of the video's height, spacing scales with the screen */
@media (min-width: 861px) {
  .hero-intro .tag { margin-bottom: clamp(20px, 2.2vw, 32px); }
  .hero-intro h1 { margin-bottom: clamp(12px, 1.3vw, 18px); }
  .hero-intro .hero-sub { margin-bottom: clamp(16px, 2vw, 28px); line-height: 1.45; }
  .hero-intro .lede { line-height: 1.75; }
}
/* the whole left block (tag to cart) sits centred against the video */
@media (min-width: 861px) { .hero-intro .hero-copy { justify-content: center; } }

/* ---------- At a glance: the final screens, both sides of the marketplace, near the top ---------- */
.glance { margin: 0; }
.glance-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 28px; }
.glance-head .eyebrow { margin: 0 0 8px; }
.glance-head h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); }
.glance-skip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
  font: 500 15px var(--font-display); transition: border-color .25s ease, translate .25s ease;
}
.glance-skip span { transition: translate .3s cubic-bezier(.22, 1, .36, 1); }
.glance-skip:hover { border-color: var(--text); }
.glance-skip:hover span { translate: 0 3px; }
.glance-skip:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* one tinted panel per side: label on the left, two screens to the right */
.glance-row {
  display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 28px);
  align-items: start; padding: clamp(20px, 3vw, 36px); border-radius: var(--radius); background: var(--tint);
}
.glance-row + .glance-row { margin-top: 16px; }
.glance-row.buyers { --tint: var(--card-yellow); }
.glance-row.sellers { --tint: var(--card-lavender); }
.glance-label { padding-top: 4px; }
.glance-label .kicker { margin: 0 0 8px; }
.glance-label h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.35; }
.glance-label p:last-child { margin: 0; font-size: var(--fs-card); color: var(--muted); }

/* screens: same 16:10 frame, hairline edge, soft lift on hover; click opens full size */
.glance-shot { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.glance-frame {
  display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent), 0 18px 36px -24px rgba(0, 0, 0, .35);
  transition: translate .45s cubic-bezier(.22, 1, .36, 1), box-shadow .45s ease;
}
.glance-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; border-radius: 0 !important; transition: scale .8s cubic-bezier(.22, 1, .36, 1); }
.glance-shot:hover .glance-frame { translate: 0 -4px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent), 0 28px 48px -26px rgba(0, 0, 0, .45); }
.glance-shot:hover .glance-frame img { scale: 1.03; }
.glance-shot:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 10px; }
.glance-cap { display: block; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.glance-cap b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--text); margin-bottom: 2px; }


@media (max-width: 860px) {
  .glance-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .glance-label { grid-column: 1 / -1; padding-top: 0; }
}
@media (max-width: 520px) { .glance-row { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .glance-frame, .glance-frame img, .glance-skip span { transition: none; } }

/* ---------- At a glance, large: two full screens, one small label each ---------- */
.glance-big { margin: 0; padding: clamp(14px, 3vw, 40px); border-radius: var(--radius); background: var(--tint); }
.glance-big + .glance-big { margin-top: 20px; }
.glance-big.buyers { --tint: var(--card-yellow); }
.glance-big.sellers { --tint: var(--card-lavender); }
.glance-pill {
  display: inline-block; margin: 0 0 clamp(12px, 2vw, 20px); padding: 6px 12px; border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text);
}
.glance-big .glance-frame { aspect-ratio: auto; }
.glance-big .glance-frame img { height: auto; }
.glance-big .glance-shot:hover .glance-frame img { scale: 1.01; }

/* ---------- Even spacing: every block on the page sits one section gap (96px) from the next ---------- */
.cs-hero .role-cards { margin-bottom: 0; }
.cs section.glance { padding-top: var(--section-gap); }
.cs .toc { margin-top: var(--section-gap); }
.cs section > :last-child, .cs section > .prose:last-child > :last-child { margin-bottom: 0; }
@media (max-width: 860px) { .cs-hero .role-cards { margin-bottom: 0; } }

/* ---------- At a glance carousel: one large screen at a time, moved by the visitor (never on its own) ---------- */
.gc {
  --tint: var(--card-yellow);
  padding: clamp(14px, 3vw, 40px); border-radius: var(--radius); background: var(--tint);
  transition: background-color .6s ease;
}
.gc[data-side="seller"] { --tint: var(--card-lavender); }
.gc-stage { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.gc-stage:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.gc-frame {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent), 0 24px 48px -28px rgba(0, 0, 0, .4);
  touch-action: pan-y;
}
.gc-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  border-radius: 0 !important; opacity: 0; transition: opacity .55s ease;
}
.gc-slide.on { opacity: 1; }

/* caption left, dots in the middle, arrows right */
.gc-bar { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; margin-top: 18px; }
.gc-cap { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.gc-who {
  padding: 5px 11px; border-radius: 999px; background: var(--surface);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.gc-name { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); color: var(--text); }
.gc-dots { display: flex; gap: 6px; }
.gc-dots button { width: 28px; height: 20px; padding: 8px 0; border: 0; background: none; cursor: pointer; }
.gc-dots i { display: block; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background-color .3s ease; }
.gc-dots button:hover i { background: color-mix(in srgb, var(--text) 35%, transparent); }
.gc-dots button[aria-current="true"] i { background: var(--text); }
.gc-dots button:focus-visible, .gc-arrows button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
.gc-arrows { display: flex; gap: 8px; }
.gc-arrows button {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .25s ease, translate .25s ease;
}
.gc-arrows button:hover { border-color: var(--text); }
.gc-arrows button[data-step="-1"]:hover { translate: -2px 0; }
.gc-arrows button[data-step="1"]:hover { translate: 2px 0; }
.gc-arrows svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .gc-bar { grid-template-columns: 1fr auto; row-gap: 12px; }
  .gc-cap { grid-column: 1 / -1; }
  .gc-name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .gc, .gc-slide { transition: none; } }

/* Two sides: one line under each illustration */
.cs .problems .problem-line { margin: 20px 0 0; font-size: var(--fs-card); line-height: 1.6; color: var(--muted); }
.cs .problems .problem-line b { color: var(--text); font-weight: 600; }

/* carousel autoplay: the current dot fills up to show when the next screen arrives */
.gc-dots i { position: relative; overflow: hidden; }
.gc-dots i::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--text); transform-origin: left; scale: 0 1; }
.gc.auto .gc-dots button[aria-current="true"] i { background: color-mix(in srgb, var(--text) 18%, transparent); }
.gc.auto .gc-dots button[aria-current="true"] i::after { animation: gc-fill var(--dur, 6.5s) linear forwards; }
@keyframes gc-fill { from { scale: 0 1; } to { scale: 1 1; } }

/* ---------- The problem: one two-column grid. Comics and the brief share the same columns and left edges ---------- */
#problem .problems, #problem .beat.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; justify-content: stretch;
}
#problem .problems { margin-top: 48px; }
#problem .problems > div { max-width: 280px; }
#problem .problems .problem-art { width: 100%; }
/* brief: image in the left column, same width as the comic above it; text in the right column */
#problem .beat.split { margin-top: 64px; align-items: center; }
#problem .beat.split.rev > :first-child { order: 2; }
#problem .beat.split > figure.narrow { justify-self: start; width: 100%; max-width: 280px; margin: 0; }
#problem .beat.split .prose { max-width: 420px; }
@media (max-width: 720px) {
  #problem .problems, #problem .beat.split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  #problem .problems > div, #problem .beat.split > figure.narrow { max-width: 320px; }
  #problem .beat.split.rev > :first-child { order: 0; }
}
#problem .quote-row { margin-top: 48px; }

/* The solution: each problem from section 01 paired with TANDM's answer */
#idea .answers { margin-top: 64px; }
#idea .answers h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
#idea .fixes { margin-top: 20px; }
#idea .fix > div:first-child { background: var(--card-yellow); }
#idea .fix > div:last-child { background: var(--card-mint); }
#idea .fix p:last-child { font-size: var(--fs-card); line-height: 1.55; }
/* the stat's scope sits beside it, smaller, so the claim reads exactly */
.bigstat .stat-scope { font-family: var(--font-display); font-size: .45em; color: var(--muted); }
/* Competitive study takeaways */
#competitors .takeaways { margin-top: 40px; }
#competitors .takeaways .kicker { margin: 0; }
#competitors .takeaways .cards { margin-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#competitors .takeaways .cards li b { font-size: 17px; line-height: 1.35; }
#competitors .takeaways .prose { margin-top: 24px; }
@media (max-width: 760px) { #competitors .takeaways .cards { grid-template-columns: minmax(0, 1fr); } }
#competitors .takeaways .prose p { margin-bottom: 0; }

/* The solution: problems and answers as one table, headers stated once */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.answer-table { width: 100%; margin-top: 20px; border-collapse: separate; border-spacing: 0; font-size: var(--fs-card); line-height: 1.55; }
.answer-table thead th {
  text-align: left; padding: 0 20px 12px; font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.answer-table thead th:first-child { width: 120px; padding-left: 0; }
.answer-table td { padding: 16px 20px; vertical-align: top; border-top: 1px solid var(--line); }
.answer-table td:nth-last-child(2) { background: color-mix(in srgb, var(--card-yellow) 70%, transparent); }
.answer-table td:last-child { background: color-mix(in srgb, var(--card-mint) 70%, transparent); }
.answer-table tbody th {
  text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--text);
}
.answer-table tr:not(.group-start) td { border-top-color: color-mix(in srgb, var(--line) 50%, transparent); }
.answer-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
@media (max-width: 640px) {
  .answer-table, .answer-table tbody, .answer-table tr, .answer-table td, .answer-table th { display: block; width: auto; }
  .answer-table thead { display: none; }
  .answer-table tbody th { padding: 20px 0 8px; border-top: 0; }
  .answer-table td { border-top: 0; padding: 12px 16px; }
  .answer-table td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .answer-table tr { margin-bottom: 10px; }
  .answer-table tbody tr:last-child td { border-bottom: 0; }
}

/* Section 1 balance: comics and the brief frame the same edges as the snail illustration above.
   Left items sit flush left, right items flush right; Sellers sit under "Local Sellers", Retailers under "Large Retailers". */
@media (min-width: 721px) {
  #problem .problems { grid-template-columns: minmax(0, 360px) minmax(0, 360px); justify-content: space-between; }
  #problem .beat.split { grid-template-columns: minmax(0, 360px) minmax(0, 360px); justify-content: space-between; }
}
@media (min-width: 721px) {
  #problem .problems > div, #problem .beat.split > figure.narrow { max-width: 360px; }
  #problem .beat.split .prose { max-width: 360px; }
}

/* Section 1, tighter: the quote sits between the two sides, and the brief is sized to its text */
@media (min-width: 861px) {
  #problem .problems { grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 320px); gap: 40px; justify-content: stretch; }
  #problem .problems > div { max-width: none; }
  #problem .problems-quote { align-self: center; padding-bottom: 72px; }
  #problem .problems-quote blockquote { margin: 0; }
  #problem .beat.split { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 40px; justify-content: stretch; margin-top: 72px; }
  #problem .beat.split > figure.narrow { max-width: 320px; }
  #problem .beat.split .prose { max-width: 520px; }
}
@media (max-width: 860px) {
  #problem .problems { grid-template-columns: minmax(0, 1fr); }
  #problem .problems-quote { order: 3; }
}
@media (min-width: 861px) {
  #problem .beat.split { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 60px; }
  #problem .beat.split > figure.narrow { max-width: 260px; }
}

/* Section 1: two smaller comics side by side, quote in the space to their right */
@media (min-width: 861px) {
  #problem .problems { grid-template-columns: 240px 240px minmax(0, 1fr); gap: 24px; justify-content: stretch; }
  #problem .problems-quote { align-self: center; padding: 0 0 72px 32px; }
  #problem .problems .problem-line { font-size: 14px; }
}
@media (min-width: 861px) {
  #problem .beat.split { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
  #problem .beat.split > figure.narrow { max-width: 240px; }
}

/* ---------- Section 1, Oct 29 late: snail → brief with quote → sellers and retailers as rows ---------- */
#problem .brief-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: center; margin-top: 64px; }
#problem .brief-row > figure { margin: 0; }
#problem .brief-body .kicker { margin: 0 0 6px; }
#problem .brief-body h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
#problem .brief-body p { margin: 0 0 12px; max-width: 60ch; }
#problem .brief-body blockquote { margin: 24px 0 0; }

#problem .side-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: center; margin-top: 56px; }
#problem .side-row + .side-row { margin-top: 40px; }
#problem .side-art { margin: 0; }
#problem .side-art .problem-art { width: 100%; max-width: none; display: block; }
#problem .side-body .kicker { margin: 0 0 6px; }
#problem .side-body h3 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
.pain-table { width: 100%; border-collapse: collapse; font-size: var(--fs-card); line-height: 1.55; }
.pain-table th { text-align: left; vertical-align: top; width: 120px; padding: 12px 16px 12px 0; font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--text); }
.pain-table td { padding: 12px 0; color: var(--muted); }
.pain-table tr + tr th, .pain-table tr + tr td { border-top: 1px solid var(--line); }
#problem .side-row.sellers .pain-table th { box-shadow: inset 3px 0 0 #f6c766; padding-left: 12px; }
#problem .side-row.retailers .pain-table th { box-shadow: inset 3px 0 0 #7fd8e6; padding-left: 12px; }

@media (max-width: 760px) {
  #problem .brief-row, #problem .side-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  #problem .brief-row > figure, #problem .side-art { max-width: 300px; }
  .pain-table th { width: 96px; }
}

/* ---------- Section 1 on phones: heading first, then image, then content; each side in its own card ---------- */
@media (max-width: 760px) {
  /* brief: label and heading lead, the document follows the text, the quote closes it */
  #problem .brief-row { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 48px; }
  #problem .brief-body { display: contents; }
  #problem .brief-body .kicker { order: 1; }
  #problem .brief-body h3 { order: 2; }
  #problem .brief-body p:not(.kicker) { order: 3; }
  #problem .brief-row > figure { order: 4; max-width: 240px; margin: 12px 0 0; }
  #problem .brief-body blockquote { order: 5; margin-top: 28px; }

  /* sellers / retailers: one tinted card each, label and heading on top */
  #problem .side-row { display: flex; flex-direction: column; gap: 0; margin-top: 40px; padding: 20px 16px 8px; border-radius: var(--radius); }
  #problem .side-row + .side-row { margin-top: 20px; }
  #problem .side-row.sellers { background: color-mix(in srgb, var(--card-yellow) 75%, transparent); }
  #problem .side-row.retailers { background: color-mix(in srgb, var(--card-sky) 75%, transparent); }
  #problem .side-body { display: contents; }
  #problem .side-body .kicker { order: 1; }
  #problem .side-body h3 { order: 2; margin-bottom: 16px; }
  #problem .side-art { order: 3; max-width: 260px; }
  #problem .pain-table { order: 4; margin-top: 16px; }
  #problem .side-row .pain-table th { box-shadow: none; padding-left: 0; }
  #problem .side-row .pain-table tr + tr th, #problem .side-row .pain-table tr + tr td { border-top-color: color-mix(in srgb, var(--text) 10%, transparent); }
}
@media (max-width: 760px) {
  #problem .side-row { text-align: left; align-items: flex-start; }
  #problem .side-row .pain-table { align-self: stretch; }
}

/* ---------- Section 04: flows open full size, plus a wall of wireframes ---------- */
/* wide, dense flows get nearly the whole screen when opened */
.lightbox { max-width: 96vw; }
.lightbox img { max-height: 84vh; }
.cs section figure.bleed .zoom img { border-radius: 10px; }

.wf-wall { margin-top: 56px; }
.wf-wall-head { margin: 0 0 20px; color: var(--muted); }
.wf-wall-head b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); color: var(--text); margin-bottom: 4px; }
.wf-wall .wall { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 0; }
@media (max-width: 860px) { .wf-wall .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .wf-wall .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }

/* Flows stay inside the content column, like every other visual (click to open full size for detail) */
.cs section figure.bleed { width: auto; left: auto; translate: none; position: static; }

/* wireframe wall: 23 screens, 8 across on desktop; every thumbnail the same 3:4 frame */
.wf-wall .wall { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.wf-wall .wall img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; }
@media (max-width: 860px) { .wf-wall .wall { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 480px) { .wf-wall .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } }
/* denser: the wall shows volume, not detail (each opens full size) */
.wf-wall .wall { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.wf-wall .wall img { border-radius: 4px; }
@media (max-width: 860px) { .wf-wall .wall { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; } }
@media (max-width: 480px) { .wf-wall .wall { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; } }

/* Hero cart: light speed-trails in dark mode, same switch as the client logos */
.hero-cart.on-dark { display: none; }
:root[data-theme="dark"] .hero-cart.on-light { display: none; }
:root[data-theme="dark"] .hero-cart.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-cart.on-light { display: none; }
  :root:not([data-theme="light"]) .hero-cart.on-dark { display: block; }
}
@media (max-width: 860px) { .hero-cart.on-light, .hero-cart.on-dark { display: none !important; } }

/* Snail and marketplace illustrations: 20% smaller, centred (phones keep full width) */
@media (min-width: 641px) {
  #problem figure.full:has(img[src*="problem-anim"]),
  #idea figure.full:has(img[src*="solution-anim"]) { width: 80%; margin-left: auto; margin-right: auto; }
}
