:root {
  --ground-1: #0b0c1a;
  --ground-2: #14152b;
  --nebula: radial-gradient(ellipse 60% 40% at 20% 0%, rgba(123,97,255,0.25), transparent 60%),
            radial-gradient(ellipse 50% 35% at 85% 15%, rgba(56,189,224,0.16), transparent 55%),
            radial-gradient(ellipse 60% 50% at 50% 100%, rgba(219,39,119,0.14), transparent 60%);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-hover: rgba(255, 255, 255, 0.10);
  --ink: #f2f1f8;
  --ink-soft: #b7b4c9;
  --ink-faint: #7d7a94;
  --accent: #8b7bff;
  --shadow-rest: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 30px -14px rgba(0,0,0,0.6);
  --shadow-hover: 0 1px 0 rgba(255,255,255,0.08) inset, 0 28px 56px -18px rgba(90,60,220,0.35);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="light"] {
  --ground-1: #eef0fb;
  --ground-2: #f7f4fb;
  --nebula: radial-gradient(ellipse 60% 40% at 20% 0%, rgba(123,97,255,0.14), transparent 60%),
            radial-gradient(ellipse 50% 35% at 85% 15%, rgba(56,189,224,0.10), transparent 55%),
            radial-gradient(ellipse 60% 50% at 50% 100%, rgba(219,39,119,0.08), transparent 60%);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-hover: rgba(255, 255, 255, 0.7);
  --ink: #1d1d1f;
  --ink-soft: #55536b;
  --ink-faint: #8a87a0;
  --accent: #6753e8;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--nebula), linear-gradient(180deg, var(--ground-1), var(--ground-2));
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

#galaxy {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 5.5rem 2rem 5rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 590;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

footer {
  text-align: center;
}

/* --- Orbit system --- */

.orbit-system {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 2rem;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed var(--glass-border);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.orbit-ring-inner {
  width: 58%;
  height: 58%;
}

.orbit-ring-outer {
  width: 100%;
  height: 100%;
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.logo-badge {
  width: 176px;
  height: 176px;
  border-radius: 36px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow-hover), 0 0 60px -10px rgba(139,123,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.6rem;
  animation: logo-pulse 4s ease-in-out infinite;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.orbit-layer {
  position: absolute;
  inset: 0;
  animation: spin var(--orbit-duration) linear infinite;
}

.orbit-layer:hover {
  animation-play-state: paused;
}

.orbit-layer:hover .orbit-pos > .tool {
  animation-play-state: paused;
}

.orbit-layer-inner {
  --orbit-duration: 40s;
  --orbit-radius: 150px;
}

.orbit-layer-outer {
  --orbit-duration: 64s;
  --orbit-radius: 258px;
  animation-direction: reverse;
}

.orbit-pos {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--angle)) translateX(var(--orbit-radius));
}

.tool {
  position: absolute;
  top: 0;
  left: 0;
  width: 148px;
  margin: -54px 0 0 -74px;
  display: block;
  padding: 1.1rem 1.05rem 1.2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow-rest);
  transform-origin: center;
  animation: spin-counter var(--orbit-duration) linear infinite;
  transition: box-shadow 0.3s ease, background 0.3s ease;
  will-change: transform;
}

.orbit-layer-outer .tool {
  animation-name: spin;
}

.tool:hover,
.tool:focus-visible {
  z-index: 4;
  box-shadow: var(--shadow-hover);
  background: var(--glass-hover);
}

.tool:hover .tool-inner,
.tool:focus-visible .tool-inner {
  transform: scale(1.08);
}

.tool:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tool-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  transition: transform 0.3s var(--spring);
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 10px -4px rgba(0,0,0,0.45);
}

.icon svg {
  width: 21px;
  height: 21px;
}

