/* ==========================================================================
   Large Desktop (1920px+)
   ========================================================================== */
@media (min-width: 1921px) {
  :root {
    --nav-margin: 28px;
    --nav-padding-x: 14px;
    --nav-padding-y: 14px;
    --nav-gap: 18px;
    --nav-link-gap: 14px;
    --nav-logo-height: 44px;
    --nav-radius: 9999px;
  }

  .desktop-navbar {
    border-radius: 9999px !important;
  }

  .nav-link {
    font-size: 15px;
    padding: 6px 14px;
  }

  .nav-cta {
    font-size: 14px;
    padding: 7px 20px;
  }

  .nav-container {
    min-height: 68px;
  }
}

/* ==========================================================================
   Standard Desktop (1440-1920px)
   ========================================================================== */
@media (max-width: 1920px) {
  :root {
    --nav-padding-x: var(--nav-padding-y);
    --nav-link-gap: 10px;
    --nav-logo-height: 36px;
  }
}

/* ==========================================================================
   Laptop (1024-1440px)
   ========================================================================== */
@media (max-width: 1366px) {
  :root {
    --nav-padding-x: 10px;
    --nav-padding-y: 10px;
    --nav-gap: 10px;
    --nav-link-gap: 8px;
    --nav-logo-height: 32px;
  }

  .hero-grid {
    gap: 40px;
  }

  .achievements-grid {
    gap: 20px;
  }

  .nav-link {
    font-size: 13px;
    padding: 4px 10px;
  }

  .nav-cta {
    font-size: 12px;
    padding: 5px 12px;
  }
}

/* ==========================================================================
   Tablet / Small Laptop (900-1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --nav-padding-x: 8px;
    --nav-padding-y: 8px;
    --nav-gap: 8px;
    --nav-link-gap: 6px;
    --nav-logo-height: 28px;
  }

  .nav-link {
    font-size: 12px;
    padding: 3px 8px;
    letter-spacing: 0.01em;
  }

  .nav-cta {
    font-size: 11px;
    padding: 4px 10px;
    letter-spacing: 0.01em;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .longform-card,
  .carousel-track .thumbnail-item {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* ==========================================================================
   Tablet Portrait / Mobile (900px and below)
   ========================================================================== */
