/* Main styles for Klowd Labs website */

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

/* Custom Properties */
:root {
  /* Colors */
  --color-primary: #4A90E2;
  --color-secondary: #F7F9FC;
  --color-accent: #2C5282;
  --color-accent-light: #3A6BA8;
  --color-text: #2D3748;
  --color-text-light: #718096;
  --color-bg: #FFFFFF;
  --color-heart: #FF5757;
  
  /* Typography */
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  
  /* Spacing */
  --space-unit: 8px;
  --space-xs: calc(var(--space-unit) * 1);   /* 8px */
  --space-sm: calc(var(--space-unit) * 2);   /* 16px */
  --space-md: calc(var(--space-unit) * 3);   /* 24px */
  --space-lg: calc(var(--space-unit) * 4);   /* 32px */
  --space-xl: calc(var(--space-unit) * 6);   /* 48px */

  /* Other */
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

/* Base Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-accent);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--color-accent);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 85vh;
  padding: var(--space-xl) var(--space-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: var(--color-secondary);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero__cloud-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(74, 144, 226, 0.3) 0%,
    rgba(44, 82, 130, 0.3) 100%
  );
}

.hero__clouds {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.hero__cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
}

.hero__cloud::before,
.hero__cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.hero__cloud--1 {
  width: 200px;
  height: 60px;
  top: 15%;
  left: -50px;
  animation: cloudFloat1 25s ease-in-out infinite;
}

.hero__cloud--1::before {
  width: 100px;
  height: 100px;
  top: -50px;
  left: 25px;
}

.hero__cloud--1::after {
  width: 80px;
  height: 80px;
  top: -35px;
  right: 25px;
}

.hero__cloud--2 {
  width: 150px;
  height: 45px;
  top: 60%;
  right: -30px;
  animation: cloudFloat2 20s ease-in-out infinite;
}

.hero__cloud--2::before {
  width: 80px;
  height: 80px;
  top: -40px;
  left: 15px;
}

.hero__cloud--2::after {
  width: 60px;
  height: 60px;
  top: -30px;
  right: 20px;
}

.hero__cloud--3 {
  width: 180px;
  height: 50px;
  top: 30%;
  right: 20%;
  animation: cloudFloat3 30s ease-in-out infinite;
}

.hero__cloud--3::before {
  width: 90px;
  height: 90px;
  top: -45px;
  left: 20px;
}

.hero__cloud--3::after {
  width: 70px;
  height: 70px;
  top: -35px;
  right: 25px;
}

.hero__cloud--4 {
  width: 160px;
  height: 48px;
  top: 45%;
  left: 25%;
  animation: cloudFloat4 28s ease-in-out infinite;
}

.hero__cloud--4::before {
  width: 85px;
  height: 85px;
  top: -42px;
  left: 18px;
}

.hero__cloud--4::after {
  width: 65px;
  height: 65px;
  top: -32px;
  right: 22px;
}

.hero__cloud--5 {
  width: 140px;
  height: 42px;
  top: 20%;
  right: 35%;
  animation: cloudFloat5 22s ease-in-out infinite;
}

.hero__cloud--5::before {
  width: 75px;
  height: 75px;
  top: -38px;
  left: 15px;
}

.hero__cloud--5::after {
  width: 58px;
  height: 58px;
  top: -28px;
  right: 18px;
}

.hero__cloud--6 {
  width: 190px;
  height: 52px;
  top: 70%;
  left: 40%;
  animation: cloudFloat6 32s ease-in-out infinite;
}

.hero__cloud--6::before {
  width: 95px;
  height: 95px;
  top: -48px;
  left: 22px;
}

.hero__cloud--6::after {
  width: 72px;
  height: 72px;
  top: -36px;
  right: 28px;
}

.hero__content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-xl) 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1), transparent);
  border-radius: var(--border-radius);
  backdrop-filter: blur(5px);
}

.hero__title {
  font-size: clamp(1.75rem, 3vw, 3.5rem);
  margin-bottom: var(--space-md);
  color: var(--color-secondary);
  white-space: nowrap;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  background: linear-gradient(to right, #ffffff, #e1e9f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.hero__tagline {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-lg);
  font-family: var(--font-heading);
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.hero__intro {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
  line-height: 1.8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Services Section */
.services {
  padding: var(--space-xl) var(--space-md);
  background-color: var(--color-secondary);
  position: relative;
  z-index: 1;
}

.services__title {
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: clamp(2rem, 4vw, 3rem);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: var(--color-bg);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.service-card__icon {
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

.service-card__title {
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.service-card__description {
  color: var(--color-text-light);
  font-size: 1rem;
}

/* Made in Canada Section */
.made-in {
  background-color: var(--color-accent-light);
  color: var(--color-secondary);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  font-size: 1.1rem;
}

.made-in .heart {
  color: var(--color-heart);
  display: inline-block;
  margin: 0 0.25rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Footer */
.footer {
  background-color: var(--color-accent);
  color: var(--color-secondary);
  padding: var(--space-lg) var(--space-md);
  position: relative;
  z-index: 1;
}

.footer__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-md);
}

.footer__copyright {
  opacity: 0.8;
}

.footer__contact {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.footer__contact .email-link {
  color: var(--color-secondary);
  opacity: 0.8;
  transition: opacity var(--transition-speed) ease;
  cursor: pointer;
  text-decoration: none;
}

.footer__contact .email-link:hover,
.footer__contact .email-link:focus {
  opacity: 1;
  text-decoration: underline;
}

/* Cloud Animations */
@keyframes cloudFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}

@keyframes cloudFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 15px); }
}

@keyframes cloudFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-15px, -20px); }
}

@keyframes cloudFloat4 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(25px, -15px); }
}

@keyframes cloudFloat5 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-18px, 12px); }
}

@keyframes cloudFloat6 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(22px, 18px); }
}

/* Animation States */
.animate-on-scroll {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.initial {
  opacity: 0;
  transform: translateY(20px);
}

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

/* Media Queries */
@media (max-width: 768px) {
  .footer__content {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
    padding: var(--space-md);
  }

  .footer__contact {
    flex-direction: column;
  }
}

/* Utilities */
.icon {
  display: inline-block;
  vertical-align: middle;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .hero__cloud-bg,
  .hero__cloud {
    animation: none;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  * {
    transition: none !important;
  }

  .animate-on-scroll,
  .animate-on-scroll.initial,
  .animate-on-scroll.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
