/* ═══════════════════════════════════════════════════════════
   手游存档库 — Orbit Launcher
   Single View · 100vh · Premium 3D Glass Icons
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #000000;
  --text: #f5f5f7;
  --text-muted: rgba(245, 245, 247, 0.52);
  --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --orbit-r: clamp(118px, 32vw, 148px);
  --icon-size: clamp(54px, 14.5vw, 64px);

  /* Theme: Home */
  --theme-a: rgba(255, 255, 255, 0.06);
  --theme-b: rgba(160, 160, 170, 0.04);
  --theme-c: rgba(255, 255, 255, 0.08);
  --theme-accent: #e8e8ed;
  --theme-glow: rgba(255, 255, 255, 0.18);
  --theme-illus: rgba(255, 255, 255, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── Theme Variants ─── */
.app[data-theme="home"] {
  --theme-a: rgba(255, 255, 255, 0.07);
  --theme-b: rgba(140, 140, 150, 0.05);
  --theme-c: rgba(255, 255, 255, 0.1);
  --theme-accent: #e8e8ed;
  --theme-glow: rgba(255, 255, 255, 0.2);
  --theme-illus: rgba(255, 255, 255, 0.14);
}

.app[data-theme="tutorial"] {
  --theme-a: rgba(255, 198, 92, 0.22);
  --theme-b: rgba(255, 160, 60, 0.12);
  --theme-c: rgba(255, 220, 140, 0.08);
  --theme-accent: #ffc65c;
  --theme-glow: rgba(255, 198, 92, 0.45);
  --theme-illus: rgba(255, 198, 92, 0.2);
}

.app[data-theme="wechat"] {
  --theme-a: rgba(74, 222, 128, 0.2);
  --theme-b: rgba(34, 197, 94, 0.12);
  --theme-c: rgba(134, 239, 172, 0.08);
  --theme-accent: #4ade80;
  --theme-glow: rgba(74, 222, 128, 0.4);
  --theme-illus: rgba(74, 222, 128, 0.18);
}

.app[data-theme="ai"] {
  --theme-a: rgba(139, 92, 246, 0.24);
  --theme-b: rgba(99, 102, 241, 0.16);
  --theme-c: rgba(167, 139, 250, 0.1);
  --theme-accent: #a78bfa;
  --theme-glow: rgba(139, 92, 246, 0.5);
  --theme-illus: rgba(167, 139, 250, 0.22);
}

.app[data-theme="download"] {
  --theme-a: rgba(56, 189, 248, 0.22);
  --theme-b: rgba(14, 165, 233, 0.14);
  --theme-c: rgba(125, 211, 252, 0.1);
  --theme-accent: #38bdf8;
  --theme-glow: rgba(56, 189, 248, 0.45);
  --theme-illus: rgba(56, 189, 248, 0.2);
}

.app[data-theme="forum"] {
  --theme-a: rgba(192, 132, 252, 0.22);
  --theme-b: rgba(168, 85, 247, 0.14);
  --theme-c: rgba(216, 180, 254, 0.08);
  --theme-accent: #c084fc;
  --theme-glow: rgba(192, 132, 252, 0.42);
  --theme-illus: rgba(192, 132, 252, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════ */
.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
}

.app[data-state="intro"] .launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app[data-state="orbit"] .launcher,
.app[data-state="focused"] .launcher {
  visibility: visible;
  animation: launcherIn 0.55s var(--ease-out-expo) forwards;
}

@keyframes launcherIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.app[data-state="orbit"] .stage { pointer-events: none; }
.app[data-state="focused"] .orbit__hint { opacity: 0; }
.app[data-state="focused"] .orbit { pointer-events: none; }
.app[data-state="focused"] .stage { z-index: 30; }

/* ═══════════════════════════════════════════════════════════
   BACKGROUND
   ═══════════════════════════════════════════════════════════ */
.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

.bg__aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out-expo);
}

.app[data-state="intro"] .bg__aurora,
.app[data-state="orbit"] .bg__aurora,
.app[data-state="focused"] .bg__aurora {
  opacity: 1;
}

.bg__mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 30% 25%, var(--theme-a) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 75% 65%, var(--theme-b) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 50% 85%, var(--theme-c) 0%, transparent 55%);
  filter: blur(40px);
  opacity: 0.85;
  animation: meshDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes meshDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -1.5%) scale(1.04); }
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}

.bg__glow--a {
  width: 55vw; height: 55vw; max-width: 420px; max-height: 420px;
  top: 8%; left: 50%;
  transform: translateX(-50%);
  background: var(--theme-a);
  opacity: 0.7;
  animation: glowFloatA 12s ease-in-out infinite;
}

