/* ==========================================================================
   MicroSteps Design System
   Awwwards-level shared CSS for the MicroSteps website redesign.
   ========================================================================== */


/* ==========================================================================
   1. Custom Properties
   ========================================================================== */

:root {
  /* Fonts */
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font: var(--font-body);

  /* Color Palette */
  --primary: #00C3A7;
  --primary-dark: #00A08A;
  --primary-subtle: rgba(0, 195, 167, 0.08);
  --primary-glow: rgba(0, 195, 167, 0.15);
  --accent: #FF7D54;

  /* Backgrounds */
  --bg: #0E131A;
  --bg-elevated: #161D27;

  /* Borders */
  --border: #1F2937;
  --border-subtle: rgba(255, 255, 255, 0.06);

  /* Text */
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;
  --text-display: clamp(3.5rem, 10vw, 7rem);

  /* Spacing (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Easing (Awwwards standard) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}


/* ==========================================================================
   2. Base Reset
   ========================================================================== */

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scrolling */
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

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

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

ul,
ol {
  list-style: none;
}

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

::selection {
  background: var(--primary);
  color: var(--bg);
}


/* ==========================================================================
   3. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

h1 {
  font-size: var(--text-5xl);
  letter-spacing: -0.04em;
  font-weight: 800;
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

h5 {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

h6 {
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.text-display {
  font-size: var(--text-display);
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1.05;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #00E5CC 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ==========================================================================
   4. Custom Cursor System (desktop only)
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  * {
    cursor: none !important;
  }
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s var(--ease-out),
    height 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: var(--primary);
  background: rgba(0, 195, 167, 0.08);
}

.cursor-ring.is-text {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  border-color: var(--primary);
}

.cursor-ring.is-action {
  width: 80px;
  height: 80px;
  border-color: var(--primary);
  background: rgba(0, 195, 167, 0.06);
}

/* Hide cursor elements on touch devices */
@media (hover: none) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}


/* ==========================================================================
   5. Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition:
    background 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav-scrolled {
  background: rgba(14, 19, 26, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  padding: 0 var(--space-8);
}

/* Logo */
.nav-logo {
  font-family: var(--font);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-logo .logo-dot {
  color: var(--primary);
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out);
}

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

.nav-link.active {
  color: var(--text);
}

/* Nav CTA */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 100px;
  transition: background 0.3s var(--ease-out);
}

.nav-cta:hover {
  background: var(--primary-dark);
}

/* Mobile Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.4s var(--ease-out),
    opacity 0.3s var(--ease-out);
  transform-origin: center;
}

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

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

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

/* Mobile Menu Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 19, 26, 0.97);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s var(--ease-out),
    visibility 0.4s var(--ease-out);
}

.mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s var(--ease-out);
}

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

.mobile-menu .btn {
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}


/* ==========================================================================
   6. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 0 0 rgba(0, 195, 167, 0);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 0 30px rgba(0, 195, 167, 0.3), 0 0 60px rgba(0, 195, 167, 0.1);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 15px rgba(0, 195, 167, 0.2);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-sm {
  padding: 8px 20px;
  font-size: var(--text-xs);
  border-radius: 100px;
}

.btn-large {
  padding: 18px 40px;
  font-size: var(--text-base);
}


/* ==========================================================================
   7. Section Layouts
   ========================================================================== */

.section {
  padding: var(--space-32) 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container-narrow {
  max-width: 720px;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  display: inline-block;
  margin-bottom: var(--space-4);
}


/* ==========================================================================
   8. Cards
   ========================================================================== */

.card {
  background: rgba(22, 29, 39, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}

.card:hover {
  border-color: rgba(0, 195, 167, 0.2);
  transform: translateY(-8px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(0, 195, 167, 0.06);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}


/* ==========================================================================
   9. Grid System
   ========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

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

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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

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


/* ==========================================================================
   10. Footer
   ========================================================================== */

.footer {
  padding: var(--space-16) 0;
  border-top: 1px solid var(--border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
}

.footer-logo {
  font-family: var(--font);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: var(--space-4);
}

.footer-logo .logo-dot {
  color: var(--primary);
}

.footer-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 320px;
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-6);
}

.footer-links li + li {
  margin-top: var(--space-3);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-8);
  margin-top: var(--space-12);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}


/* ==========================================================================
   11. Scroll Progress Bar
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1001;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
  pointer-events: none;
}


/* ==========================================================================
   12. Animation Utility Classes (GSAP initial states)
   ========================================================================== */

/* Initial states set by GSAP in JS — no CSS opacity:0 needed. */

/* ==========================================================================
   12b. Grain Texture Overlay
   ========================================================================== */

.grain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}


/* ==========================================================================
   13. Accessibility
   ========================================================================== */

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

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  .grain {
    display: none !important;
  }

  .cta-beams {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Skip link for keyboard navigation */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   14. Form Styles
   ========================================================================== */

label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  display: block;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 120px;
}


/* ==========================================================================
   15. Display Font Overrides
   ========================================================================== */

.nav-logo,
.footer-logo,
.text-display,
.section-label,
.stat-number,
.step-number {
  font-family: var(--font-display);
}

.stat-number {
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   16. Phone Mockup
   ========================================================================== */

.phone-mockup {
  position: relative;
  width: 280px;
  height: 560px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: 40px;
  padding: 12px;
  margin-left: auto;
  box-shadow:
    0 0 80px rgba(0, 195, 167, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.4);
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: var(--bg);
  border-radius: 12px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 28px;
  overflow: hidden;
  padding: 44px 16px 16px;
}

@media (max-width: 768px) {
  .phone-mockup {
    width: 240px;
    height: 480px;
    margin: 0 auto;
    border-radius: 32px;
  }

  .phone-screen {
    border-radius: 22px;
    padding: 36px 10px 10px;
  }

  .phone-mockup::before {
    width: 60px;
    height: 20px;
    top: 10px;
  }
}

@media (max-width: 480px) {
  .phone-mockup {
    width: 200px;
    height: 400px;
    border-radius: 28px;
    padding: 8px;
  }

  .phone-screen {
    border-radius: 20px;
    padding: 32px 8px 8px;
  }

  .phone-mockup::before {
    width: 50px;
    height: 16px;
    top: 8px;
    border-radius: 8px;
  }
}


/* ==========================================================================
   17. Responsive Utilities
   ========================================================================== */

/* Hide on mobile, show on desktop */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on desktop, show on mobile */
@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Responsive typography scaling */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

  .text-display {
    letter-spacing: -2px;
  }

  .section {
    padding: var(--space-16) 0;
  }

  .container {
    padding: 0 var(--space-6);
  }

  .nav-inner {
    padding: 0 var(--space-6);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--text-3xl);
    letter-spacing: -0.02em;
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .text-display {
    font-size: clamp(2rem, 10vw, 3.5rem);
    letter-spacing: -1.5px;
  }

  .section {
    padding: var(--space-12) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .nav-inner {
    padding: 0 var(--space-4);
  }

  .nav-logo {
    font-size: var(--text-base);
  }
}
