:root {
  /* Light theme variables */
  --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 50%, #f4fdf8 100%);
  --radial-bg: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.6) 50%, transparent 80%);
  --text-main: #334155;
  --text-muted: #64748b;
  --text-navy: #0f172a;
  
  --card-bg: rgba(255, 255, 255, 0.45);
  --card-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 30px 60px rgba(18, 47, 78, 0.06),
                 inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  
  --logo-bg: #ffffff;
  --logo-border: rgba(255, 255, 255, 0.8);
  --logo-shadow: 0 15px 35px rgba(18, 47, 78, 0.08),
                 inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --bubble-bg: #ffffff;
  --bubble-border: rgba(255, 255, 255, 0.8);
  --bubble-shadow: 0 10px 25px rgba(17, 45, 76, 0.06);

  --arrow-bg: rgba(255, 255, 255, 0.9);
  --arrow-border: rgba(255, 255, 255, 0.8);
  
  --blue: #0876d8;
  --cyan: #0798b8;
  --indigo: #5149e6;
  --green: #0fa775;
  
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  /* Dark theme overrides */
  --bg-gradient: linear-gradient(135deg, #020617 0%, #070e1e 50%, #010409 100%);
  --radial-bg: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.95) 50%, transparent 80%);
  --text-main: #94a3b8;
  --text-muted: #64748b;
  --text-navy: #f8fafc;
  
  --card-bg: rgba(13, 22, 38, 0.4);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 30px 70px rgba(0, 0, 0, 0.5),
                 inset 0 0 0 1px rgba(255, 255, 255, 0.03);
                 
  --logo-bg: #ffffff;
  --logo-border: rgba(255, 255, 255, 0.06);
  --logo-shadow: 0 15px 35px rgba(0, 0, 0, 0.4),
                 inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --bubble-bg: #ffffff;
  --bubble-border: rgba(255, 255, 255, 0.05);
  --bubble-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);

  --arrow-bg: rgba(15, 23, 42, 0.9);
  --arrow-border: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-gradient);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
  font-family:
    Outfit, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    var(--radial-bg),
    var(--bg-gradient);
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* Ambient Background Fluid Lights (antigravity.google style) */
body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 20% 30%, rgba(8, 118, 216, 0.14), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(15, 167, 117, 0.14), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(81, 73, 230, 0.1), transparent 30%);
  opacity: 0.95;
  z-index: -2;
  transition: opacity 0.5s var(--ease);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(8, 118, 216, 0.22), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(15, 167, 117, 0.22), transparent 35%),
    radial-gradient(circle at 50% 90%, rgba(81, 73, 230, 0.16), transparent 35%);
}

a {
  color: inherit;
  text-decoration: none;
}

.launcher {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 5vw, 64px);
}

/* Fluid morphing blobs */
.ambient {
  position: fixed;
  z-index: -1;
  width: 52vmax;
  height: 52vmax;
  border-radius: 999px;
  filter: blur(140px);
  opacity: 0.6;
  pointer-events: none;
  will-change: transform, opacity;
  transition: filter 0.5s var(--ease);
}

[data-theme="dark"] .ambient {
  opacity: 0.75;
}

.ambient-one {
  top: -22vmax;
  left: -16vmax;
  background: radial-gradient(circle, rgba(8, 118, 216, 0.32), transparent 65%);
  animation: fluidOne 24s ease-in-out infinite alternate;
}

.ambient-two {
  right: -20vmax;
  bottom: -22vmax;
  background: radial-gradient(circle, rgba(15, 167, 117, 0.28), transparent 65%);
  animation: fluidTwo 28s ease-in-out infinite alternate;
}

.ambient-three {
  top: 30%;
  right: 6%;
  width: 32vmax;
  height: 32vmax;
  background: radial-gradient(circle, rgba(81, 73, 230, 0.22), transparent 65%);
  animation: fluidThree 20s ease-in-out infinite alternate;
}

/* Floating Theme Switcher */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  color: var(--text-navy);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s var(--spring);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 10px 25px rgba(8, 118, 216, 0.25);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Glassmorphic Dashboard Card */
.launcher-stage {
  display: grid;
  width: min(940px, 100%);
  gap: clamp(36px, 6vw, 56px);
  place-items: center;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  transition: 
    background-color 0.5s var(--ease), 
    border-color 0.5s var(--ease), 
    box-shadow 0.5s var(--ease);
}

.brand-hero {
  display: grid;
  gap: 16px;
  place-items: center;
  text-align: center;
  animation: riseIn 800ms var(--ease) both;
}

.logo-orbit {
  position: relative;
  display: grid;
  width: clamp(120px, 14vw, 150px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  outline: none;
}

.logo-orbit:focus-visible,
.app-bubble:focus-visible {
  outline: 3px solid rgba(8, 118, 216, 0.4);
  outline-offset: 8px;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(8, 118, 216, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 15px 35px rgba(22, 58, 96, 0.05);
  will-change: transform, opacity;
  transition: border-color 0.5s var(--ease);
}

[data-theme="dark"] .logo-ring {
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.01),
    0 15px 35px rgba(0, 0, 0, 0.25);
}

.logo-ring-one {
  animation: rotateSoft 25s linear infinite;
}

.logo-ring-two {
  inset: 8px;
  border-color: rgba(15, 167, 117, 0.12);
  opacity: 0.78;
  animation: rotateSoftReverse 20s linear infinite;
}

[data-theme="dark"] .logo-ring-two {
  border-color: rgba(255, 255, 255, 0.03);
}

.logo-core {
  position: relative;
  display: grid;
  width: 86%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--logo-border);
  border-radius: 999px;
  background: var(--logo-bg);
  box-shadow: var(--logo-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.logo-core img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12%;
  display: block;
}

.brand-title {
  display: grid;
  gap: 6px;
}

.kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.5s var(--ease);
}

