/* Experiments page: playground carousel (13 Nov 2026). Loaded only by experiments/index.html.
   Layout and motion follow bengiannis.com/playground; numbers are in playground.js and in
   new-portfolio-code/experiments-redesign/LOG.md.

   Breakpoints (Ben's): 12-column grid, --pg-space 14px, 18px from 640px, 24px from 768px.
     <768      full-width video (8px gutters) that opens the live site; title, date and description below
     768–1023  video in 8 columns, card in 4, no minimap or scroll effects
     ≥1024     minimap, centre line, scale/fade scroll; video centred in columns 4–9, card in 10–12 (max 416px) */

.pg {
  --pg-space: 14px;
  --pg-col: calc((100vw - var(--pg-space) * 13) / 12);
  --pg-span3: calc(var(--pg-col) * 3 + var(--pg-space) * 2);
  --pg-media-max-h: calc(100svh - 256px - var(--pg-space) * 2);
  --pg-radius: 16px;
  --pg-ease-link: cubic-bezier(.2, 1, .2, 1);
  --pg-ease-fade: cubic-bezier(.4, 0, .2, 1);
  /* card spacing */
  --pg-pad: 18px;
  --pg-title: 20px;
  --pg-desc: 15px;
  --pg-gap-date: 4px;   /* title → date */
  --pg-gap-desc: 14px;  /* date → description */
  --pg-gap-block: 18px; /* description → chips → buttons */
  position: relative;
  z-index: 0;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  color: var(--site-ink-muted);
  font-family: var(--type-sans);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 640px) { .pg { --pg-space: 18px; } }
@media (min-width: 768px) { .pg { --pg-space: 24px; } }
@media (min-width: 1280px) {
  .pg { --pg-pad: 24px; --pg-title: var(--type-h3); --pg-desc: 16px; --pg-gap-date: 6px; --pg-gap-desc: 18px; --pg-gap-block: 22px; }
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg :focus-visible { outline: 2px solid var(--site-accent); outline-offset: 3px; border-radius: 6px; }
.pg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* Framer's header is sticky in the page flow; keep the scaling rows underneath it. */
div:has(> header[data-framer-name]) { z-index: 5; }

/* ---------- list: phone first ---------- */
.pg-list { display: flex; flex-direction: column; gap: 56px; padding: 32px 8px 96px; }
.pg-row { margin: 0; }
.pg-inner { display: flex; flex-direction: column; }
.pg-media { position: relative; width: 100%; aspect-ratio: var(--ar); border-radius: 12px; overflow: hidden; background: var(--site-surface); }
.pg-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.pg-media-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; -webkit-tap-highlight-color: transparent; }
.pg-media-link:active { background: rgba(255, 255, 255, .06); }
.pg-badge {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(16, 16, 16, .55); -webkit-backdrop-filter: blur(10px) saturate(1.6); backdrop-filter: blur(10px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 8px rgba(0, 0, 0, .3); color: var(--site-ink);
}
.pg-badge svg { width: 12px; height: 12px; }
.pg .pg-media-link:focus-visible { outline-offset: -3px; border-radius: 12px; }

/* ---------- card ---------- */
.pg-card { border-radius: var(--pg-radius); background: var(--site-surface); }
.pg-card-body { padding: var(--pg-pad); transition: opacity .4s var(--pg-ease-fade); }
.pg-title { margin: 0; font-family: var(--type-mix); font-weight: 420; font-size: var(--pg-title); line-height: 1.2; letter-spacing: -.005em; color: var(--site-ink); text-wrap: balance; }
.pg-when { margin: var(--pg-gap-date) 0 0; font-family: var(--type-sans); font-size: 15px; line-height: 1.35; color: var(--site-ink-muted); font-variant-numeric: tabular-nums; }
.pg-desc { margin: var(--pg-gap-desc) 0 0; font-family: var(--type-sans); font-size: var(--pg-desc); line-height: 1.55; color: var(--site-ink); text-wrap: pretty; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--pg-gap-block) 0 0; padding: 0; list-style: none; }
.pg-chips li { padding: 4px 11px; border: 1px solid var(--site-line); border-radius: 999px; font-family: var(--type-sans-medium); font-weight: 550; font-size: 13px; line-height: 1.3; color: var(--site-ink); }
.pg-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--pg-gap-block); }
.pg-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-family: var(--type-sans-medium); font-weight: 550; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .5s var(--pg-ease-link), scale .5s var(--pg-ease-link);
}
.pg-pill::before { content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none; background: linear-gradient(to bottom, rgba(0, 0, 0, .18) 0%, transparent 50%); mix-blend-mode: multiply; }
.pg-pill svg { width: 10px; height: 10px; flex: none; }
.pg .pg-pill-primary { background: var(--site-ink); color: var(--site-canvas); }
.pg .pg-pill-primary:hover { background: #fff; color: var(--site-canvas); }
.pg .pg-pill-secondary { background: var(--site-surface-hover); color: var(--site-ink); }
.pg .pg-pill-secondary:hover { background: var(--site-line); color: var(--site-ink); }
@media (hover: hover) { .pg-pill:hover { scale: 1.05; transition-duration: .3s; } }
.pg-pill:active { scale: .98; transition-duration: .12s; }
@media (min-width: 1280px) {
  .pg-chips li { padding: 5px 12px; font-size: 14px; }
  .pg-pill { padding: 9px 16px; font-size: 15px; }
}

/* ---------- fixed chrome (≥1024 only) ---------- */
.pg-minimap, .pg-centre, .pg-label, .pg-keys { display: none; }
.pg-chrome { transition: opacity .4s var(--pg-ease-fade); }
.pg.is-footer .pg-chrome { opacity: 0; pointer-events: none; }
.pg-minimap {
  position: fixed; top: 0; left: var(--pg-space); z-index: 2; width: 128px; height: 100%; align-items: flex-start; justify-content: center; overflow: hidden;
  -webkit-mask: linear-gradient(to bottom, transparent 5%, #fff 30%, #fff 70%, transparent 95%); mask: linear-gradient(to bottom, transparent 5%, #fff 30%, #fff 70%, transparent 95%);
}
.pg-track { display: flex; flex-direction: column; gap: 4px; width: 100%; will-change: transform; }
.pg-thumb { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px; }
.pg-thumb img { display: block; width: 100%; height: auto; max-height: 128px; object-fit: cover; border-radius: 3px; }
.pg-centre { position: fixed; top: 0; left: calc(var(--pg-space) * 2 + 128px); z-index: 1; height: 100vh; width: calc(var(--pg-span3) - var(--pg-space) - 128px); align-items: center; pointer-events: none; }
.pg-centre hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--site-line); -webkit-mask: linear-gradient(to right, #fff, #fff, transparent); mask: linear-gradient(to right, #fff, #fff, transparent); }
.pg-label { position: fixed; left: var(--pg-space); bottom: var(--pg-space); z-index: 3; margin: 0; font-family: var(--type-sans-medium); font-weight: 550; font-size: var(--type-label); line-height: 1.25; color: var(--site-ink); }
.pg-label span { margin-left: 8px; color: var(--site-ink-muted); font-variant-numeric: tabular-nums; }
.pg-keys { position: fixed; right: var(--pg-space); bottom: var(--pg-space); z-index: 3; margin: 0; align-items: center; gap: 8px; font-family: var(--type-sans); font-size: 15px; line-height: 1.25; color: var(--site-ink-muted); }
.pg-keys kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--site-line); border-radius: 6px; font-family: var(--type-sans-medium); font-weight: 550; font-size: 13px; line-height: 1; color: var(--site-ink); }

