/* ==========================================================================
   CASE STUDY — Figma: Case study Rationalfx (33:1213)
   Three columns at 1440: contents 221 · article 571 · balance 225, 40 apart,
   centred. The contents column sticks while the article scrolls.
   ========================================================================== */

.case {
  padding-top: var(--space-90);              /* Figma: 90 */
  padding-bottom: var(--section-y);
}
.case__layout {
  display: grid;
  grid-template-columns: 13.8125rem minmax(0, 35.6875rem) 14.0625rem; /* 221 · 571 · 225 */
  justify-content: center;
  align-items: start;
  column-gap: var(--space-40);
}

/* ---------- Contents ---------- */
.case__nav {
  /* Figma 33:1306 — Back row 24 tall (level with the meta row), 32 to the contents, so the
     first contents item lines up with the title (both 56 from the top) */
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-32);
}
.case__nav .toc { width: 100%; }
.toc__back { min-height: 1.5rem; transition: color var(--duration-fast) var(--ease-out); } /* 24, as the meta row */
.toc__back:hover { color: var(--color-text); }
.toc__back .icon { filter: var(--icon-filter); }
.case__nav .toc__item .icon { filter: var(--icon-filter); }
/* Contents behaviour (case-study.js):
   · the section you're reading gets a light pill; inside a group, the group row
     gets one too, and the group folds open (chevron flips) while others fold shut
   · only the current sub-item shows the ↳ corner, and its text slides over for it */
.case__nav {
  max-height: calc(100svh - var(--header-h) - var(--space-40));
  overflow-y: auto;
  scrollbar-width: none;
}
.case__nav .toc__item {
  border-radius: var(--radius-md);           /* navigation: 8 */
  transition: background-color 300ms var(--ease-out), color 300ms var(--ease-out);
}
/* The current link's pill is one shared element that glides between links (case-study.js);
   a group row stays lit while you're inside it */
.case__nav .toc { position: relative; }
.toc__pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  pointer-events: none;
}
.case__nav .toc > li { position: relative; z-index: 1; }
.case__nav .toc__item[aria-current="true"] { color: var(--color-text); }
.toc__group.is-current > .toc__item--group {
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  color: var(--color-text);
}
.toc__chevron { transition: transform 450ms cubic-bezier(0.65, 0, 0.35, 1); }
.toc__group.is-open .toc__chevron { transform: rotate(180deg); }

/* fold: rows animate open from 0fr → 1fr */
.toc__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 450ms cubic-bezier(0.65, 0, 0.35, 1);
}
.toc__group.is-open > .toc__sub { grid-template-rows: 1fr; }
.toc__sub-list {
  min-height: 0;
  overflow: hidden;
  list-style: none;
  padding: 0 0 0 var(--space-20);            /* sub-items sit indented under their group */
  display: flex;
  flex-direction: column;
  gap: var(--space-4);                      /* Figma: 4 */
}
.toc__group.is-open .toc__sub-list { padding-top: var(--space-4); } /* Figma: 4 under the group */
.toc__sub-list > li {
  opacity: 0;
  translate: 0 -4px;
  transition: opacity 250ms ease, translate 350ms var(--ease-out);
}
.toc__group.is-open .toc__sub-list > li {
  opacity: 1;
  translate: 0 0;
  transition-delay: calc(80ms + var(--i, 0) * 25ms);
}
.case__nav .toc__item--sub {
  justify-content: flex-start;
  align-self: stretch;
  gap: 0;
}
.toc__corner {
  width: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: width 350ms var(--ease-out), margin 350ms var(--ease-out), opacity 250ms ease, transform 350ms var(--ease-out);
}
.toc__item--sub[aria-current="true"] .toc__corner {
  width: var(--icon-sm);
  margin-right: var(--space-4);
  opacity: 1;
  transform: none;
}

