@font-face {
  font-family: 'Cabinet Grotesk';
  src: local('Cabinet Grotesk');
}

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

:root {
  --bg-primary: #09090b;
  --bg-secondary: #0c0c0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #fafafa;
  --text-secondary: rgba(250, 250, 250, 0.55);
  --text-muted: rgba(250, 250, 250, 0.3);
  --accent-500: #369876;
  --accent-400: #44b88d;
  --accent-600: #2a7a5e;
  --accent-glow: rgba(54, 152, 118, 0.15);
  --accent-glow-strong: rgba(54, 152, 118, 0.25);
  --accent-fill-08: rgba(54, 152, 118, 0.08);
  --accent-fill-06: rgba(54, 152, 118, 0.06);
  --accent-fill-05: rgba(54, 152, 118, 0.05);
  --accent-fill-04: rgba(54, 152, 118, 0.04);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Satoshi', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px;
  pointer-events: none;
  z-index: 100;
}


/* ===================== PRELOADER ===================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-svg {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 30px var(--accent-glow-strong));
}

.hex-outline {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: hexDraw 1.6s ease-in-out forwards;
}

@keyframes hexDraw {
  to { stroke-dashoffset: 0; }
}

.loader-gear {
  transform-origin: 60px 60px;
  animation: loaderSpin 2s linear infinite;
}

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

.loader-dot {
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { r: 4; opacity: 0.6; }
  50% { r: 7; opacity: 1; }
}

.orbit-arc {
  transform-origin: 60px 60px;
  stroke-dasharray: 30 60;
  animation: orbitSpin 1.8s linear infinite;
}

.orbit-arc-reverse {
  transform-origin: 60px 60px;
  stroke-dasharray: 20 70;
  animation: orbitSpinReverse 2.4s linear infinite;
}

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

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

.preloader-bar-track {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 2rem;
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-600), var(--accent-400));
  border-radius: 2px;
  animation: barFill 2.2s ease-in-out forwards;
  box-shadow: 0 0 8px var(--accent-glow-strong);
}

@keyframes barFill {
  0%   { width: 0%; }
  30%  { width: 45%; }
  60%  { width: 70%; }
  85%  { width: 90%; }
  100% { width: 100%; }
}

.preloader-text {
  margin-top: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.3s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}


/* ===================== MAIN PAGE ===================== */

.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0;
  pointer-events: none;
}

.ambient-glow--accent {
  background: var(--accent-500);
  top: 20%;
  left: 25%;
}

.ambient-glow--dim {
  background: rgba(54, 152, 118, 0.4);
  bottom: 10%;
  right: 20%;
  width: 400px;
  height: 400px;
}

@keyframes glowFadeIn {
  to { opacity: 0.07; }
}

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -15px) scale(1.05); }
  66%       { transform: translate(-15px, 10px) scale(0.95); }
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.container {
  display: flex;
  align-items: center;
  gap: 5rem;
  max-width: 1100px;
  width: 100%;
}

/* SVG illustration */
.illustration {
  flex-shrink: 0;
  width: 380px;
  height: 380px;
  position: relative;
  opacity: 0;
  transform: scale(0.92);
  will-change: transform, opacity;
}

.illustration svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 40px var(--accent-glow));
}

/* Gear animations — paused until revealed */
.gear-large {
  transform-origin: 170px 190px;
  animation: rotateCW 12s linear infinite;
  animation-play-state: paused;
}

.gear-small {
  transform-origin: 285px 120px;
  animation: rotateCCW 8s linear infinite;
  animation-play-state: paused;
}

.gear-tiny {
  transform-origin: 110px 90px;
  animation: rotateCW 6s linear infinite;
  animation-play-state: paused;
}

.wrench-group {
  transform-origin: 200px 200px;
  animation: wrenchSwing 4s ease-in-out infinite;
  animation-play-state: paused;
}

.pulse-ring {
  transform-origin: 200px 200px;
  animation: pulseRing 3s ease-in-out infinite;
  animation-play-state: paused;
}

.pulse-ring-delayed {
  transform-origin: 200px 200px;
  animation: pulseRing 3s ease-in-out 1s infinite;
  animation-play-state: paused;
}

.float-particle {
  animation: floatUp 5s ease-in-out infinite;
  animation-play-state: paused;
}

