/* ==========================================================================
   Playground — every app Lascade has shipped.
   Loaded after main.css; overrides the old .playground rules there.
   Top: "the dial" — app cards fanned on a giant wheel whose hub sits below
   the screen; scrolling turns it (js/main.js → playgroundDial).
   Palette and type follow the site: #101010 / #fff / #333, Jakarta.
   ========================================================================== */

.playground {
  --pg-ease: cubic-bezier(0.075, 0.82, 0.165, 1);
  --pg-line: #333333;
  --pg-card-h: clamp(240px, 42vh, 470px);
  --pg-card-w: calc(var(--pg-card-h) * 0.5933); /* portrait card, 356 x 600 */
  background: #101010;
  color: #fff;
  padding: 0;
  min-height: 0;
  height: auto;
}

/* ---------- The dial (pinned) ---------- */

.playground .pg_rail {
  position: relative;
  height: 100vh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

/* colour wash that follows the app in the middle */
.pg_glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(70vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: #2f66e0;
  filter: blur(120px);
  opacity: 0.32;
  transform: translate(-50%, -50%);
  transition: background-color 0.9s ease;
  z-index: -1;
  pointer-events: none;
}

.playground .pg_top {
  padding: 5rem 4rem 0; /* top clears the fixed nav; sides match #container */
  flex-shrink: 0;
}

.pg_head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 3rem;
}

.pg_eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: JakartaMedium;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.4rem;
}

.pg_eyebrow::before {
  content: "";
  width: 2rem;
  height: 1.5px;
  background: currentColor;
}

.pg_head h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
  line-height: 100%;
}

.pg_lede {
  max-width: 300px;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.5;
  text-align: right;
  padding-bottom: 0.4rem;
}

/* Stage holds the giant name and the fanned cards */
.pg_stage {
  position: relative;
  flex: 1;
  min-height: calc(var(--pg-card-h) + 3rem);
}

.pg_bigname {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.pg_bigname span {
  display: inline-block;
  font-size: clamp(5rem, 17vw, 17rem);
  letter-spacing: -0.08em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
}

.pg_dial {
  position: absolute;
  inset: 0;
}

/* Every card sits at the top-centre of the stage; js rotates it around the hub
   (transform-origin is pushed far below the card, at the wheel's centre). */
.pg_dcard {
  position: absolute;
  left: 50%;
  top: 1.5rem;
  width: var(--pg-card-w);
  height: var(--pg-card-h);
  margin-left: calc(var(--pg-card-w) / -2);
  border-radius: clamp(20px, 2.2vw, 32px);
  overflow: hidden;
  background: var(--c);
  color: var(--t);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  will-change: transform;
  cursor: pointer;
  outline: none;
}

/* Each card: brand colour + big icon */
.pg_dcard.is-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.22), transparent 60%),
    var(--c);
}

.pg_tile_cat {
  position: absolute;
  top: 1.2rem;
  left: 1.3rem;
  font-family: JakartaMedium;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.pg_tile_icon {
  width: 52%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.55);
}

.pg_tile_name {
  position: absolute;
  left: 1.3rem;
  right: 1.3rem;
  bottom: 1.2rem;
  font-size: clamp(1.2rem, 1.7vw, 1.7rem);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

/* darkens cards as they swing away from the middle (opacity set by js) */
.pg_dshade {
  position: absolute;
  inset: 0;
  background: #101010;
  opacity: var(--shade, 0);
  pointer-events: none;
}

.pg_dcard:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}

/* Caption for the app in the middle */
.pg_caption {
  position: relative;
  flex-shrink: 0;
  height: 9.5rem;
  margin-bottom: 1.25rem;
}

.pg_cap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.6s var(--pg-ease), visibility 0s linear 0.45s;
}

.pg_cap.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s ease 0.1s, transform 0.8s var(--pg-ease) 0.1s, visibility 0s;
}

.pg_cap_meta {
  display: flex;
  gap: 1.2rem;
  font-family: JakartaMedium;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.45;
}

.pg_cap h4 {
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  margin-top: 0.3rem;
}

.pg_cap_line {
  opacity: 0.55;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.pg_cap_stores {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.pg_progress {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  width: 160px;
  height: 1px;
  margin-left: -80px;
  background: var(--pg-line);
  overflow: hidden;
}

.pg_progress span {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

/* Pill button — same fill-from-bottom motion as .btn, without blend modes */
.pg_pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50px;
  color: #fff;
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.pg_pill::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 100%;
  background: #fff;
  border-radius: 100% 100% 0 0;
  z-index: -1;
  transition: top 0.3s ease-in-out, border-radius 0.3s ease-in-out;
}

.pg_pill:hover,
.pg_pill:focus-visible {
  color: #101010;
  border-color: #fff;
}

.pg_pill:hover::before,
.pg_pill:focus-visible::before {
  top: 0;
  border-radius: 0;
}

.pg_pill i {
  font-size: 0.95rem;
}

/* ---------- Breakpoints ---------- */

@media (max-width: 768px) {
  .playground {
    --pg-card-h: clamp(220px, 38vh, 380px);
  }

  .playground .pg_top {
    padding: 4rem 2rem 0;
  }

  .pg_head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .pg_lede {
    text-align: left;
    padding-bottom: 0;
    font-size: 0.9rem;
  }

  .pg_caption {
    height: 10rem;
  }
}

@media (max-width: 540px) {
  .playground .pg_top {
    padding: 4rem 1rem 0;
  }
}

@media (max-height: 760px) and (min-width: 769px) {
  .playground {
    --pg-card-h: clamp(200px, 38vh, 360px);
  }

  .playground .pg_top {
    padding-top: 4.2rem;
  }

  .pg_head h2 {
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg_glow,
  .pg_cap {
    transition: none;
  }
}
