/**
 * Homepage Layout Fixes
 * Improves spacing, alignment and consistency of elements under the hero section
 *
 * @package Zero_Qubit_Astra_Child
 * @since 1.0.0
 */

/* Executive Hero Section Headline Styles */
.hero-headline {
  font-size: 2.2rem;
  font-weight: 500; /* Refined from 600 for executive appeal */
  color: var(--text-secondary, #86868b); /* Apple-inspired secondary text for light backgrounds */
  margin: 15px 0;
  line-height: 1.2;
  padding-left: 0;
  letter-spacing: -0.01em; /* Subtle tightening for sophistication */
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Executive Professional Title Styling */
.hero-main-title {
  letter-spacing: 0.5px; /* Reduced from 1px for sophistication */
  position: relative;
  color: var(--text-primary, #1d1d1f); /* Apple-inspired primary text for light backgrounds */
  animation: professionalGlow 6s ease-in-out infinite alternate; /* Slower, more refined */
  padding-left: 0;
  margin-left: 0;
  display: inline-block;
  font-weight: 600; /* Less bold, more refined */
  text-align: center;
  width: 100%;
}

/* Professional subtle text enhancement for light backgrounds */
.hero-main-title {
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),     /* Subtle dark shadow for depth */
    0 1px 2px rgba(0, 0, 0, 0.05);    /* Light refinement */
}

@keyframes professionalGlow {
  0% {
    text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.1),
      0 1px 2px rgba(0, 0, 0, 0.05);
  }
  50% {
    text-shadow: 
      0 3px 6px rgba(0, 0, 0, 0.15),
      0 1px 3px rgba(0, 0, 0, 0.08),
      0 0 8px rgba(0, 122, 204, 0.1); /* Subtle brand color accent */
  }
  100% {
    text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.1),
      0 1px 2px rgba(0, 0, 0, 0.05);
  }
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-muted);
  font-weight: 400;
  margin-bottom: 20px;
  max-width: 600px;
  line-height: 1.5;
  padding-left: 0;
}

/* Executive Mobile Experience */
@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0 50px; /* Optimized mobile spacing */
  }
  
  .hero-headline {
    font-size: 1.8rem;
    text-align: center; /* Center align for mobile executives */
  }
  
  .hero-main-title {
    font-size: 2rem; /* Appropriately sized for mobile executives */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for mobile */
    text-align: center;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    text-align: center;
  }
}

/* Professional Tablet Layout */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-left-pane {
    padding-right: 20px; /* Optimized spacing */
  }
  
  .hero-right-pane {
    padding-left: 15px;
  }
}

.hero-left-pane {
  padding-right: 30px;
  padding-left: 10px;
  margin-left: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-section {
  position: relative;
  padding: 60px 0 60px;
  overflow: hidden;
  background-color: var(--bg-primary, #ffffff); /* Apple-inspired white background */
  border-bottom: 1px solid var(--border-light, #e5e5e7); /* Light border */
}

/* Apple-Inspired Subtle Scan Effects for Light Theme */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--primary-subtle, rgba(0, 122, 204, 0.15)), 
    transparent
  );
  animation: quantumScanTop 8s ease-in-out infinite;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--border-light, #e5e5e7), 
    transparent
  );
  animation: quantumScanBottom 6s ease-in-out infinite reverse;
}

@keyframes quantumScanTop {
  0%, 100% { opacity: 0.3; transform: scaleX(0.5); }
  50% { opacity: 0.6; transform: scaleX(1); }
}

@keyframes quantumScanBottom {
  0%, 100% { opacity: 0.2; transform: scaleX(0.3); }
  50% { opacity: 0.5; transform: scaleX(0.8); }
}

/* Executive Presentation Mode */
.executive-mode .hero-main-title {
  animation: none; /* Remove all text animations */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Minimal static shadow */
}

.executive-mode .hero-section::before,
.executive-mode .hero-section::after {
  display: none; /* Hide quantum scan effects */
}

