/* Production polish: motion, footer, cookie and mobile hero refinements. */

:root {
  --rv-chrome-strong: #eef1f4;
  --rv-chrome-soft: #c6ccd5;
  --rv-chrome-line: rgb(238 241 244 / 0.48);
  --rv-chrome-surface: rgb(238 241 244 / 0.065);
  --rv-chrome-surface-hover: rgb(238 241 244 / 0.12);
  --rv-chrome-focus: #b8c8ec;
  --nav-cta-bg: linear-gradient(180deg, rgb(255 255 255 / 0.11), rgb(255 255 255 / 0.035)), #08090c;
  --nav-cta-bg-hover: #eef1f4;
  --nav-cta-bg-active: #c6ccd5;
  --nav-cta-border: rgb(238 241 244 / 0.48);
  --nav-cta-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 12px 30px rgb(0 0 0 / 0.38);
  --nav-cta-glow: 0 0 0 rgb(0 0 0 / 0);
}

/* Header controls: calm chrome instead of the previous neon-magenta CTA. */
.site-header .nav-pill {
  border-color: rgb(238 241 244 / 0.66) !important;
  background: transparent !important;
  color: var(--rv-chrome-strong) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08) !important;
}

.site-header .nav-pill:hover {
  border-color: rgb(255 255 255 / 0.92) !important;
  background: var(--rv-chrome-surface-hover) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14) !important;
}

.site-header .nav-pill:active {
  transform: translateY(0) scale(0.98);
}

.site-header .nav-pill:focus-visible,
.site-header .nav-right .nav-cta:focus-visible,
body.home-page .wave-hero-cta:focus-visible,
.studio-footer-cta:focus-visible {
  outline: 2px solid var(--rv-chrome-focus) !important;
  outline-offset: 3px;
  box-shadow: none !important;
}

@media (min-width: 901px) {
  .site-header .nav-right .nav-cta {
    min-width: 198px;
    min-height: 46px;
    padding: 0 18px;
    border-color: rgb(255 255 255 / 0.82);
    background: transparent;
    color: var(--rv-chrome-strong);
    font-size: 17px;
    letter-spacing: 0.09em;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08) !important;
  }

  .site-header .nav-right .nav-cta::after {
    display: none;
  }

  .site-header .nav-right .nav-cta:hover {
    border-color: var(--rv-chrome-strong);
    background: var(--rv-chrome-strong);
    color: #08090c;
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.36) !important;
  }

  .site-header .nav-right .nav-cta:active {
    transform: scale(0.98);
    border-color: var(--rv-chrome-soft);
    background: var(--rv-chrome-soft);
    color: #08090c;
    box-shadow: none !important;
  }
}

