/* ============================================================
   fazz. — motion layer (site-wide)
   Custom cursor, page transitions, image reveals, hover polish,
   hero pin + floats, build-scene (scroll story), tubes canvas.
   Behaviour lives in js/fazz-motion.js.
   ============================================================ */

/* ---------- page enter ---------- */
@media (prefers-reduced-motion: no-preference) {
  body { animation: fz-pagein .5s ease both; }
}
@keyframes fz-pagein { from { opacity: 0; } }

/* ---------- page transition overlay ---------- */
.fz-pt { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.fz-pt span { position: absolute; inset: -2% 0; transform: translateY(103%); }
.fz-pt-a { background: var(--violet); }
.fz-pt-b { background: var(--ink); }
.fz-pt.play { pointer-events: auto; }
.fz-pt.play .fz-pt-a { transition: transform .48s cubic-bezier(.7,0,.2,1); transform: translateY(0); }
.fz-pt.play .fz-pt-b { transition: transform .48s cubic-bezier(.7,0,.2,1) .08s; transform: translateY(0); }
.fz-pt.cover span { transform: translateY(0); transition: none; }
.fz-pt.leave .fz-pt-b { transition: transform .6s cubic-bezier(.7,0,.25,1); transform: translateY(-103%); }
.fz-pt.leave .fz-pt-a { transition: transform .6s cubic-bezier(.7,0,.25,1) .07s; transform: translateY(-103%); }

/* ---------- custom cursor ---------- */
html.fz-cursor, html.fz-cursor * { cursor: none !important; }
.fz-dot {
  position: fixed; left: 0; top: 0; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--violet); z-index: 10001; pointer-events: none;
}
.fz-ring {
  position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 1.5px solid rgba(123,53,232,0.55); z-index: 10000; pointer-events: none;
  display: grid; place-items: center;
  transition: width .25s, height .25s, margin .25s, background .25s, border-color .25s, opacity .25s;
}
.fz-ring .fz-cur-lbl { font: 600 11px/1 var(--body); letter-spacing: .04em; color: #fff; opacity: 0; transition: opacity .18s; white-space: nowrap; }
.fz-ring.grow { width: 52px; height: 52px; margin: -26px 0 0 -26px; background: rgba(123,53,232,0.09); }
.fz-ring.view { width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(123,53,232,0.92); border-color: transparent; }
.fz-ring.view .fz-cur-lbl { opacity: 1; }
html.fz-cur-hide .fz-ring, html.fz-cur-hide .fz-dot { opacity: 0; }

/* ---------- image reveals (clip-path) ---------- */
.fz-ir { clip-path: inset(18% 9% 18% 9%); transform: scale(1.07); transition: clip-path 1s cubic-bezier(.65,0,.2,1), transform 1.3s cubic-bezier(.3,.7,.2,1); }
.fz-ir.fz-in { clip-path: inset(0 0 0 0); transform: none; }

/* ---------- hover polish ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.32) 50%, transparent 60%);
  transform: translateX(-130%);
}
.btn:hover::after { transform: translateX(130%); transition: transform .65s ease; }
.nav-links a { position: relative; }
.nav-links a::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; border-radius: 2px;
  background: var(--violet); transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.65,0,.2,1);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.proj-card { overflow: hidden; }
.proj-card image-slot, .proj-card img { transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.proj-card:hover image-slot, .proj-card:hover img { transform: scale(1.05); }

/* ---------- zoom-to-full frames (scroll-driven, JS) ---------- */
.bw, [data-zoom-full] { will-change: transform; }

/* ---------- hero pin + floating chips (home) ---------- */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  body[data-page="home"] .hero { position: sticky; top: 0; z-index: 0; }
  body[data-page="home"] :where(section:not(.hero), .ticker, footer, .site-footer) { position: relative; z-index: 1; }
  body[data-page="home"] :where(section:not(.hero):not(.dark):not([style*="background"])) { background: var(--paper); }
}
[data-float] { will-change: transform; }
.fz-chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 100px; padding: 10px 18px;
  font-weight: 600; font-size: 13px; color: var(--ink); box-shadow: var(--shadow-md);
  pointer-events: none; white-space: nowrap;
}
.fz-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.fz-glow {
  position: absolute; z-index: 0; width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(123,53,232,0.22), transparent 68%);
}

