/* =============================================
   LIQUID GLASS - material + the shapes that use it.
   Loaded last (after studio.css). Clients, projects, the back button.
   ============================================= */
:root {
  --lg-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
  --lg-rim: rgba(255, 255, 255, 0.3);
  --lg-blur: blur(14px) saturate(1.8) brightness(1.08);
}
/* the material: frosted body, bright top-left rim, soft inner glow, falling shadow */
.lg {
  background: var(--lg-bg); border: 1px solid var(--lg-rim);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -12px 22px rgba(255, 255, 255, 0.05), inset 12px 0 22px -14px rgba(255, 255, 255, 0.35), 0 16px 40px rgba(0, 0, 0, 0.35);
}
/* Chromium bends what is behind the glass (refraction); everything else keeps the blur */
html.lg-svg .lg { -webkit-backdrop-filter: url(#lgRefract) blur(8px) saturate(1.8) brightness(1.08); backdrop-filter: url(#lgRefract) blur(8px) saturate(1.8) brightness(1.08); }

/* ---------- colour that lives behind the glass ---------- */
.lg-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.lg-orbs i { position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.8; animation: lgOrb var(--d, 24s) ease-in-out infinite alternate; }
.lg-orbs i:nth-child(1) { width: 540px; height: 540px; inset-inline-end: -8%; top: 4%; background: radial-gradient(circle at 35% 35%, #9333ea, transparent 68%); --d: 26s; }
.lg-orbs i:nth-child(2) { width: 460px; height: 460px; inset-inline-start: -6%; top: 34%; background: radial-gradient(circle at 40% 40%, #c026d3, transparent 68%); --d: 21s; animation-delay: -6s; }
.lg-orbs i:nth-child(3) { width: 420px; height: 420px; inset-inline-end: 28%; bottom: -6%; background: radial-gradient(circle at 40% 40%, #6366f1, transparent 70%); --d: 29s; animation-delay: -11s; }
.lg-orbs i:nth-child(4) { width: 260px; height: 260px; inset-inline-start: 34%; top: 8%; background: radial-gradient(circle at 40% 40%, #ff4d6d, transparent 70%); opacity: 0.55; --d: 18s; animation-delay: -3s; }
@keyframes lgOrb { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(70px, -56px, 0) scale(1.18); } }
.client-grid-sec, .px { position: relative; overflow: hidden; }
.px .wrap { position: relative; z-index: 1; }

/* ================= clients: shapes, not boxes ================= */
#clRail { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(26px, 3.6vw, 52px) clamp(16px, 2.4vw, 34px); align-items: center; margin-top: clamp(26px, 4vw, 52px); padding-bottom: 30px; }
#clRail .client-card, #clRail .client-card.reveal.in {
  background: none; border: 0; border-radius: 0; overflow: visible; box-shadow: none; opacity: 1;
  animation: lgFloat var(--fd, 8s) ease-in-out infinite alternate; animation-delay: var(--fl, 0s);
}
#clRail .client-card.reveal { opacity: 1; transition: transform 0.5s var(--ease-out); }
#clRail .client-card:hover { box-shadow: none; }
#clRail .client-card::before, #clRail .client-card::after { display: none; }
@keyframes lgFloat { from { translate: 0 -8px; } to { translate: 0 10px; } }

/* a different silhouette for every card */
#clRail .client-card:nth-child(9n+1) { grid-column: span 4; --ar: 4 / 5.1; --br: 999px 999px 34px 34px; --fd: 7.5s; }
#clRail .client-card:nth-child(9n+2) { grid-column: span 5; --ar: 5 / 4; --br: 58% 42% 52% 48% / 44% 56% 44% 56%; --br2: 44% 56% 46% 54% / 56% 44% 56% 44%; --fd: 9s; --fl: -2s; }
#clRail .client-card:nth-child(9n+3) { grid-column: span 3; --ar: 1; --br: 50%; --br2: 56% 44% 48% 52% / 48% 54% 46% 52%; --fd: 6.5s; --fl: -4s; }
#clRail .client-card:nth-child(9n+4) { grid-column: span 3; --ar: 1; --br: 78% 22% 78% 22% / 22% 78% 22% 78%; --br2: 70% 30% 70% 30% / 30% 70% 30% 70%; --fd: 8.5s; --fl: -1s; }
#clRail .client-card:nth-child(9n+5) { grid-column: span 4; --ar: 4 / 5; --br: 34px 34px 999px 999px; --fd: 7s; --fl: -3s; }
#clRail .client-card:nth-child(9n+6) { grid-column: span 5; --ar: 5 / 4; --br: 42% 58% 38% 62% / 55% 45% 55% 45%; --br2: 56% 44% 52% 48% / 44% 56% 46% 54%; --fd: 9.5s; --fl: -5s; }
#clRail .client-card:nth-child(9n+7) { grid-column: span 5; --ar: 5 / 4; --br: 50% 50% 46% 54% / 62% 38% 62% 38%; --br2: 46% 54% 52% 48% / 52% 48% 56% 44%; --fd: 8s; --fl: -6s; }
#clRail .client-card:nth-child(9n+8) { grid-column: span 3; --ar: 1; --br: 50%; --br2: 44% 56% 54% 46% / 52% 44% 56% 48%; --fd: 7s; --fl: -2.5s; }
#clRail .client-card:nth-child(9n+9) { grid-column: span 4; --ar: 4 / 5.1; --br: 999px 999px 34px 34px; --fd: 8.2s; --fl: -3.5s; }

#clRail .card-media {
  aspect-ratio: var(--ar, 1); border-radius: var(--br, 24px); background: var(--bg-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 34px 60px -26px rgba(0, 0, 0, 0.7), 0 0 70px -18px rgba(147, 51, 234, 0.45);
  clip-path: circle(0% at 50% 58%);
  transition: clip-path 1.25s var(--ease-expo), border-radius 0.9s var(--ease-expo);
  animation: lgMorph var(--md, 11s) ease-in-out infinite alternate; animation-play-state: paused;
}
#clRail .client-card.in .card-media, #clRail .client-card.reveal.in .card-media { clip-path: circle(150% at 50% 58%); animation-play-state: running; }
#clRail .client-card:nth-child(9n+2) .card-media, #clRail .client-card:nth-child(9n+3) .card-media, #clRail .client-card:nth-child(9n+4) .card-media, #clRail .client-card:nth-child(9n+6) .card-media, #clRail .client-card:nth-child(9n+7) .card-media, #clRail .client-card:nth-child(9n+8) .card-media { animation-name: lgMorph; }
#clRail .client-card:nth-child(9n+1) .card-media, #clRail .client-card:nth-child(9n+5) .card-media, #clRail .client-card:nth-child(9n+9) .card-media { animation: none; }
@keyframes lgMorph { from { border-radius: var(--br); } to { border-radius: var(--br2, var(--br)); } }
#clRail .client-card:nth-child(1) .card-media { transition-delay: 0s; } #clRail .client-card:nth-child(2) .card-media { transition-delay: 0.1s; } #clRail .client-card:nth-child(3) .card-media { transition-delay: 0.2s; }
#clRail .client-card:nth-child(4) .card-media { transition-delay: 0.1s; } #clRail .client-card:nth-child(5) .card-media { transition-delay: 0.2s; } #clRail .client-card:nth-child(6) .card-media { transition-delay: 0.3s; }
#clRail .client-card:nth-child(7) .card-media { transition-delay: 0.1s; } #clRail .client-card:nth-child(8) .card-media { transition-delay: 0.2s; } #clRail .client-card:nth-child(9) .card-media { transition-delay: 0.3s; }
#clRail .card-media img { object-position: 50% 12%; transform: scale(1.12); transition: transform 1.6s var(--ease-expo); }
#clRail .client-card.in .card-media img { transform: scale(1.02); }
#clRail .client-card:hover .card-media img { transform: scale(1.1); transition-duration: 0.9s; }
/* a pool of light that follows the pointer across the surface */
#clRail .card-media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.3), transparent 62%);
}
#clRail .client-card:hover .card-media::after { opacity: 1; }
/* the label is a drop of glass resting on the shape's edge */
#clRail .card-body {
  position: absolute; left: 50%; bottom: -20px; translate: -50% 0; width: max-content; max-width: 90%; padding: 11px 24px 12px; border-radius: 999px; text-align: center;
  background: var(--lg-bg); border: 1px solid var(--lg-rim);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -10px 18px rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(14px) scale(0.9); transition: opacity 0.7s var(--ease-out) 0.55s, transform 0.9s var(--ease-expo) 0.55s, translate 0.5s var(--ease-expo);
}
html.lg-svg #clRail .card-body { -webkit-backdrop-filter: url(#lgRefract) blur(8px) saturate(1.8) brightness(1.08); backdrop-filter: url(#lgRefract) blur(8px) saturate(1.8) brightness(1.08); }
#clRail .client-card.in .card-body { opacity: 1; transform: none; }
#clRail .client-card:hover .card-body { translate: -50% -8px; }
#clRail .card-tag { margin: 0 0 2px; font-size: 0.74rem; color: rgba(255, 255, 255, 0.78); white-space: nowrap; }
#clRail .card-name, #clRail .client-card.featured .card-name { font-size: 1.08rem; color: #fff; white-space: nowrap; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
#clRail .card-play {
  width: 68px; height: 68px; font-size: 1.1rem; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.6), rgba(147, 51, 234, 0.72) 70%);
  border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 30px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); scale: 0.55; transform: none; opacity: 0; transition: opacity 0.35s, scale 0.6s var(--ease-expo);
}
#clRail .client-card:hover .card-play { opacity: 1; scale: 1; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.7), rgba(147, 51, 234, 0.85) 70%); }
#clRail .client-card:focus-visible { outline: 3px solid var(--lav); outline-offset: 10px; border-radius: 30px; }
#clRail .client-card.featured .card-media img { object-position: 50% 30%; }

@media (max-width: 1024px) {
  #clRail { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #clRail .client-card:nth-child(n) { grid-column: span 3; }
  #clRail .client-card:nth-child(3n) { grid-column: span 6; }
}

/* ================= projects: glass on the index ================= */
.px-row { isolation: isolate; }
.px-row::before {
  content: ''; position: absolute; inset: 4px -26px; z-index: -1; border-radius: 999px; pointer-events: none;
  background: var(--lg-bg); border: 1px solid var(--lg-rim); -webkit-backdrop-filter: blur(12px) saturate(1.7); backdrop-filter: blur(12px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -10px 22px rgba(255, 255, 255, 0.05), 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0; scale: 0.96 0.7; transition: opacity 0.4s var(--ease-out), scale 0.7s var(--ease-expo);
}
@media (hover: hover) and (pointer: fine) { .px-row:hover::before { opacity: 1; scale: 1; } }
.px-go {
  background: var(--lg-bg); border-color: var(--lg-rim); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 20px rgba(0, 0, 0, 0.3);
}
@media (hover: hover) and (pointer: fine) { .px-row:hover .px-go { background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.65), var(--accent) 72%); } }
/* the cursor preview is a drop of glass too */
.px-pv {
  border-radius: 46% 54% 42% 58% / 56% 42% 58% 44%; clip-path: circle(0% at 50% 50%); animation: lgMorphPv 5.5s ease-in-out infinite alternate;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45), 0 34px 60px rgba(0, 0, 0, 0.55), 0 0 90px rgba(147, 51, 234, 0.4);
  transition: clip-path 0.7s var(--ease-expo), opacity 0.25s;
}
.px-pv.on { clip-path: circle(150% at 50% 50%); }
.px-pv::after { inset: 0; background: radial-gradient(circle at 26% 16%, rgba(255, 255, 255, 0.45), transparent 42%), linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent 40%); }
@keyframes lgMorphPv { from { border-radius: 46% 54% 42% 58% / 56% 42% 58% 44%; } to { border-radius: 56% 44% 56% 44% / 44% 58% 42% 56%; } }

