/* ================================================================
   MASSS Homepage — Global Styles
   ================================================================ */

/* ----------------------------------------------------------------
   CSS Variables — BRAND.md Color System
   ---------------------------------------------------------------- */
:root {
  /* Primary Colors */
  --color-obsidian: #0a0a0f;
  --color-mint: #00f5a0;
  --color-violet: #6366f1;
  --color-blue: #00c9ff;

  /* Supporting Neutrals */
  --color-surface: #111118;
  --color-card: #1c1c27;
  --color-border-light: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.15);

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: #8b8ba0;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00f5a0, #6366f1, #00c9ff);
  --gradient-cta: linear-gradient(135deg, #00f5a0, #00c9ff);
  --glow-mint: radial-gradient(circle, rgba(0, 245, 160, 0.15) 0%, transparent 70%);
  --glow-violet: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
}

/* ----------------------------------------------------------------
   Animations
   ---------------------------------------------------------------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ----------------------------------------------------------------
   Intro / Splash Screen — Logo Animation (from BRAND.md)
   ---------------------------------------------------------------- */
@keyframes masss-draw {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}

@keyframes masss-node-pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes masss-word-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-obsidian);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.intro-screen.fading-out {
  opacity: 0;
  pointer-events: none;
}

.intro-logo-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Animated path */
.masss-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: masss-draw 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

/* Nodes — start hidden, pop in staggered */
.masss-node {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scale(0);
  opacity: 0;
}

.masss-node-1 { animation: masss-node-pop 0.4s ease-out 1s    forwards; }
.masss-node-2 { animation: masss-node-pop 0.4s ease-out 1.15s forwards; }
.masss-node-3 { animation: masss-node-pop 0.4s ease-out 1.3s  forwards; }

/* Wordmark slides in after nodes */
.masss-wordmark-anim {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--color-text-primary);
  opacity: 0;
  animation: masss-word-in 0.5s ease-out 1.4s forwards;
}

.masss-wordmark-anim span {
  color: var(--color-mint);
}

/* ----------------------------------------------------------------
   Reset / Base Styles
   ---------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-obsidian);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

p {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ----------------------------------------------------------------
   Button Component
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  padding: 10px 24px;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--gradient-cta);
  color: var(--color-obsidian);
  box-shadow: 0 4px 16px rgba(0, 245, 160, 0.2);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(0, 245, 160, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.12);
  border: 0.5px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-mint);
  color: var(--color-text-primary);
}

/* ----------------------------------------------------------------
   Card Components
   ---------------------------------------------------------------- */
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------------------
   Pill / Badge
   ---------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill-mint {
  background: rgba(0, 245, 160, 0.12);
  color: var(--color-mint);
  border: 0.5px solid rgba(0, 245, 160, 0.3);
}

.pill-violet {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 0.5px solid rgba(99, 102, 241, 0.3);
}

.pill-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* ----------------------------------------------------------------
   Section Label
   ---------------------------------------------------------------- */
.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-mint);
  margin-bottom: var(--space-base);
}

.section-heading {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3xl);
}

/* ----------------------------------------------------------------
   Header / Navigation
   ---------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--color-border-light);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--color-text-primary);
  text-transform: uppercase;
}

.logo-wordmark span {
  color: var(--color-mint);
}

/* Desktop Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  padding: 0;
}

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


/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile Nav dropdown */
.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-base) var(--space-lg) var(--space-lg);
  gap: var(--space-base);
  border-top: 0.5px solid var(--color-border-light);
  background: rgba(10, 10, 15, 0.97);
  animation: fade-in 0.15s ease;
}

.mobile-nav .nav-link {
  font-size: 16px;
  text-align: left;
  padding: var(--space-sm) 0;
  color: var(--color-text-secondary);
}

.mobile-nav-cta {
  margin-top: var(--space-sm);
  width: 100%;
}

/* ----------------------------------------------------------------
   Hero Section
   ---------------------------------------------------------------- */