/* Hero and footer share one restrained monochrome CTA hierarchy. */
body.home-page .wave-hero-cta-primary,
.studio-footer-cta {
  border: 1px solid var(--rv-chrome-strong);
  background: linear-gradient(180deg, #f5f6f7, #dfe3e8);
  color: #090a0c;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.85),
    0 12px 28px rgb(0 0 0 / 0.32);
}

body.home-page .wave-hero-cta-primary:hover,
.studio-footer-cta:hover {
  border-color: #fff;
  background: #fff;
  color: #090a0c;
  box-shadow: 0 16px 32px rgb(0 0 0 / 0.38);
}

body.home-page .wave-hero-cta-primary:active,
.studio-footer-cta:active {
  transform: scale(0.98);
  border-color: var(--rv-chrome-soft);
  background: var(--rv-chrome-soft);
  color: #090a0c;
}

body.home-page .wave-hero-cta-secondary {
  border-color: rgb(238 241 244 / 0.38);
  background: rgb(5 6 9 / 0.64);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}

body.home-page .wave-hero-cta-secondary:hover {
  border-color: rgb(238 241 244 / 0.78);
  background: rgb(238 241 244 / 0.09);
}

/* One composited reveal per element. No scroll polling or per-element rAF loops. */
.reveal-base,
.reveal-base--left,
.reveal-base--right,
.reveal-base.reveal-surface {
  --rv-reveal-x: 0px;
  --rv-reveal-y: 18px;
  opacity: 0 !important;
  transform: translate3d(0, var(--rv-reveal-y), 0) scale(0.995) !important;
  transition:
    opacity 0.46s cubic-bezier(0.16, 1, 0.3, 1) var(--rv-reveal-delay, 0ms),
    transform 0.58s cubic-bezier(0.16, 1, 0.3, 1) var(--rv-reveal-delay, 0ms) !important;
  animation: none !important;
  will-change: auto !important;
}

.reveal-base--left {
  --rv-reveal-x: 0px;
}

.reveal-base--right {
  --rv-reveal-x: 0px;
}

/* Cards and content surfaces enter as one scene, without multi-frame
   sub-staggers that expose an empty card shell during fast scrolling. */
.reveal-surface,
.rv-stable-media-reveal {
  --rv-reveal-delay: 0ms !important;
}

.reveal-base.is-visible,
.reveal-base--left.is-visible,
.reveal-base--right.is-visible,
.reveal-base.reveal-surface.is-visible {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

.rv-stable-media-reveal {
  opacity: 0.94 !important;
}

.rv-stable-media-reveal.rv-stable-media-visible {
  opacity: 1 !important;
}

/* Portfolio is one continuous proof-of-work scene. Arm it from the section
   observer so a direct or fast scroll cannot leave offscreen cards concealed. */
.product-portfolio-section.rv-motion-scene-in .product-portfolio-item.reveal-base,
.product-portfolio-section.rv-motion-scene-in .product-portfolio-item.reveal-base--left,
.product-portfolio-section.rv-motion-scene-in .product-portfolio-item.reveal-base--right {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

/* Keep the card movement, but avoid repainting a blend sweep across full cards. */
.rv-stable-media-reveal::after {
  display: none !important;
}

.rv-motion-scene::before {
  filter: none !important;
}

/* First-frame posters prevent black or unrelated placeholder frames. */
body.home-page .wave-hero-media {
  background-image: url("../public/works/wave-hero/wave-hero-poster-desktop-20260730.webp") !important;
}

body.home-page .wave-hero-media::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: url("../public/works/wave-hero/wave-hero-poster-desktop-20260730.webp") center / cover no-repeat;
  opacity: 1;
  transform: translate3d(0, 8%, 0) scale(1.055);
  transform-origin: center;
  transition: opacity 0.22s ease;
}

body.home-page .wave-hero-media.is-video-playing::before {
  opacity: 0;
}

body.home-page .showreel-section .hero-reel {
  background: #07080b url("../public/works/hero-reel-poster-20260730.webp") center / cover no-repeat;
}

body.home-page .showreel-section .hero-reel-video {
  opacity: 0;
  transition: opacity 0.22s ease !important;
}

body.home-page .showreel-section .hero-reel-video.rv-media-playing {
  opacity: 1;
}

@media (max-width: 900px) {
  body.home-page .wave-hero-media,
  body.home-page .wave-hero-media::before {
    background-image: url("../public/works/wave-hero/wave-hero-poster-mobile-20260730.webp") !important;
    background-position: 59% 60% !important;
  }

  body.home-page .wave-hero-media::before {
    transform: translate3d(0, 15%, 0) scale(1.08);
  }
}

@media (max-width: 520px) {
  body.home-page .wave-hero-media,
  body.home-page .wave-hero-media::before {
    background-position: 61% 61% !important;
  }

  body.home-page .wave-hero-media::before {
    transform: translate3d(0, 19%, 0) scale(1.1);
  }
}

.rv-motion-scene {
  position: relative;
  isolation: isolate;
}

.rv-motion-scene::before,
.rv-motion-scene::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.rv-motion-scene::before {
  z-index: 3;
  top: 0;
  right: clamp(20px, 4vw, 64px);
  left: clamp(20px, 4vw, 64px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(238 241 244 / 0.72), rgb(157 169 194 / 0.34), transparent);
  opacity: 0;
  transform: scaleX(0.08);
  transform-origin: left center;
  transition: opacity 0.55s ease, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.rv-motion-scene::after {
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: min(320px, 32%);
  background:
    radial-gradient(circle at 18% 0%, rgb(203 211 226 / 0.09), transparent 48%),
    radial-gradient(circle at 82% 0%, rgb(116 130 160 / 0.07), transparent 44%);
  opacity: 0;
  transition: opacity 0.68s ease;
}

.rv-motion-scene[data-motion-direction="right"]::before {
  transform-origin: right center;
}

.rv-motion-scene.rv-motion-scene-in::before {
  opacity: 1;
  transform: scaleX(1);
}

.rv-motion-scene.rv-motion-scene-in::after {
  opacity: 1;
}

/* Hidden cookie UI must leave the compositing tree after its exit transition. */
.cookie-banner[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}

.cookie-banner.visible[aria-hidden="false"] {
  visibility: visible;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.rv-assistant-launcher.is-loading {
  cursor: progress;
}

.rv-assistant-launcher.is-loading::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid rgb(238 241 244 / 0.18);
  border-top-color: var(--rv-chrome-strong);
  border-radius: 50%;
  animation: rvAssistantLoad 0.8s linear infinite;
}

@keyframes rvAssistantLoad {
  to { transform: rotate(360deg); }
}

/* Footer: the approved dark visual system with a restrained chrome accent. */
.studio-footer-block {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 8vw, 124px) 0 max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(255 255 255 / 0.1);
  background:
    radial-gradient(circle at 12% 4%, rgb(197 205 221 / 0.11), transparent 32%),
    radial-gradient(circle at 88% 16%, rgb(102 116 147 / 0.08), transparent 30%),
    #050508;
  color: #f4f2f5;
}

.studio-footer-inner {
  width: min(1440px, calc(100% - 64px));
  max-width: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.62fr) minmax(180px, 0.34fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
}

.studio-footer-kicker {
  margin: 0 0 18px;
  color: #d6dbe3;
  font: 600 11px/1.3 "Spline Sans", "Segoe UI", sans-serif;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.studio-footer-title {
  margin: 0;
  color: #f4f2f5;
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 5vw, 5.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.93;
  text-transform: uppercase;
}

.studio-footer-lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: #bdb8c2;
  font: 400 clamp(16px, 1.45vw, 20px)/1.5 "Spline Sans", "Segoe UI", sans-serif;
}

.studio-footer-actions,
.studio-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.studio-footer-actions {
  margin-top: 30px;
}

.studio-footer-links {
  margin-top: 18px;
}

.studio-footer-cta,
.studio-footer-phone,
.studio-footer-chip {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font: 700 13px/1 "Spline Sans", "Segoe UI", sans-serif;
  text-decoration: none;
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.studio-footer-phone,
.studio-footer-chip {
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.035);
  color: #f4f2f5;
}

.studio-footer-chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
}

.studio-footer-cta:hover,
.studio-footer-phone:hover,
.studio-footer-chip:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.studio-footer-phone:hover,
.studio-footer-chip:hover {
  border-color: rgb(255 255 255 / 0.48);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  box-shadow: none;
}

.studio-footer-right {
  min-height: 190px;
  padding-left: 28px;
  border-left: 1px solid rgb(255 255 255 / 0.12);
  color: #aaa5af;
  font: 400 14px/1.65 "Spline Sans", "Segoe UI", sans-serif;
}

.studio-footer-meta {
  color: #d0ccd3;
}

.studio-footer-legal {
  gap: 8px;
}

.studio-footer-legal a {
  color: #aaa5af;
  font-size: 12px;
}

.studio-footer-legal a:hover {
  color: #fff;
}

.studio-footer-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  color: #77727e;
  font: 500 11px/1.5 "Spline Sans", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-footer-logo-mark {
  width: 84px;
  height: 84px;
  border: 1px solid rgb(238 241 244 / 0.28);
  border-radius: 50%;
  background: rgb(238 241 244 / 0.055);
  color: #d6dbe3;
  font-size: 24px;
}

/* Standalone privacy page shares the production visual system. */
.privacy-page {
  min-height: 100vh;
  background: #050508;
  color: #f4f2f5;
  font-family: "Spline Sans", "Segoe UI", sans-serif;
}

.privacy-main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 120px;
}