@media (max-width: 900px) {
  .desktop-navbar {
    display: none !important;
  }

  /* FIX 1: Keep navbar fully pill-shaped on all mobile sizes */
  .mobile-navbar {
    display: block !important;
    border-radius: 9999px !important;
  }

  .mobile-navbar::before {
    border-radius: 9999px !important;
  }

  .mobile-menu-overlay.open .mobile-menu-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-content {
    order: 1;
    text-align: center;
    align-items: center;
    gap: 14px;
  }

  .hero-brand {
    align-items: center;
  }

  .hero-text-logo {
    max-width: clamp(340px, 60vw, 520px);
  }

  .hero-heading {
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    line-height: 1.4;
  }

  .hero-desc {
    max-width: 520px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-showreel {
    order: 2;
    max-width: min(100%, 760px);
    margin: 0 auto;
    width: 100%;
  }

  .showreel-play-btn {
    width: 60px;
    height: 60px;
  }

  .showreel-play-btn .play-icon {
    width: 22px;
    height: 22px;
  }

  /* FIX 3: Video playback controls — side-by-side in top-right without overlap */
  .vlb-trigger {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  .showreel-mute-btn {
    top: 10px;
    right: 48px;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .showreel-timeline {
    bottom: 6px;
    left: clamp(22px, 6.5vw, 32px);
    right: clamp(22px, 6.5vw, 32px);
    height: 36px;
    box-sizing: border-box;
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }

  .clients .section-heading--center {
    margin-bottom: 32px;
  }

  /* Isolated Client Marquee toggle on tablet/mobile */
  .clients {
    /* The marquee handles its own horizontal clipping. Keep vertical overflow
       visible so the lowered cards retain their full bottom shadow. */
    overflow: visible;
  }

  .clients-marquee--desktop {
    display: none !important;
  }

  .clients-marquee--mobile {
    display: block !important;
    padding: clamp(24px, 3.5vw, 32px) 0 var(--section-pad-y) 0;
    /* Balance the card row between the clients heading and the Portfolio section. */
    margin-top: clamp(64px, 11vw, 88px);
    margin-bottom: calc(0px - clamp(64px, 11vw, 88px));
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  }

  /* Showcase and Short-Form grids */
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .shortform-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .thumbnail-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  /* FIX 5: Portfolio & Thumbnail carousels — 1 card full-width on mobile & tablet */
  .longform-card,
  .carousel-track .thumbnail-item {
    flex: 0 0 100%;
    width: 100%;
  }

  /* FIX 6: Genre / badge tags smaller on mobile */
  .longform-genre {
    font-size: 0.75rem;
    padding: 7px 12px;
  }

  .longform-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .reviews-grid {
    gap: 20px;
  }

  .review-card {
    flex: 0 1 calc(50% - 10px);
    max-width: 480px;
  }

  /* Footer on Tablet & Mobile: Logo & Twitter/X button side-by-side on same row, copyright beneath */
  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 20px;
    text-align: center;
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .footer-logo {
    order: 1;
    display: flex;
    align-items: center;
  }

  .footer-socials {
    order: 2;
    display: flex;
    align-items: center;
  }

  .footer-copy {
    order: 3;
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   Small Mobile (480-620px)
   ========================================================================== */
@media (max-width: 620px) {
  .hide-mobile {
    display: none;
  }

  .section-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding-top: clamp(76px, 12vw, 92px);
    padding-bottom: 56px;
    min-height: auto;
    /* Clip horizontal overflow only — lets the showreel bottom shadow
       bleed softly into the next section instead of being hard-cut */
    overflow-x: clip;
    overflow-y: visible;
  }

  .hero-text-logo {
    max-width: clamp(280px, 75vw, 420px);
  }

  .hero-heading {
    font-size: clamp(0.98rem, 4.2vw, 1.25rem);
    line-height: 1.4;
  }

  .hero-desc {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 4px auto 0;
    gap: 10px;
  }

  .hero-buttons .btn {
    width: 100%;
    padding: 14px 26px;
  }

  .hero-showreel {
    max-width: 100%;
  }

  .hero-grid {
    gap: 24px;
  }

  /* FIX 1: Keep pill shape — override the old 18px border-radius */
  .mobile-navbar {
    top: 10px;
    width: calc(100% - 24px);
    border-radius: 9999px !important;
  }

  .mobile-navbar::before {
    border-radius: 9999px !important;
  }

  .mobile-nav-container {
    padding: 6px;
    min-height: 48px;
  }

  .mobile-nav-logo,
  .mobile-hamburger {
    width: 28px;
    height: 28px;
    padding: 0;
  }

  .mobile-nav-logo-image {
    width: 28px;
    height: 28px;
    max-height: 28px;
  }

  .mobile-hamburger {
    gap: 4px;
  }

  .mobile-hamburger span {
    height: 2px;
  }

  .mobile-hamburger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-hamburger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu-panel {
    padding: 20px 16px 16px;
    width: calc(100% - 24px);
  }

  .mobile-menu-link {
    font-size: 1rem;
    padding: 10px 14px;
  }

  .mobile-menu-cta {
    font-size: 0.9rem;
    padding: 12px 16px;
  }

  .mobile-menu-logo-image {
    height: 28px;
    width: 28px;
  }

  .mobile-menu-close {
    width: 36px;
    height: 36px;
  }

  .showreel-play-btn {
    width: 52px;
    height: 52px;
  }

  .showreel-play-btn .play-icon {
    width: 18px;
    height: 18px;
  }

  /* FIX 3: Timeline + mute button — side-by-side top-right on small phones */
  .vlb-trigger {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }

  .showreel-mute-btn {
    top: 8px;
    right: 42px;
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .showreel-timeline {
    bottom: 6px;
    left: clamp(22px, 6.5vw, 32px);
    right: clamp(22px, 6.5vw, 32px);
    height: 34px;
    box-sizing: border-box;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .achievement-card {
    padding: 22px 12px;
  }

  .clients .section-heading--center {
    margin-bottom: 0;
  }

  .clients-marquee--mobile {
    padding: 24px 0 var(--section-pad-y) 0;
  }

  .client-card--mobile {
    min-width: 220px;
    padding: 18px 20px;
    gap: 14px;
  }

  .client-card--mobile .client-mark {
    width: 58px;
    height: 58px;
  }

  .client-card--mobile .client-name {
    font-size: 0.94rem;
  }

  .client-card--mobile .client-subscribers {
    font-size: 0.78rem;
  }

  /* FIX 5: Portfolio carousel — 1 card full-width on small mobile */
  .longform-card {
    flex: 0 0 100%;
  }

  /* FIX 6: Genre / badge smaller at small mobile (full-width cards) */
  .longform-genre {
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .longform-badge {
    font-size: 0.62rem;
    padding: 3px 9px;
  }

  /* FIX 7: Thumbnail carousel — 1 thumbnail at a time, full-width */
  .carousel-track .thumbnail-item {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  /* Ensure carousel arrows don't overlap content on small screens */
  .carousel-arrow--left {
    left: -14px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .carousel-arrow--right {
    right: -14px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .why-grid,
  .shortform-grid,
  .thumbnail-grid,
  .thumbnail-main .thumbnail-grid-full {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Short-form: stack to single column */
  .shortform-grid {
    grid-template-columns: 1fr;
  }

  .reviews-grid {
    gap: 18px;
  }

  .review-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .why-card .card-label {
    padding: 14px 16px 16px;
  }

  .why-card .card-label h3 {
    font-size: 0.92rem;
  }

  .why-card .card-label p {
    font-size: 0.78rem;
  }

  .why-card .mute-btn {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
    bottom: 10px;
    right: 10px;
  }

  .view-more-btn {
    font-size: 0.82rem;
    padding: 12px 28px;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    min-width: 0;
  }

  .faq-trigger {
    padding: 18px 18px;
    font-size: 0.92rem;
  }

  .faq-item.is-open .faq-trigger {
    padding-bottom: 10px;
  }

  .faq-panel {
    padding: 0 18px;
  }

  .faq-panel p {
    padding-bottom: 18px;
  }

  .footer-inner {
    gap: 12px 18px;
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .thumbnail-desc {
    font-size: 0.95rem;
  }

  .thumbnail-item,
  .review-item {
    border-radius: var(--radius-sm);
  }

  .thumbnail-footer .btn {
    width: 100%;
  }

  .review-card {
    padding: 24px;
  }

  .review-body p {
    font-size: 1rem;
  }

  .review-avatar {
    width: 48px;
    height: 48px;
  }

  .review-name {
    font-size: 1.05rem;
  }

  .review-role {
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   Very Small Mobile (360-480px)
   ========================================================================== */
@media (max-width: 480px) {

  /* FIX 1: Keep pill-shape even at smallest screens */
  .mobile-navbar {
    top: 8px;
    width: calc(100% - 20px);
    border-radius: 9999px !important;
  }

  .mobile-navbar::before {
    border-radius: 9999px !important;
  }

  .mobile-nav-container {
    padding: 6px;
    min-height: 44px;
  }

  .mobile-nav-logo,
  .mobile-hamburger {
    width: 24px;
    height: 24px;
    padding: 0;
  }

  .mobile-nav-logo-image {
    width: 24px;
    height: 24px;
    max-height: 24px;
  }

  .mobile-hamburger {
    gap: 3.5px;
  }

  .mobile-hamburger span {
    height: 2px;
  }

  .mobile-hamburger.open span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  .mobile-hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-hamburger.open span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  .mobile-menu-panel {
    padding: 16px 14px 14px;
    width: calc(100% - 20px);
    border-radius: 20px;
  }

  .mobile-menu-link {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  .mobile-menu-cta {
    font-size: 0.85rem;
    padding: 10px 14px;
  }

  .mobile-menu-logo-image {
    height: 24px;
    width: 24px;
  }

  .mobile-menu-close {
    width: 32px;
    height: 32px;
  }

  .mobile-menu-close span {
    width: 16px;
    height: 1.5px;
  }

  /* Keep brand wordmark large and prominent */
  .hero-text-logo {
    max-width: clamp(240px, 78vw, 320px);
  }

  .hero-heading {
    font-size: clamp(0.92rem, 4.5vw, 1.15rem);
    line-height: 1.4;
  }

  .hero-desc {
    font-size: 0.8rem;
  }

  .hero {
    padding-top: clamp(72px, 8vw, 88px);
    padding-bottom: var(--section-pad-y);
  }

  .section-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* FIX 5 & 7: Carousels stay full-width on tiniest phones */
  .longform-card {
    flex: 0 0 100%;
  }

  .carousel-track .thumbnail-item {
    flex: 0 0 100%;
  }

  .client-card--mobile {
    min-width: 200px;
    padding: 14px 16px;
    gap: 12px;
  }

  .client-card--mobile .client-mark {
    width: 48px;
    height: 48px;
  }

  .client-card--mobile .client-name {
    font-size: 0.88rem;
  }

  .client-card--mobile .client-subscribers {
    font-size: 0.74rem;
  }
}

/* ==========================================================================
   Mobile Landscape
   ========================================================================== */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {

  /* FIX 1: Keep pill-shape in landscape too */
  .mobile-navbar {
    top: 6px;
    width: calc(100% - 24px);
    border-radius: 9999px !important;
  }

  .mobile-navbar::before {
    border-radius: 9999px !important;
  }

  .mobile-nav-container {
    padding: 5px;
    min-height: 42px;
  }

  .mobile-nav-logo,
  .mobile-hamburger {
    width: 24px;
    height: 24px;
    padding: 0;
  }

  .mobile-nav-logo-image {
    height: 24px;
  }

  .mobile-hamburger {
    gap: 3px;
  }

  .mobile-hamburger span {
    height: 1.5px;
  }

  .mobile-hamburger.open span:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
  }

  .mobile-hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-hamburger.open span:nth-child(3) {
    transform: translateY(-4.5px) rotate(-45deg);
  }

  .mobile-menu-panel {
    padding: 16px 14px 14px;
    max-height: 80vh;
  }

  .mobile-menu-link {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .mobile-menu-cta {
    font-size: 0.8rem;
    padding: 10px 14px;
  }

  .hero {
    padding-top: clamp(64px, 7vw, 80px);
    padding-bottom: var(--section-pad-y);
    min-height: auto;
  }

  .hero-text-logo {
    max-width: clamp(210px, 82vw, 280px);
  }

  .hero-heading {
    font-size: clamp(0.88rem, 4.8vw, 1.05rem);
    line-height: 1.4;
  }

  .hero-desc {
    font-size: 0.8rem;
  }

  .hero-buttons .btn {
    padding: 8px 18px;
    font-size: 0.75rem;
  }

  .hero-showreel {
    max-width: 45%;
  }

  .showreel-play-btn {
    width: 36px;
    height: 36px;
  }

  .showreel-play-btn .play-icon {
    width: 14px;
    height: 14px;
  }

  .vlb-trigger {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
  }

  .showreel-mute-btn {
    width: 24px;
    height: 24px;
    font-size: 0.55rem;
    top: 6px;
    right: 34px;
  }

  .showreel-timeline {
    bottom: 4px;
    left: clamp(18px, 5vw, 24px);
    right: clamp(18px, 5vw, 24px);
    height: 32px;
  }

  .section-inner {
    padding: 30px 20px;
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .achievement-card {
    padding: 12px 8px;
  }

  .achievement-number {
    font-size: 1.4rem;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .why-card .card-label {
    padding: 10px 14px 12px;
  }

  .why-card .card-label h3 {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Safe area support for notched devices
   ========================================================================== */
@supports (padding: max(0px)) {
  .desktop-navbar {
    top: max(var(--nav-margin), env(safe-area-inset-top));
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  .mobile-navbar {
    top: max(12px, env(safe-area-inset-top));
  }

  /* The edge-aligned page headers set their own top position. */
  .site-navbar--edge {
    top: max(var(--nav-margin), env(safe-area-inset-top));
  }

  .mobile-menu-overlay {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* The base `top` for .site-navbar is overridden at these breakpoints, so the
   safe-area version has to be re-declared at the same breakpoints to stay
   ahead in the cascade (this file loads after style.css). */
@media (max-width: 900px) {
  @supports (padding: max(0px)) {
    .site-navbar--edge {
      top: max(10px, env(safe-area-inset-top));
    }
  }
}

@media (max-width: 480px) {
  @supports (padding: max(0px)) {
    .site-navbar--edge {
      top: max(8px, env(safe-area-inset-top));
    }
  }
}

@media (max-width: 768px) {

  .mobile-navbar {
    top: max(10px, env(safe-area-inset-top));
  }

  /* Let mobile carousel cards use the same page gutters as surrounding content.
     The section already has horizontal padding, so a second track inset made
     full-width videos and thumbnails look undersized. */
  .thumbnail-showcase .carousel-track {
    padding-left: 0;
    padding-right: 0;
    gap: 16px;
  }

  .portfolio-longform .carousel-track {
    padding-left: 0;
    padding-right: 0;
    gap: 16px;
  }
}


/* ==========================================================================
   Touch Device Improvements (phone / tablet)
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {

  /* Mute buttons on videos always visible on touch — no :hover to reveal */
  .shortform-card .mute-btn,
  .mute-btn,
  .vlb-trigger {
    opacity: 0.75;
  }

  /* Showreel timeline: always visible on touch, no hover required */
  .showreel-timeline {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Disable translateY hover lifts on cards — prevents sticky hover state on iOS */
  .longform-card:hover,
  .shortform-card:hover,
  .client-card:hover,
  .achievement-card:hover,
  .review-card:hover,
  .thumbnail-item:hover {
    transform: none;
  }

  /* Keep review card parallax reset (JS handles this) */
  .review-card:hover {
    transform: translateY(var(--parallax-y));
  }
}

/* Preserve touch-friendly gestures on phone and tablet showreels. */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  .showreel-wrapper {
    touch-action: manipulation;
  }

  .showreel-wrapper .showreel-timeline,
  .showreel-wrapper .timeline-track {
    touch-action: none;
  }
}

/* Phone-only controls state for the un-zoomed hero showreel. Controls are
   visible while paused; a background tap can hide/reveal them without playing. */
@media (max-width: 768px) {

  .showreel-wrapper.is-playing .showreel-controls,
  .showreel-wrapper.mobile-ui-hidden .showreel-controls {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .showreel-wrapper.is-playing.show-mobile-ui .showreel-controls {
    opacity: 1;
    visibility: visible;
  }
}

/* ==========================================================================
   Video Lightbox — Touch / Mobile Overrides
   Isolated to (hover: none) and (pointer: coarse) so desktop is unaffected.
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {

  /* ── 1. Shrink center play/pause hitbox to just the visual circle ───────── */
  /*      On desktop it is 200×200 (invisible area). On touch, shrink it so  */
  /*      the timeline scrubber underneath is reachable.                      */
  .vlb__center-play {
    width: 70px;
    height: 70px;
  }

  /* The visual icon is already 70×70, so no inner offset needed */
  .vlb__center-play-icon {
    width: 70px;
    height: 70px;
  }

  /* ── 2. Always show controls on open (no hover required) ──────────────── */
  /*      On touch, :hover never fires, so we force-show the controls and    */
  /*      timeline when the lightbox is open. They get hidden by the toggle. */
  .vlb.is-open .vlb__controls {
    opacity: 1;
  }

  .vlb.is-open .vlb__timeline {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Always show the center play button when paused — critical on touch */
  .vlb__center-play.is-paused {
    opacity: 1;
  }

  /* Also show it briefly when playing (opacity controlled by JS visibility toggle) */
  .vlb.is-open .vlb__center-play {
    opacity: 1;
  }

  /* ── 3. UI hidden state (.vlb--ui-hidden on the panel) ───────────────── */
  /*      JS adds this class when the user taps blank space.                  */
  /*      Hides timeline, controls bar, center play button, and genre badge.  */
  /*      The X close button is NEVER hidden (always accessible).            */
  .vlb__panel.vlb--ui-hidden .vlb__timeline {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  /* When UI is hidden, only conceal the mute button — NOT the whole controls bar.
     A child cannot override its parent's opacity in CSS compositing, so we target
     each button independently. The close button (vlb__close) always stays visible. */
  .vlb__panel.vlb--ui-hidden .vlb__mute {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
  }

  /* Close button is ALWAYS visible and tappable, even when UI is hidden */
  .vlb__panel.vlb--ui-hidden .vlb__close {
    opacity: 1;
    pointer-events: auto;
  }

  .vlb__panel.vlb--ui-hidden .vlb__center-play {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
  }

  /* Genre badge (video title text) also hides with the rest of the UI */
  .vlb__panel.vlb--ui-hidden .vlb__genre-badge {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
  }

  /* ── 4. Hide the desktop ESC hint on touch ─────────────────────────────── */
  /*      The esc hint text is not relevant on mobile.                        */
  .vlb__esc-hint {
    display: none;
  }

  /* ── 5. Backdrop on touch: tap-to-toggle-UI zone ──────────────────────── */
  /*      JS handles the backdrop click to toggle UI (not close).            */
  /*      Remove the cursor:pointer cue — it's not meaningful on touch.     */
  .vlb__backdrop {
    cursor: default;
  }
}

/* ==========================================================================
   Mobile & Tablet Background Performance & Visual Optimization
   --------------------------------------------------------------------------
   Guarantees desktop remains 100% untouched while mobile & tablet devices
   benefit from zero cursor-glow GPU compositing overhead, disabled click
   particles, and lightweight static ambient gradient orbs.
   ========================================================================== */
@media (max-width: 1024px),
(pointer: coarse),
(hover: none) {

  /* 1. Eliminate heavy 140vmax full-screen cursor-following glow on mobile/touch */
  body::before {
    display: none !important;
  }

  /* 2. Completely disable interactive clicking particles on mobile/touch */
  .click-particle {
    display: none !important;
  }

  /* 3. Streamline ambient gradient orbs for silky smooth 60-120fps touch scrolling:
        - Disable continuous multi-layer GPU keyframe drift animations
        - Hide secondary and tertiary background orbs
        - Keep a lightweight, soft static top hero beacon for rich brand mood */
  .bg-orb {
    animation: none !important;
    will-change: auto !important;
  }

  .bg-orb--2,
  .bg-orb--3 {
    display: none !important;
  }

  .bg-orb--1 {
    width: 90vw;
    height: 90vw;
    top: -25vw;
    left: 0vw;
    filter: blur(55px);
    opacity: 0.75;
    transform: none !important;
  }

  /* 4. Complete isolation: Hide desktop marquee and show pure CSS mobile marquee on touch devices */
  .clients-marquee--desktop {
    display: none !important;
  }

  .clients-marquee--mobile {
    display: block !important;
  }
}

/* Reduced motion preference for mobile marquee */
@media (prefers-reduced-motion: reduce) {
  .marquee-track-mobile {
    animation: none !important;
    transform: none !important;
  }
}
