/* Animated landing — only when body.landing-motion */

.landing-motion {
  --glow: rgba(82, 130, 255, 0.45);
}

:is(.site-shell, .landing-motion) .ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

:is(.site-shell, .landing-motion) .ambient-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, var(--glow), transparent 55%);
  opacity: 0.35;
}

:is(.site-shell, .landing-motion) .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orb-drift 18s ease-in-out infinite;
}

:is(.site-shell, .landing-motion) .orb-a {
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: -12%;
  right: -8%;
  background: #5282ff;
}

:is(.site-shell, .landing-motion) .orb-b {
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  bottom: 5%;
  left: -12%;
  background: #3ecf8e;
  animation-delay: -6s;
}

:is(.site-shell, .landing-motion) .orb-c {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  top: 38%;
  left: 42%;
  background: #9b6dff;
  opacity: 0.28;
  animation-delay: -11s;
}

/* —— Header (shell + landing) —— */

:is(.site-shell, .landing-motion) .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

:is(.site-shell, .landing-motion) .site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

[data-theme='light'] :is(.site-shell, .landing-motion) .site-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

:is(.site-shell, .landing-motion) .topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.7rem 0;
  min-height: 3.5rem;
}

:is(.site-shell, .landing-motion) .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
}

:is(.site-shell, .landing-motion) .brand-logo {
  width: 36px;
  height: 36px;
  max-height: none;
  border-radius: 10px;
  object-fit: contain;
}

:is(.site-shell, .landing-motion) .brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

:is(.site-shell, .landing-motion) .nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

:is(.site-shell, .landing-motion) .nav a {
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

:is(.site-shell, .landing-motion) .nav a:hover,
:is(.site-shell, .landing-motion) .nav a:focus-visible {
  color: var(--text);
  background: var(--surface-hover);
}

:is(.site-shell, .landing-motion) .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

:is(.site-shell, .landing-motion) .topbar-actions .lang-switch {
  padding: 0.2rem;
}

:is(.site-shell, .landing-motion) .topbar-actions .lang-link {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.62rem;
}

:is(.site-shell, .landing-motion) .btn-topbar {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  min-height: 0;
}

:is(.site-shell, .landing-motion) .btn-topbar-short {
  display: none;
}

:is(.site-shell, .landing-motion) .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  flex-shrink: 0;
}

:is(.site-shell, .landing-motion) .nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

:is(.site-shell, .landing-motion) .nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

:is(.site-shell, .landing-motion) .nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

:is(.site-shell, .landing-motion) .nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.landing-motion .hero-grid {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
  gap: clamp(2rem, 5vw, 4rem);
}

.landing-motion .hero-copy .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  letter-spacing: 0.06em;
}

.landing-motion h1 {
  max-width: 14ch;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
}

.landing-motion .text-gradient {
  background: linear-gradient(120deg, #8eb4ff 0%, #5282ff 45%, #3ecf8e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-motion .hero-stage {
  position: relative;
  min-height: 340px;
}

.landing-motion .hero-phone {
  position: relative;
  margin: 0 auto;
  max-width: 320px;
  padding: 0.65rem;
  border-radius: 32px;
  background: linear-gradient(145deg, #2e2e34, #121214);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(82, 130, 255, 0.15);
}

.landing-motion.is-motion-ready .hero-phone {
  animation: phone-float 5s ease-in-out infinite;
}

.landing-motion .hero-phone::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(82, 130, 255, 0.7),
    rgba(62, 207, 142, 0.4),
    rgba(155, 109, 255, 0.5)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
}

.landing-motion .hero-phone-bar {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-motion .hero-phone-notch {
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.landing-motion .hero-chat {
  min-height: 260px;
  padding: 0.75rem 0.85rem 1rem;
  border-radius: 22px;
  background: #0e0e10;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: opacity 0.22s ease;
}

.landing-motion .hero-chat.hero-chat--swap {
  opacity: 0.35;
}

.landing-motion .live-dot {
  animation: live-pulse 1.8s ease-in-out infinite;
}

.landing-motion .section-head h2 {
  letter-spacing: -0.02em;
}

.landing-motion .step-item {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
}

.landing-motion .how-layout .step-item:hover {
  transform: translateX(6px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}

.landing-motion .hero-bubble {
  max-width: 88%;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 0.4s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-motion .hero-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.landing-motion .hero-bubble--in {
  align-self: flex-end;
  background: #2f6df2;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.landing-motion .hero-bubble--out {
  align-self: flex-start;
  background: #252528;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.landing-motion .hero-typing {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

.landing-motion .hero-bubble time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  opacity: 0.55;
  text-align: right;
}

.landing-motion .hero-float {
  position: absolute;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.landing-motion.is-motion-ready .hero-float {
  animation: float-badge 4.5s ease-in-out infinite;
}

.landing-motion .hero-float--1 {
  top: 8%;
  left: -4%;
  animation-delay: 0s;
}

.landing-motion .hero-float--2 {
  bottom: 12%;
  right: -6%;
  animation-delay: -2.2s;
}

.landing-motion .btn-primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(82, 130, 255, 0.35);
}

.landing-motion .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  animation: btn-shine 4s ease-in-out infinite;
}

.landing-motion .feature-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.landing-motion .feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(82, 130, 255, 0.08),
    transparent 50%,
    rgba(62, 207, 142, 0.06)
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.landing-motion .feature-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

.landing-motion .feature-card:hover::before {
  opacity: 1;
}

.landing-motion .feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  font-size: 1.35rem;
  line-height: 1;
}

.landing-motion .section#how {
  position: relative;
}

.landing-motion .how-layout .phone-mock {
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(82, 130, 255, 0.12);
}

:is(.site-shell, .landing-motion) .cta.cta-panel {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
}

:is(.site-shell, .landing-motion) .cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

:is(.site-shell, .landing-motion) .cta-panel::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--cta-angle, 0deg),
    #5282ff,
    #3ecf8e,
    #9b6dff,
    #5282ff
  );
  z-index: 0;
  animation: cta-rotate 6s linear infinite;
  opacity: 0.55;
}

