/* ========================================
   BluBuilds.dev - Styles
   ======================================== */

/* CSS Variables */
:root {
  --bg: #000000;
  --surface: #111827;
  --surface-light: #1F2937;
  --primary: #3B82F6;
  --primary-light: #60A5FA;
  --primary-dark: #1E40AF;
  --accent: #0EA5E9;
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --border: #374151;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text-muted);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   Background Animation - Floating Orbs
   ======================================== */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation: float-1 25s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: float-2 30s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-dark) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation: float-3 20s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-50px, 100px) scale(1.1); }
  50% { transform: translate(-100px, 50px) scale(0.95); }
  75% { transform: translate(-30px, -50px) scale(1.05); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, -80px) scale(1.1); }
  66% { transform: translate(40px, 40px) scale(0.9); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -40px) scale(1.15); }
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

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

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

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

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

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: background 0.2s;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

.section-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--text);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 700;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 60px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-height);
  position: relative;
}

.hero-content {
  text-align: center;
  max-width: 700px;
  padding: 24px;
}

.hero-logo {
  width: 200px;
  height: auto;
  margin-bottom: 32px;
  animation: logo-float 6s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-tagline {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 40px;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* ========================================
   Services Section
   ======================================== */
.services {
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.5) 50%, transparent 100%);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s;
}

.card:hover {
  background: var(--surface-light);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
}

.card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--primary);
}

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

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

/* ========================================
   Projects Section
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.1);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.project-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.project-header h3 {
  font-size: 1.35rem;
  color: var(--text);
}

.project-desc {
  font-size: 1rem;
  margin-bottom: 20px;
}

.project-features {
  list-style: none;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-features li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

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

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--primary-light);
}

.project-link svg {
  transition: transform 0.2s;
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

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

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

.footer p {
  font-size: 0.9rem;
}

.footer-link {
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ========================================
   Scroll Animations
   ======================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for cards */
.services-grid .card:nth-child(1) { transition-delay: 0s; }
.services-grid .card:nth-child(2) { transition-delay: 0.1s; }
.services-grid .card:nth-child(3) { transition-delay: 0.2s; }

.projects-grid .project-card:nth-child(1) { transition-delay: 0s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.15s; }

/* ========================================
   Project Pages
   ======================================== */
.project-hero {
  padding: 140px 0 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 40px;
  transition: color 0.2s;
}

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

.project-hero-content {
  max-width: 800px;
}

.project-hero-icon {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 20px;
  margin-bottom: 24px;
  color: var(--primary);
}

.project-hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  color: var(--text);
  margin-bottom: 20px;
  font-weight: 700;
}

.project-hero-desc {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 700px;
}

.project-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.project-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

.btn-secondary:hover {
  background: var(--surface-light);
  border-color: var(--primary);
}

/* Features Section */
.features-section {
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.5) 50%, transparent 100%);
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s;
}

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

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Use Cases Section */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.use-case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.use-case h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 12px;
}

.use-case p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Security Section */
.security-section {
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.3) 100%);
}

.security-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.security-content h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 16px;
}

.security-content > p {
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.security-features {
  list-style: none;
  display: inline-block;
  text-align: left;
}

.security-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 1rem;
  color: var(--text);
}

.security-features svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Install Section */
.install-section {
  padding: 80px 0;
}

.install-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.install-content h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 16px;
}

.install-content > p {
  font-size: 1.1rem;
  margin-bottom: 28px;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 28px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 1rem;
  color: var(--primary-light);
}

/* Feature card stagger */
.features-grid .feature-card:nth-child(1) { transition-delay: 0s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.05s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.25s; }

.use-cases-grid .use-case:nth-child(1) { transition-delay: 0s; }
.use-cases-grid .use-case:nth-child(2) { transition-delay: 0.1s; }
.use-cases-grid .use-case:nth-child(3) { transition-delay: 0.2s; }
.use-cases-grid .use-case:nth-child(4) { transition-delay: 0.3s; }

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

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 16px 0;
    font-size: 1.1rem;
  }

  .nav-links a::after {
    display: none;
  }

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

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

  .hero-logo {
    width: 150px;
  }

  section {
    padding: 80px 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Project pages mobile */
  .project-hero {
    padding: 100px 0 60px;
  }

  .project-hero-icon {
    width: 80px;
    height: 80px;
  }

  .project-hero-icon svg {
    width: 48px;
    height: 48px;
  }

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

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .project-hero-actions {
    flex-direction: column;
  }

  .project-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .orb,
  .hero-logo,
  .animate-on-scroll {
    animation: none;
    transition: none;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