/* ---------- tubes canvas (dark showreel bg) ---------- */
.fz-tubes-sec { position: relative; overflow: hidden; }
#fz-tubes { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .5; }
.fz-tubes-sec > .wrap { position: relative; z-index: 1; }

/* ---------- site showcase (3-col grid, grey→color reveal, 3D tilt) ---------- */
.carousel-scene { position: relative; overflow: hidden; background: #0c0a16; padding: 100px 0; }
.car-stage { position: relative; max-width: 1600px; margin: 0 auto; padding: 0 40px; }
.car-bg {
  position: absolute; inset: -20% -10%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 20% 10%, rgba(123,53,232,.35), transparent 55%),
              radial-gradient(circle at 85% 90%, rgba(123,53,232,.22), transparent 50%);
}
.car-head { position: relative; z-index: 2; text-align: center; margin-bottom: 56px; }
.car-head .eyebrow { color: var(--violet-light, #c79bff); }
.car-head .h2 { color: #fff; margin-top: 10px; }

.car-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

/* ---- chat-thread project cards ---- */
.chat-card {
  background: #17151f; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 30px 60px -18px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(36px) scale(.97); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.75,.2,1);
}
.car-grid { align-items: stretch; }
.chat-body { flex: 1 1 auto; }
.chat-card.in { opacity: 1; transform: translateY(0) scale(1); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.chat-ava {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), #5a2ea6); color: #fff; font-weight: 700; font-size: 13px;
}
.chat-head-txt { display: flex; flex-direction: column; line-height: 1.25; }
.chat-head-txt b { font-size: 13.5px; color: #fff; }
.chat-head-txt i { font-style: normal; font-size: 11.5px; color: rgba(255,255,255,.4); }
.chat-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #57e08a; box-shadow: 0 0 0 0 rgba(87,224,138,.55); animation: car-badge-pulse 2s ease-out infinite; }

.chat-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-row { display: flex; }
.chat-row.out { justify-content: flex-end; }
.chat-row.in { justify-content: flex-start; }
.chat-bubble {
  max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.45;
}
.chat-row.out .chat-bubble { background: var(--violet); color: #fff; border-bottom-right-radius: 5px; }
.chat-row.in .chat-bubble { background: #2a2836; color: rgba(255,255,255,.92); border-bottom-left-radius: 5px; }
.chat-bubble.shot { padding: 6px; display: flex; flex-direction: column; gap: 7px; max-width: 100%; }
.chat-bubble.shot img { width: 100%; border-radius: 11px; display: block; aspect-ratio: 16/10; object-fit: cover; object-position: top center; }
.chat-bubble.shot span { padding: 0 5px 3px; font-size: 13px; }
.chat-read { align-self: flex-end; font-size: 11px; color: rgba(255,255,255,.32); margin-top: 2px; }

.chat-link {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.07); font-size: 12.5px; font-weight: 600; color: var(--violet-light, #c79bff);
  text-decoration: none; transition: color .2s, background .2s; margin-top: auto;
}
.chat-link svg { width: 12px; height: 12px; }
.chat-link:hover { color: #fff; background: rgba(255,255,255,.04); }

@keyframes car-badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(87,224,138,.55); }
  70% { box-shadow: 0 0 0 6px rgba(87,224,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(87,224,138,0); }
}

@media (max-width: 900px) {
  .carousel-scene { padding: 64px 0; }
  .car-grid { grid-template-columns: 1fr; gap: 28px; }
}