.float-particle:nth-child(2) {
  animation-delay: 1.5s;
  animation-duration: 6s;
}

.float-particle:nth-child(3) {
  animation-delay: 3s;
  animation-duration: 4.5s;
}

/* Resume SVG inner animations after reveal — staggered so gears spin up after illustration fades in */
.revealed .gear-large       { animation-play-state: running; animation-delay: 0.4s; }
.revealed .gear-small       { animation-play-state: running; animation-delay: 0.5s; }
.revealed .gear-tiny        { animation-play-state: running; animation-delay: 0.6s; }
.revealed .wrench-group     { animation-play-state: running; animation-delay: 0.5s; }
.revealed .pulse-ring       { animation-play-state: running; animation-delay: 0.7s; }
.revealed .pulse-ring-delayed { animation-play-state: running; animation-delay: 1.2s; }
.revealed .float-particle   { animation-play-state: running; animation-delay: 0.8s; }

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

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

@keyframes wrenchSwing {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(8deg); }
  75%      { transform: rotate(-8deg); }
}

@keyframes pulseRing {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50%      { opacity: 0.3; transform: scale(1.1); }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50%      { transform: translateY(-12px) scale(1.1); opacity: 0.8; }
}

/* Content section */
.content {
  flex: 1;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.4rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 1.75rem;
  opacity: 0;
  transform: translateY(12px);
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow-strong);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-glow-strong); }
  50%      { opacity: 0.5; box-shadow: 0 0 16px var(--accent-glow-strong); }
}

.heading {
  font-family: 'Cabinet Grotesk', 'Satoshi', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateY(16px);
}

.heading span {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 480px;
  font-weight: 300;
  opacity: 0;
  transform: translateY(16px);
}

.divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-500), transparent);
  margin: 1.75rem 0;
  opacity: 0;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(16px);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
  text-decoration: none;
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-discord:hover {
  background: var(--accent-400);
  box-shadow: 0 0 30px var(--accent-glow-strong), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.btn-discord:active {
  transform: translateY(0);
}

.btn-discord svg {
  width: 18px;
  height: 18px;
}

.status-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

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

@keyframes illustrationIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Footer */
.footer {
  padding: 1.25rem 2rem;
  text-align: center;
  opacity: 0;
}

.footer-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.footer-text .separator {
  margin: 0 0.15rem;
}

.footer-credit {
  color: rgba(250, 250, 250, 0.2);
}

/* Page-reveal animations (triggered by JS adding .revealed to body) */
.revealed .ambient-glow--accent {
  animation: glowFadeIn 2.5s ease-out 0.8s forwards, glowFloat 8s ease-in-out infinite 3s;
}

.revealed .ambient-glow--dim {
  animation: glowFadeIn 3s ease-out 1.2s forwards, glowFloat 10s ease-in-out infinite reverse 3.5s;
}

.revealed .illustration {
  animation: illustrationIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.revealed .badge       { animation: fadeUp 0.7s ease-out 0.30s forwards; }
.revealed .heading     { animation: fadeUp 0.7s ease-out 0.50s forwards; }
.revealed .description { animation: fadeUp 0.7s ease-out 0.70s forwards; }
.revealed .divider     { animation: fadeUp 0.7s ease-out 0.85s forwards; }
.revealed .cta-row     { animation: fadeUp 0.7s ease-out 1.00s forwards; }
.revealed .footer      { animation: fadeUp 0.7s ease-out 1.30s forwards; }


/* ===================== RESPONSIVE ===================== */

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
  }

  .illustration {
    width: 260px;
    height: 260px;
  }

  .description {
    max-width: 520px;
    margin: 0 auto;
  }

  .divider {
    margin: 1.5rem auto;
  }

  .cta-row {
    justify-content: center;
    flex-wrap: wrap;
  }

  html, body {
    overflow: auto;
    overflow-x: hidden;
  }
}

@media (max-width: 500px) {
  .main {
    padding: 1.5rem 1.25rem;
  }

  .illustration {
    width: 200px;
    height: 200px;
  }

  .heading {
    font-size: 1.8rem;
  }

  .description {
    font-size: 0.95rem;
  }

  .badge {
    font-size: 0.72rem;
  }

  .footer {
    padding: 1rem 1.25rem;
  }
}
