/* ==========================================================================
   Sky High Visions — motion enhancement layer
   Restrained, premium micro-interactions layered on top of the working
   Webflow (IX2) base. Monochrome, respects the editorial aesthetic, and never
   fights IX2 (only touches props/elements IX2 does not animate).
   All motion is gated behind prefers-reduced-motion.
   ========================================================================== */

/* Native smooth scroll — ties the whole page together without a JS scroll
   hijack that would break IX2's scroll triggers. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --------------------------------------------------------------------------
   Hero background-video (Our Story). Do NOT force height on .w-background-video
   here — Webflow already sizes it natively (.video-reel min-height:590px +
   .w-background-video height:500px with the <video> absolutely positioned to
   fill). An earlier height:100%!important override collapsed .video-reel to 0
   (percentage height against an auto-height .wrap-video-background), leaving
   only the 80px gray padding frame visible. The <video poster> + the video's
   own inline background-image already provide the poster fallback, so the
   verbatim Webflow CSS is left to do its job untouched.

   The REAL "video didn't pull through" bug: `.overlay-video` is a grey curtain
   (z-index:3; background:var(--grey); inset:0) whose base rule is display:none,
   but the static Webflow export baked an inline style="display:block" onto it —
   IX2 was meant to wipe it away to reveal the video, but our-story ships a
   different IX2 bundle that never runs that interaction, so the curtain sat on
   top of the (correctly playing) video forever. Restore its intended resting
   state so the video shows.
   -------------------------------------------------------------------------- */
.wrap-video-background .overlay-video {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Hide the "Our Team" roster on the Our Story / About page (client request).
   display:none also spares the browser the 8 team-member photo downloads.
   Reversible — delete this rule to bring the team back.
   -------------------------------------------------------------------------- */
.section-team {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Reveal safety-net. IX2 fade-in interactions occasionally fail to fire on a
   static export, leaving content stuck at opacity:0 (e.g. the "Selected work"
   block). shv-motion.js tags those elements .shv-catch when they scroll into
   view; this transitions them to visible. Only ever RAISES opacity, never
   hides. IX2-revealed elements are already opacity:1 so this is a no-op there.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .shv-catch {
    animation: shv-fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* No animation — just make sure nothing is left invisible. */
  .shv-catch { opacity: 1 !important; transform: none !important; }
}
@keyframes shv-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Magnetic pill buttons. shv-motion.js sets --shv-mx/--shv-my on hover; the
   transition here springs the button toward the cursor and back.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .nav-btn,
  .cta,
  .w-button,
  a.cta-link,
  .link-brand-footer {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease;
    transform: translate(var(--shv-mx, 0px), var(--shv-my, 0px));
    will-change: transform;
  }
}

/* --------------------------------------------------------------------------
   Portfolio / recent-works cards — image zoom + subtitle reveal on hover.
   The subtitle (.text-project-tile-subtext) ships at opacity:0 in the verbatim
   markup; reveal it on hover for a sleek editorial feel.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .link-project-halves-grid,
  a.link-project-halves-grid {
    overflow: hidden;
  }
  .link-project-halves-grid .image-project-general,
  .work-block_image,
  .image-project-general {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
  }
  .link-project-halves-grid:hover .image-project-general {
    transform: scale(1.045);
  }
  .link-project-halves-grid .text-project-tile-subtext {
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(6px);
  }
  .link-project-halves-grid:hover .text-project-tile-subtext {
    opacity: 1 !important;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Link underline sweep — smooth the existing .link-bottom-line / under-line
   accents so CTAs and the email link feel intentional.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .link-bottom-line,
  .cta-link .link-bottom-line,
  .see-website-line,
  .link-under-line {
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease;
  }
  a.cta-link:hover .link-bottom-line { width: 100% !important; }
  a.view-site-url:hover .see-website-line { width: 60% !important; }
}

/* --------------------------------------------------------------------------
   Client marquee — an added "cool animated section" (opt-in via .shv-marquee).
   A seamless, auto-scrolling strip; pauses on hover. Populated by shv-motion.js
   from the portfolio thumbnails when a .shv-marquee host is present.
   -------------------------------------------------------------------------- */
.shv-marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.shv-marquee__track {
  display: flex;
  width: max-content;
  gap: 28px;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .shv-marquee__track { animation: shv-marquee 48s linear infinite; }
  .shv-marquee:hover .shv-marquee__track { animation-play-state: paused; }
}
.shv-marquee__item {
  flex: 0 0 auto;
  height: 132px;
  width: 220px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  filter: grayscale(1);
  opacity: 0.72;
  transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.shv-marquee__item:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-4px);
}
@keyframes shv-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================================================
   New home hero (kinetic statement) — replaces the old card-collage hero.
   Bold oversized headline with a rotating word + a full-width work marquee.
   Monochrome, nav-safe (light hero keeps the dark nav readable).
   ========================================================================== */
