/* SmartNest Automation Canada - Node-Mesh Design */

/* Color Palette */
:root {
  --deep-navy: #0B1220;
  --signal-blue: #3AA7FF;
  --teal: #20C6B7;
  --graphite: #1A2230;
  --soft-gray: #A7B0BD;
  --white: #FFFFFF;
  --shadow: rgba(0,0,0,.28);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--deep-navy);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1 { font-size: 3.1rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.2rem; font-weight: 500; }

@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.8rem; }
}

/* Container & Grid */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

@media (max-width: 768px) {
  .row { gap: 16px; }
  .col-6, .col-4, .col-3 { grid-column: span 12; }
}

/* Node-Mesh Background */
.node-mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-navy);
  z-index: -1;
  opacity: 0.4;
}

.node-mesh-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, var(--signal-blue) 0%, transparent 1px),
    radial-gradient(circle at 80% 80%, var(--teal) 0%, transparent 1px),
    radial-gradient(circle at 40% 60%, var(--signal-blue) 0%, transparent 1px),
    radial-gradient(circle at 60% 40%, var(--teal) 0%, transparent 1px);
  background-size: 150px 150px, 180px 180px, 120px 120px, 200px 200px;
  animation: nodeFloat 15s ease-in-out infinite;
}

.node-mesh-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, rgba(58, 167, 255, 0.03) 50%, transparent 70%);
  animation: meshPulse 8s ease-in-out infinite;
}

@keyframes nodeFloat {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  25% { transform: translateY(-10px) translateX(5px); }
  50% { transform: translateY(-5px) translateX(-10px); }
  75% { transform: translateY(-15px) translateX(-5px); }
}

@keyframes meshPulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.3; }
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 24px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--signal-blue);
  text-decoration: none;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover, nav a.active {
  color: var(--signal-blue);
}

.mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--graphite);
    padding: 1rem;
  }
  
  nav.active {
    display: block;
  }
  
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  .mobile-menu {
    display: block;
  }
}

/* Cards */
.card {
  background: var(--graphite);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 12px 28px var(--shadow);
  transition: all 0.2s ease;
  border: 1px solid rgba(58, 167, 255, 0.1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(58, 167, 255, 0.2);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.badge-beginner { background: var(--signal-blue); color: var(--deep-navy); }
.badge-advanced { background: var(--teal); color: var(--white); }
.badge-privacy { background: var(--soft-gray); color: var(--deep-navy); }
.badge-local { background: var(--teal); color: var(--white); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--signal-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: #2E9EFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(58, 167, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--signal-blue);
  border: 2px solid var(--signal-blue);
}

.btn-secondary:hover {
  background: var(--signal-blue);
  color: var(--white);
}

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

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

.hero h1 {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--white) 0%, var(--signal-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--soft-gray);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Stats Section */
.stats {
  padding: 4rem 0;
  background: rgba(26, 34, 48, 0.5);
  margin: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--signal-blue);
  display: block;
}

.stat-label {
  font-size: 1rem;
  color: var(--soft-gray);
  margin-top: 0.5rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  margin-bottom: 1rem;
}

.section-title p {
  font-size: 1.1rem;
  color: var(--soft-gray);
  max-width: 600px;
  margin: 0 auto;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Advantages Grid */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.advantage-item {
  text-align: center;
  padding: 2rem;
}

.advantage-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--signal-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
}

/* Reviews */
.reviews {
  background: rgba(26, 34, 48, 0.5);
  padding: 4rem 0;
  margin: 2rem 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.review-item {
  background: var(--graphite);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(58, 167, 255, 0.1);
}

.review-text {
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.review-author {
  font-weight: 600;
  color: var(--signal-blue);
}

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, var(--signal-blue) 0%, var(--teal) 100%);
  padding: 3rem 0;
  border-radius: 20px;
  margin: 2rem 0;
  text-align: center;
}

.newsletter h3 {
  color: var(--white);
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  max-width: 400px;
  margin: 0 auto;
  gap: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--white);
  color: var(--signal-blue);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.newsletter-form button:hover {
  transform: translateY(-1px);
}

/* Categories */
.categories {
  padding: 4rem 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.category-card {
  background: var(--graphite);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  text-decoration: none;
  color: var(--white);
  border: 1px solid rgba(58, 167, 255, 0.1);
  transition: all 0.2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--signal-blue);
  box-shadow: 0 12px 28px rgba(58, 167, 255, 0.2);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--signal-blue);
}

/* Footer */
footer {
  background: var(--graphite);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(58, 167, 255, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--signal-blue);
  margin-bottom: 1rem;
}

.footer-section a {
  color: var(--soft-gray);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--signal-blue);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(58, 167, 255, 0.1);
  color: var(--soft-gray);
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

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

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--signal-blue);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--teal);
  transform: translateY(-2px);
}

/* Loading Animation */
.loading {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

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

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}