.bg__glow--b {
  width: 42vw; height: 42vw; max-width: 320px; max-height: 320px;
  bottom: 18%; right: -8%;
  background: var(--theme-b);
  opacity: 0.55;
  animation: glowFloatB 15s ease-in-out infinite;
}

.bg__glow--c {
  width: 30vw; height: 30vw; max-width: 240px; max-height: 240px;
  bottom: 35%; left: -5%;
  background: var(--theme-c);
  opacity: 0.4;
  animation: glowFloatC 10s ease-in-out infinite;
}

@keyframes glowFloatA {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-48%) translateY(12px); }
}

@keyframes glowFloatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-16px, -20px); }
}

@keyframes glowFloatC {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, 16px); }
}

.bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
  animation: noiseShift 0.5s steps(2) infinite;
  transition: opacity 1s var(--ease-out-expo) 0.3s;
}

.app[data-state="intro"] .bg__noise,
.app[data-state="orbit"] .bg__noise,
.app[data-state="focused"] .bg__noise {
  opacity: 0.045;
}

@keyframes noiseShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2%, -1%); }
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 30%, rgba(0,0,0,0.55) 100%);
}

/* ═══════════════════════════════════════════════════════════
   ENTRANCE
   ═══════════════════════════════════════════════════════════ */
.intro {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: var(--safe-t) 32px var(--safe-b);
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out-expo), visibility 0.45s;
}

.app[data-state="orbit"] .intro,
.app[data-state="focused"] .intro {
  opacity: 0;
  visibility: hidden;
}

.intro__logo-wrap {
  perspective: 800px;
}

.intro__logo {
  width: 72px;
  height: 72px;
  color: var(--text);
  filter: blur(16px);
  opacity: 0;
  transform: scale(0.88);
  animation: logoFocus 0.9s var(--ease-out-expo) 0.45s forwards;
}

.intro__logo svg { width: 100%; height: 100%; }

@keyframes logoFocus {
  0% { filter: blur(16px); opacity: 0; transform: scale(0.88); }
  100% { filter: blur(0); opacity: 1; transform: scale(1); }
}

.intro__title {
  display: flex;
  gap: 2px;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}

.intro__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  animation: charIn 0.5s var(--ease-out-expo) forwards;
}

.intro__char:nth-child(1) { animation-delay: 0.75s; }
.intro__char:nth-child(2) { animation-delay: 0.83s; }
.intro__char:nth-child(3) { animation-delay: 0.91s; }
.intro__char:nth-child(4) { animation-delay: 0.99s; }
.intro__char:nth-child(5) { animation-delay: 1.07s; }

@keyframes charIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.intro__subtitle {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
  animation: subtitleIn 0.7s var(--ease-out-expo) 1.15s forwards;
}

@keyframes subtitleIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Page scale during intro */
.app[data-state="intro"] {
  animation: pageScaleIn 0.8s var(--ease-out-expo) 1.25s forwards;
}

@keyframes pageScaleIn {
  from { transform: scale(0.96); }
  to { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   LAUNCHER
   ═══════════════════════════════════════════════════════════ */
.launcher {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + var(--safe-t))
    calc(16px + var(--safe-r))
    calc(12px + var(--safe-b))
    calc(16px + var(--safe-l));
}

/* ═══════════════════════════════════════════════════════════
   CORE
   ═══════════════════════════════════════════════════════════ */
.core {
  position: absolute;
  left: 50%;
  top: calc(42% + var(--safe-t) * 0.3);
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  z-index: 5;
  will-change: transform, opacity;
}

.core__ring {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
}

.app[data-state="intro"] .core__ring,
.app[data-state="intro"] .core__pulse,
.app[data-state="intro"] .core__emblem {
  animation: none;
  opacity: 0;
}

.app[data-state="orbit"] .core__ring,
.app[data-state="focused"] .core__ring {
  animation: ringAppear 0.8s var(--ease-out-expo) forwards;
}

.core__ring--1 { inset: -28px; }
.core__ring--2 { inset: -44px; border-color: rgba(255, 255, 255, 0.03); }

.app[data-state="orbit"] .core__ring--1,
.app[data-state="focused"] .core__ring--1 { animation-delay: 0.12s; }

.app[data-state="orbit"] .core__ring--2,
.app[data-state="focused"] .core__ring--2 { animation-delay: 0.22s; }

@keyframes ringAppear {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.core__pulse {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--theme-glow) 0%, transparent 70%);
  opacity: 0;
}