/* ---------- Article ---------- */
.case__article {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}
.case__head {                                         /* Figma 33:1254: meta 24 · 32 · title */
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
.case__head .meta { color: var(--color-text-muted); }
.case__head .tag { line-height: 1rem; }               /* Figma 37:1454: 24 tall (4 + 16 + 4) */
.case__title {
  font-size: var(--text-xl);                 /* 40 */
  letter-spacing: var(--tracking-xl);
  line-height: var(--leading-tight);         /* 120% */
  font-weight: var(--weight-regular);
  color: var(--color-text-strong);
}
.case__hero {
  height: 37.5rem;                           /* 600: every project's overview image, the same height */
  background: var(--color-surface-subtle);   /* Figma #E5E5E5 placeholder */
}
.case__body {
  margin-top: var(--space-40);               /* 40 + 40 = Figma's 80 under the hero */
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}
.case__figure {
  height: 23.875rem;                         /* 382 */
  background: var(--color-surface-subtle);
}
.case__article section { scroll-margin-top: calc(var(--header-h) + var(--space-20)); }

/* ---------- Article type — Figma 33:1213 ----------
   label 14/20 #484848 · section heading 16/24 Medium #333 · sub-section heading
   14/20 Medium #333 · body 14/20 #767676 (the opening introduction 16/24, as in Figma).
   Spacing: 22 inside a section, 16 label → heading, 40 between blocks. */
.article-section { gap: 22px; }                      /* Figma: 22 */
/* Figma 33:1233: with a label, label → 16 → heading → 16 → body */
.article-section__eyebrow + .case__heading { margin-bottom: -6px; }
.article-section__eyebrow {
  margin-bottom: -6px;                               /* label → heading: 16 */
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-regular);
  color: var(--color-text-secondary);                /* #484848 */
}
.case__heading {
  font-size: var(--text-sm);                         /* 14/20 Medium — all case study text is 14 */
  line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.prose__p,
.prose__list,
.prose__quote {
  font-size: var(--text-sm);                         /* 14/20 #767676 */
  line-height: var(--leading-sm);
  color: var(--color-text-muted);
}
.prose__p.c-default { color: var(--color-text); }
.article-section strong { font-weight: var(--weight-medium); color: var(--color-text); }
.article-section em { font-style: italic; }

/* Not in the Figma frame — built from its sizes and colours */
.prose__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.prose__list li {
  position: relative;
  padding-left: var(--space-16);
}
.prose__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 3px;                                        /* the Figma meta dot */
  height: 3px;
  border-radius: var(--radius-full);
  background: currentColor;
}
.prose__quote {
  margin: 0;
  padding-left: var(--space-16);
  border-left: 1px solid var(--color-text);
  color: var(--color-text);                          /* 14/20 #333 */
}
.quote-card {                                        /* sits like an image block */
  margin: 18px 0 0;                                  /* 22 + 18 = 40 between blocks */
  padding: var(--space-32);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-16);
  row-gap: var(--space-8);
  border-radius: var(--radius-xl);                   /* 20, as the Figma images */
  background: var(--color-surface-subtle);
}
.quote-card__avatar {                                /* replace with an <img> of the person */
  grid-row: span 2;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-muted);
}
.quote-card__text {                                  /* = section heading: 14/20 Medium */
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.quote-card__by {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-text-muted);
}
.insight {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
/* Learnings in two columns (Rank reflection); one column on phones */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-40) var(--space-24);
}
@media (max-width: 40rem) { .insight-grid { grid-template-columns: 1fr; } }
.insight__title {                                    /* = sub-section heading: 14/20 Medium */
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

/* Project details under the hero */
.case__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-24) var(--space-20);
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}
.case__details dt { color: var(--color-text-muted); margin-bottom: var(--space-4); }
.case__details dd { margin: 0; color: var(--color-text); }

.article-section .case__figure { margin-top: 18px; } /* 22 + 18 = Figma's 40 above an image */