/* ================= client page ================= */
/* the local video fills its frame (it used to be wider than the frame, so the poster was cut in half) */
.cd-video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cd-video-frame { border-radius: 34px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 90px rgba(147, 51, 234, 0.3), 0 30px 60px rgba(0, 0, 0, 0.5); }

/* ================= back button ================= */
.cd-back { display: none !important; }
/* desktop: a glass orb that never leaves the corner; the label opens on hover / focus (and once on arrival) */
.cd-fab {
  position: fixed; z-index: 850; top: 112px; inset-inline-start: max(14px, calc((100vw - 1100px) / 2 - 86px)); display: inline-flex; align-items: center; padding: 6px; border-radius: 999px;
  font-weight: 800; font-size: 0.98rem; color: #fff; white-space: nowrap; transition: transform 0.5s var(--ease-expo);
}
.cd-fab .cd-fab-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), rgba(147, 51, 234, 0.85) 72%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); transition: transform 0.5s var(--ease-expo); }
.cd-fab svg { width: 20px; height: 20px; }
.cd-fab #cdFabTxt { max-width: 0; opacity: 0; overflow: hidden; margin-inline-start: 0; transition: max-width 0.6s var(--ease-expo), opacity 0.3s, margin 0.5s var(--ease-expo); animation: fabHint 4.2s 1.4s both; }
.cd-fab:hover #cdFabTxt, .cd-fab:focus-visible #cdFabTxt { max-width: 200px; opacity: 1; margin-inline: 12px 16px; animation: none; }
@keyframes fabHint { 0%, 100% { max-width: 0; opacity: 0; margin-inline-start: 0; } 14%, 78% { max-width: 200px; opacity: 1; margin-inline: 12px 16px; } }
.cd-fab:hover .cd-fab-ic { transform: translateX(4px) scale(1.08); }
.cd-fab:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; }
@media (max-width: 700px) { .cd-fab { display: none; } }

