/* Global Styles */
:root {
  /* Quay Tech Brand Colors */
  --quay-purple: #6B46C1;
  --quay-purple-light: #8B5CF6;
  --quay-purple-dark: #553C9A;
  --quay-purple-gradient: linear-gradient(135deg, #6B46C1 0%, #8B5CF6 100%);
  --quay-purple-gradient-reverse: linear-gradient(135deg, #8B5CF6 0%, #6B46C1 100%);
  --quay-purple-subtle: rgba(107, 70, 193, 0.1);
  --quay-purple-hover: rgba(107, 70, 193, 0.15);
}

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

/* Loading Indicator */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--quay-purple-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.loading.active {
  transform: scaleX(1);
}

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--quay-purple), var(--quay-purple-light), #A855F7);
  z-index: 1001;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(107, 70, 193, 0.5);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes particle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.hero-content {
  animation: float 6s ease-in-out infinite;
}

/* Particle Effect */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-particles::before,
.hero-particles::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: particle 15s linear infinite;
}

.hero-particles::before {
  left: 20%;
  animation-delay: -5s;
}

.hero-particles::after {
  left: 80%;
  animation-delay: -10s;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: #2d3748;
  background: var(--quay-purple-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(107, 70, 193, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: #1a202c;
  letter-spacing: -0.025em;
}

p {
  margin-bottom: 1.25rem;
  color: #4a5568;
  font-weight: 400;
  line-height: 1.8;
}

a {
  color: #0055a5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
.navbar {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 30px rgba(107, 70, 193, 0.12);
  border-bottom: 1px solid rgba(107, 70, 193, 0.15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-image {
  height: 45px;
  width: auto;
  transition: all 0.3s ease;
}

.logo:hover .logo-image {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: #4a5568;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--quay-purple);
  background: var(--quay-purple-subtle);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--quay-purple-gradient);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(107, 70, 193, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%), url('images/hero.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(107, 70, 193, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--quay-purple-gradient);
  color: #ffffff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeInUp 1s ease-out 0.4s both;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 50px rgba(107, 70, 193, 0.5);
  background: var(--quay-purple-gradient-reverse);
}

.btn:active {
  transform: translateY(-2px) scale(1.02);
  transition: all 0.1s ease;
}

.btn.small {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Sections */
.section {
  padding: 120px 20px;
  /* ensure anchored sections appear below the fixed nav */
  scroll-margin-top: 80px;
  background: #ffffff;
  position: relative;
}

.section:nth-child(even) {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.gray-bg {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.container:nth-child(even) {
  animation-delay: 0.2s;
}

.container:nth-child(odd) {
  animation-delay: 0.1s;
}

h2 {
  font-size: 2.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  margin-top: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--quay-purple-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--quay-purple-gradient);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(107, 70, 193, 0.3);
}

h2::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(107, 70, 193, 0.3) 50%, transparent 100%);
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 3rem;
}

.cards-grid .card:nth-child(1) {
  animation: slideInLeft 0.8s ease-out 0.1s both;
}

.cards-grid .card:nth-child(2) {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.cards-grid .card:nth-child(3) {
  animation: slideInRight 0.8s ease-out 0.5s both;
}

.cards-grid .card:nth-child(4) {
  animation: slideInLeft 0.8s ease-out 0.7s both;
}

.cards-grid .card:nth-child(5) {
  animation: slideInRight 0.8s ease-out 0.9s both;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--quay-purple-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(107, 70, 193, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
  border-radius: 50%;
  z-index: -1;
}

.card:hover::after {
  width: 300px;
  height: 300px;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(107, 70, 193, 0.15);
}

.card:hover::before {
  opacity: 1;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: all 0.4s ease;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.card:hover img {
  transform: scale(1.1);
  filter: brightness(1.1) saturate(1.2);
}

.card-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.8);
}

.card-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: #1a202c;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--quay-purple);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding-left: 1rem;
}

.subtitle::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: var(--quay-purple-gradient);
  border-radius: 2px;
}

.card-content p {
  flex-grow: 1;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card-content .btn {
  align-self: flex-start;
}

/* Impact Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  margin-top: 3rem;
}

.stats-grid .stat:nth-child(1) {
  animation: slideInLeft 0.8s ease-out 0.2s both;
}

.stats-grid .stat:nth-child(2) {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stats-grid .stat:nth-child(3) {
  animation: slideInRight 0.8s ease-out 0.6s both;
}

.stats-grid .stat:nth-child(4) {
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg, transparent 0%, rgba(107, 70, 193, 0.05) 50%, transparent 100%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.stat:hover::before {
  opacity: 1;
  transform: rotate(45deg) translate(20%, 20%);
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(107, 70, 193, 0.15);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--quay-purple-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #4a5568;
  font-weight: 500;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Values Grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 3rem;
}

.values-grid .value:nth-child(1) {
  animation: slideInLeft 0.8s ease-out 0.3s both;
}

.values-grid .value:nth-child(2) {
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.values-grid .value:nth-child(3) {
  animation: slideInRight 0.8s ease-out 0.7s both;
}

.value {
  padding: 2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

.value:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(107, 70, 193, 0.1);
}

.value h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #1a202c;
  font-weight: 700;
  position: relative;
}

.value h3::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: var(--quay-purple-gradient);
  border-radius: 2px;
}

.value p {
  font-size: 1rem;
  line-height: 1.7;
  color: #4a5568;
}

/* Contact Section */
.contact-section {
  max-width: 700px;
  text-align: center;
  position: relative;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.contact-form {
  margin-top: 3rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--quay-purple);
  box-shadow: 0 0 0 3px var(--quay-purple-subtle);
  background: rgba(255, 255, 255, 1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a0aec0;
  font-weight: 400;
}

/* Form Validation & Messages */
.error-message {
  display: block;
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.error-message.show {
  opacity: 1;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-group.success input,
.form-group.success textarea {
  border-color: #38a169;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

.btn-loading svg {
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.form-message {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-message.success {
  background: rgba(56, 161, 105, 0.1);
  border: 1px solid rgba(56, 161, 105, 0.2);
  color: #38a169;
}

.form-message.error {
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.2);
  color: #e53e3e;
}

.form-group textarea {
  resize: vertical;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #ffffff;
  padding: 60px 20px;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.5) 50%, transparent 100%);
}

.footer p {
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.footer a {
  color: #a0aec0;
  margin-right: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.footer a:hover {
  color: var(--quay-purple-light);
  transform: translateY(-2px);
}

.footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--quay-purple-gradient);
  transition: width 0.3s ease;
}

.footer a:hover::after {
  width: 100%;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--quay-purple-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 12px 40px rgba(107, 70, 193, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px) scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--quay-purple);
    flex-direction: column;
    padding: 2rem 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(107, 70, 193, 0.1);
  }
  
  .nav-links.active {
    transform: translateX(0);
  }
  
  .nav-links li {
    text-align: center;
    margin: 0.5rem 0;
  }
  
  .logo-image {
    height: 38px;
  }
  
  .hero h1 {
    font-size: 3rem;
    padding: 0 1rem;
  }
  
  .hero p {
    font-size: 1rem;
    padding: 0 1rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .values-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .section {
    padding: 80px 15px;
  }
  
  h2 {
    font-size: 2.25rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .card-content {
    padding: 1.5rem;
  }
  
  .value {
    padding: 1.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .logo-image {
    height: 32px;
  }
}