.opening-animation { display: none !important; } /* retire the old video/card hero */

.shv-hero {
  background: #fefefe;
  padding: clamp(130px, 16vh, 210px) 0 0; /* more breathing room below the fixed nav */
  overflow: hidden;
}

/* Home "Recent Works" gallery → smaller, auto-playing opposing marquee
   (scoped to .shv-mg). Services keeps its scroll-driven IX2 gallery untouched. */
.section.moving-gallery.shv-mg {
  margin-top: -50px;        /* pull the carousel 50px closer to the hero */
  padding-bottom: 40px;
}
.shv-mg .moving-gallery-master {
  position: relative; top: auto;     /* drop the sticky-scroll behavior */
  overflow: hidden;
}
/* Each row is a flex strip of varied-size tiles that overflows the clip so the
   marquee has room to drift. width:max-content = sum of the tiles. */
.shv-mg .moving-gallery-top-grid,
.shv-mg .moving-gallery-bottom-grid {
  display: flex !important;
  grid-template-columns: none !important;   /* neutralize the stock grid */
  align-items: stretch;
  gap: 16px;
  width: max-content;
  height: 30vh;
  min-height: 220px;
  will-change: transform;
  transition: none;       /* rAF drives the transform every frame */
}
.shv-mg .moving-gallery-top-grid { margin-bottom: 16px; }
.shv-mg-tile {
  position: relative;
  flex: 0 0 auto;
  border-radius: 10px;
  background-size: cover;
  background-position: center top;
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
  overflow: hidden;
  transition: transform .45s cubic-bezier(.16,1,.3,1), box-shadow .45s ease;
}
.shv-mg-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px rgba(0,0,0,.24);
}
.shv-mg-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; line-height: 1.25;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.shv-mg-tile:hover .shv-mg-cap { opacity: 1; transform: none; }
.shv-mg-nav {
  position: absolute; top: 50%; z-index: 5;
  width: 52px; height: 52px; border-radius: 999px;
  transform: translateY(-50%);
  border: 0; cursor: pointer;
  background: rgba(10,10,10,.82); color: #fff;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: background .25s ease, transform .25s ease, opacity .25s ease;
}
.shv-mg-nav:hover { background: #16c65a; }
.shv-mg-nav[disabled] { opacity: .3; pointer-events: none; }
.shv-mg-prev { left: 22px; }
.shv-mg-next { right: 22px; }
@media (max-width: 767px){ .shv-mg-nav { width: 44px; height: 44px; left: 12px; } .shv-mg-next { right: 12px; left: auto; } }
.shv-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px clamp(56px, 8vh, 104px);
}
.shv-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; letter-spacing: .04em; color: #6b6b6b;
  font-variant-caps: all-small-caps; text-transform: lowercase;
  margin-bottom: 28px;
}
.shv-hero__dot {
  width: 9px; height: 9px; border-radius: 50%; background: #16c65a;
  box-shadow: 0 0 0 0 rgba(22,198,90,.6);
}
@media (prefers-reduced-motion: no-preference){
  .shv-hero__dot { animation: shv-pulse 2s infinite; }
}
@keyframes shv-pulse { 0%{box-shadow:0 0 0 0 rgba(22,198,90,.5)} 70%{box-shadow:0 0 0 8px rgba(22,198,90,0)} 100%{box-shadow:0 0 0 0 rgba(22,198,90,0)} }