.app[data-state="orbit"] .core__pulse,
.app[data-state="focused"] .core__pulse {
  animation: corePulse 0.9s var(--ease-out-expo) forwards, coreBreathe 4s ease-in-out 1s infinite;
}

@keyframes corePulse {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 0.6; transform: scale(1); }
}

@keyframes coreBreathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.08); }
}

.core__emblem {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 245, 247, 0.85);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
}

.app[data-state="orbit"] .core__emblem,
.app[data-state="focused"] .core__emblem {
  animation: emblemIn 0.7s var(--ease-out-expo) forwards;
}

.core__emblem svg { width: 44px; height: 44px; }

@keyframes emblemIn {
  from { opacity: 0; transform: scale(0.8); filter: blur(8px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ═══════════════════════════════════════════════════════════
   STAGE — Focused Content
   ═══════════════════════════════════════════════════════════ */
.stage {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(48px + var(--safe-t))
    28px
    calc(80px + var(--safe-b));
}

.stage__panel {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform, opacity, filter;
  --focus-p: 0;
}

.stage__illus {
  width: min(220px, 52vw);
  height: min(220px, 52vw);
  margin-bottom: 28px;
  position: relative;
  transform-style: preserve-3d;
  perspective: 600px;
}

.stage__illus-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: illusFloat 5s ease-in-out infinite;
}

@keyframes illusFloat {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-10px) rotateX(2deg); }
}

.stage__title {
  font-size: clamp(28px, 7.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  opacity: clamp(0, calc((var(--focus-p) - 0.18) / 0.45), 1);
  transform: translateY(calc((1 - clamp(0, (var(--focus-p) - 0.18) / 0.45, 1)) * 18px));
}

.stage__desc {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  white-space: pre-line;
  color: var(--text-muted);
  max-width: 300px;
  margin-bottom: 32px;
  opacity: clamp(0, calc((var(--focus-p) - 0.26) / 0.45), 1);
  transform: translateY(calc((1 - clamp(0, (var(--focus-p) - 0.26) / 0.45, 1)) * 14px));
}

.stage__action {
  min-height: 52px;
  opacity: clamp(0, calc((var(--focus-p) - 0.34) / 0.45), 1);
  transform: scale(calc(0.88 + clamp(0, (var(--focus-p) - 0.34) / 0.45, 1) * 0.12));
}

.stage__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 200px;
  padding: 14px 36px;
  background: var(--theme-accent);
  color: #0a0a0c;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 0 6px 32px var(--theme-glow);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}

.stage__btn:active {
  transform: scale(0.94);
}

.stage__btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Illustration Components */
.illus-scene {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.illus-glass {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 40px var(--theme-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.illus-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 45%);
  pointer-events: none;
}

.illus-glass--home { width: 140px; height: 140px; }
.illus-glass--tutorial { width: 160px; height: 120px; }
.illus-glass--wechat { width: 130px; height: 130px; border-radius: 20px; }
.illus-glass--ai { width: 150px; height: 150px; border-radius: 50%; }
.illus-glass--download { width: 110px; height: 190px; border-radius: 28px; }
.illus-glass--forum { width: 150px; height: 130px; }

.illus-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-accent);
}

.illus-icon svg { width: 48px; height: 48px; }

.illus-orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: orbitSpin 20s linear infinite;
}

.illus-orbit-ring--1 { width: 180px; height: 180px; }
.illus-orbit-ring--2 { width: 210px; height: 210px; animation-direction: reverse; animation-duration: 28s; }

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

.illus-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.illus-step {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
}

.illus-step--active {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: #0a0a0c;
  box-shadow: 0 0 20px var(--theme-glow);
}

.illus-step--done {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
}

.illus-bubble {
  position: absolute;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  animation: illusFloat 4s ease-in-out infinite;
}

.illus-bubble--1 { width: 70px; height: 32px; top: 20px; left: 10px; animation-delay: 0.3s; }
.illus-bubble--2 { width: 55px; height: 26px; top: 40px; right: 8px; animation-delay: 0.8s; }
.illus-bubble--3 { width: 65px; height: 28px; bottom: 25px; left: 20px; animation-delay: 0.1s; }

.illus-ai-core {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--theme-accent), transparent 70%);
  box-shadow: 0 0 40px var(--theme-glow);
  animation: aiPulse 3s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.12); opacity: 1; }
}

.illus-phone-screen {
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.illus-phone-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--theme-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0c;
  box-shadow: 0 4px 20px var(--theme-glow);
}

.illus-phone-icon svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════════════════
   ORBIT
   ═══════════════════════════════════════════════════════════ */