/* ---------- tablet 768–1023: video 8 columns, card 4, no scroll effects ---------- */
@media (min-width: 768px) {
  .pg-media-link { display: none; }
  .pg-list { gap: 40px; padding: 80px var(--pg-space) 120px; }
  .pg-inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--pg-space); align-items: start; }
  .pg-media { grid-column: 1 / 9; border-radius: var(--pg-radius); }
  .pg-card { grid-column: 9 / 13; }
}

/* ---------- desktop ≥1024: minimap, centre line, scale/fade scroll ---------- */
@media (min-width: 1024px) {
  .pg-list { gap: var(--pg-space); padding: calc(var(--pg-space) + 128px) var(--pg-space); }
  .pg-inner { will-change: transform, opacity; }
  .pg-row:not(.is-active) .pg-inner { cursor: pointer; }
  .pg-media { grid-column: 4 / 10; justify-self: center; width: min(100%, calc(var(--pg-media-max-h) * var(--ar))); }
  .pg-card { grid-column: 10 / 13; max-width: 416px; }
  .pg-row:not(.is-active) .pg-card-body { opacity: 0; pointer-events: none; }
  .pg-minimap, .pg-centre { display: flex; }
  .pg-label { display: block; }
  .pg-keys { display: flex; }
}

/* ---------- phones: no card surface, no chips or buttons; the video is the link ---------- */
@media (max-width: 767px) {
  .pg-card { background: none; border-radius: 0; }
  .pg-card-body { padding: 16px 6px 0; }
  .pg-title { font-size: 22px; }
  .pg-when { margin-top: 4px; font-size: 14px; }
  .pg-desc { margin-top: 10px; font-size: 16px; }
  .pg-chips, .pg-cta { display: none; }
}
