/* ═════════════ Craft mode: Design Playground ═════════════
   Board card (replaces "Open a folder"), the home-sheet state of the Craft stage,
   the dark gallery and the story viewer. Scoped to .cpg / .cpg-boardcard / .cr-hero.is-pg. */

/* ── Board card ── */
.cr-hero .cpg-boardcard { display: block; text-align: left; padding: 0; cursor: pointer; }
.cpg-boardcard-text { position: absolute; left: 28px; right: 28px; top: 26px; bottom: 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cpg-boardcard-title { font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; }
.cpg-boardcard-hint { font-size: 15px; color: var(--on-glass-2); }
.cpg-boardcard-fan { position: absolute; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; }
.cpg-fan {
  position: absolute; left: -46px; top: -66px; width: 92px; height: 132px;
  border-radius: 18px; overflow: hidden; background: #1d1e22;
  box-shadow: 0 10px 26px rgba(20, 10, 20, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 560ms var(--ease-arrive);
}
.cpg-fan img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpg-fan--0 { transform: translateX(-58px) translateY(8px) rotate(-11deg); }
.cpg-fan--1 { transform: translateX(0) translateY(-4px) rotate(0deg); z-index: 2; }
.cpg-fan--2 { transform: translateX(58px) translateY(8px) rotate(11deg); }
.cpg-fan--0 img { object-position: 50% 50%; }
.cpg-fan--1 img { object-position: 18% 50%; }
.cpg-fan--2 img { object-position: 64% 50%; }
.cpg-boardcard:hover .cpg-fan--0, .cpg-boardcard:focus-visible .cpg-fan--0 { transform: translateX(-72px) translateY(4px) rotate(-16deg); }
.cpg-boardcard:hover .cpg-fan--1, .cpg-boardcard:focus-visible .cpg-fan--1 { transform: translateY(-12px) scale(1.04); }
.cpg-boardcard:hover .cpg-fan--2, .cpg-boardcard:focus-visible .cpg-fan--2 { transform: translateX(72px) translateY(4px) rotate(16deg); }
.cpg-boardcard.is-over .cpg-fan--1 { transform: translateY(-12px) scale(1.08); }
.cpg-boardcard:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 700px) {
  .cpg-boardcard-text { top: 22px; bottom: 22px; right: 46%; }
  .cpg-boardcard-fan { left: 72%; top: 50%; transform: scale(0.72); }
}

/* ── The Craft stage as a bottom sheet ── */
html.ga-pg-open, html.ga-pg-open body { overflow: hidden !important; }
html.ga-craft .craft-switch, html.ga-craft .ga-brand { transition: opacity 0.3s ease, visibility 0s linear 0s; }
html.ga-pg-open .craft-switch, html.ga-pg-open .ga-brand { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0s linear 0.25s; }
.cr-hero.is-pg { z-index: 901; box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.45); will-change: transform; }
.cr-hero.is-pg .cr-backdrop { position: absolute; top: var(--pg-scroll, 0px); bottom: auto; height: 100vh; }