h1 {
  margin: 0;
  color: var(--text-navy);
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  transition: color 0.5s var(--ease);
}

/* App Grid Layout */
.app-orbit {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 24px);
  align-items: start;
}

/* Reverted Circular Link Bubble */
.app-bubble {
  --accent: var(--blue);
  --tint: rgba(8, 118, 216, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: center;
  outline: none;
  cursor: pointer;
  animation: bubbleIn 720ms var(--spring) both;
}

.app-bubble:nth-child(1) { animation-delay: 80ms; }
.app-bubble:nth-child(2) { animation-delay: 150ms; }
.app-bubble:nth-child(3) { animation-delay: 220ms; }
.app-bubble:nth-child(4) { animation-delay: 290ms; }

/* Perfect Circular Icon Container */
.bubble-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(114px, 12vw, 136px);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #ffffff 8%), color-mix(in srgb, var(--accent) 74%, #09213e 26%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 15px 30px color-mix(in srgb, var(--accent) 20%, transparent);
  transition: transform 0.4s var(--spring), box-shadow 0.3s var(--ease);
  overflow: hidden;
}

.bubble-icon--logo {
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  box-shadow: var(--bubble-shadow);
  transition: 
    transform 0.4s var(--spring), 
    box-shadow 0.3s var(--ease),
    background-color 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.bubble-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12%;
  display: block;
  border-radius: 50%;
}

/* Fallback icons styling */
.bubble-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 90%, #ffffff 10%), color-mix(in srgb, var(--accent) 70%, #09213e 30%));
  color: #ffffff;
  border-radius: 50%;
}

.bubble-icon-fallback svg {
  width: 40%;
  height: 40%;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Circle Hover micro-animations */
.app-bubble:hover .bubble-icon,
.app-bubble:focus-visible .bubble-icon {
  transform: translateY(-8px) scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 22px 45px color-mix(in srgb, var(--accent) 30%, transparent);
}

[data-theme="dark"] .app-bubble:hover .bubble-icon--logo,
[data-theme="dark"] .app-bubble:focus-visible .bubble-icon--logo {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 22px 45px rgba(0, 0, 0, 0.55),
    0 0 30px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Card Content styling */
.bubble-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bubble-name {
  color: var(--text-navy);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  font-weight: 800;
  line-height: 1.2;
  transition: color 0.5s var(--ease);
}

.bubble-meta {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.5s var(--ease);
}

/* Sibling Glow aura */
.bubble-aura {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(114px, 12vw, 136px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--spring);
}

.app-bubble:hover .bubble-aura,
.app-bubble:focus-visible .bubble-aura {
  opacity: 1;
  transform: translate(-50%, -8px) scale(1.3);
}

/* Action Arrow Indicator */
.bubble-arrow {
  position: absolute;
  top: 8px;
  right: calc(50% - clamp(57px, 6vw, 68px));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--arrow-border);
  background: var(--arrow-bg);
  color: var(--text-navy);
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translate(-4px, 4px) scale(0.85);
  transition: 
    opacity 0.3s var(--ease),
    transform 0.4s var(--spring),
    background-color 0.3s var(--ease),
    color 0.3s var(--ease);
  z-index: 2;
}

.app-bubble:hover .bubble-arrow,
.app-bubble:focus-visible .bubble-arrow {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Accent Colors */
.app-blue {
  --accent: var(--blue);
  --tint: rgba(8, 118, 216, 0.08);
}

.app-cyan {
  --accent: var(--cyan);
  --tint: rgba(7, 152, 184, 0.08);
}

.app-indigo {
  --accent: var(--indigo);
  --tint: rgba(81, 73, 230, 0.08);
}

.app-green {
  --accent: var(--green);
  --tint: rgba(15, 167, 117, 0.08);
}

/* Animations Keyframes */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.84);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rotateSoft {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateSoftReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Fluid fluid animations styled like antigravity.google */
@keyframes fluidOne {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate3d(8vw, -8vh, 0) scale(1.15) rotate(120deg);
  }
  66% {
    transform: translate3d(-6vw, 10vh, 0) scale(0.85) rotate(240deg);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1) rotate(360deg);
  }
}

@keyframes fluidTwo {
  0% {
    transform: translate3d(0, 0, 0) scale(1.1) rotate(360deg);
  }
  50% {
    transform: translate3d(-10vw, 8vh, 0) scale(0.9) rotate(180deg);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1.1) rotate(0deg);
  }
}

@keyframes fluidThree {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9) rotate(0deg);
  }
  50% {
    transform: translate3d(10vw, 6vh, 0) scale(1.2) rotate(-180deg);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(0.9) rotate(0deg);
  }
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .launcher {
    align-items: center;
    padding: 32px 24px;
  }

  .launcher-stage {
    gap: 36px;
    padding: 40px 32px;
  }

  .app-orbit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 20px;
  }
}

@media (max-width: 520px) {
  .launcher {
    padding: 24px 16px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  .launcher-stage {
    gap: 30px;
    padding: 32px 20px;
    border-radius: 30px;
  }

  .brand-hero {
    gap: 12px;
  }

  .logo-orbit {
    width: 110px;
  }

  .app-orbit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .app-bubble {
    gap: 10px;
  }

  .bubble-icon {
    width: clamp(96px, 20vw, 114px);
  }

  .bubble-name {
    font-size: 0.9rem;
  }

  .bubble-meta {
    font-size: 0.68rem;
  }

  .bubble-arrow {
    display: none;
  }
}

/* Prefers Reduced Motion settings */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
