/* ==========================================================================
   2026-11-28 Antigravity · Apple.com Interactive Rendering & Motion Layer
   Covers:
   1. Luxury Desktop Hover (specular glass spotlight, subtle 3D tilt, photo aperture zoom,
      button glass sheen + arrow glide, frosted navbar hover pills)
   2. Luxury Mobile Touch (native iOS press compression, contact-point bloom, zero sticky hover,
      scroll-focus card elevation, momentum scroll-snap & spring sheets)
   3. Keynote Scroll Choreography (reading progress hairline, staggered scroll reveals,
      hero scroll parallax, spring modals & accordions)
   Gated by html[data-aq-motion="on"] so explicit "暂停动效" turns everything off cleanly,
   while bypassing legacy blanket prefers-reduced-motion locks on macOS preview.
   ========================================================================== */

:root {
  --aq-ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --aq-ease-spring: cubic-bezier(0.22, 1.24, 0.36, 1);
  --aq-ease-press: cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Remove ugly default mobile gray tap flash on all interactive controls */
a, button, summary, label, .card, .story-card, .case-hub-card, .case-ledger-card, .service-path {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 1. Top Luminous Reading Progress Hairline ---------- */
.aq-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 130;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #0071e3 0%, #2997ff 60%, #64d2ff 100%);
  box-shadow: 0 0 10px rgba(41, 151, 255, 0.55);
  opacity: 0;
  will-change: transform, opacity;
}
html[data-aq-motion="on"] .aq-scroll-progress {
  transition: opacity 0.25s ease !important;
}
.aq-scroll-progress.is-active {
  opacity: 1;
}

/* ---------- 2. Apple Keynote Staggered Scroll Reveals ---------- */
html[data-aq-motion="on"].aq-reveal-ready [data-aq-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.988);
  will-change: transform, opacity;
}
html[data-aq-motion="on"].aq-reveal-ready [data-aq-reveal].is-revealing {
  transition:
    opacity 0.72s var(--aq-ease-apple) var(--aq-delay, 0ms),
    transform 0.78s var(--aq-ease-apple) var(--aq-delay, 0ms) !important;
}

/* ---------- 3. Dynamic Frosted Header Elevation & Hover Pills ---------- */
html[data-aq-motion="on"] .site-header,
html[data-aq-motion="on"] .nav,
html[data-aq-motion="on"] .notes-nav {
  transition: background-color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease !important;
}
.site-header.is-scrolled,
.nav.is-scrolled,
.notes-nav.is-scrolled {
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.14);
}
body.home .site-header.is-scrolled,
.nav.dark.is-scrolled {
  box-shadow: 0 10px 32px -10px rgba(0, 0, 0, 0.65);
}

/* Desktop Navbar Frosted Pill Hover */
@media (hover: hover) and (pointer: fine) {
  html[data-aq-motion="on"] #main-nav a:not(.button),
  html[data-aq-motion="on"] .nav-links a,
  html[data-aq-motion="on"] .notes-nav-links a {
    position: relative;
    padding: 6px 12px;
    margin: -6px -12px;
    border-radius: 980px;
    transition: background-color 0.22s var(--aq-ease-apple), color 0.22s ease !important;
  }
  html[data-aq-motion="on"] #main-nav a:not(.button):hover,
  html[data-aq-motion="on"] .nav-links a:hover,
  html[data-aq-motion="on"] .notes-nav-links a:hover {
    background-color: rgba(0, 0, 0, 0.055);
  }
  html[data-aq-motion="on"] body.home #main-nav a:not(.button):hover,
  html[data-aq-motion="on"] body.route-b2b #main-nav a:not(.button):hover,
  html[data-aq-motion="on"] body.route-capabilities #main-nav a:not(.button):hover,
  html[data-aq-motion="on"] .nav.dark .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.11);
  }
}

/* ---------- 4. Specular Pointer-Tracking (Obsidian Dark Panels) & Card Elevation ---------- */
[data-aq-spot="dark"] {
  position: relative;
  overflow: hidden;
  --mx: 50%;
  --my: 50%;
  --spot-op: 0;
}
[data-aq-spot="dark"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  opacity: var(--spot-op);
  background: radial-gradient(
    480px circle at var(--mx) var(--my),
    rgba(41, 151, 255, 0.20) 0%,
    rgba(100, 210, 255, 0.05) 40%,
    transparent 70%
  );
}
html[data-aq-motion="on"] [data-aq-spot="dark"]::before {
  transition: opacity 0.36s var(--aq-ease-apple) !important;
}