:is(.site-shell, .landing-motion) .cta-panel > * {
  position: relative;
  z-index: 1;
}

:is(.site-shell, .landing-motion) .cta-panel .cta-inner {
  margin: 2px;
  border-radius: calc(var(--radius-lg) - 2px);
  background: var(--cta-bg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

:is(.site-shell, .landing-motion) .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

:is(.site-shell, .landing-motion) .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero: visible immediately, no enter animation (font/layout stable) */
:is(.site-shell, .landing-motion) .page-hero.reveal,
.landing-motion .hero-grid > .reveal {
  opacity: 1;
  transform: none;
  transition: none;
  animation: none;
}

.landing-motion .guides-panel {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.landing-motion .guides-panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@property --cta-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes orb-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(3%, 4%) scale(1.05);
  }
  66% {
    transform: translate(-4%, 2%) scale(0.96);
  }
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

@keyframes phone-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes float-badge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(62, 207, 142, 0);
  }
}

@keyframes btn-shine {
  0%,
  75%,
  100% {
    transform: translateX(-120%);
  }
  35% {
    transform: translateX(120%);
  }
}

@keyframes cta-rotate {
  to {
    --cta-angle: 360deg;
  }
}

[data-theme='light'] :is(.site-shell, .landing-motion) .ambient-bg::after {
  opacity: 0.18;
}

[data-theme='light'] :is(.site-shell, .landing-motion) .orb {
  opacity: 0.28;
}

[data-theme='light'] .landing-motion .hero-phone {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 24px 50px rgba(0, 0, 0, 0.12),
    0 0 60px rgba(82, 130, 255, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  :is(.site-shell, .landing-motion) .orb,
  .landing-motion .hero-phone,
  .landing-motion .hero-float,
  .landing-motion .text-gradient,
  .landing-motion .btn-primary::after,
  :is(.site-shell, .landing-motion) .cta-panel::before {
    animation: none;
  }

  :is(.site-shell, .landing-motion) .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .landing-motion .hero-bubble {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 900px) {
  :is(.site-shell, .landing-motion) .topbar-inner {
    flex-wrap: wrap;
    align-items: center;
  }

  :is(.site-shell, .landing-motion) .nav-toggle {
    display: inline-flex;
    order: 2;
  }

  :is(.site-shell, .landing-motion) .topbar-actions {
    order: 3;
    margin-left: 0;
  }

  :is(.site-shell, .landing-motion) .brand {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  :is(.site-shell, .landing-motion) .topbar-inner {
    row-gap: 0.35rem;
  }

  :is(.site-shell, .landing-motion) .nav {
    order: 4;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      padding 0.35s ease;
  }

  :is(.site-shell, .landing-motion) .nav.is-open {
    max-height: 280px;
    opacity: 1;
    pointer-events: auto;
    padding: 0.35rem 0 0.5rem;
  }

  :is(.site-shell, .landing-motion) .nav a {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--card) 70%, transparent);
  }

  .landing-motion .hero-float {
    display: none;
  }

  .landing-motion .hero-stage {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  :is(.site-shell, .landing-motion) .brand-name {
    display: none;
  }

  :is(.site-shell, .landing-motion) .btn-topbar-long {
    display: none;
  }

  :is(.site-shell, .landing-motion) .btn-topbar-short {
    display: inline;
  }

  :is(.site-shell, .landing-motion) .topbar-actions .lang-switch {
    display: none;
  }
}