/* ── Gallery ── */
.cpg-gallery {
  position: fixed; inset: 0; z-index: 900;
  background: radial-gradient(120% 90% at 50% 0%, #1d1e22 0%, #16171b 70%);
  color: #fff;
  font-family: var(--font-ui, "Inter", system-ui, sans-serif);
  --cw: min(236px, calc((100vw - 300px) / 4));
  --ch: calc(var(--cw) * 1.542);
  --round: 54px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.cpg button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.cpg a { color: inherit; text-decoration: none; }
.cpg :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cpg:focus { outline: none; } /* the dialog root only takes focus so keys keep working after a click on empty space */

.cpg-round {
  display: inline-grid; place-items: center;
  width: var(--round); height: var(--round); border-radius: 50%;
  color: #ececef;
  transition: background 0.2s ease, transform 0.24s var(--ease-snap, ease), opacity 0.2s ease;
}
.cpg .cpg-round { background: #2a2b30; }
.cpg .cpg-round:hover { background: #36373d; }
.cpg .cpg-round:active { transform: scale(0.94); }
.cpg .cpg-round[disabled] { opacity: 0.35; cursor: default; }
.cpg .cpg-round[aria-current="page"] { background: #3a3b41; color: #fff; }
.cpg .cpg-round--blue { background: #2457f5; color: #fff; }
.cpg .cpg-round--blue:hover { background: #3a68ff; }
.cpg .cpg-round--white { background: #fff; color: #111; }
.cpg .cpg-round--white:hover { background: #ececec; }

.cpg-back { position: absolute; left: 28px; top: 18px; z-index: 5; }
.cpg-rail { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.cpg-tools { position: absolute; right: 28px; top: 18px; display: flex; flex-direction: column; gap: 15px; z-index: 5; }

/* Tabs: Case studies / Design Playground / AI works (a segmented control with a sliding pill) */
.cpg-tabs {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: stretch; height: 50px; padding: 4px;
  border-radius: 999px; background: #202126;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.cpg-tabs-pill {
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 0;
  border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cpg .cpg-tab {
  position: relative; z-index: 1; padding: 0 20px; border-radius: 999px;
  font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; color: rgba(255, 255, 255, 0.74);
  transition: color 300ms ease;
}
.cpg .cpg-tab:hover { color: #fff; }
.cpg .cpg-tab[aria-selected="true"] { color: #111; }
.cpg .cpg-tab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cpg-ghosts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cpg-ghosts .cpg-grid { will-change: opacity, transform; transform-origin: 50% 0; }

.cpg.is-story .cpg-tabs, .cpg.is-story .cpg-tools { opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; }
.cpg .cpg-tabs, .cpg .cpg-tools { transition: opacity 0.4s ease 0.15s, visibility 0s; }

/* Grid */
.cpg-scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 114px 110px 150px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.cpg-grid {
  list-style: none; margin: 0 auto; padding: 0;
  display: grid; grid-template-columns: repeat(4, var(--cw)); justify-content: center;
  column-gap: 20px; row-gap: 40px;
}
.cpg-cell { display: flex; flex-direction: column; min-width: 0; }
.cpg-date { display: block; height: 14px; margin: 0 0 8px 6px; font-size: 11px; line-height: 14px; color: rgba(255, 255, 255, 0.6); letter-spacing: 0.01em; }

.cpg-card {
  position: relative; display: block; width: var(--cw); height: var(--ch);
  border-radius: 30px; overflow: hidden; text-align: left;
  background: #26272c; color: #fff;
  transition: transform 0.35s var(--ease-arrive, ease), box-shadow 0.35s ease;
  isolation: isolate;
}
.cpg-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35); }
.cpg-card-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: -1; }
.cpg-card-shade { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.3) 100%); }
.cpg-card-head { position: absolute; top: 16px; left: 16px; right: 18px; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1; }
.cpg-card-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #ddd; flex-shrink: 0; }
.cpg-card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.cpg-card-meta { margin-left: auto; font-size: 12px; opacity: 0.72; font-variant-numeric: tabular-nums; }
.cpg-card-segs { position: absolute; left: 26px; right: 26px; bottom: 20px; z-index: 1; display: flex; gap: 4px; }
.cpg-card-segs i { flex: 1; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.5); }

/* Number cards (reference "3:15" and "0:20") */
.cpg-card--video { background: #211f1f; }
.cpg-card--duration { background: linear-gradient(180deg, #2c2d32 0%, #222327 100%); }
.cpg-card--live { background: linear-gradient(180deg, #3b3c41 0%, #26272b 55%, #1d1e22 100%); }
.cpg-num { position: absolute; left: 0; right: 0; top: 23%; text-align: center; font-size: calc(var(--cw) * 0.29); font-weight: 300; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.cpg-num--live { display: flex; align-items: center; justify-content: center; gap: 10px; color: rgba(255, 255, 255, 0.92); }
.cpg-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.22); }
@media (prefers-reduced-motion: no-preference) { .cpg-live-dot { animation: cpgPulse 2s ease-in-out infinite; } }
@keyframes cpgPulse { 50% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0.05); } }
.cpg-live-url { position: absolute; left: 0; right: 0; top: 47%; text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.cpg-wave { position: absolute; left: 18px; right: 18px; top: 51%; height: 13%; display: flex; align-items: flex-end; gap: 2px; }
.cpg-wave i { flex: 1; min-width: 1px; border-radius: 1px; background: #fff; }
.cpg-card--live .cpg-wave { top: 62%; opacity: 0.45; }
.cpg-dur-row { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; align-items: center; justify-content: center; gap: 36px; }
/* Decorative player marks around the play disc: plain glyphs, not buttons */
.cpg-mini { width: 42px; height: 42px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.5); font-size: 13px; pointer-events: none; }
.cpg-playbtn { width: 62px; height: 62px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; }
.cpg-playbtn svg { margin-left: 3px; }

/* Type specimen (this page) */
.cpg-card--type { background: #cfcfcf; }
.cpg .cpg-type-bg.cr-wp-thumb { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; box-shadow: none; transform: none; background-size: cover; background-position: center; filter: saturate(0.9); z-index: -1; transition: none; }
.cpg-type-poster {
  position: absolute; left: 16px; right: 16px; top: 54px; bottom: 44px; z-index: 0;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: #f1f0ec; color: #111; border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25), inset 0 0 0 4px #111;
}
.cpg-type-cap { font-size: 8px; letter-spacing: 0.02em; color: #444; }
.cpg-type-abc { font-size: calc(var(--cw) * 0.15); font-weight: 600; line-height: 0.9; letter-spacing: -0.045em; }
.cpg-card--type .cpg-card-segs i { background: rgba(255, 255, 255, 0.75); }

/* ── Story viewer ── */
.cpg-story { position: absolute; inset: 0; z-index: 3; overflow: hidden; }
.cpg-track { position: absolute; inset: 0; transition: transform 640ms var(--ease-arrive, cubic-bezier(0.16, 1, 0.3, 1)); will-change: transform; }
.cpg-slide { position: absolute; overflow: hidden; background: #24252a; display: block; padding: 0; }
.cpg-slide.is-video { background: #211f1f; }
.cpg-slide--peek { opacity: 0.92; transition: opacity 0.2s ease; }
.cpg-slide--peek:hover { opacity: 1; }
.cpg-pan { position: absolute; left: 0; top: 0; height: 100%; max-width: none; display: block; transition: transform 900ms var(--ease-arrive, ease); }
.cpg-slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cpg-slide-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.32)); pointer-events: none; }
.cpg-segs { position: absolute; left: 11%; right: 11%; bottom: 38px; display: flex; gap: 8px; z-index: 2; }
.cpg-segs i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.38); overflow: hidden; }
.cpg-segs b { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.cpg-segs i.is-done b { transform: scaleX(1); }
.cpg-segs i.is-on b { animation-name: cpgSeg; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes cpgSeg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cpg-tap { position: absolute; top: 0; bottom: 80px; width: 34%; z-index: 1; }
.cpg-tap--prev { left: 0; cursor: w-resize; }
.cpg-tap--next { right: 0; cursor: e-resize; }
.cpg-tap[disabled] { cursor: default; }
.cpg .cpg-tap:focus-visible { outline-offset: -6px; border-radius: 28px; }

/* Story chrome arrives after the card lands (the grow takes 500ms): side buttons one by one, 550-750ms */
.cpg-actions > *, .cpg-panel, .cpg-nav, .cpg-pip, .cpg-slide--peek {
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.4s var(--ease-arrive, ease);
}
.cpg-actions > * { transform: scale(0.82); }
.cpg-panel { transform: translateY(calc(-100% + 10px)); }
.cpg-story.is-in .cpg-actions > *, .cpg-story.is-in .cpg-nav, .cpg-story.is-in .cpg-pip { opacity: 1; transform: none; }
.cpg-story.is-in .cpg-slide--peek { opacity: 0.92; transform: none; }
.cpg-story.is-in .cpg-panel { opacity: 1; transform: translateY(-100%); }
.cpg-story.is-in .cpg-actions > :nth-child(1) { transition-delay: 0.58s; }
.cpg-story.is-in .cpg-actions > :nth-child(2) { transition-delay: 0.65s; }
.cpg-story.is-in .cpg-actions > :nth-child(3) { transition-delay: 0.72s; }
.cpg-story.is-in .cpg-panel { transition-delay: 0.6s; }
.cpg-story.is-in .cpg-pip { transition-delay: 0.66s; }
.cpg-story.is-in .cpg-nav, .cpg-story.is-in .cpg-slide--peek { transition-delay: 0.74s; }
.cpg-story .cpg-panel .cpg-nav { transition: none; opacity: 1; transform: none; }

.cpg-actions { position: absolute; display: flex; flex-direction: column; gap: 14px; z-index: 4; }
.cpg-actions-av { width: var(--round); height: var(--round); border-radius: 50%; object-fit: cover; background: #e9e6e3; }
.cpg-nav { position: absolute; right: 28px; bottom: 28px; display: flex; flex-direction: column; gap: 12px; z-index: 4; }
.cpg-pip {
  position: absolute; right: 28px; top: 24px; width: 140px; height: 96px; z-index: 4;
  border-radius: 24px; overflow: hidden; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.cpg .cpg-pip-photo.cr-wp-thumb { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; box-shadow: none; transform: none; background-size: cover; background-position: center; transition: transform 0.5s var(--ease-arrive, ease); }
.cpg-pip:hover .cpg-pip-photo.cr-wp-thumb { transform: scale(1.06); }
.cpg-pip-label { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px; background: rgba(20, 20, 24, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 12px; }

/* Info panel (white, beside the story) */
.cpg-panel {
  position: absolute; z-index: 4; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px 24px 22px; border-radius: 28px;
  background: #fff; color: #111;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.cpg-panel-kicker { margin: 0; font-size: 12px; color: #7a7a7a; }
.cpg-panel-title { margin: 0 0 4px; font-size: 26px; line-height: 1.1; font-weight: 400; letter-spacing: -0.025em; }
.cpg-panel-body { overflow-y: auto; min-height: 0; flex: 0 1 auto; overscroll-behavior: contain; }
.cpg-panel-body p { margin: 0; font-size: 14.5px; line-height: 1.5; color: #3b3b3b; }
.cpg-panel-body h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: #111; }
.cpg-tools-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cpg-tools-list li { padding: 6px 11px; border-radius: 999px; background: #f2f2f2; font-size: 12px; color: #333; }
.cpg-proto { margin-top: 14px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; background: #111; color: #fff !important; font-size: 14px; }
.cpg-proto:hover { background: #2b2b2b; }
.cpg-more { align-self: flex-start; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; opacity: 0.85; margin-top: 2px; }

/* Compact (portrait tablet): panel sits inside the story, progress moves to the top */
.cpg-story.is-compact .cpg-panel {
  border-radius: 0 0 var(--pg-r, 28px) var(--pg-r, 28px);
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.35), rgba(18, 18, 22, 0.78) 30%);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  color: #fff; box-shadow: none; padding: 22px 22px 22px;
}
.cpg-story.is-compact .cpg-panel-kicker { color: rgba(255, 255, 255, 0.66); }
.cpg-story.is-compact .cpg-panel-body p { color: rgba(255, 255, 255, 0.86); }
.cpg-story.is-compact .cpg-panel-body h4 { color: #fff; }
.cpg-story.is-compact .cpg-tools-list li { background: rgba(255, 255, 255, 0.14); color: #fff; }
.cpg-story.is-compact .cpg-proto { background: #fff; color: #111 !important; }
.cpg-story.is-compact .cpg-segs { top: 16px; bottom: auto; left: 18px; right: 18px; }
.cpg-story.is-compact .cpg-slide-shade { top: 0; bottom: auto; height: 90px; background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3)); }
.cpg-story.is-compact .cpg-tap { top: 40px; bottom: 45%; }
.cpg-panel-body.is-clamped { max-height: 4.6em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.cpg-story.is-compact .cpg-panel-body:not(.is-clamped) { max-height: 46vh; }

/* ── Case studies and AI works: the All work card format ──
   The face is sized in em (16px at a 268px card) so the grid card and the story slide match. */
.cpg-grid--cs { column-gap: 20px; row-gap: 34px; }
.cpg .cpg-card--case { width: var(--csw); height: var(--csh); background: #fff; color: #000; border-radius: 30px; }
.cpg-card--case:hover { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.cpg-cs {
  --well: #f5f5f5;
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: 0.5em; font-size: calc(var(--csf, var(--csw, 268px)) * 0.0597); color: #000; text-align: left;
}
.cpg-cs-media {
  position: relative; display: block; flex: 0 0 auto; aspect-ratio: 16 / 10; border-radius: 1.4em; overflow: hidden;
  background: #f4f3f4;
}
/* Stretched row (fewer projects than a full row): the picture grows, the text stays the same size */
.cpg-grid--cs.is-wide .cpg-cs-media { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
.cpg-grid--cs.is-wide .cpg-cs-body { flex: 0 0 auto; }
.cpg-grid--cs.is-wide .cpg-cs-foot { margin-top: 1.4em; }
.cpg-cs-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1); }
.cpg-card--case:hover .cpg-cs-media img { transform: scale(1.03); }
.cpg-cs-body { display: flex; flex-direction: column; gap: 1em; flex: 1 1 auto; min-height: 0; padding: 0.875em 0.5em 0.375em 0.375em; }
.cpg-cs-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875em; align-items: center; }
.cpg .cpg-cs-orb { width: 3.125em; height: 3.125em; }
.cpg-cs-orb--plain { display: block; border-radius: 50%; background: #ece8ee; }
.cpg-cs-name { display: flex; flex-direction: column; min-width: 0; gap: 0.125em; }
.cpg-cs-name b { font-size: 1.0625em; line-height: 1.22; letter-spacing: -0.015em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpg-cs-name span { font-size: 0.8125em; line-height: 1.3; color: #707070; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cpg-cs-foot {
  margin-top: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tags tags" "metric go";
  align-items: end; gap: 0.875em 0.625em;
}
.cpg-cs-tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 0.25em; }
.cpg-cs-chip {
  display: inline-flex; align-items: center; height: 1.75em; padding: 0 0.7em; border-radius: 999px;
  border: 1px solid #eaeaea; font-size: 0.75em; line-height: 1; color: #3a3a3a; white-space: nowrap;
}
.cpg-cs-metric { grid-area: metric; display: flex; flex-direction: column; min-width: 0; justify-content: flex-end; }
.cpg-cs-metric b { font-size: 2.75em; line-height: 1; letter-spacing: -0.045em; font-weight: 400; font-variant-numeric: tabular-nums; }
.cpg-cs-metric.is-word b { font-size: 1.875em; letter-spacing: -0.035em; }
.cpg-cs-metric span { margin-top: 0.4em; font-size: 0.8125em; line-height: 1.25; color: #767676; }
.cpg-cs-go {
  grid-area: go; display: grid; place-items: center; width: 3.125em; height: 3.125em; border-radius: 50%;
  background: #f5f5f5; color: #000; transition: background 0.2s ease, color 0.2s ease;
}
.cpg-cs-go svg { width: 1em; height: 1em; }
.cpg-card--case:hover .cpg-cs-go, .cpg-card--case:focus-visible .cpg-cs-go { background: #2b55f6; color: #fff; }

/* In the story the slide is the card, larger */
.cpg-slide.is-case { background: #fff; color: #000; }
.cpg-cs--slide .cpg-cs-media img { transition: none; }
.cpg-story.is-mobile .cpg-slide.is-case .cpg-cs { padding: 0; }
.cpg-story.is-mobile .cpg-slide.is-case .cpg-cs-media { border-radius: 0; aspect-ratio: auto; height: 42%; }
.cpg-story.is-mobile .cpg-slide.is-case .cpg-cs-body { flex: 0 0 auto; padding: 1.1em 1em 0; }
.cpg-story.is-mobile .cpg-slide.is-case .cpg-cs-foot { margin-top: 1.2em; }
.cpg-story.is-compact:not(.is-mobile) .cpg-slide.is-case .cpg-cs-media { aspect-ratio: 16 / 8; }
.cpg-story.is-compact:not(.is-mobile) .cpg-slide.is-case .cpg-cs-body { flex: 0 0 auto; }
.cpg-story.is-compact:not(.is-mobile) .cpg-slide.is-case .cpg-cs-foot { margin-top: 0.4em; }
.cpg-story.is-compact .cpg-panel.is-case-panel { gap: 8px; }

/* Story panel extras for case studies */
.cpg-facts { margin: 14px 0 0; display: grid; gap: 8px; }
.cpg-facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.4; }
.cpg-facts dt { color: #7a7a7a; }
.cpg-facts dd { margin: 0; color: #222; }
.cpg-story.is-compact .cpg-facts dt { color: rgba(255, 255, 255, 0.62); }
.cpg-story.is-compact .cpg-facts dd { color: #fff; }
.cpg-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cpg .cpg-panel-actions .cpg-proto { margin-top: 0; padding: 0 18px; white-space: nowrap; }
.cpg .cpg-proto--primary { background: #2b55f6; }
.cpg .cpg-proto--primary:hover { background: #2044d8; }
.cpg .cpg-proto--ghost { background: #f0f0f0; color: #111 !important; }
.cpg .cpg-proto--ghost:hover { background: #e4e4e4; }
.cpg-story.is-compact .cpg-proto--primary { background: #2b55f6; color: #fff !important; }
.cpg-story.is-compact .cpg-proto--ghost { background: rgba(255, 255, 255, 0.16); color: #fff !important; }

/* Home bar: the visible strip of Home at the bottom */
.cpg-homebar {
  position: fixed; left: 2%; right: 2%; bottom: 0; height: 96px; z-index: 902;
  border-radius: 34px 34px 0 0; cursor: pointer;
}
.cpg .cpg-homebar:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.cpg.is-story .cpg-homebar, .cpg.is-closing .cpg-homebar { visibility: hidden; pointer-events: none; }
.cpg.is-closing { pointer-events: none; }

/* ── Tablet ── */
@media (max-width: 1099px) and (min-width: 701px) {
  .cpg-gallery { --cw: min(236px, calc((100vw - 232px) / 3)); }
  .cpg-scroll { padding: 106px 96px 150px; }
  .cpg-grid { grid-template-columns: repeat(3, var(--cw)); column-gap: 20px; row-gap: 34px; }
  .cpg-card { border-radius: 26px; }
  .cpg-pip { width: 112px; height: 80px; border-radius: 20px; }
  .cpg-dur-row { gap: 22px; }
  .cpg-mini { width: 36px; height: 36px; }
  .cpg-playbtn { width: 52px; height: 52px; }
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .cpg-gallery { --cw: calc((100vw - 44px) / 2); --ch: calc(var(--cw) * 1.36); --round: 46px; }
  .cpg-back { left: 14px; top: 14px; }
  .cpg-rail { display: none; }
  .cpg-tools { right: 14px; top: 14px; }
  .cpg-tools .cpg-round--blue { display: none; }
  /* Tabs get their own row under the back and search buttons */
  .cpg-tabs { top: 70px; left: 16px; right: 16px; transform: none; height: 44px; padding: 3px; }
  .cpg-tabs-pill { top: 3px; bottom: 3px; }
  .cpg .cpg-tab { flex: 1 1 auto; padding: 0 8px; font-size: 13px; }
  .cpg-scroll { padding: 132px 16px 130px; }
  .cpg-grid { grid-template-columns: repeat(2, var(--cw)); column-gap: 12px; row-gap: 22px; }
  .cpg-date { margin-bottom: 6px; }
  .cpg-card { border-radius: 24px; }
  .cpg-card-head { top: 12px; left: 12px; right: 12px; font-size: 12px; gap: 6px; }
  .cpg-card-av { width: 22px; height: 22px; }
  .cpg-card-segs { left: 18px; right: 18px; bottom: 14px; }
  .cpg-num { top: 25%; }
  .cpg-dur-row { gap: 12px; bottom: 7%; }
  .cpg-mini { width: 30px; height: 30px; font-size: 11px; }
  .cpg-mini svg { width: 12px; height: 12px; }
  .cpg-playbtn { width: 44px; height: 44px; }
  .cpg-playbtn svg { width: 18px; height: 18px; }
  .cpg-type-poster { top: 44px; bottom: 32px; left: 12px; right: 12px; }
  .cpg-homebar { height: 84px; left: 3%; right: 3%; border-radius: 28px 28px 0 0; }

  /* Story: full screen, actions on the right, details in a bottom glass panel */
  .cpg.is-story .cpg-back { background: rgba(20, 20, 24, 0.5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .cpg-story.is-mobile .cpg-actions { right: 12px; top: 72px; gap: 10px; }
  .cpg-story.is-mobile .cpg-actions .cpg-round:not(.cpg-round--white) { background: rgba(20, 20, 24, 0.5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .cpg-story.is-mobile .cpg-nav--panel { position: absolute; top: 16px; right: 14px; bottom: auto; flex-direction: row; gap: 8px; }
  .cpg-story.is-mobile .cpg-nav--panel .cpg-round { width: 40px; height: 40px; }
  .cpg-story.is-mobile .cpg-panel-kicker, .cpg-story.is-mobile .cpg-panel-title { padding-right: 96px; }
  .cpg-story.is-mobile .cpg-panel {
    left: 0; right: 0; top: auto; bottom: 0; transform: translateY(10px);
    border-radius: 26px 26px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: 70vh;
  }
  .cpg-story.is-mobile.is-in .cpg-panel { transform: none; }
  .cpg-story.is-mobile .cpg-panel-title { font-size: 22px; }
  .cpg-story.is-mobile .cpg-segs { top: 22px; bottom: auto; left: 74px; right: 16px; }
  .cpg-story.is-mobile .cpg-slide-shade { height: 140px; }
}

/* ── Reduced motion: quick fades only ── */
@media (prefers-reduced-motion: reduce) {
  .cpg-track, .cpg-pan, .cpg-fan, .cpg-card, .cpg-pip-photo.cr-wp-thumb { transition: none !important; }
  .cpg-actions > *, .cpg-panel, .cpg-nav, .cpg-pip, .cpg-slide--peek { transition: opacity 0.15s ease !important; transform: none; transition-delay: 0s !important; }
  .cpg-panel { transform: translateY(-100%); }
  .cpg-story.is-mobile .cpg-panel { transform: none; }
  .cpg-card:hover { transform: none; }
}

/* ── Design Playground: Home slides UP; the bar sits at the top, the gallery below it ── */
.cr-hero.is-pg.is-pg-up { box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45); }
.cpg--up .cpg-homebar { top: 0; bottom: auto; border-radius: 0 0 34px 34px; }
.cpg--up .cpg-back { top: 114px; }
.cpg-title { position: absolute; top: 118px; left: 50%; transform: translateX(-50%); z-index: 5; margin: 0; color: #fff; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.cpg.is-story .cpg-title { opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; }
.cpg--up .cpg-scroll { padding: 186px 110px 60px; }
@media (max-width: 1099px) and (min-width: 701px) { .cpg--up .cpg-scroll { padding: 180px 96px 60px; } }
@media (max-width: 700px) {
  .cpg--up .cpg-homebar { border-radius: 0 0 28px 28px; }
  .cpg--up .cpg-back { top: 98px; }
  .cpg-title { top: 108px; }
  .cpg--up .cpg-scroll { padding: 156px 16px 40px; }
}
.cpg--up.is-story .cpg-back { top: 18px; }
@media (max-width: 700px) { .cpg--up.is-story .cpg-back { top: 14px; } }

/* ═════════════ Design Playground on the Home board (PlaygroundBoard) ═════════════
   Same wallpaper and top bar. Home's cards blur away, the explorations blur in where they were. */
.cr-grid.cr-pg-out .cr-dim { opacity: 0; transform: scale(0.88); filter: blur(14px); pointer-events: none;
  transition: opacity 340ms ease, transform 420ms cubic-bezier(0.55, 0, 0.75, 0.2), filter 340ms ease; }
.cr-grid.cr-pg-out .cr-dim:nth-child(2n) { transition-delay: 30ms; }
.cr-grid.cr-pg-out .cr-dim:nth-child(3n) { transition-delay: 60ms; }
.cr-board.is-pgb > .cr-grid { visibility: visible; }
/* Fills the board exactly (no extra side padding): same columns, unit and gutter as Home */
.cpb { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; }
.cpb-grid { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; } /* cards centred, back sits just above */
.cpb-row { display: flex; justify-content: center; }
.cpb-card { position: relative; flex: none; display: block; padding: 0; border: 0; border-radius: 32px; overflow: hidden; cursor: pointer;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 360ms ease, opacity 380ms ease, filter 380ms ease; }
.cpb-gap { flex: none; }
.cpb-card:hover { transform: translateY(-3px) scale(1.015); }
.cpb-card:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cpb-media { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Liquid glass frame around every visual (the design system's .cr-glass card) */
.cpb-card .cpb-media { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); border-radius: 20px; }
/* Header: back button left, then the title, aligned with the cards' left edge */
.cpb-head { position: relative; z-index: 3; flex: none; align-self: stretch; display: flex; align-items: center; gap: 14px; margin-bottom: 4px;
  transition: opacity 380ms ease, filter 380ms ease; }
.cpb-back { position: relative; flex: none; z-index: 3; border: 0; cursor: pointer;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), opacity 380ms ease, filter 380ms ease, background 200ms ease; }
.cpb-back:hover { transform: translateY(-2px); }
.cpb-back:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cpb-head-text { min-width: 0; color: var(--wp-topbar-ink, #fff); }
.cpb-head-title { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
.cpb-head-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.35; opacity: 0.72; }
.cpb.has-sheet .cpb-head { opacity: 0; pointer-events: none; }
/* Name shows on hover or focus: the picture lifts and the name sits in the glass frame below it, no pill */
.cpb-card .cpb-media { transition: height 380ms cubic-bezier(0.16, 1, 0.3, 1); }
.cpb-card:hover .cpb-media, .cpb-card:focus-visible .cpb-media { height: calc(100% - 58px); }
.cpb-cap { position: absolute; left: 20px; right: 20px; bottom: 13px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  color: #fff; text-shadow: 0 1px 8px rgba(30, 15, 40, 0.28); pointer-events: none;
  opacity: 0; transform: translateY(6px); transition: opacity 240ms ease 60ms, transform 380ms cubic-bezier(0.16, 1, 0.3, 1); }
.cpb-cap-title { min-width: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpb-cap-kind { flex: none; font-size: 12px; opacity: 0.75; }
.cpb-card:hover .cpb-cap, .cpb-card:focus-visible .cpb-cap { opacity: 1; transform: none; }
@media (hover: none) {
  .cpb-card .cpb-media { height: calc(100% - 50px); }
  .cpb-cap { opacity: 1; transform: none; left: 16px; right: 16px; bottom: 11px; }
  .cpb-cap-kind { display: none; }
}
.cpb.has-sheet .cpb-card { opacity: 0.25; filter: blur(4px); transform: scale(0.96); }
.cpb-scrim { position: absolute; inset: -40px; z-index: 4; }
.cpb-sheet { position: absolute; inset: -14px 0 -18px; z-index: 5; display: flex; gap: 0; overflow: hidden; }
.cpb-sheet-media { flex: 0 0 64%; height: 100%; box-sizing: border-box; padding: 14px; display: flex; align-items: center; justify-content: center; }
.cpb-sheet-media .cpb-media { width: auto; height: auto; max-width: 100%; max-height: 100%; aspect-ratio: var(--r, 1.6); border-radius: 18px; object-fit: cover; box-shadow: 0 10px 30px rgba(20, 10, 30, 0.18); }
.cpb-sheet-body { flex: 1 1 0; min-width: 240px; padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.cpb-sheet-top { display: flex; align-items: center; justify-content: space-between; }
.cpb-tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cpb-tools .cr-chip { background: rgba(255, 255, 255, 0.9); }
.cpb-sheet-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cpb-cta { gap: 6px; background: var(--ink, #1a1a1a); color: #fff; text-decoration: none; }
.cpb-steps { display: flex; gap: 8px; }
.cpb-next svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .cr-grid.cr-pg-out .cr-dim, .cpb-card { transition: none; } }

/* Tablet and phone: the board flows, so the playground does too */
.cr-hero[data-cr-fit="stack"] .cr-board.is-pgb > .cr-grid { display: none; }
.cr-hero[data-cr-fit="stack"] .cpb { position: relative; inset: auto; max-width: 420px; margin: 0 auto; }
.cr-hero[data-cr-fit="stack"] .cpb-grid { justify-content: flex-start; padding-top: 4px; }
.cr-hero[data-cr-fit="stack"] .cpb-card { border-radius: 28px; }
.cr-hero[data-cr-fit="stack"] .cpb-card .cpb-media { inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); border-radius: 19px; }
.cr-hero[data-cr-fit="stack"] .cpb-sheet, .cr-hero[data-cr-fit="flow"] .cpb-sheet { position: fixed; inset: auto 12px 12px; top: 84px; flex-direction: column; }
.cr-hero[data-cr-fit="stack"] .cpb-sheet-media, .cr-hero[data-cr-fit="flow"] .cpb-sheet-media { flex: none; height: auto; width: 100%; max-height: 52%; padding: 10px; }
.cr-hero[data-cr-fit="stack"] .cpb-sheet-body, .cr-hero[data-cr-fit="flow"] .cpb-sheet-body { min-width: 0; padding: 18px; }

/* Every picture and motion piece in the sheet opens full size */
.cpb-sheet-media { container-type: size; }
.cpb-zoomable { position: relative; display: block; flex: none; width: min(100cqw, 100cqh * var(--r, 1.6)); aspect-ratio: var(--r, 1.6); padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 18px; }
.cpb-zoomable .cpb-media { width: 100%; height: 100%; max-width: none; max-height: none; }
.cr-hero[data-cr-fit="stack"] .cpb-sheet-media, .cr-hero[data-cr-fit="flow"] .cpb-sheet-media { container-type: inline-size; }
.cr-hero[data-cr-fit="stack"] .cpb-zoomable, .cr-hero[data-cr-fit="flow"] .cpb-zoomable { width: min(100cqw, 42vh * var(--r, 1.6)); }
.cpb-zoomable:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cpb-zoom-hint { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92); color: #1a1a1a; box-shadow: 0 4px 14px rgba(20, 10, 30, 0.18);
  opacity: 0; transform: scale(0.9); transition: opacity 200ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1); }
.cpb-zoomable:hover .cpb-zoom-hint, .cpb-zoomable:focus-visible .cpb-zoom-hint { opacity: 1; transform: none; }
@media (hover: none) { .cpb-zoom-hint { opacity: 1; transform: none; } }
.cpb-zoom { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 64px 24px 24px; box-sizing: border-box;
  background: rgba(14, 10, 20, 0.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); cursor: zoom-out;
  animation: cpbZoomIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.cpb-zoom-frame { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.cpb-zoom-frame .cpb-media { width: auto; height: auto; max-width: 100%; max-height: 100%; aspect-ratio: var(--r, 1.6); object-fit: contain; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: cpbZoomFrame 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.cpb-zoom-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: #1a1a1a; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.cpb-zoom-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes cpbZoomIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cpbZoomFrame { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cpb-zoom, .cpb-zoom-frame .cpb-media { animation: none; } .cpb-card .cpb-media { transition: none; } }
@media (hover: none) {
  .cr-hero[data-cr-fit="stack"] .cpb-card .cpb-media { height: calc(100% - 46px); }
  .cr-hero[data-cr-fit="stack"] .cpb-cap { left: 14px; right: 14px; bottom: 12px; }
  .cr-hero[data-cr-fit="stack"] .cpb-cap-title { font-size: 13px; }
}

/* Phones: a solid strip behind the back button and tabs, so the grid scrolls under it cleanly */
@media (max-width: 700px) {
  .cpg-gallery::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
    height: calc(128px + env(safe-area-inset-top, 0px));
    background: linear-gradient(to bottom, #1b1c20 0%, #1b1c20 78%, rgba(27, 28, 32, 0) 100%);
  }
  .cpg.is-story .cpg-gallery::before, .cpg--up .cpg-gallery::before { display: none; }
}
/* Phones: the Home card peeking at the bottom reads as a card you can tap back to: a grab handle and a light shade */
@media (max-width: 700px) {
  .cpg:not(.cpg--up) .cpg-homebar { background: linear-gradient(to bottom, rgba(18, 18, 22, 0.05), rgba(18, 18, 22, 0.28)); }
  .cpg:not(.cpg--up) .cpg-homebar::before {
    content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }
}