.orbit {
  position: absolute;
  inset: 0;
  z-index: 12;
  touch-action: pan-x;
}

.orbit__track {
  position: absolute;
  left: 50%;
  top: calc(42% + var(--safe-t) * 0.3);
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  perspective: 900px;
}

.orbit__track::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--orbit-r) * 2 + var(--icon-size));
  height: calc(var(--orbit-r) * 2 + var(--icon-size));
  margin: calc((var(--orbit-r) * -1) - var(--icon-size) / 2) 0 0 calc((var(--orbit-r) * -1) - var(--icon-size) / 2);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 0;
  pointer-events: none;
}

.orbit__track::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--orbit-r) * 2);
  height: calc(var(--orbit-r) * 2);
  margin: calc(var(--orbit-r) * -1) 0 0 calc(var(--orbit-r) * -1);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 58%, rgba(255,255,255,0.02) 59%, transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.app[data-state="orbit"] .orbit__track::before,
.app[data-state="focused"] .orbit__track::before {
  animation: ringAppear 0.8s var(--ease-out-expo) 0.08s forwards;
}

.app[data-state="orbit"] .orbit__track::after,
.app[data-state="focused"] .orbit__track::after {
  animation: ringAppear 0.8s var(--ease-out-expo) 0.16s forwards;
}

.app[data-state="intro"] .orbit__hint {
  opacity: 0;
}

.app[data-state="orbit"] .orbit__hint {
  animation: hintFadeIn 0.45s var(--ease-out-expo) 0.65s forwards;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes hintFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.orbit__hint {
  position: absolute;
  bottom: calc(16px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(245, 245, 247, 0.22);
  opacity: 0;
  pointer-events: none;
}

.app[data-state="orbit"] .orbit__hint span {
  display: block;
  animation: hintPulse 3s ease-in-out 1.2s infinite;
}

/* ─── 3D Orbit Icon ─── */
.orbit-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--icon-size);
  height: calc(var(--icon-size) + 22px);
  margin-left: calc(var(--icon-size) / -2);
  margin-top: calc(var(--icon-size) / -2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.orbit-icon__body {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
  transform-style: preserve-3d;
  animation: iconBreathe 4s ease-in-out infinite;
}

.orbit-icon__body-inner {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease-spring);
}

.orbit-icon__glass {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 24px var(--icon-glow, rgba(255,255,255,0.08)),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateZ(8px);
}

.orbit-icon__glass::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at var(--hl-x, 30%) var(--hl-y, 25%),
    rgba(255, 255, 255, 0.35) 0%,
    transparent 45%
  );
  pointer-events: none;
  transition: background 0.15s;
}

.orbit-icon__glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 60%
  );
  pointer-events: none;
}

.orbit-icon__rim {
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.02) 60%,
    rgba(255, 255, 255, 0.25) 100%
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
  pointer-events: none;
  transform: translateZ(10px);
}

.orbit-icon__shadow {
  position: absolute;
  bottom: -8px;
  left: 10%;
  width: 80%;
  height: 12px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  filter: blur(4px);
  transform: translateZ(-4px) rotateX(80deg);
  opacity: 0.6;
}

.orbit-icon__svg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 245, 247, 0.9);
  transform: translateZ(14px);
  transition: color 0.4s, transform 0.35s var(--ease-spring);
}

.orbit-icon__svg svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.orbit-icon__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.55;
  transform: translateY(0) translateZ(6px);
  transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo), color 0.35s;
  pointer-events: none;
}

.orbit-icon.is-active .orbit-icon__label {
  opacity: 1;
  transform: translateY(0) translateZ(6px);
  color: var(--text);
}

.orbit-icon.is-active .orbit-icon__svg {
  color: var(--icon-accent, var(--theme-accent));
}

.orbit-icon.is-active .orbit-icon__glass {
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 32px var(--icon-glow, var(--theme-glow)),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.orbit-icon.is-focused .orbit-icon__body-inner {
  transform: scale(1.18) rotateZ(6deg);
}

.orbit-icon.is-pressing .orbit-icon__body-inner {
  transform: scale(0.88) translateZ(-4px);
}

.orbit-icon.is-pressing .orbit-icon__ripple {
  animation: rippleOut 0.5s var(--ease-out-expo) forwards;
}

.orbit-icon__ripple {
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  border: 1px solid var(--icon-accent, var(--theme-accent));
  opacity: 0;
  pointer-events: none;
}

@keyframes rippleOut {
  0% { opacity: 0.6; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.4); }
}

