/* Motion layer styles — values mirror the reference site's TypedHeader, CustomCursor,
   Slider, LandingLatestBlogs and Header components. */

/* Pre-hide elements the intro timeline animates in, so they never flash before JS runs.
   The inline head script removes .motion-pending after 4s as a fail-safe. */
.motion-pending .hero-logo,
.motion-pending .hero-buttons,
.motion-pending .hero .particle-field,
.motion-pending .hero h1,
.motion-pending body:not(.docs-page) .page-hero h1 { opacity: 0 }

/* Typed header */
.typed-container { position: relative }
.typed-char { display: inline }
.typed-cursor {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0;
  height: 1em; width: max(2px, .055em);
  transform: translate3d(var(--cursor-pos-x, 0), var(--cursor-pos-y, 0), 0);
}
.typed-cursor i {
  display: block; width: 100%; height: 100%; border-radius: 1px;
  background: linear-gradient(180deg, #3279f9 0%, #346bf1 55%, #ff4641 100%);
  animation: typed-blink .5s infinite;
}
.download-banner .typed-cursor i { background: linear-gradient(180deg, #8ab4ff, #ffffff) }
@keyframes typed-blink { 0% { opacity: 0 } 10% { opacity: 1 } to { opacity: 0 } }

/* Follow cursor pill */
.motion-cursor-wrapper { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; border-radius: inherit }
.motion-cursor { position: absolute; top: 0; left: 0; opacity: 0; transform: scale(0); will-change: transform; pointer-events: none }
.motion-cursor .cursor-content {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 12px 20px 12px 14px; border-radius: 999px;
  color: #121317; background: #fff; border: 1px solid #e1e3e8;
  font-size: 15px; font-weight: 500; line-height: 1;
  box-shadow: 0 6px 24px #1213170f;
}
.has-motion-cursor, .has-motion-cursor * { cursor: none !important }
.has-motion-cursor .media-expand { opacity: 0 !important }

/* Intro scale-in: keep the transform origin centred like the reference video section */
.intro-section { transform-origin: 50% 50%; will-change: transform }

/* Header: slide away on scroll down, opaque once scrolled (reference .header.hidden / .scrolled) */
.header { transition: transform .35s ease, background-color .25s ease }
.header.scroll-hidden:not(.menu-open):not(:focus-within) { transform: translateY(calc(-100% - 60px)) } /* also clears the announcement bar hanging below the header */
.home-page .header:not(.scrolled):not(.menu-open) { background: transparent }
.header.scrolled, .header.menu-open { background: #fff }

/* Use-case slider */
.case-viewport { position: relative; width: 100%; overflow: visible }
.case-stage { overflow: hidden }
.case-track {
  display: grid; align-items: center; gap: 24px; width: 100%; will-change: transform;
  grid-template-columns: repeat(var(--item-count, 1), var(--slide-width, 100%));
  user-select: none; -webkit-user-select: none;
}
.case-track > * { min-width: 0 }
.case-slide { transition: opacity .3s }
.case-slide:not(.is-active) { opacity: 0; visibility: hidden; pointer-events: none }
.case-viewport.is-dragging .case-slide { visibility: visible }
.case-viewport.is-dragging, .case-viewport.is-dragging * { cursor: grabbing !important }
.case-track img { -webkit-user-drag: none }
.case-copy-wrapper { display: grid; flex: 1; min-width: 0 }
.case-copy { grid-area: 1 / 1 }
.case-copy:not(.is-active) { pointer-events: none }
.case-copy > * { opacity: 0; visibility: hidden; transform: translateY(30px) }
.case-copy.is-active > * { opacity: 1; visibility: visible; transform: none }

/* Latest cards slider */
.reference-news { overflow-x: clip }
.news-slider { position: relative; width: 100% }
.news-slider .news-track {
  display: grid; gap: 24px; overflow: visible; padding-bottom: 0; scroll-snap-type: none;
  grid-template-columns: repeat(var(--item-count, 3), var(--item-width, minmax(0, 1fr)));
  will-change: transform; user-select: none; -webkit-user-select: none;
}
.news-slider .news-card { position: relative; flex: none; min-width: 0 }
.news-slider .news-card:not(:last-child)::after {
  content: ""; position: absolute; top: 0; left: calc(100% + 12px); width: 1px; height: 100%; background: #2122260f;
}
.news-slider .news-card img { -webkit-user-drag: none; transition: transform .6s cubic-bezier(.2, .7, .2, 1) }
.news-slider .news-card:hover img { transform: scale(1.02) }
.news-slider.is-dragging, .news-slider.is-dragging * { cursor: grabbing !important }
.slider-controls[hidden] { display: none !important }
.slider-controls { display: inline-flex; align-items: center; margin-top: 24px; padding: 4px; border-radius: 99em; background: #eff1f5 }
.slider-control-button {
  display: flex; align-items: center; justify-content: center; inline-size: 42px; block-size: 36px; padding: 0;
  border: 0; border-radius: 99em; background: transparent; color: #121317; cursor: pointer; transition: background .2s;
}
.slider-control-button:first-child svg { transform: rotate(180deg) }
.slider-control-button:hover:not(:disabled) { background: #e3e6ec }
.slider-control-button:disabled { color: #b4b8bf; cursor: not-allowed }

/* Arrow nudge on hover (reference .arrow-link) */
.text-link svg:last-child, .reference-band h2 a svg, .news-card small svg, .button svg:last-child { transition: transform .3s }
.text-link:hover svg:last-child, .text-link:focus-visible svg:last-child,
.reference-band h2 a:hover svg, .news-card:hover small svg { transform: translateX(50%) }
.intro-toolbar .text-link:hover svg:last-child { transform: none }

/* Download banner scales in from .85 — keep it centred */
.download-banner { transform-origin: 50% 50% }

@media (prefers-reduced-motion: reduce) {
  .typed-cursor { display: none }
  .case-copy > * { transition: none }
}

/* ---------- Product media aura (reference feature-explorer media: window floating in a drifting
   Google-colour glow). Markup injected by motion.js initMediaAura(). ---------- */
.square-media, .reference-product-story .feature-visual {
  position: relative; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, #f7f9fc 0%, #f1f3f7 60%, #eef0f4 100%);
}
.square-media > .real-product-media, .feature-visual > .real-product-media { position: relative; z-index: 2 }
.media-aura { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.6s cubic-bezier(.2,.7,.2,1) }
.is-aura-visible > .media-aura { opacity: 1 }
/* colour ring hugging the window, like the blurred frame around new-chat.png */
.media-aura .aura-ring {
  position: absolute; left: var(--aura-l, 8%); top: var(--aura-t, 20%); width: var(--aura-w, 84%); height: var(--aura-h, 60%);
  border-radius: 28px; filter: blur(34px); opacity: .75; transform: scale(1.04);
  background: conic-gradient(from var(--aura-angle, 0deg), #6ea8ff, #a98bff, #ff8fb1, #ffcf6b, #8fe3b0, #6ea8ff);
  animation: aura-spin 6s linear infinite;
}
@property --aura-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg }
@keyframes aura-spin { to { --aura-angle: 360deg } }
/* drifting soft blobs */
.media-aura .aura-blob { position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform }
.media-aura .aura-blob.b1 { background: #7fb0ff; left: 8%; top: -18%; animation: aura-drift-1 6s ease-in-out infinite alternate }
.media-aura .aura-blob.b2 { background: #ffb3c4; right: -16%; bottom: -10%; animation: aura-drift-2 7s ease-in-out infinite alternate }
.media-aura .aura-blob.b3 { background: #ffe08a; left: -14%; bottom: -22%; opacity: .5; animation: aura-drift-3 8s ease-in-out infinite alternate }
@keyframes aura-drift-1 { to { transform: translate(28%, 14%) scale(1.15) } }
@keyframes aura-drift-2 { to { transform: translate(-24%, -18%) scale(.9) } }
@keyframes aura-drift-3 { to { transform: translate(30%, -10%) scale(1.1) } }
.media-aura:not(.is-running) * { animation-play-state: paused }
/* hover: glow brightens, window lifts */
.square-media .screenshot-open, .feature-visual .screenshot-open { transition: transform .6s cubic-bezier(.2,.7,.2,1), box-shadow .6s }
.square-media:hover .media-aura .aura-ring, .feature-visual:hover .media-aura .aura-ring { opacity: .95 }
.square-media:hover .screenshot-open, .feature-visual:hover .screenshot-open { transform: translateY(-6px); box-shadow: 0 22px 50px #2632481f }
.media-aura .aura-ring { transition: opacity .6s }

@media (prefers-reduced-motion: reduce) {
  .media-aura { opacity: 1; transition: none }
  .media-aura * { animation: none !important }
  .square-media:hover .screenshot-open, .feature-visual:hover .screenshot-open { transform: none }
}

/* ---------- Glowing orb card (reference home feature 4, "Antigravity SDK" feature-3.jpg):
   deep navy field, soft blue ring, glowing centred title. Breathing + a light sweeping the ring. ---------- */
.square-media.orb-media {
  position: relative; display: grid; place-items: center; padding: 0; overflow: hidden; isolation: isolate;
  text-decoration: none; color: #fff; container-type: inline-size;
  background: radial-gradient(circle at 50% 50%, #000 0 30%, #02050d 44%, #081530 70%, #142d6b 100%);
}
.orb-media > span { grid-area: 1 / 1; pointer-events: none }
/* the orb card is an <a>, so it needs the same right-column placement parity.css gives div:last-child */
.reference-band > .orb-media { grid-column: 7 / 13; width: 100% }
@media (max-width: 900px) { .reference-band > .orb-media { grid-column: auto } }
/* wide diffuse halo behind the ring */
.orb-glow {
  width: 92%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, transparent 52%, #2f5fb44d 64%, #3b6fc94d 72%, transparent 82%);
  filter: blur(18px); animation: orb-breathe 5s ease-in-out infinite;
}
/* the ring: thick, blurred, slightly lighter on the rim like the source image */
.orb-ring {
  width: 74%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 clamp(22px, 7cqi, 48px) #4a72b8b3, 0 0 clamp(40px, 12cqi, 90px) clamp(10px, 4cqi, 30px) #5b86d080, inset 0 0 clamp(40px, 12cqi, 90px) clamp(10px, 4cqi, 30px) #5b86d066;
  filter: blur(clamp(10px, 3.2cqi, 22px)); animation: orb-breathe 5s ease-in-out infinite;
}
/* a brighter arc that travels around the ring */
.orb-sheen {
  width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from var(--orb-angle, 0deg), transparent 0 64%, #a9c6ff 78%, #e6efff 82%, #a9c6ff 86%, transparent 96%);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 64% 76%, transparent 84%);
          mask: radial-gradient(circle, transparent 0 58%, #000 64% 76%, transparent 84%);
  filter: blur(clamp(8px, 2.6cqi, 18px)); opacity: .85; mix-blend-mode: screen;
  animation: orb-sweep 7s linear infinite, orb-breathe 5s ease-in-out infinite;
}
@property --orb-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg }
@keyframes orb-sweep { to { --orb-angle: 360deg } }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); opacity: .82 } 50% { transform: scale(1.045); opacity: 1 } }
.orb-title {
  position: relative; z-index: 2; font-size: clamp(26px, 7.4cqi, 56px); font-weight: 450; letter-spacing: -.01em; white-space: nowrap;
  color: #fff; text-shadow: 0 0 14px #ffffffb3, 0 0 34px #8fb4ffb3, 0 2px 30px #4a72b8;
}
.orb-title .reveal-char { display: inline-block }
/* entrance + hover */
.orb-media .orb-glow, .orb-media .orb-ring, .orb-media .orb-sheen { transition: filter .6s }
.orb-media:hover .orb-ring { filter: blur(clamp(8px, 2.6cqi, 18px)) brightness(1.25) }
.orb-media:hover .orb-sheen { animation-duration: 3.5s, 5s }
.orb-media:focus-visible { outline: 2px solid #3279f9; outline-offset: 4px }
.orb-media:not(.is-running) * { animation-play-state: paused }
@media (prefers-reduced-motion: reduce) { .orb-media * { animation: none !important } }

/* ---------- Home video section (reference YoutubeVideoSection): rounded 16:9 stage, muted autoplay loop,
   follow cursor, bottom-right control button; click opens the full player dialog. The recording is only
   274x190, so it sits centred at ~2x on a drifting colour field instead of being stretched edge to edge. ---------- */
.video-wrapper {
  position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  aspect-ratio: 16 / 9; border-radius: 32px; border: 1px solid #e6e8ea;
  background: radial-gradient(120% 90% at 50% 0%, #f7f9fc 0%, #f1f3f7 60%, #eef0f4 100%);
  box-shadow: 0 12px 50px #20212408;
}
.video-wrapper:focus-visible { outline: 2px solid #3279f9; outline-offset: 4px }
.video-wrapper > .media-aura .aura-blob { width: 46% }
.video-frame {
  position: relative; z-index: 2; width: min(548px, 62%); aspect-ratio: 274 / 189; /* source frame is 274x189; the mp4 adds 1px black padding at the bottom */ border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: 0 30px 80px #26324826, 0 0 0 1px #20212412;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), box-shadow .6s;
}
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; image-rendering: auto }
.video-wrapper:hover .video-frame { transform: translateY(-6px) scale(1.015); box-shadow: 0 40px 90px #2632482e, 0 0 0 1px #20212412 }
.video-badge {
  position: absolute; z-index: 3; left: 24px; top: 24px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; line-height: 1.2; color: #3c4043; background: #ffffffd9; border: 1px solid #e1e3e8;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.video-control-button {
  position: absolute; z-index: 3; right: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; color: #121317;
  background: #ffffffb3; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid #e1e3e8;
  transition: transform .3s, background .3s;
}
.video-wrapper:hover .video-control-button { background: #fff; transform: scale(1.06) }
.has-motion-cursor .video-control-button { opacity: 0 }
@media (max-width: 900px) { .video-wrapper { border-radius: 20px } .video-frame { width: min(548px, 78%); border-radius: 12px } }
@media (max-width: 600px) {
  .video-wrapper { aspect-ratio: 4 / 3; border-radius: 15px }
  .video-frame { width: 86% }
  .video-badge { left: 12px; top: 12px; font-size: 11px; padding: 4px 9px }
  .video-control-button { width: 40px; height: 40px; right: 12px; bottom: 12px }
}
@media (prefers-reduced-motion: reduce) { .video-wrapper:hover .video-frame { transform: none } }

/* Case slide typed title (reference .slide-image-overlay .typed-container, adapted to light screenshots) */
.case-slide { position: relative }
.case-slide-label {
  position: absolute; z-index: 4; left: 20px; top: 20px; max-width: calc(100% - 40px); pointer-events: none;
  padding: 10px 18px; border-radius: 999px; font-size: clamp(16px, 1.6vw, 24px); font-weight: 450; line-height: 1.25; color: #121317;
  background: #ffffffd9; border: 1px solid #e1e3e8; box-shadow: 0 8px 30px #2632481a;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
@media (max-width: 600px) { .case-slide-label { left: 10px; top: 10px; padding: 6px 12px; font-size: 14px } }

/* ---------- Product film: full-bleed 16:9 video like the reference landing video ---------- */
.video-wrapper.is-film { background: #05070c; border-color: #1b1e25; aspect-ratio: 16 / 9; display: block }
.video-wrapper.is-film .landing-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.video-wrapper.is-film:hover .landing-video { transform: scale(1.015) }
.video-wrapper.is-film .video-control-button { color: #fff; background: #ffffff26; border-color: #ffffff33 }
.video-wrapper.is-film:hover .video-control-button { background: #ffffff40 }
@media (max-width: 600px) { .video-wrapper.is-film { aspect-ratio: 16 / 9 } }
@media (prefers-reduced-motion: reduce) { .video-wrapper.is-film:hover .landing-video { transform: none } }

/* Film caption row: caption left, "play the full film" link right; stacks on phones */
.intro-toolbar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  margin-top: 14px; font-size: 13px; line-height: 1.45;
}
.intro-toolbar > span { min-width: 0; color: #5f6368 }
.intro-toolbar .text-link { flex: none }
@media (max-width: 600px) {
  .intro-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 12px }
}

/* Full-film player dialog (reference youtube-dialog: large dark 16:9 player) */
#media-dialog:has(video:not([hidden])) {
  width: min(1280px, calc(100vw - 64px)); padding: 52px 20px 20px; background: #0b0c10; color: #e8eaed;
}
#media-dialog:has(video:not([hidden])) video {
  width: 100%; height: auto; max-height: 78svh; aspect-ratio: 16 / 9; background: #000; border-radius: 12px;
}
#media-dialog:has(video:not([hidden])) figcaption { color: #9aa0a6 }
#media-dialog:has(video:not([hidden])) .media-close { color: #e8eaed }
#media-dialog:has(video:not([hidden])) .media-close:hover { background: #ffffff1a }
@media (max-width: 600px) { #media-dialog:has(video:not([hidden])) { width: calc(100vw - 16px); padding: 48px 6px 12px } }

/* ---------- Header mega menu: the chevron flips while a panel is open ---------- */
.desktop-nav button svg { transition: transform .28s cubic-bezier(.2,.7,.2,1) }
.desktop-nav button[aria-expanded="true"] svg { transform: rotate(180deg) }
@media (prefers-reduced-motion: reduce) { .desktop-nav button svg { transition: none } }

/* ---------- Header logo context menu ---------- */
.logo-menu {
  position: fixed; z-index: 80; min-width: 236px; padding: 6px;
  background: #fff; border: 1px solid #e3e5e9; border-radius: 14px;
  box-shadow: 0 18px 46px #20212426, 0 2px 8px #2021240f;
}
.logo-menu [role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
  border: 0; border-radius: 9px; background: none; color: #202124;
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none;
}
.logo-menu [role="menuitem"] svg:first-child { flex: none; color: #5f6368 }
.logo-menu [role="menuitem"] svg:last-child { margin-left: auto; color: #80868b }
.logo-menu [role="menuitem"]:hover { background: #f1f3f4 }
.logo-menu [role="menuitem"]:focus-visible { outline: 2px solid #3279f9; outline-offset: -2px }
.logo-menu-hint { margin: 4px 11px 3px; font-size: 11.5px; color: #80868b }

/* ---------- Particle cards: “免费提供” chip ---------- */
.audience-badge {
  position: absolute; z-index: 2; top: 26px; right: 28px;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; background: #ffffffcf; border: 1px solid #e0e3e8;
  font-size: 12px; line-height: 1.2; color: #3c4043;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.audience-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #1a73e8 }
@media (max-width: 600px) { .audience-badge { top: 16px; right: 16px; font-size: 11px; padding: 4px 9px } }