/* Copy still to come — visible so it isn't forgotten */
.case__todo {
  padding: var(--space-16);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 64rem) {
  .case__layout { grid-template-columns: 12rem minmax(0, 1fr); }
  .case__balance { display: none; }
}
@media (max-width: 40rem) {
  .case__details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-card { padding: var(--space-20); }
  .case { padding-top: calc(var(--header-h) + var(--space-10)); }
  .case__layout { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-32); }
  .case__nav { position: static; }
  .case__nav .toc { display: none; }          /* phones: just the Back link above the article */
  .case__hero, .case__hero.case__media { height: auto; aspect-ratio: 571 / 600; }
  .case__figure { height: auto; aspect-ratio: 571 / 382; }
}

/* ---------- Real media (images and looping videos) ----------
   Natural aspect ratio instead of the placeholder's fixed height; the hero keeps its crop.
   Videos are muted loops that only play while on screen (case-study.js). */
.case__fig { margin: 0; }
.article-section .case__fig { margin-top: 18px; }        /* as .case__figure: 40 above an image */
.article-section .case__fig .case__figure { margin-top: 0; }
.case__fig + .case__fig { margin-top: var(--space-16); }
.case__figure.case__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: cover;
}
.case__hero.case__media { display: block; width: 100%; height: 37.5rem; object-fit: cover; }
.case__hero.sole-thumb { aspect-ratio: auto !important; }  /* the live map poster fills the same frame */
@media (max-width: 40rem) {
  .case__hero.case__media { height: auto; }
  .case__hero.sole-thumb { height: auto; aspect-ratio: 571 / 600 !important; }
}

/* ---------- Product showcase (scripts/showcase.js) ----------
   A product frame with two views behind the Works-page toggle: Product (the app's screens
   in a row you can drag along, Mobbin-style) and Motion (the prototype video). */