.executive-mode #ai-particles-background {
  opacity: 0.2; /* Greatly reduce particle visibility */
}

/* Reduced Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  .hero-main-title {
    animation: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Static subtle shadow */
  }
  
  .hero-section::before,
  .hero-section::after {
    animation: none;
  }
  
  #ai-particles-background {
    display: none; /* Hide particles completely */
  }
  
  .hero-nav-item .arrow {
    transition: none;
  }
  
  .hero-content-panel {
    animation: none;
  }
}

/* Global section spacing and consistency */
.site-main > section,
.site-main > div {
  padding: 60px 0;
  position: relative;
}

/* Container consistency */
.container-xl,
.ast-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 30px;
}

/* Large screen adjustments */
@media (min-width: 2560px) {
  .container-xl,
  .ast-container {
    max-width: 1800px;
    padding: 0 60px;
  }
  
  .hero-content-container {
    padding-left: 40px;
  }
  
  .hero-left-pane {
    padding-left: 20px;
  }
}

.hero-content-container {
  padding-left: 20px;
}

/* What We Do Section */
.what-we-do-section {
  background-color: var(--color-bg);
  padding: 40px 0;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  margin-top: 0;
}

.what-we-do-content {
  width: 100%;
}

.what-we-do-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.3), transparent);
}

.what-we-do-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

.what-we-do-section .section-header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  width: 100%;
}

.what-we-do-section .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

.what-we-do-section .section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), rgba(0, 229, 255, 0.8));
}

.what-we-do-section .section-description {
  font-size: 1.15rem;
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto 30px;
  line-height: 1.6;
  font-weight: 300;
}

.what-we-do-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.what-we-do-card-link-wrapper {
  height: 100%;
}

.what-we-do-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  transition: transform 0.3s ease;
  display: flex;
}

.what-we-do-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.85)); /* Light glassmorphism background */
  border: 1px solid var(--border-light, #e5e5e7);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px var(--glass-shadow-medium, rgba(0, 0, 0, 0.08));
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex: 1;
  height: 100%;
}

.what-we-do-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.what-we-do-card-link:hover {
  transform: translateY(-8px);
}

.what-we-do-card-link:hover .what-we-do-card {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.2);
}

.what-we-do-card:hover::before {
  opacity: 1;
}

.what-we-do-card .card-icon {
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.what-we-do-card:hover .card-icon {
  transform: scale(1.1);
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.what-we-do-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.what-we-do-card .card-headline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 15px;
  line-height: 1.3;
}

.what-we-do-card .card-description {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.what-we-do-card .card-cta-button {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.1), rgba(0, 229, 255, 0.2));
  color: var(--color-accent);
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: auto;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 229, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.what-we-do-card .card-cta-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
  transition: left 0.7s ease;
}

.what-we-do-card:hover .card-cta-button:before {
  left: 100%;
}

.what-we-do-card:hover .card-cta-button {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.2), rgba(0, 229, 255, 0.3));
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Highlight effect for targeted sections */
.highlight-section {
  animation: section-highlight 1.5s ease-out;
}

@keyframes section-highlight {
  0% {
    box-shadow: 0 0 0 rgba(0, 255, 255, 0);
    transform: scale(1);
  }
  20% {
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 255, 255, 0);
    transform: scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .what-we-do-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .what-we-do-cards {
    grid-template-columns: 1fr;
  }
  
  .what-we-do-section {
    padding: 50px 0;
    min-height: auto;
  }
  
  .what-we-do-section .section-title {
    font-size: 1.3rem;
  }
  
  .what-we-do-section .section-description {
    font-size: 1rem;
  }
}

/* Business Section Improvements */
.business-section-container {
  background-color: var(--color-bg-alt);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 80px 0;
}

.business-section-container .zq-grid-header {
  text-align: center;
  margin-bottom: 50px;
}