/* Smooth GPU transitions on all interactive cards */
html[data-aq-motion="on"] .story-card,
html[data-aq-motion="on"] .service-path,
html[data-aq-motion="on"] .case-hub-card,
html[data-aq-motion="on"] .case-ledger-card,
html[data-aq-motion="on"] .sp-card,
html[data-aq-motion="on"] .sp-plan,
html[data-aq-motion="on"] .sp-tele-card,
html[data-aq-motion="on"] .sp-fan-frame,
html[data-aq-motion="on"] .card,
html[data-aq-motion="on"] .macro > div,
html[data-aq-motion="on"] .process-steps article,
html[data-aq-motion="on"] .notes-switch a,
html[data-aq-motion="on"] .gw-pill,
html[data-aq-motion="on"] .route-service-notes .faq-list details {
  transition:
    transform 0.42s var(--aq-ease-apple),
    box-shadow 0.42s var(--aq-ease-apple),
    border-color 0.28s ease,
    background-color 0.28s ease !important;
}

/* Luxury Desktop Hover Choreography (strictly desktop fine-pointer!) */
@media (hover: hover) and (pointer: fine) {
  html[data-aq-motion="on"] .story-card:hover,
  html[data-aq-motion="on"] .case-hub-card:hover,
  html[data-aq-motion="on"] .service-path:hover,
  html[data-aq-motion="on"] .sp-plan:hover {
    transform: perspective(1000px) translate3d(0, -6px, 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    border-color: rgba(0, 113, 227, 0.22);
    box-shadow:
      0 26px 56px -18px rgba(0, 0, 0, 0.14),
      0 8px 20px -8px rgba(0, 113, 227, 0.10);
  }
  html[data-aq-motion="on"] .case-ledger-card:hover,
  html[data-aq-motion="on"] .sp-card:hover,
  html[data-aq-motion="on"] .card:hover,
  html[data-aq-motion="on"] .process-steps article:hover {
    transform: translate3d(0, -5px, 0);
    border-color: rgba(0, 113, 227, 0.20);
    box-shadow:
      0 20px 44px -16px rgba(0, 0, 0, 0.11),
      0 4px 14px -6px rgba(0, 113, 227, 0.08);
  }
  html[data-aq-motion="on"] .sp-tele-card:hover,
  html[data-aq-motion="on"] .macro > div:hover {
    transform: translate3d(0, -4px, 0);
    border-color: rgba(41, 151, 255, 0.36);
    box-shadow: 0 18px 40px -14px rgba(0, 113, 255, 0.24);
  }
  html[data-aq-motion="on"] .notes-switch a:not([aria-current="page"]):hover {
    transform: translate3d(0, -3px, 0);
    border-color: rgba(0, 113, 227, 0.24);
    box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.09);
  }
  html[data-aq-motion="on"] .route-service-notes .faq-list details:hover {
    transform: translate3d(0, -2px, 0);
    border-color: rgba(0, 113, 227, 0.22);
  }
  html[data-aq-motion="on"] .gw-pill:hover {
    transform: translate3d(0, -2px, 0);
    border-color: rgba(41, 151, 255, 0.45);
    box-shadow: 0 8px 20px -6px rgba(41, 151, 255, 0.28);
  }

  /* Cinematic Photo Aperture Zoom inside Cards */
  html[data-aq-motion="on"] .story-thumb img,
  html[data-aq-motion="on"] .case-hub-thumb img,
  html[data-aq-motion="on"] .sp-fan-frame img,
  html[data-aq-motion="on"] .sp-demo img {
    transition: transform 0.72s var(--aq-ease-apple), filter 0.45s ease !important;
    will-change: transform;
  }
  html[data-aq-motion="on"] .story-card:hover .story-thumb img,
  html[data-aq-motion="on"] .case-hub-card:hover .case-hub-thumb img,
  html[data-aq-motion="on"] .sp-fan-frame:hover img {
    transform: scale(1.052);
    filter: brightness(1.03) contrast(1.02);
  }
  html[data-aq-motion="on"] .story-badge,
  html[data-aq-motion="on"] .case-hub-badge {
    transition: transform 0.35s var(--aq-ease-apple), background-color 0.25s ease !important;
  }
  html[data-aq-motion="on"] .story-card:hover .story-badge,
  html[data-aq-motion="on"] .case-hub-card:hover .case-hub-badge {
    transform: translate3d(0, -2px, 0);
    background: rgba(0, 113, 227, 0.90);
  }
}

