/* ============================================================
   MindFlow — Shared Stylesheet
   Design System: Material-inspired, Duolingo-clean, 3D animated
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* Neutral */
  --white:      #FFFFFF;
  --off-white:  #F7F9F8;
  --text-dark:  #1A2421;
  --text-mid:   #4A5E58;
  --text-light: #8FA89F;
  --border:     rgba(0,0,0,0.07);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:  0 24px 64px rgba(0,0,0,0.12);

  /* Typography */
  --font-display: 'Nunito', sans-serif;
  --font-body:    'Outfit', sans-serif;

  /* Radius */
  --r-sm:  8px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --r-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--off-white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }

p {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-mid);
  line-height: 1.7;
}

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

/* ── Layout Utilities ──────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.section--sm { padding: 48px 0; }

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 249, 248, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.nav.scrolled { box-shadow: var(--shadow-md); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.nav__links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav__links a {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--r-full);
  transition: background 0.2s, color 0.2s;
  color: var(--text-mid);
}

.nav__links a:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }
.nav__links a.active { color: var(--white); }

.nav__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-sm);
}

/* Mobile nav */
.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 12px 20px 16px;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.nav__mobile a {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--r-md);
  color: var(--text-mid);
  transition: background 0.2s;
}

.nav__mobile a:hover { background: rgba(0,0,0,0.04); }
.nav__mobile a.active { color: var(--white); }

.nav__mobile.open { display: flex; }

@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__menu-btn { display: flex; }
}

/* ── Pill / Badge ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--r-full);
  margin-bottom: 16px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--white {
  background: var(--white);
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

.btn--outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.6);
  color: var(--white);
}

.btn--outline:hover { background: rgba(255,255,255,0.15); }

.btn--lg { padding: 16px 36px; font-size: 1.05rem; }
.btn--icon { padding: 14px; border-radius: 50%; }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ── 3D Scene Container ─────────────────────────────────── */
.scene-3d {
  perspective: 800px;
  perspective-origin: center center;
}

/* ── Floating animation ─────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(1.5deg); }
  66%       { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-16px) rotate(-2deg); }
}

@keyframes spin3d {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

@keyframes spin3dX {
  from { transform: rotateX(0deg) rotateY(0deg); }
  to   { transform: rotateX(360deg) rotateY(120deg); }
}

@keyframes orbitRing {
  from { transform: rotateX(70deg) rotateZ(0deg); }
  to   { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes morphBlob {
  0%  { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100%{ border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* ── Scroll-reveal base ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

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

.reveal-group.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay: 0s; }
.reveal-group.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay: 0.08s; }
.reveal-group.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay: 0.16s; }
.reveal-group.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay: 0.24s; }
.reveal-group.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay: 0.32s; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 32px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 8px;
}

.footer__tagline { font-size: 0.875rem; }

.footer__col h4 {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer__links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer__links a { font-size: 0.875rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--white); }

.footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .footer__inner { grid-template-columns: 1fr; gap: 28px; }
  .footer__bottom { flex-direction: column; text-align: center; }
  .section { padding: 60px 0; }
}

/* ── Contact Form ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: currentColor;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.form-group textarea { resize: vertical; min-height: 100px; }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Grid helpers ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── 3D Shapes (reusable) ───────────────────────────────── */
.shape-3d {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  pointer-events: none;
}

/* ── Tilt card JS helper ────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, box-shadow 0.18s;
  will-change: transform;
}

/* ensure inner elements lift in 3D space */
.tilt-card > * { transform-style: preserve-3d; }

/* ── Page transition overlay ────────────────────────────── */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--off-white);
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.35s, transform 0s 0.35s;
}

.page-transition.leaving {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease-in, transform 0s;
}

/* ── Particle canvas (hero bg) ──────────────────────────── */
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* ── Cursor glow ────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}

/* ── Scroll progress bar (top of page) ─────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

/* ── Back-to-top button ─────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover { transform: translateY(-3px); }

/* ── Tooltip ────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text-dark);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Number counter animation ───────────────────────────── */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── Glassmorphism utility ──────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-group > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