.privacy-back {
  color: #d6dbe3;
  text-decoration: none;
}

.privacy-title {
  margin: 48px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.privacy-meta,
.privacy-section p,
.privacy-section li {
  color: #bdb8c2;
  line-height: 1.65;
}

.privacy-section {
  padding: 34px 0;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.privacy-section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.privacy-section a {
  color: #d6dbe3;
}

@media (max-width: 900px) {
  body.home-page .wave-hero-content {
    justify-content: flex-start;
    width: calc(100vw - 40px);
    padding: clamp(132px, 17svh, 164px) 0 72px;
  }

  body.home-page .wave-hero-video {
    --wave-video-y: 15%;
    --wave-video-scale: 1.08;
    object-position: 59% 60%;
  }

  body.home-page .wave-hero-shade {
    background:
      linear-gradient(180deg, rgb(3 3 5 / 0.82) 0%, rgb(3 3 5 / 0.36) 42%, rgb(3 3 5 / 0.08) 68%, #050508 100%),
      linear-gradient(90deg, rgb(3 3 5 / 0.86) 0%, rgb(3 3 5 / 0.5) 58%, rgb(3 3 5 / 0.12) 100%);
  }

  body.home-page .wave-hero-title {
    max-width: min(100%, 620px);
  }

  body.home-page .wave-hero-copy {
    max-width: 330px;
  }

  .reveal-base,
  .reveal-base--left,
  .reveal-base--right,
  .reveal-base.reveal-surface,
  .service-simple-card.reveal-base,
  .section-title.reveal-base,
  .section-subtitle.reveal-base,
  .section-description.reveal-base {
    --rv-reveal-y: 16px;
    opacity: 0 !important;
    transform: translate3d(0, var(--rv-reveal-y), 0) scale(0.996) !important;
    transition:
      opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1) var(--rv-reveal-delay, 0ms),
      transform 0.52s cubic-bezier(0.16, 1, 0.3, 1) var(--rv-reveal-delay, 0ms) !important;
  }

  .reveal-base--left,
  .reveal-base--right { --rv-reveal-x: 0px; }

  .reveal-base.is-visible,
  .reveal-base--left.is-visible,
  .reveal-base--right.is-visible,
  .reveal-base.reveal-surface.is-visible,
  .service-simple-card.reveal-base.is-visible,
  .section-title.reveal-base.is-visible,
  .section-subtitle.reveal-base.is-visible,
  .section-description.reveal-base.is-visible {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
  }

  .rv-motion-scene::after {
    display: none;
  }

  .studio-footer-block {
    padding: 72px 0 calc(100px + env(safe-area-inset-bottom));
  }

  .studio-footer-inner {
    width: calc(100% - 40px);
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .studio-footer-title {
    font-size: clamp(2.4rem, 12vw, 4.2rem);
  }

  .studio-footer-right {
    min-height: 0;
    padding: 24px 0 0;
    border-top: 1px solid rgb(255 255 255 / 0.12);
    border-left: 0;
  }

  .studio-footer-mark {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 520px) {
  body.home-page .wave-hero-content {
    width: calc(100vw - 44px);
    padding-top: clamp(124px, 15.5svh, 148px);
  }

  body.home-page .wave-hero-actions {
    width: min(100%, 248px);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-top: 22px;
  }

  body.home-page .wave-hero-cta {
    width: 100%;
    min-height: 50px;
    padding: 0 20px;
    font-size: 14px;
  }

  body.home-page .wave-hero-cta-secondary {
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 4px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  body.home-page .wave-hero-cta-secondary::after {
    content: "\2193";
    margin-left: 9px;
    color: var(--rv-chrome-soft);
    font-size: 16px;
    line-height: 1;
  }

  body.home-page .wave-hero-cta-secondary:hover {
    border-color: transparent;
    background: transparent;
    color: #fff;
  }

  body.home-page .wave-hero-video {
    --wave-video-y: 19%;
    --wave-video-scale: 1.1;
    object-position: 61% 61%;
  }

  body.home-page .wave-hero-title {
    max-width: 100%;
    font-size: clamp(1.72rem, 7.75vw, 2.1rem);
  }

  body.home-page .wave-hero-copy {
    max-width: 320px;
    margin-top: 20px;
    line-height: 1.48;
  }

  .studio-footer-actions {
    align-items: stretch;
  }

  .studio-footer-cta,
  .studio-footer-phone {
    flex: 1 1 100%;
  }
}

/* Accessibility fallback only. Standard settings retain the full motion
   choreography above; reduced motion never leaves content hidden. */
@media (prefers-reduced-motion: reduce) {
  .reveal-base,
  .reveal-base--left,
  .reveal-base--right,
  .reveal-base.reveal-surface,
  .service-simple-card.reveal-base,
  .section-title.reveal-base,
  .section-subtitle.reveal-base,
  .section-description.reveal-base {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .rv-assistant-launcher.is-loading::before {
    animation-duration: 0.8s !important;
  }
}