/* ---------- 5. Tactile Apple Buttons (Glass Sheen + Lift + Press Spring) ---------- */
html[data-aq-motion="on"] .button,
html[data-aq-motion="on"] .sp-btn,
html[data-aq-motion="on"] .pill-btn,
html[data-aq-motion="on"] .btn-primary,
html[data-aq-motion="on"] .btn-outline-light,
html[data-aq-motion="on"] .notes-nav-cta,
html[data-aq-motion="on"] .notes-preview-cta,
html[data-aq-motion="on"] .chip,
html[data-aq-motion="on"] .goal-tabs button,
html[data-aq-motion="on"] .billing-switch button,
html[data-aq-motion="on"] [data-style-filter],
html[data-aq-motion="on"] [data-manual] {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.26s var(--aq-ease-spring),
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.32s var(--aq-ease-apple),
    color 0.2s ease !important;
}

/* Subtle diagonal glass specular sweep across primary blue CTAs */
.button::after,
.sp-btn:not(.sp-btn-line):not(.sp-btn-ghost)::after,
.pill-btn::after,
.btn-primary::after,
.notes-nav-cta::after,
.notes-preview-cta::after {
  content: "";
  position: absolute;
  top: -10%;
  left: -130%;
  width: 65%;
  height: 120%;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 20%, rgba(255, 255, 255, 0.32) 50%, transparent 80%);
  transform: skewX(-18deg);
}

@media (hover: hover) and (pointer: fine) {
  html[data-aq-motion="on"] .button:hover,
  html[data-aq-motion="on"] .sp-btn:not(.sp-btn-line):not(.sp-btn-ghost):hover,
  html[data-aq-motion="on"] .pill-btn:hover,
  html[data-aq-motion="on"] .btn-primary:hover,
  html[data-aq-motion="on"] .notes-nav-cta:hover,
  html[data-aq-motion="on"] .notes-preview-cta:hover {
    transform: translate3d(var(--mag-x, 0px), calc(-1.5px + var(--mag-y, 0px)), 0);
    box-shadow: 0 12px 28px -8px rgba(0, 113, 227, 0.52);
  }
  html[data-aq-motion="on"] .button:hover::after,
  html[data-aq-motion="on"] .sp-btn:not(.sp-btn-line):not(.sp-btn-ghost):hover::after,
  html[data-aq-motion="on"] .pill-btn:hover::after,
  html[data-aq-motion="on"] .btn-primary:hover::after,
  html[data-aq-motion="on"] .notes-nav-cta:hover::after,
  html[data-aq-motion="on"] .notes-preview-cta:hover::after {
    left: 165%;
    transition: left 0.68s var(--aq-ease-apple) !important;
  }
  html[data-aq-motion="on"] .btn-outline-light:hover,
  html[data-aq-motion="on"] .sp-btn-dark-ghost:hover {
    transform: translate3d(0, -1.5px, 0);
    box-shadow: 0 10px 24px -8px rgba(41, 151, 255, 0.30);
  }
  html[data-aq-motion="on"] .chip:hover {
    transform: translate3d(0, -1px, 0);
  }

  /* Trailing arrow micro-glide on text links & card footers */
  html[data-aq-motion="on"] .story-foot .read,
  html[data-aq-motion="on"] .case-hub-foot strong,
  html[data-aq-motion="on"] .case-ledger-card em,
  html[data-aq-motion="on"] .head-link,
  html[data-aq-motion="on"] .sp-link {
    transition: transform 0.28s var(--aq-ease-apple), color 0.2s ease !important;
  }
  html[data-aq-motion="on"] .story-card:hover .story-foot .read,
  html[data-aq-motion="on"] .case-hub-card:hover .case-hub-foot strong,
  html[data-aq-motion="on"] .case-ledger-card:hover em,
  html[data-aq-motion="on"] .head-link:hover,
  html[data-aq-motion="on"] .sp-link:hover {
    transform: translate3d(4px, 0, 0);
  }
}