@keyframes iconBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.orbit-icon:nth-child(1) .orbit-icon__body { animation-delay: 0s; }
.orbit-icon:nth-child(2) .orbit-icon__body { animation-delay: 0.6s; }
.orbit-icon:nth-child(3) .orbit-icon__body { animation-delay: 1.2s; }
.orbit-icon:nth-child(4) .orbit-icon__body { animation-delay: 1.8s; }
.orbit-icon:nth-child(5) .orbit-icon__body { animation-delay: 2.4s; }
.orbit-icon:nth-child(6) .orbit-icon__body { animation-delay: 3s; }

/* Orbit entrance stagger */
.orbit-icon {
  opacity: 0;
  filter: blur(8px);
}

.app[data-state="orbit"] .orbit-icon,
.app[data-state="focused"] .orbit-icon {
  animation: orbitIconIn 0.7s var(--ease-out-expo) forwards;
}

.orbit-icon:nth-child(1) { animation-delay: 0.28s; }
.orbit-icon:nth-child(2) { animation-delay: 0.36s; }
.orbit-icon:nth-child(3) { animation-delay: 0.44s; }
.orbit-icon:nth-child(4) { animation-delay: 0.52s; }
.orbit-icon:nth-child(5) { animation-delay: 0.60s; }
.orbit-icon:nth-child(6) { animation-delay: 0.68s; }

@keyframes orbitIconIn {
  from { opacity: 0; filter: blur(8px); }
  to { opacity: 1; filter: blur(0); }
}

.app[data-state="focused"] .orbit-icon:not(.is-focused) {
  pointer-events: none;
}

/* Back affordance */
.stage__back {
  position: absolute;
  top: calc(12px + var(--safe-t));
  left: calc(16px + var(--safe-l));
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  visibility: hidden;
  z-index: 40;
  cursor: pointer;
  pointer-events: none;
  touch-action: manipulation;
  will-change: transform, opacity;
}

.stage__back:active {
  transform: scale(0.92) !important;
  background: rgba(255, 255, 255, 0.1);
}
.stage__back svg { width: 20px; height: 20px; opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════
   DESKTOP ENHANCEMENTS
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root {
    --orbit-r: 168px;
    --icon-size: 68px;
  }

  .core { width: 96px; height: 96px; }
  .stage__panel { max-width: 440px; }
  .stage__illus { width: 260px; height: 260px; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   TOUCH — same visuals, GPU-friendly rendering
   ═══════════════════════════════════════════════════════════ */

.app.is-touch .bg__aurora,
.app.is-touch .bg__noise {
  display: none;
}

.app.is-touch .bg__mesh {
  filter: blur(32px);
}

.app.is-touch .bg__glow {
  filter: blur(55px);
}

.app.is-touch .orbit-icon__glass,
.app.is-touch .core__emblem,
.app.is-touch .illus-glass,
.app.is-touch .stage__btn--ghost,
.app.is-touch .stage__back {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app.is-touch.orbit-track-mode .orbit__track {
  transform: rotate(var(--orbit-angle, 0rad));
  transform-style: flat;
  will-change: transform;
}

.app.is-touch.orbit-track-mode .orbit-icon {
  transform-origin: 50% calc(var(--icon-size) / (var(--icon-size) + 22px) * 50%);
  transform:
    translate3d(var(--focus-tx, 0), var(--focus-ty, 0), 0)
    rotate(var(--slot-angle))
    translate3d(0, var(--orbit-r), 0)
    rotate(calc(-1 * var(--slot-angle) - var(--orbit-angle, 0rad)))
    scale(var(--icon-scale, 1));
  opacity: var(--icon-opacity, 1);
  filter: none;
  transform-style: flat;
}

.app.is-touch.orbit-track-mode .orbit-icon.is-focused {
  height: var(--icon-size);
  transform-origin: 50% 50%;
}

.app.is-touch.orbit-track-mode .orbit-icon.is-focused .orbit-icon__label {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.app.is-touch.orbit-track-mode .orbit-icon.is-focused .orbit-icon__body-inner {
  transform: none;
}

.app.is-touch[data-state="focused"] .stage__illus-inner {
  animation: none;
}

.app.is-touch[data-state="focused"] .orbit-icon.is-focused {
  z-index: 60;
}

.app.is-touch.orbit-track-mode .orbit-icon__glass {
  transform: none;
}

.app.is-touch .orbit-icon,
.app.is-touch .orbit-icon__body,
.app.is-touch .core,
.app.is-touch .stage__panel,
.app.is-touch .stage__back,
.app.is-touch {
  will-change: auto;
}
