/* ============================================
   Stillmind Hub — Professional Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #0a0a0f;
  --color-bg-alt: #11111a;
  --color-surface: #161625;
  --color-surface-hover: #1e1e32;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(120, 100, 255, 0.25);
  --color-text: #e8e8f0;
  --color-text-muted: #8888a0;
  --color-primary: #7c6aff;
  --color-primary-glow: rgba(124, 106, 255, 0.35);
  --color-accent: #00e0a0;
  --color-accent-glow: rgba(0, 224, 160, 0.2);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1140px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Animated Background Grid --- */
.background-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(124, 106, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 106, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridFloat 20s ease-in-out infinite;
}

@keyframes gridFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-15px, -15px); }
}

/* Gradient overlay on top of grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 106, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 224, 160, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  background: rgba(10, 10, 15, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--transition);
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav a:hover {
  color: var(--color-text);
}

.nav a:hover::after {
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

.hero-content {
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 20px rgba(124, 106, 255, 0.0)); }
  100% { filter: drop-shadow(0 0 40px rgba(124, 106, 255, 0.3)); }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--color-text-muted);
  font-weight: 300;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-primary:hover {
  background: #6b58f0;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--color-primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.btn-download {
  width: 100%;
}

/* --- Sections --- */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
  text-align: center;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px var(--color-primary-glow);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text);
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

/* --- Ecosystem Grid --- */
.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* --- Downloads --- */
.downloads-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.select {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.picker-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hint {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-accent);
  min-height: 1.4em;
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}


.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* --- Download Cards --- */
.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.download-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--color-primary-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.download-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  color: var(--color-text);
}

.download-card:hover::after {
  opacity: 1;
}

.download-card > * {
  position: relative;
  z-index: 1;
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.download-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.download-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(124, 106, 255, 0.1);
  color: var(--color-primary);
  transition: all var(--transition);
}

.download-card:hover .download-btn {
  background: var(--color-primary);
  color: #fff;
}

.download-card-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-card-disabled:hover {
  transform: none;
  border-color: var(--color-border);
}

.download-card-disabled:hover::after {
  opacity: 0;
}

.download-card-disabled:hover .download-btn {
  background: rgba(124, 106, 255, 0.1);
  color: var(--color-primary);
}

/* --- About Section --- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-pro {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
}

.about-headline {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.about-subheadline {
  color: var(--color-primary);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.about-location {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.about-pro > p {
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.about-list {
  list-style: none;
  padding: 0;
  margin-bottom: 8px;
}

.about-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.about-contact {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.about-contact p {
  margin-bottom: 8px;
  font-size: 0.93rem;
}

.about-socials {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.about-socials p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* --- Footer --- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer strong {
  color: var(--color-text);
}

/* --- Fade-in Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid children */
.ecosystem-grid .card:nth-child(1) { transition-delay: 0s; }
.ecosystem-grid .card:nth-child(2) { transition-delay: 0.1s; }
.ecosystem-grid .card:nth-child(3) { transition-delay: 0.2s; }
.ecosystem-grid .card:nth-child(4) { transition-delay: 0.3s; }

.downloads-grid .download-card:nth-child(1),
.downloads-grid .download-card-disabled:nth-child(1) { transition-delay: 0s; }
.downloads-grid .download-card:nth-child(2),
.downloads-grid .download-card-disabled:nth-child(2) { transition-delay: 0.1s; }
.downloads-grid > :nth-child(3) { transition-delay: 0.2s; }
.downloads-grid > :nth-child(4) { transition-delay: 0.3s; }

/* --- Floating Particles (via JS) --- */
.particle {
  position: fixed;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-20vh) scale(1);
  }
}

/* --- Pulse animation for primary buttons --- */
.btn-primary {
  animation: btnPulse 3s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--color-primary-glow); }
  50% { box-shadow: 0 4px 35px var(--color-primary-glow), 0 0 60px rgba(124, 106, 255, 0.15); }
}

/* --- Typing cursor for hero (optional via JS) --- */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-primary);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Mobile hamburger --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all var(--transition);
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-alt);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 40px;
    transition: right var(--transition);
    border-left: 1px solid var(--color-border);
    z-index: 200;
  }

  .nav.open {
    right: 0;
  }

  .nav a {
    font-size: 1.1rem;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .section {
    padding: 60px 0;
  }

  .picker-grid {
    grid-template-columns: 1fr;
  }

  .picker-actions {
    flex-direction: column;
  }

  .about-pro {
    padding: 24px;
  }

  .about-socials {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}

/* --- Scroll progress bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 1000;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}