/* Universal tactile press compression (Desktop click + Mobile tap!) */
html[data-aq-motion="on"] .button:active,
html[data-aq-motion="on"] .sp-btn:active,
html[data-aq-motion="on"] .pill-btn:active,
html[data-aq-motion="on"] .btn-primary:active,
html[data-aq-motion="on"] .btn-outline-light:active,
html[data-aq-motion="on"] .notes-nav-cta:active,
html[data-aq-motion="on"] .notes-preview-cta:active,
html[data-aq-motion="on"] .chip:active,
html[data-aq-motion="on"] .aq-pressed {
  transform: scale(0.968) !important;
  transition: transform 0.12s var(--aq-ease-press), box-shadow 0.12s ease !important;
}

/* ---------- 6. Spring Accordions, Modals & Chat Panel ---------- */
html[data-aq-motion="on"] .faq-list summary span,
html[data-aq-motion="on"] details.faq summary::after {
  display: inline-block;
  transition: transform 0.32s var(--aq-ease-spring) !important;
}
html[data-aq-motion="on"] .faq-list details[open] summary span {
  transform: rotate(45deg);
}
html[data-aq-motion="on"] .faq-list details[open] p,
html[data-aq-motion="on"] details.faq[open] p {
  animation: aq-fade-down 0.32s var(--aq-ease-apple) both !important;
}

html[data-aq-motion="on"] .chat-panel:not([hidden]) {
  animation: aq-modal-spring 0.36s var(--aq-ease-spring) both !important;
}
html[data-aq-motion="on"] .modal-bg.show .modal {
  animation: aq-modal-spring 0.36s var(--aq-ease-spring) both !important;
}
html[data-aq-motion="on"] #sheet[open] {
  animation: aq-sheet-up 0.38s var(--aq-ease-apple) both !important;
}
html[data-aq-motion="on"] .site-preview-dialog[open] {
  animation: aq-modal-spring 0.34s var(--aq-ease-apple) both !important;
}

@keyframes aq-fade-down {
  from { opacity: 0; transform: translate3d(0, -6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes aq-modal-spring {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.955); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes aq-sheet-up {
  from { opacity: 0.4; transform: translate3d(0, 100%, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ---------- 7. Luxury Mobile Touch Interactions (<= 780px / coarse pointer) ---------- */
@media (max-width: 780px), (hover: none) {
  /* Native iOS touch-point bloom inside pressed cards */
  [data-aq-spot].aq-pressed::before {
    opacity: 1 !important;
  }

  /* Mobile viewport focal spotlight as user scrolls through cards */
  html[data-aq-motion="on"] .story-card.aq-in-focus,
  html[data-aq-motion="on"] .case-hub-card.aq-in-focus,
  html[data-aq-motion="on"] .service-path.aq-in-focus,
  html[data-aq-motion="on"] .card.aq-in-focus {
    border-color: rgba(0, 113, 227, 0.22);
    box-shadow: 0 18px 38px -16px rgba(0, 0, 0, 0.12);
  }
  html[data-aq-motion="on"] .story-card.aq-in-focus .story-thumb img,
  html[data-aq-motion="on"] .case-hub-card.aq-in-focus .case-hub-thumb img {
    transform: scale(1.028);
    transition: transform 0.85s var(--aq-ease-apple) !important;
  }

  /* Smooth momentum horizontal strips */
  .m-toc,
  .sp-anchor .wrap > div,
  .gw-pills {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .m-toc a,
  .sp-anchor a,
  .gw-pill {
    scroll-snap-align: start;
  }

  /* Mobile Nav Drawer Spring Entrance */
  html[data-aq-motion="on"] #main-nav.open {
    animation: aq-fade-down 0.30s var(--aq-ease-apple) both !important;
  }
}

/* Hero Scroll-Linked Parallax Layer GPU hint */
.hero-earth-visual,
.sp-fan,
.notes-hero-cover img {
  will-change: transform;
}

/* Explicit Motion Pause Switch (respects user clicking "暂停动效") */
html[data-aq-motion="off"] .aq-scroll-progress { display: none !important; }
html[data-aq-motion="off"] [data-aq-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
html[data-aq-motion="off"] [data-aq-spot]::before {
  opacity: 0 !important;
}