.icon-todo  { background: linear-gradient(160deg, #34d399, #059669); }
.icon-crm   { background: linear-gradient(160deg, #8b7bff, #5b3fe0); }
.icon-shop  { background: linear-gradient(160deg, #fb923c, #ea580c); }
.icon-calc  { background: linear-gradient(160deg, #38bde0, #0e7ea8); }
.icon-plan  { background: linear-gradient(160deg, #f472b6, #db2777); }

.tool-name {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.tool-desc {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
}

footer {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-faint);
}

/* --- Dancing chicken --- */

.chicken {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  animation: chicken-bob 0.6s ease-in-out infinite;
}

.chicken-flip {
  transform: scaleX(-1);
  animation: chicken-bob-flip 0.6s ease-in-out infinite;
}

.chicken-body {
  position: relative;
  width: 34px;
  height: 30px;
  background: #fefaf1;
  border-radius: 60% 60% 55% 55%;
  box-shadow: inset -4px -3px 0 rgba(0,0,0,0.05);
}

.chicken-head {
  position: absolute;
  top: -14px;
  left: 3px;
  width: 18px;
  height: 16px;
  background: #fefaf1;
  border-radius: 50%;
  animation: chicken-head-bob 0.6s ease-in-out infinite;
  transform-origin: bottom center;
}

.chicken-comb {
  position: absolute;
  top: -6px;
  left: 5px;
  width: 8px;
  height: 6px;
  background: #ef4444;
  border-radius: 50% 50% 0 0;
}

.chicken-eye {
  position: absolute;
  top: 5px;
  left: 11px;
  width: 2.5px;
  height: 2.5px;
  background: #1d1d1f;
  border-radius: 50%;
}

.chicken-beak {
  position: absolute;
  top: 8px;
  left: 15px;
  width: 0;
  height: 0;
  border-top: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  border-left: 6px solid #f59e0b;
}

.chicken-wattle {
  position: absolute;
  top: 10px;
  left: 8px;
  width: 3px;
  height: 4px;
  background: #ef4444;
  border-radius: 0 0 50% 50%;
}

.chicken-wing {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 13px;
  height: 16px;
  background: #f3ead9;
  border-radius: 50% 40% 50% 40%;
  transform-origin: top center;
  animation: chicken-wing-flap 0.3s ease-in-out infinite;
}

.chicken-tail {
  position: absolute;
  top: -4px;
  right: -3px;
  width: 12px;
  height: 14px;
  background: #f3ead9;
  border-radius: 50% 50% 50% 0;
  transform: rotate(25deg);
}

.chicken-leg {
  position: absolute;
  bottom: -7px;
  width: 3px;
  height: 8px;
  background: #f59e0b;
  border-radius: 1px;
}

.chicken-leg-l { left: 9px; animation: chicken-leg-l 0.6s ease-in-out infinite; }
.chicken-leg-r { right: 9px; animation: chicken-leg-r 0.6s ease-in-out infinite; }

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

@keyframes spin-counter {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes logo-pulse {
  0%, 100% { box-shadow: var(--shadow-hover), 0 0 60px -10px rgba(139,123,255,0.45); }
  50% { box-shadow: var(--shadow-hover), 0 0 80px -6px rgba(139,123,255,0.65); }
}

@keyframes chicken-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-3px) rotate(4deg); }
}

@keyframes chicken-bob-flip {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(-4deg); }
  50% { transform: scaleX(-1) translateY(-3px) rotate(4deg); }
}

@keyframes chicken-head-bob {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(8deg); }
}

@keyframes chicken-wing-flap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-25deg); }
}

@keyframes chicken-leg-l {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-10deg); }
}

@keyframes chicken-leg-r {
  0%, 100% { transform: translateY(-2px) rotate(10deg); }
  50% { transform: translateY(0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tool {
    transition: none;
  }
  .chicken, .chicken-flip, .chicken-head, .chicken-wing, .chicken-leg-l, .chicken-leg-r {
    animation: none;
  }
  .orbit-layer, .tool, .logo-badge {
    animation: none;
  }
}

@media (max-width: 640px) {
  .orbit-system {
    max-width: 100%;
    aspect-ratio: auto;
    min-height: 620px;
  }
  .tool {
    width: 128px;
    margin: -48px 0 0 -64px;
    padding: 0.9rem 0.85rem 1rem;
  }
  .logo-badge {
    width: 92px;
    height: 92px;
  }
  .orbit-ring-inner { width: 62%; height: auto; aspect-ratio: 1/1; }
  .orbit-ring-outer { width: 96%; height: auto; aspect-ratio: 1/1; }
}
