/* Agency motion layer for portfolio demos (GSAP + CSS) */
html.motion-site {
  scroll-behavior: auto;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Shared glass pill removed — each demo owns its header. */

.hero--cinematic {
  max-width: none !important;
  width: 100%;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

.hero--cinematic .hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-media--live img.hero-live {
  animation: hero-kenburns 22s ease-in-out infinite alternate;
}

@keyframes hero-kenburns {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.16) translate3d(-1.5%, -1%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media--live img.hero-live {
    animation: none;
  }
}

.hero-media img,
.hero--cinematic .hero-media img,
.hero--cinematic .hero-media video.hero-video {
  width: 100%;
  height: 120%;
  object-fit: cover;
  will-change: transform;
}

.hero--cinematic .hero-media video.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .hero--cinematic .hero-media video.hero-video {
    display: none;
  }
}

.hero--cinematic .hero-media:has(video.hero-video) > img {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero--cinematic .hero-media:has(video.hero-video) > img {
    display: block;
  }
}

.hero--cinematic .hero-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 120%, rgb(0 0 0 / 0.35), transparent 55%),
    linear-gradient(180deg, rgb(0 0 0 / 0.35) 0%, rgb(0 0 0 / 0.55) 100%);
}

.hero--cinematic .hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 6rem clamp(1.25rem, 5vw, 4.5rem) 4rem;
  max-width: none !important;
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-block: 1px solid rgb(255 255 255 / 0.08);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: marquee-x 28s linear infinite;
}

.marquee span {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

@keyframes marquee-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hscroll {
  overflow: hidden;
}

.hscroll__track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.stack-card {
  min-height: 100dvh;
  display: flex;
  align-items: center;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

.scale-frame {
  overflow: hidden;
}

.scale-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
}

.word-scrub span {
  opacity: 0.14;
}

.hero-3d,
.stage-3d {
  position: relative;
}

.hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.stage-3d {
  height: min(68vh, 640px);
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgb(255 255 255 / 0.06), transparent 55%);
}

.hero-3d canvas,
.stage-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.demo-form {
  display: grid;
  gap: 0.75rem;
  width: min(440px, 100%);
  margin-inline: auto;
  text-align: left;
}

.demo-form input,
.demo-form textarea,
.demo-form select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.07);
  color: inherit;
  font: inherit;
}

.demo-form textarea {
  min-height: 110px;
  resize: vertical;
}

.demo-form .ok {
  display: none;
  text-align: center;
  padding: 1.2rem 0;
}

.demo-form .form-error {
  display: none;
  text-align: center;
  padding: 1.2rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.demo-form.is-error .form-error {
  display: block;
}

.demo-form.is-sent .fields {
  display: none;
}

.demo-form.is-sent .ok {
  display: block;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.meta-row article {
  padding: 1.25rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.04);
}

.meta-row b {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2.5rem clamp(1.25rem, 5vw, 4rem) 3rem;
  opacity: 0.72;
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .meta-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track,
  [data-reveal],
  .scale-frame img {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .hero--cinematic .hero-copy {
    padding-top: 6.5rem;
    min-height: 88dvh;
  }

  .hscroll__track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .hscroll__track > * {
    scroll-snap-align: start;
    flex: 0 0 min(82vw, 340px);
  }
}