/* dock on phones: glass, with the back button first on inner pages */
@media (max-width: 700px) {
  .dock { background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); border-color: rgba(255, 255, 255, 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 18px 40px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
  .dock .dock-back { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), rgba(147, 51, 234, 0.9) 75%); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); }
  .dock .dock-back svg { width: 20px; height: 20px; }
}

/* ================= phones ================= */
@media (max-width: 700px) {
  .lg-orbs i { filter: blur(34px); }
  .lg-orbs i:nth-child(1) { width: 320px; height: 320px; } .lg-orbs i:nth-child(2) { width: 280px; height: 280px; } .lg-orbs i:nth-child(3) { width: 260px; height: 260px; } .lg-orbs i:nth-child(4) { display: none; }
  /* the carousel keeps its swipe; every card is still a different shape */
  #clRail { display: flex; padding-block: 12px 40px; margin-top: 22px; }
  #clRail .client-card:nth-child(n) { grid-column: auto; flex: 0 0 70%; max-width: 300px; align-self: center; }
  #clRail .client-card:nth-child(even) { flex-basis: 76%; }
  #clRail .client-card:nth-child(3n) { flex-basis: 58%; }
  #clRail .card-media, #clRail .client-card.featured .card-media { aspect-ratio: var(--ar, 1); clip-path: none; transition: border-radius 0.9s var(--ease-expo); }
  #clRail .card-body { opacity: 1; transform: none; padding: 9px 18px 10px; bottom: -16px; }
  #clRail .card-name { font-size: 0.98rem; }
  #clRail .card-media img { transform: none; }

  .px-row { grid-template-columns: 72px minmax(0, 1fr) 42px; gap: 14px; padding: 12px 14px 12px 12px; margin-bottom: 12px; border: 0 !important; border-radius: 28px; background: var(--lg-bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 30px rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6); border: 1px solid var(--lg-rim) !important; }
  .px-row::before { display: none; }
  .px-th { width: 72px; aspect-ratio: 4 / 5; border-radius: 40px 40px 12px 12px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
  .px-list li:last-child .px-row { border-bottom: 1px solid var(--lg-rim) !important; }
}
@media (prefers-reduced-motion: reduce) {
  #clRail .client-card, #clRail .client-card.reveal.in, .lg-orbs i, #clRail .card-media, .px-pv { animation: none !important; }
  #clRail .card-media { clip-path: none; } #clRail .card-body { opacity: 1; transform: none; }
}

/* ================= round 3: one shape, no numbers ================= */
.cl-head { grid-template-columns: 1fr; }
#clRail { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(44px, 5vw, 68px) clamp(20px, 3vw, 44px); align-items: start; padding-bottom: 40px; }
#clRail .client-card:nth-child(n) { grid-column: auto; --ar: 1; --br: 50%; --br2: 50%; }
#clRail .client-card, #clRail .client-card.reveal.in { animation: none; }
#clRail .card-media { animation: none !important; border-radius: 50%; }
#clRail .client-card:hover { transform: none; }
#clRail .card-media { transition: clip-path 1.25s var(--ease-expo), transform 0.9s var(--ease-expo), box-shadow 0.6s; }
#clRail .client-card:hover .card-media { transform: scale(1.035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 40px 70px -26px rgba(0, 0, 0, 0.75), 0 0 90px -10px rgba(147, 51, 234, 0.6); }
#clRail .card-body { bottom: -6px; }
@media (max-width: 1024px) { #clRail { grid-template-columns: repeat(2, minmax(0, 1fr)); } #clRail .client-card:nth-child(n) { grid-column: auto; } }
@media (max-width: 700px) {
  #clRail { display: flex; gap: 22px; }
  #clRail .client-card:nth-child(n) { flex: 0 0 68%; max-width: 290px; }
  #clRail .card-body { bottom: -4px; }
}
/* the project preview and the phone thumbnails are circles as well */
.px-pv { border-radius: 50%; aspect-ratio: 1; animation: none; }
@media (max-width: 700px) {
  .px-row { grid-template-columns: 62px minmax(0, 1fr) 42px; }
  .px-th { width: 62px; aspect-ratio: 1; border-radius: 50%; }
}