.business-section-container .zq-grid-title {
  font-size: 2.25rem;
  margin-bottom: 15px;
  color: var(--color-text);
}

.business-section-container .zq-grid-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
  margin: 15px auto 0;
  border-radius: 2px;
}

/* Business Card Improvements */
.business-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 25px;
}

.business-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border-color: rgba(var(--color-accent-rgb), 0.3);
}

.business-card-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-accent-rgb), 0.1);
  border-radius: 50%;
  margin-right: 8px;
  color: var(--color-accent);
  font-size: 0.9rem;
}

.business-card .zq-grid-item-image {
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.business-card .zq-grid-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.business-card .zq-grid-item-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.business-card .zq-grid-item-subtitle-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.business-card .zq-grid-item-subtitle {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
}

.business-card .zq-grid-item-description {
  margin-bottom: 25px;
  line-height: 1.6;
  flex-grow: 1;
}

.business-card .zq-button {
  align-self: flex-start;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: var(--color-bg);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.business-card .zq-button:after {
  content: '→';
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.business-card .zq-button:hover:after {
  transform: translateX(4px);
}

/* Portfolio Grid Improvements */
.zq-grid-layout {
  padding: 80px 0;
  background-color: var(--color-bg);
}

.zq-grid-layout .zq-grid-header {
  text-align: center;
  margin-bottom: 50px;
}

.zq-grid-layout .zq-grid-subtitle {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.zq-grid-layout .zq-grid-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  margin-bottom: 15px;
}

.zq-grid-layout .zq-grid-title:after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
  margin: 15px auto 0;
  border-radius: 2px;
}

.zq-grid-layout .zq-grid-item {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-alt);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zq-grid-layout .zq-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.zq-grid-layout .zq-grid-item-image {
  height: 220px;
  overflow: hidden;
}

.zq-grid-layout .zq-grid-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.zq-grid-layout .zq-grid-item:hover .zq-grid-item-image img {
  transform: scale(1.05);
}

.zq-grid-layout .zq-grid-item-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.zq-grid-layout .zq-grid-item-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.zq-grid-layout .zq-grid-item-subtitle {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.zq-grid-layout .zq-grid-item-description {
  margin-bottom: 20px;
  line-height: 1.6;
  flex-grow: 1;
}

.zq-grid-layout .zq-button {
  align-self: flex-start;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: var(--color-bg);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.zq-grid-layout .zq-button:after {
  content: '→';
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.zq-grid-layout .zq-button:hover:after {
  transform: translateX(4px);
}

/* CTA Section Improvements */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.cta-section .zq-section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--color-text);
}

.cta-section .zq-section-subtitle {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 25px;
}

.cta-section p {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 30px;
  color: var(--color-muted);
}

.cta-section .flex {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.cta-section .zq-button {
  padding: 12px 25px;
  font-size: 1rem;
}

.cta-section .zq-button.primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: var(--color-bg);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .site-main > section,
  .site-main > div {
    padding: 50px 0;
  }
  
  .business-section-container,
  .zq-grid-layout,
  .cta-section {
    padding: 60px 0;
  }
  
  .business-section-container .zq-grid-title,
  .zq-grid-layout .zq-grid-title,
  .cta-section .zq-section-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .site-main > section,
  .site-main > div {
    padding: 40px 0;
  }
  
  .business-section-container,
  .zq-grid-layout,
  .cta-section {
    padding: 50px 0;
  }
  
  .business-section-container .zq-grid-title,
  .zq-grid-layout .zq-grid-title,
  .cta-section .zq-section-title {
    font-size: 1.75rem;
  }
  
  .business-card .zq-grid-item-image {
    height: 160px;
  }
  
  .zq-grid-layout .zq-grid-item-image {
    height: 180px;
  }
  
  .cta-section .flex {
    flex-direction: column;
    gap: 10px;
  }
  
  .cta-section .zq-button {
    width: 100%;
  }
}