#hero {
  position: relative;
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Large ambient glows */
.glow-mint-hero {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 245, 160, 0.12) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
  animation: fade-in 1s ease 0.2s both;
}

.glow-violet-hero {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  bottom: -120px;
  left: -80px;
  pointer-events: none;
  animation: fade-in 1s ease 0.4s both;
}

.hero-container {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  margin-bottom: var(--space-xl);
  animation: fade-in-up 0.6s ease both;
}

.hero-headline {
  font-size: clamp(48px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, #ffffff 30%, var(--color-mint) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fade-in-up 0.6s ease 0.1s both;
}

.hero-subheadline {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-2xl);
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  animation: fade-in-up 0.6s ease 0.2s both;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-base);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  animation: fade-in-up 0.6s ease 0.3s both;
}

.hero-cta-group .btn {
  padding: 12px 28px;
  font-size: 15px;
}

.hero-nudge {
  font-size: 13px;
  color: var(--color-text-muted);
  animation: fade-in-up 0.6s ease 0.4s both;
}

/* ----------------------------------------------------------------
   Engineering Section
   ---------------------------------------------------------------- */
#engineering {
  background-color: var(--color-surface);
  padding: var(--space-4xl) var(--space-2xl);
}

.engineering-container {
  max-width: 1100px;
  margin: 0 auto;
}

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

.engineering-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
  padding: var(--space-xl);
}

.engineering-card:hover {
  border-color: rgba(0, 245, 160, 0.2);
  box-shadow: 0 8px 32px rgba(0, 245, 160, 0.06);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.feature-description {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ----------------------------------------------------------------
   Products Section
   ---------------------------------------------------------------- */
#products {
  padding: var(--space-4xl) var(--space-2xl);
}

.products-container {
  max-width: 1100px;
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-2xl);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-xl);
}

.product-card:hover {
  border-color: rgba(0, 245, 160, 0.2);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.product-card--highlighted {
  border-color: rgba(0, 245, 160, 0.5);
  box-shadow: 0 0 48px rgba(0, 245, 160, 0.12);
  transition: border-color 1s ease, box-shadow 1s ease;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-base);
  gap: var(--space-md);
}

.product-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.product-card-description {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-lg);
}

.product-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  flex-grow: 1;
}

.product-feature-list li {
  font-size: 13px;
  color: var(--color-text-secondary);
  padding-left: var(--space-base);
  position: relative;
}

.product-feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-mint);
  opacity: 0.6;
}

.product-card-footer {
  display: flex;
  align-items: center;
}


/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
footer {
  border-top: 0.5px solid var(--color-border-light);
  padding: var(--space-3xl) var(--space-lg);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.footer-top {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 0.7;
}

.footer-wordmark {
  font-size: 16px;
  letter-spacing: 3px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 0.5px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: var(--space-base);
}

.footer-copyright {
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */
@media (max-width: 900px) {
  .engineering-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (max-width: 768px) {
  :root {
    --space-4xl: 56px;
    --space-3xl: 40px;
  }

  /* Hide desktop nav, show hamburger */
  .header-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }


  #hero {
    min-height: auto;
    padding: 80px var(--space-lg) var(--space-3xl);
    align-items: flex-start;
  }

  .glow-mint-hero {
    width: 280px;
    height: 280px;
    top: -60px;
    right: -80px;
  }

  .glow-violet-hero {
    width: 240px;
    height: 240px;
    bottom: -60px;
    left: -60px;
  }

  .hero-headline {
    font-size: clamp(40px, 11vw, 56px);
    letter-spacing: -1.5px;
  }

  .hero-subheadline {
    font-size: 15px;
  }

  .hero-cta-group .btn {
    padding: 11px 24px;
    font-size: 14px;
  }

  .section-heading {
    font-size: 26px;
    margin-bottom: var(--space-2xl);
  }

  #features,
  #products,
  #about {
    padding: var(--space-3xl) var(--space-lg);
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    gap: var(--space-lg);
  }
}