.shv-hero__title {
  font-size: clamp(2.8rem, 8vw, 6.6rem);
  line-height: .98; letter-spacing: -.02em; font-weight: 800;
  color: #0a0a0a; margin: 0 0 28px; max-width: 15ch;
}
.shv-hero__rotator {
  position: relative; display: inline-block; vertical-align: bottom;
  height: 1em; width: 8.6em; text-align: left; color: #0a0a0a;
}
.shv-hero__rotator::after {
  content: ""; position: absolute; left: 0; right: .15em; bottom: .04em;
  height: .08em; background: #16c65a;
}
.shv-hero__word {
  position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0;
}
.shv-hero__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: no-preference){
  .shv-hero__word { animation: shv-rotate 8.4s infinite; }
  .shv-hero__word:nth-child(1){ animation-delay: 0s; }
  .shv-hero__word:nth-child(2){ animation-delay: 2.1s; }
  .shv-hero__word:nth-child(3){ animation-delay: 4.2s; }
  .shv-hero__word:nth-child(4){ animation-delay: 6.3s; }
}
@media (prefers-reduced-motion: reduce){ .shv-hero__word:nth-child(1){ opacity:1; } }
@keyframes shv-rotate {
  0%   { opacity:0; transform: translateY(.45em) rotate(2deg); }
  3%,22% { opacity:1; transform: none; }
  25%,100% { opacity:0; transform: translateY(-.45em) rotate(-2deg); }
}

.shv-hero__sub {
  font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.5; color: #4a4a4a;
  max-width: 46ch; margin: 0 0 40px;
}
.shv-hero__actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.shv-hero__cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: #0a0a0a; color: #fff; text-decoration: none;
  padding: 18px 34px; border-radius: 999px; font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: .03em;
}
.shv-hero__cta span { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.shv-hero__cta:hover span { transform: translateX(5px); }
.shv-hero__ghost {
  color: #0a0a0a; text-decoration: none; font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: .03em;
  border-bottom: 2px solid #0a0a0a; padding-bottom: 3px;
}

/* Full-width work marquee band anchoring the hero */
.shv-hero__marquee {
  width: 100%; overflow: hidden; background: #0a0a0a; padding: 26px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.shv-hero__track { display: flex; width: max-content; gap: 22px; }
@media (prefers-reduced-motion: no-preference){
  .shv-hero__track { animation: shv-marquee 55s linear infinite; }
  .shv-hero__marquee:hover .shv-hero__track { animation-play-state: paused; }
}
.shv-hero__tile {
  flex: 0 0 auto; width: 260px; height: 150px; border-radius: 10px;
  background-size: cover; background-position: center top;
  filter: grayscale(1) contrast(1.05); opacity: .62;
  transition: filter .5s ease, opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1);
}
.shv-hero__tile:hover { filter: none; opacity: 1; transform: translateY(-5px); }

/* Load reveal for the hero copy */
@media (prefers-reduced-motion: no-preference){
  .shv-hero__eyebrow, .shv-hero__title, .shv-hero__sub, .shv-hero__actions {
    opacity: 0; animation: shv-hero-in .9s cubic-bezier(.16,1,.3,1) forwards;
  }
  .shv-hero__title { animation-delay: .08s; }
  .shv-hero__sub { animation-delay: .18s; }
  .shv-hero__actions { animation-delay: .26s; }
}
@keyframes shv-hero-in { from{opacity:0; transform:translateY(26px);} to{opacity:1; transform:none;} }