.showcase {
  margin: 0;
  display: flex;
  flex-flow: row wrap;                                  /* the name and the toggle share a row */
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12) var(--space-16);
}
.showcase__stage { flex: 1 0 100%; }
/* Which flow this is, above its frame */
.showcase__name {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.article-section .showcase { margin-top: 18px; }         /* 40 above, as an image */
.showcase__toggle { align-self: center; }
.showcase__stage {
  position: relative;
  height: 23.875rem;                                   /* 382 — the figure frame */
  border-radius: var(--radius-xl);
  background: var(--color-surface-subtle);
  overflow: hidden;
}
.showcase__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s linear 260ms;
}
.showcase__panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s;
}
/* Product: screens in a row, scroll-snapped; the ends fade into the frame */
.showcase__strip {
  display: flex;
  gap: var(--space-12);
  height: 100%;
  padding: var(--space-24);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--space-24);
  scrollbar-width: none;
  cursor: grab;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--space-24), #000 calc(100% - var(--space-24)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--space-24), #000 calc(100% - var(--space-24)), transparent);
}
.showcase__strip::-webkit-scrollbar { display: none; }
.showcase__strip.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.showcase__strip.is-gliding { scroll-snap-type: none; }
.showcase__strip:focus-visible { box-shadow: inset 0 0 0 2px var(--color-text); }
.showcase__screen {
  flex: none;
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: 390 / 844;                             /* a phone screen */
  border-radius: var(--radius-lg);
  object-fit: cover;
  scroll-snap-align: start;
  -webkit-user-drag: none;
}
/* Numbered feature notes (Figma Anatomy / Callout): a blue number and a line of explanation */
.callout {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  padding: var(--space-12);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  font-size: 0.9375rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.callout__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-callout);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}
.callout__text { padding-top: 1px; }
/* The pulse: a ring that keeps leaving the marker, so the eye finds it */
@keyframes callout-ping {
  0% { transform: scale(1); opacity: 0.5; }
  70%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Product: pulsing markers on the screens; hover, focus or tap one for its note */
.showcase__shot { position: relative; flex: none; height: 100%; aspect-ratio: 390 / 844; container-type: size; }
.showcase__shot .showcase__screen { width: 100%; }
.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  width: max(20px, 6.5cqw);
  height: max(20px, 6.5cqw);
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-callout);
  color: #fff;
  font: 500 max(11px, 4cqw) / 1 var(--font-sans);
  cursor: pointer;
  isolation: isolate;
  transition: transform 160ms var(--ease-out);
}
.hotspot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%;
  background: inherit;
  animation: callout-ping 2.4s var(--ease-out) infinite;
  animation-delay: var(--delay, 0s);
}
.hotspot:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .hotspot:hover { transform: scale(1.08); } }
.hotspot:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.hotspot-note {
  position: absolute;
  z-index: 3;
  width: 15rem;
  font-size: 0.875rem;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.hotspot-note.is-open { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hotspot::before { animation: none; }
  .hotspot-note { transform: none; }
}

/* Expand: the frame grows into a large view (scripts/showcase.js) */
.showcase__stage[data-cursor] { cursor: zoom-in; }
.showcase__expand {
  position: absolute; top: var(--space-12); right: var(--space-12); z-index: 4;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: var(--color-bg); cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.showcase__expand .icon { filter: var(--icon-filter); }
.showcase__expand:active { transform: scale(0.94); }
.showcase-dialog {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: var(--space-24); border: 0; background: transparent; overflow: hidden;
}
.showcase-dialog[open] { display: grid; place-items: center; }
.showcase-dialog::backdrop { background: transparent; }
.showcase-dialog__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.showcase-dialog__close {
  position: absolute; top: var(--space-16); right: var(--space-16); z-index: 2;
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.showcase-dialog__close:active { transform: scale(0.94); }
.showcase-dialog .showcase { position: relative; z-index: 1; width: min(75rem, 100%); transform-origin: 50% 0; }
.showcase-dialog .showcase__stage { height: min(80dvh, 52rem); cursor: auto; }
.showcase-dialog .showcase__expand { display: none; }
.showcase-dialog .showcase__toggle { background: var(--color-bg); border-radius: 999px; }
.showcase__placeholder { display: block; }
html.is-locked { overflow: hidden; }

/* Motion: the prototype video fills the frame */
/* Motion: a live phone playing the flow (scripts/flow-player.js) */
.flow { position: relative; height: 100%; padding: var(--space-24) 0; display: flex; justify-content: center; overflow: hidden; }
.flow__device {
  position: relative;
  height: 100%;
  aspect-ratio: 402 / 874;
  border-radius: 9.4% / 4.3%;                          /* follows the screen's 54pt corners */
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--color-border, rgba(0, 0, 0, 0.08));
  isolation: isolate;
  transform-origin: 0 0;
}
.flow__screen { position: absolute; left: 0; top: 0; width: 402px; height: 874px; transform-origin: 0 0; overflow: hidden; }
.flow__layer { position: absolute; left: 0; top: 0; width: 402px; height: 874px; display: block; user-select: none; pointer-events: none; }
.flow__popover, .flow__sheet { width: auto; }
.flow__sheet { width: 402px; }
.flow__dim { position: absolute; inset: 0; pointer-events: none; }
.flow__shot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.flow__cover, .flow__key, .flow__window { position: absolute; }
.flow__window { overflow: hidden; }
.flow__sheet-shade { position: absolute; inset: 0; border-radius: 32px; background: rgba(0, 0, 0, 0.5); pointer-events: none; }
/* Typed into a field: Geist 16 as in Figma, with a caret riding after the last character */
.flow__text { position: absolute; white-space: pre; font-family: var(--font-sans); font-weight: 400; }
.flow__text-ch { display: inline-block; white-space: pre; }
.flow__text--wrap { white-space: normal; }
.flow__text--wrap .flow__text-ch { display: inline; white-space: normal; }   /* break between words */
/* Odometer: each digit is a wheel in a window one line tall (scripts/flow-player.js odometer()) */
.flow__odo { position: absolute; pointer-events: none; }   /* the slots clip; the line may run a hair past its cover */
.flow__odo-line { position: absolute; display: flex; white-space: pre; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.flow__odo-slot { position: relative; display: block; height: 100%; overflow: hidden; }
.flow__odo-reel, .flow__odo-digit, .flow__odo-ch { display: block; }
.flow__odo-out { position: absolute; left: 0; top: 0; }
/* A scrolling list and the frosted bar it passes under (flow-player.js scroller(), glass()) */
.flow__scroll { position: absolute; display: block; max-width: none; }
.flow__glass { position: absolute; left: 0; width: 402px; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%); mask-image: linear-gradient(180deg, transparent, #000 40%); }
.flow__glass-bar { position: absolute; display: block; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.flow__home-indicator { position: absolute; left: 134px; top: 860px; width: 134px; height: 5px; border-radius: 3px; background: #000; }
.flow__label { width: 100%; font-family: var(--font-sans); font-weight: 400; font-variant-numeric: tabular-nums; }
.flow__caret {
  display: inline-block; width: 1.5px; height: 1.15em; margin-left: 1px; vertical-align: -0.2em;
  background: #0436fc; animation: flow-caret 1s steps(1) infinite;
}
@keyframes flow-caret { 50% { opacity: 0; } }
.flow__key { border-radius: 5px; background: rgba(0, 0, 0, 0.12); opacity: 0; }
.flow__badge { width: auto; height: auto; }
/* The typed amount: Geist as in Figma, 48 with a 20 ".00", tabular so digits don't jitter */
.flow__amount {
  position: absolute; left: 0; width: 402px; text-align: center; white-space: nowrap;
  font-family: var(--font-sans); font-weight: 500; color: #1a1a1a; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.flow__amount-ch, .flow__amount-small { display: inline-block; }
.flow__amount-small { font-size: var(--small); color: var(--small-color, #767676); letter-spacing: var(--small-ls, 0); }
.flow__dim--page { background: rgba(0, 0, 0, 0.06); }
.flow__dim--sheet { background: rgba(0, 0, 0, 0.4); }
/* The touch in the prototypes, as in the screen recordings from Figma: a disc that presses,
   a halo closing in as it lands, a ring that grows out on release. Centred on its point. */
.flow__touch { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 30; }
.flow__touch > i { position: absolute; border-radius: 50%; opacity: 0; }
.flow__touch-disc {
  left: -17px; top: -17px; width: 34px; height: 34px;
  background: rgba(0, 0, 0, 0.1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.flow__touch-halo { left: -24px; top: -24px; width: 48px; height: 48px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 0 8px rgba(0, 0, 0, 0.05); }
.flow__touch-ring { left: -21px; top: -21px; width: 42px; height: 42px; box-shadow: inset 0 0 0 2px rgba(78, 90, 166, 0.55); }
.flow__clock { position: absolute; width: 0; height: 0; }
.showcase__video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}
@media (max-width: 40rem) {
  .showcase__stage { height: 20rem; }
  .showcase__strip { padding: var(--space-16); gap: var(--space-8); }
}

/* ---------- View other projects (scripts/more-projects.js) ----------
   End of every case study: a row of tall cards that slide up into view; choosing one grows
   it to fill the screen while the others shrink into a strip at the bottom. */
.more {
  padding-block: var(--section-y);
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
.more__head { display: flex; flex-direction: column; gap: var(--space-16); }
.more__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-12);
  overflow: visible;                   /* cards fly in from the screen's right edge */
  scrollbar-width: none;
}
.more__row.is-entered { overflow-x: auto; } /* once in place, a long row scrolls sideways */
.more__row.is-dragging { user-select: none; }
.more__row.is-dragging .more__card { pointer-events: none; }
.more__item { transform-origin: 0% 100%; will-change: transform, opacity; }
.more__row::-webkit-scrollbar { display: none; }
.more__item { flex: none; display: flex; flex-direction: column; gap: var(--space-8); width: clamp(12rem, 22vw, 20rem); }
.more__card {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-subtle);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}
.more__card:active { transform: scale(0.98); }
.more__card:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.more__media { display: block; width: 100%; height: 100%; object-fit: cover; }
.more__media.media--checker { background: var(--color-surface) url("../../assets/images/placeholder.png") repeat 0 0 / 26.25rem; filter: var(--placeholder-filter); }
.more__label { display: flex; justify-content: space-between; gap: var(--space-8); font-size: var(--text-sm); line-height: var(--leading-sm); }
.more__name { color: var(--color-text); }
.more__year { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* Full-screen stage */
html.is-more-open { overflow: hidden; scrollbar-gutter: stable; }
.more__stage {
  position: fixed;
  inset: 0;
  z-index: 58;                         /* above the header, lamp and menu; under the cursor */
  background: var(--color-bg);
}
.more__big {
  position: fixed;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface-subtle);
  color: #fff;
  text-decoration: none;
}
.more__big[aria-disabled="true"] { cursor: default; }
.more__title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-24);
  text-align: center;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-xl);
  line-height: var(--leading-tight);
  text-shadow: 0 1px 24px rgb(0 0 0 / 0.35);
  pointer-events: none;
}
.more__close {
  position: fixed;
  top: calc(16px + var(--space-16));
  right: calc(16px + var(--space-16));
  padding: 0.375rem var(--space-10);
  border-radius: var(--radius-md);
  background: rgb(0 0 0 / 0.45);
  color: #fff;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
}
.more__thumbs {
  position: fixed;
  right: calc(16px + var(--space-16));
  bottom: calc(16px + var(--space-16));
  display: flex;
  gap: var(--space-4);
}
.more__thumb {
  width: 2.75rem;                      /* 44 × 59 — the cards' 3:4 */
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.6;
  cursor: pointer;
  transform-origin: 0 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.more__thumb:hover, .more__thumb[aria-current="true"] { opacity: 1; }
.more__stage.is-settled .more__thumb[aria-current="true"] { outline: 1.5px solid #fff; outline-offset: 1px; } /* only once landed */

/* Project Overview: the title, hero and details at the top, as one contents stop */
.case__overview { display: flex; flex-direction: column; gap: var(--space-40); }

/* ---------- Live component cards (scripts/spec.js + styles/ds.css) ----------
   Design Systems case study: each card has a label, a live stage you can use, and a
   code drawer (HTML / CSS tabs) with copy. */
.spec {
  margin: 18px 0 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
}
.spec + .spec { margin-top: var(--space-12); }
.spec__head {
  display: flex; align-items: center; gap: var(--space-8);
  padding: var(--space-10) var(--space-10) var(--space-10) var(--space-16);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.125rem;
  color: var(--color-text-muted); letter-spacing: 0.04em;
}
.spec__head::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--color-text); opacity: 0.55; }
.spec__hint { margin-left: auto; letter-spacing: 0; opacity: 0.8; font-family: var(--font-sans); }
.spec__tabs { margin-left: var(--space-12); font-family: var(--font-sans); letter-spacing: 0; }
.spec__hint + .spec__tabs { margin-left: var(--space-12); }
.spec__head:not(:has(.spec__hint)) .spec__tabs { margin-left: auto; }
/* Design: a roomy stage, so every component has space to breathe */
.spec__stage {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-16);
  min-height: 12rem;
  padding: var(--space-40) var(--space-32);
  /* the system's own canvas: follows its light / dark tokens (styles/ds.css) */
  background-color: var(--ds-canvas, var(--color-bg));
  background-image: radial-gradient(color-mix(in srgb, var(--ds-canvas-text, var(--color-text)) 10%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: -8px -8px;
}
.spec__stage--block { display: block; }
@media (max-width: 40rem) {
  .spec__stage { padding: var(--space-24) var(--space-16); }
  .spec__head { flex-wrap: wrap; row-gap: var(--space-4); }
  .spec__tabs { display: flex; flex: none; margin-left: auto; }
}
.spec__stage:has(.ds-dropdown) { min-height: 27rem; align-items: flex-start; } /* room for the open menu */
.spec__stage[hidden], .spec__codeview[hidden] { display: none; }
/* Code: HTML / CSS + Copy */
.spec__codeview { min-height: 12rem; background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.spec__codebar { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-10) var(--space-10) 0 var(--space-16); }
.spec__langs { display: flex; gap: var(--space-4); }
.spec__lang, .spec__copy {
  height: 1.75rem; padding: 0 var(--space-10); border: 0; border-radius: var(--radius-sm);
  background: transparent; font: inherit; font-size: var(--text-xs); color: var(--color-text-muted); cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.spec__lang[aria-selected="true"] { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text); }
.spec__copy { margin-left: auto; color: var(--color-text); }
.spec__copy:hover, .spec__lang:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.spec__lang:focus-visible, .spec__copy:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-text); }
.spec__pre {
  margin: 0; max-height: 26rem; overflow: auto; padding: var(--space-16) var(--space-16) var(--space-24);
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.7;
  color: var(--color-text); tab-size: 2; white-space: pre;
}
.tok-tag { color: var(--color-text); font-weight: 500; }
.tok-attr, .tok-prop { color: var(--color-text-muted); }
.tok-str, .tok-val { color: color-mix(in srgb, var(--color-text) 78%, #a06a1a); }
.tok-com { color: var(--color-text-muted); opacity: 0.7; font-style: italic; }

/* Inline links in case study copy */
.prose__link { color: var(--color-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose__link:hover { text-decoration-thickness: 2px; }

/* ---------- Page frame (scripts/page-frame.js) ----------
   A website page in a browser frame, Desktop / Mobile. The full-length page scrolls through
   the frame as you read past it, so the whole page is seen without any writing. */
.page-frame { margin: 18px 0 0; border-radius: var(--radius-xl); background: var(--color-surface-subtle); overflow: hidden; }
.page-frame__bar { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-10) var(--space-10) var(--space-10) var(--space-16); }
.page-frame__dots { display: flex; gap: 6px; }
.page-frame__dots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--color-text) 18%, transparent); }
.page-frame__url {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
  padding: var(--space-4) var(--space-12); border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-muted);
}
.page-frame__stage { position: relative; aspect-ratio: 16 / 10; }
.page-frame__stage .showcase__panel { padding: 0 var(--space-10) var(--space-10); }
.page-frame__view { position: relative; height: 100%; overflow: hidden; border-radius: var(--radius-md); background: var(--color-bg); }
.page-frame__page { display: block; width: 100%; height: auto; will-change: transform; }
.page-frame__page.media--checker { height: 320%; }   /* placeholder: a long page */
/* Mobile: a phone-shaped window in the middle of the frame */
.page-frame__phone { height: 100%; aspect-ratio: 390 / 760; margin: 0 auto; padding: 8px; border-radius: 28px; background: var(--color-text); }
.page-frame__phone .page-frame__view { border-radius: 21px; }
/* Sign up journey: wide (desktop) screens in the strip */
.showcase__screen--wide { aspect-ratio: 16 / 10; }
.case__todo-inline { color: var(--color-text-muted); font-style: italic; }
@media (max-width: 40rem) {
  .page-frame__toggle { display: none; }
}

/* Enlarge for single images and videos (scripts/media-zoom.js): the same button as a showcase */
.zoomable { position: relative; }
.zoomable[data-cursor] { cursor: zoom-in; }
.showcase-dialog > .case__media { cursor: auto; }
