/* ============================================================
   MindWeave Labs — Design System
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Custom Properties --- */
:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-tertiary:   #1a1a2e;
  --text-primary:  #e8e8ed;
  --text-secondary:#8888a0;
  --accent:        #6c5ce7;
  --accent-glow:   #a78bfa;
  --accent-alt:    #00d4aa;
  --border:        #2a2a3e;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --section-pad: clamp(60px, 10vw, 100px);
}

/* --- Base --- */
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
}

p {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 65ch;
}

/* --- Header / Nav --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--accent-glow);
}

.logo svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

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

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    #1a0a2e 25%,
    #0a1a2e 50%,
    #0a2e1a 75%,
    var(--bg-primary) 100%
  );
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  z-index: -2;
}

.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.15;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero .container {
  position: relative;
}

.hero h1 {
  margin-bottom: 16px;
}

.hero h1 .accent {
  color: var(--accent-glow);
}

.tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--accent-alt);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.hero-cta {
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.hero-cta:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.3);
}

.hero-cta svg {
  width: 18px;
  height: 18px;
  display: inline;
}

/* --- Sections --- */
.section {
  padding: var(--section-pad) 0;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section p.lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 60ch;
  line-height: 1.7;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: rgba(18, 18, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(108, 92, 231, 0.1);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--accent-glow);
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Tools Section --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.tool-card {
  background: rgba(18, 18, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-alt);
  box-shadow: 0 12px 40px rgba(0, 212, 170, 0.1);
}

.tool-card .badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-alt);
  margin-bottom: 16px;
}

.tool-card h3 {
  margin-bottom: 10px;
}

.tool-card p {
  font-size: 0.9rem;
}

/* --- Content Section --- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.content-card {
  background: rgba(18, 18, 26, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.3s ease;
}

.content-card:hover {
  border-color: var(--accent);
}

.content-card .meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.content-card p {
  font-size: 0.9rem;
}

/* --- Divider --- */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* --- Footer --- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-glow);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

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

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    flex-direction: column;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

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

  .card-grid,
  .tools-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
