:root {
  --bg: #f4f7ff;
  --surface: #ffffff;
  --text: #18253f;
  --muted: #5a6783;
  --primary: #2b70ff;
  --primary-2: #7340ff;
  --accent: #ff5f6d;
  --border: rgba(43, 112, 255, 0.15);
  --shadow: 0 20px 44px rgba(33, 66, 131, 0.12);
}

:root[data-theme='dark'] {
  --bg: #0f1728;
  --surface: #16203a;
  --text: #ecf1ff;
  --muted: #bfd1ff;
  --primary: #7ba2ff;
  --primary-2: #bd92ff;
  --accent: #ff8b98;
  --border: rgba(150, 172, 255, 0.28);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background-image: url('Background.PNG');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
}

.orb-1 {
  top: -120px;
  left: -80px;
  width: 340px;
  height: 340px;
  background: rgba(116, 105, 255, 0.2);
}

.orb-2 {
  right: -90px;
  bottom: 100px;
  width: 280px;
  height: 280px;
  background: rgba(255, 95, 109, 0.2);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

:root[data-theme='dark'] .top-bar {
  background: rgba(15, 23, 40, 0.82);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-fade {
  width: 44px;
  height: 44px;
}

.project-name-highlight {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--primary);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.main-content {
  max-width: 1050px;
  margin: 30px auto 70px;
  padding: 0 clamp(14px, 3vw, 26px);
  display: grid;
  gap: 24px;
}

.hero-section,
.interactive-section,
.stats-section,
.testimonial-section,
.community-form {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 34px);
}

.hero-section {
  text-align: center;
}

.logo-bounce {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.logo-bounce img {
  width: clamp(80px, 14vw, 110px);
  height: clamp(80px, 14vw, 110px);
  animation: floatLogo 2.8s ease-in-out infinite;
}

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

.welcome-title {
  margin: 10px 0 8px;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
}

.colorful {
  color: var(--accent);
}

.subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.16rem);
}

.button-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn.active,
.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(61, 95, 213, 0.24);
}

.pulse {
  animation: pulseGlow 2.2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 95, 213, 0.2); }
  70% { box-shadow: 0 0 0 12px rgba(61, 95, 213, 0); }
}

.interactive-section h2,
.stats-section h2,
.testimonial-section h2,
.community-form h2 {
  margin: 0 0 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.feature-card {
  background: linear-gradient(165deg, rgba(43, 112, 255, 0.12), rgba(255, 95, 109, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  transition: transform 0.2s ease;
}

.tilt-card:hover {
  transform: translateY(-4px);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.03rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(43, 112, 255, 0.08), transparent);
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.testimonial-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
}

.testimonial {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  color: var(--muted);
}

.testimonial-author {
  margin: 10px 0 0;
  font-weight: 600;
  color: var(--primary);
}

.community-form form {
  display: grid;
  gap: 12px;
}

.community-form input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 85%, #ffffff 15%);
}

.form-tip,
.form-message {
  margin: 10px 0 0;
  color: var(--muted);
}

.form-message {
  min-height: 1.2em;
}

footer {
  text-align: center;
  padding: 20px 14px 28px;
  color: #4a3b32; /* Deep, warm brown */
}

.scroll-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(61, 95, 213, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.confetti {
  position: fixed;
  top: -16px;
  width: 9px;
  height: 12px;
  border-radius: 2px;
  animation: fall 2.4s linear forwards;
  pointer-events: none;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(540deg);
    opacity: 0;
  }
}

@media (max-width: 680px) {
  .top-bar {
    padding: 14px;
  }

  .testimonial-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .control-btn {
    align-self: center;
  }
}

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