:root {
  color-scheme: dark;
  --ink: #f7faf8;
  --muted: #9db0aa;
  --panel: rgba(247, 250, 248, 0.07);
  --line: rgba(247, 250, 248, 0.16);
  --accent: #62d6bd;
  --accent-soft: rgba(98, 214, 189, 0.24);
  --rose: #e4a2b0;
  --amber: #e3cb76;
  --bg: #101615;
  font-family: "Outfit", "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body.home-page {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 30%, rgba(98, 214, 189, 0.22), transparent 30vw),
    radial-gradient(circle at 18% 76%, rgba(228, 162, 176, 0.16), transparent 26vw),
    linear-gradient(135deg, #101615 0%, #15211e 45%, #0f1518 100%);
}

body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 60% 42%, black, transparent 72%);
}

body.home-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 0 50%, rgba(247, 250, 248, 0.03) 50% 100%);
  background-size: 100% 6px;
  opacity: 0.35;
}

.happi-stage {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}

.happi-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
}

.brand-mark,
.studio-link {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}

.brand-sigil {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(247, 250, 248, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.studio-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 250, 248, 0.06);
  color: #dce8e4;
  font-size: 13px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.studio-link:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 214, 189, 0.42);
  background: rgba(98, 214, 189, 0.12);
}

.happi-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: 40px;
  align-items: center;
  padding: 24px 0 48px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.hero-kicker {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(58px, 10vw, 132px);
  line-height: 0.88;
  letter-spacing: 0;
  font-weight: 900;
}

.hero-text {
  width: min(100%, 520px);
  margin: 28px 0 0;
  color: #b9c8c3;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.word-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.word-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(247, 250, 248, 0.055);
  color: #d8e4df;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.motion-field {
  position: relative;
  min-height: 640px;
  border: 1px solid rgba(247, 250, 248, 0.1);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(247, 250, 248, 0.08), rgba(247, 250, 248, 0.02)),
    radial-gradient(circle at 52% 46%, rgba(98, 214, 189, 0.14), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 40px 110px rgba(4, 9, 9, 0.38);
  overflow: hidden;
}

.motion-field::before,
.motion-field::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(247, 250, 248, 0.08);
  border-radius: 42% 58% 52% 48%;
  animation: drift 16s ease-in-out infinite alternate;
}

.motion-field::after {
  inset: 18%;
  border-color: rgba(98, 214, 189, 0.16);
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.core-orbit {
  position: absolute;
  width: min(58%, 360px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(98, 214, 189, 0.36);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: orbitSpin 18s linear infinite;
}

.core-orbit::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 214, 189, 0.34), rgba(98, 214, 189, 0.04) 62%, transparent 64%);
  filter: blur(1px);
}

.core-word {
  position: relative;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border: 1px solid rgba(247, 250, 248, 0.18);
  border-radius: 50%;
  background: rgba(16, 22, 21, 0.72);
  color: #eef8f4;
  font-size: 22px;
  font-weight: 800;
  animation: counterSpin 18s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.dot-a { top: -6px; left: 50%; }
.dot-b { right: 10%; bottom: 9%; background: var(--rose); }
.dot-c { left: 4%; bottom: 26%; background: var(--amber); }

.signal-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  aspect-ratio: 1;
  border: 1px solid rgba(98, 214, 189, 0.28);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.62);
  opacity: 0;
  animation: pulseRing 4.8s ease-out infinite;
}

.ring-two { animation-delay: 1.6s; }
.ring-three { animation-delay: 3.2s; }

.floating-token {
  position: absolute;
  border: 1px solid rgba(247, 250, 248, 0.14);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(247, 250, 248, 0.075);
  color: #e8f1ee;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  animation: tokenFloat 6s ease-in-out infinite alternate;
}

.token-create { left: 12%; top: 18%; color: var(--accent); }
.token-diy { right: 14%; top: 24%; animation-delay: -1.5s; color: var(--amber); }
.token-joy { right: 18%; bottom: 20%; animation-delay: -3s; color: var(--rose); }
.token-build { left: 16%; bottom: 24%; animation-delay: -4.5s; }

.circuit-line {
  position: absolute;
  height: 1px;
  width: 36%;
  background: linear-gradient(90deg, transparent, rgba(98, 214, 189, 0.6), transparent);
  opacity: 0.46;
  animation: scanLine 5.4s ease-in-out infinite alternate;
}

.line-a { left: 8%; top: 34%; }
.line-b { right: 8%; top: 63%; animation-delay: -1.8s; }
.line-c { left: 30%; bottom: 12%; animation-delay: -3.6s; }

.happi-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 26px;
  color: rgba(247, 250, 248, 0.54);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

@keyframes orbitSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

@keyframes pulseRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.58); }
  16% { opacity: 0.58; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
}

@keyframes tokenFloat {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(12px, -16px, 0); }
}

@keyframes drift {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(18deg) scale(1.08); }
}

@keyframes scanLine {
  from { transform: translate3d(-18px, 0, 0); opacity: 0.18; }
  to { transform: translate3d(18px, 0, 0); opacity: 0.6; }
}

@media (max-width: 820px) {
  .happi-stage {
    width: min(100% - 28px, 680px);
  }

  .happi-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 18px;
  }

  .motion-field {
    min-height: 420px;
    border-radius: 26px;
  }

  .happi-footer {
    flex-direction: column;
    gap: 8px;
  }
}

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