.portfolio-primary-navigation { display: flex; align-items: flex-start; gap: 24px; pointer-events: auto; }
.portfolio-primary-navigation > .portfolio-prototypes-nav { flex:none; }

/* The catalog shares project introductions and the gallery's wide material. */
html.work-grid .portfolio-viewer-prototypes {
  --type-title: inherit;
  --type-title-leading: inherit;
  position: relative;
  display: block;
  max-width: 1480px;
  padding: 0;
}
html.work-grid .portfolio-viewer-prototypes #portfolio-viewer-title { line-height: var(--type-title-leading); }
html.work-grid .portfolio-viewer-prototypes #portfolio-viewer-title + .portfolio-viewer-summary { color: var(--portfolio-copy); margin: 24px auto 0; }
.ai-prototypes-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--nd-space-8);
}
.ai-prototypes-list .cms-project-card { min-width: 0; }
/* The same measured launch group as each project hero, with one native link. */
html.work-grid.home-gallery .portfolio-viewer-prototypes .ai-prototypes-list .ai-prototype-box .home-project-visual.ai-prototype-surface{
  position:relative;display:block;width:100%;height:auto;min-height:0;
  aspect-ratio:auto;padding:0;overflow:clip;box-sizing:border-box;
}
html.work-grid.home-gallery .portfolio-viewer-prototypes .ai-prototypes-list .ai-prototype-surface::before{
  -webkit-backdrop-filter:none;backdrop-filter:none;
}
.ai-prototypes-list .ai-prototype-entry .prototype-launch{max-width:100%}
@media(max-width:767px){
  .portfolio-primary-navigation{gap:20px}
  .portfolio-primary-navigation>.portfolio-prototypes-nav{display:none}
  html.work-grid .portfolio-viewer-prototypes #portfolio-viewer-title+.portfolio-viewer-summary{margin-top:20px}
  .ai-prototypes-list{gap:var(--nd-space-4)}
}

/* Static thumbnails provide a desktop overview without playing a second demo. */
.ai-prototype-index { display: none; }
@media (min-width: 1024px) {
  .ai-prototype-index {
    --prototype-index-selection: rgb(24 24 24 / .72);
    position: fixed;
    inset-block-start: 50%;
    inset-inline-end: max(16px, calc((100vw - 1480px) / 2 + 16px));
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: calc(var(--nd-space-1) / 2);
    padding: calc(var(--nd-space-1) / 2);
    border: 1px solid var(--control-line);
    border-radius: 10px;
    background: var(--control-glass);
    box-shadow: var(--control-shadow);
    backdrop-filter: var(--control-glass-filter);
    -webkit-backdrop-filter: var(--control-glass-filter);
    transform: translateY(-50%);
  }
  html[data-theme="dark"] .ai-prototype-index {
    --prototype-index-selection: rgb(232 232 232 / .82);
  }
  .ai-prototype-jump {
    appearance: none;
    display: grid;
    place-items: center;
    width: 60px;
    min-height: 48px;
    padding: 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
  }
  .ai-prototype-jump img {
    display: block;
    width: 52px;
    height: 40px;
    border-radius: 3px;
    object-fit: cover;
    object-position: center;
    outline: 1px solid var(--control-line);
    outline-offset: -1px;
    pointer-events: none;
    transform: scale(.72);
    transform-origin: center;
  }
  .ai-prototype-jump[aria-current] { background: var(--prototype-index-selection); }
  .ai-prototype-jump[aria-current] img { transform: scale(1); }
  .ai-prototype-jump:not([aria-current]):focus-visible { background: var(--menu-hover); }
  html.work-grid[data-focus-input="keyboard"] .ai-prototype-jump:focus-visible { outline: 2px solid var(--heading); outline-offset: 2px; }
  html.work-grid[data-theme="dark"] .ai-prototype-jump:is(
    [data-ai-prototype-jump="ai-prototype-small-universe"],
    [data-ai-prototype-jump="ai-prototype-big-brother"],
    [data-ai-prototype-jump="ai-prototype-afterhours"]
  ) img { filter: brightness(1.14); }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .ai-prototype-jump:not([aria-current]):hover { background: var(--menu-hover); }
}
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  html.work-grid:not([data-focus-input="keyboard"]) .ai-prototype-jump img { transition: transform 220ms cubic-bezier(.23,1,.32,1); }
  /* easeOutBack settles the new selection while the previous preview shrinks. */
  html.work-grid:not([data-focus-input="keyboard"]) .ai-prototype-jump[aria-current] img { transition: transform 280ms cubic-bezier(.34,1.56,.64,1); }
}
.ai-prototype-index[hidden] { display: none; }

@media (min-width:768px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  html.work-grid.home-gallery[data-theme="dark"] .portfolio-viewer-prototypes .ai-prototype-box:is(:hover,:focus-visible) .home-project-visual.ai-prototype-surface { transform: scale(1.04); }
}


/* The visible CTA remains part of its enclosing link, but receives hover. */
html.work-grid .portfolio-viewer-prototypes .ai-prototype-box .prototype-launch{pointer-events:auto}

/* The launch surface gains a soft halo in its own project palette. */
@media (min-width:768px) and (hover:hover) and (pointer:fine) {
  .portfolio-viewer :is(
    .ai-prototype-entry, .su-case, .speedster-component-prototype, .speedster-current-hero,
    .case-editorial[data-case-slug="big-brother"], .case-editorial[data-case-slug="afterhours"]
  ) .prototype-launch:not(:disabled):hover::before {
    box-shadow: inset 0 2px 10px rgb(255 255 255 / .28),
      0 0 14px rgb(var(--prototype-ring, 0 100 255) / .49),
      0 0 32px rgb(var(--prototype-shadow, 0 79 229) / .26);
  }
}

@media(min-width:768px){.ai-prototypes-list .cms-project-caption{display:none}}
