/* Index page specific styles */
/* Extracted from inline <style> block for maintainability */

/* ========================================
   HERO SECTION - Rebuilt for stability
   NO animations, NO transforms on hover
   GSAP handles entrance, then static
   ======================================== */

.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 24px 16px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  color: white;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  width: 100%;
}

.hero-subtitle {
  display: inline-block;
  padding: 6px 14px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 12px 0;
  color: var(--color-green);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.95);
}

.hero-tagline strong {
  color: #FFFFFF;
  font-weight: 700;
}

.hero-description {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 auto 16px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
}

.hero-stat-value:first-child {
  color: #FFFFFF; /* Changed from #FF4528 (red) to meet WCAG AA contrast (was 3.2:1, now 16:1) */
}

.hero-stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Hero buttons - Unified system from components.css
   RECOMMENDED: Use class="btn btn-primary btn-hero" or "btn btn-secondary btn-hero"

   Legacy classes below for backward compatibility - consider migrating to unified system */
.hero-btn-primary,
.hero-btn-secondary {
  cursor: pointer;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  min-height: 52px;
  min-width: 160px;
  /* ONLY background-color transition - prevents cursor flicker */
  transition: background-color 0.2s ease;
}

.hero-btn-primary {
  background-color: white;
  color: var(--color-navy-dark);
}

.hero-btn-primary:hover {
  background-color: #f0f0f0;
}

.hero-btn-secondary {
  background-color: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.hero-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.hero-social-proof {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 auto;
  letter-spacing: 0.5px;
  text-align: center;
  display: block;
  width: 100%;
  max-width: 100%;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  font-size: 0.75rem;
}

/* Hero responsive */
@media (max-width: 768px) {
  .hero {
    padding: 80px 16px 16px;
    min-height: auto;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-btn-primary,
  .hero-btn-secondary {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
}

/* ======================================== */

/* Trust badge animation - ONLY used by other sections, not hero */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive overrides for home page */
@media (max-width: 968px) {
  .value-props-grid,
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .apps-preview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .stat-number {
    font-size: 2.5rem;
  }
}

@media (max-width: 640px) {
  .value-props-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .apps-preview-grid {
    grid-template-columns: 1fr !important;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

/* Enhanced Application Preview Styles */
.app-preview-item {
  position: relative;
  overflow: hidden;
}

.app-preview-item:hover {
  border-color: var(--color-navy);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(15, 45, 82, 0.15);
}

.app-preview-item:hover svg {
  transform: scale(1.1);
  stroke: var(--color-navy);
}

.app-preview-item svg {
  transition: all 0.3s ease;
}

.app-preview-item .app-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 45, 82, 0.95), rgba(15, 45, 82, 0.8));
  color: #fff;
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.app-preview-item:hover .app-desc {
  transform: translateY(0);
}

.app-preview-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  text-align: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.app-preview-link:hover {
  border-color: var(--color-navy);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(15, 45, 82, 0.15);
}

.app-preview-link:hover svg {
  transform: scale(1.1);
  stroke: var(--color-navy);
}

.app-preview-link svg {
  transition: all 0.3s ease;
}

.app-preview-link .app-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 45, 82, 0.95), rgba(15, 45, 82, 0.85));
  color: #fff;
  padding: 0.75rem 0.5rem;
  font-size: 0.6875rem;
  line-height: 1.3;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  text-align: center;
}

.app-preview-link:hover .app-desc {
  transform: translateY(0);
}

.app-preview-link .app-name {
  font-size: 0.875rem;
  color: var(--color-navy);
  font-weight: 500;
}

/* Text-only application tiles (no icons) */
.app-preview-text-only {
  padding: 1rem 1.25rem;
  justify-content: center;
  min-height: auto;
}

.app-preview-text-only .app-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* 4-column grid for apps-preview-grid - set via inline style, but responsive overrides here */

/* Hero Video Background */
.hero-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero Video Tiles */
.hero-videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.hero-video-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  aspect-ratio: 16/10;
  background: var(--gray-100);
}

.hero-video-tile:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16/9;
}

.hero-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-video-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}

/* Hide video on mobile for performance */
@media (max-width: 768px) {
  .hero-background video {
    display: none;
  }

  .hero-videos {
    max-width: 420px;
  }

  .hero-video-tile {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 480px) {
  .hero-videos {
    grid-template-columns: 1fr;
  }
}

.value-prop-card:hover,
.service-card:hover,
.step:hover {
  border-color: rgba(15, 45, 82, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.footer-links a:hover {
  color: #fff;
}

/* ROI Calculator Styles */
.roi-calculator {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.roi-calculator::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(15, 45, 82, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.roi-calculator-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.roi-calculator-content h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.roi-calculator-content p {
  color: rgba(255,255,255,0.8);
  font-size: 1.125rem;
  line-height: 1.6;
}

.roi-form {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.roi-field {
  margin-bottom: 1.5rem;
}

.roi-field label {
  display: block;
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.roi-field select,
.roi-field input[type="range"] {
  width: 100%;
}

.roi-field select {
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.roi-field select option {
  background: var(--color-navy);
  color: #fff;
}

.roi-slider-container {
  position: relative;
}

.roi-slider-value {
  position: absolute;
  right: 0;
  top: -1.75rem;
  color: var(--color-navy);
  font-weight: 700;
  font-size: 1.25rem;
}

.roi-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  outline: none;
}

.roi-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--color-navy);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 45, 82, 0.4);
  transition: transform 0.2s ease;
}

.roi-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.roi-results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.roi-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.roi-result-item {
  text-align: center;
}

.roi-result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.roi-result-value.highlight {
  color: var(--color-navy);
  font-size: 2.5rem;
}

.roi-result-label {
  color: rgba(255,255,255,0.7);
  font-size: 0.8125rem;
}

.roi-cta {
  text-align: center;
}

.roi-cta .btn {
  width: 100%;
}

@media (max-width: 968px) {
  .roi-calculator-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .roi-results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .roi-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .roi-result-value {
    font-size: 1.5rem;
  }

  .roi-result-value.highlight {
    font-size: 1.75rem;
  }
}

/* Text Logo Styles */
.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  letter-spacing: -0.02em;
}

.logo-text .logo-sofos {
  color: var(--color-navy);
}

.logo-text .logo-robotics {
  color: var(--color-navy);
  font-weight: 700;
}

/* (footer logo colors now live in components.css shared FOOTER section) */

/* CTA Button Animations - Simplified to prevent cursor flicker */
.hero-cta .btn,
.apps-preview-cta .btn {
  position: relative;
  /* Specific transitions only - "all" was causing flicker */
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Shimmer effect REMOVED - was causing cursor flicker */

.hero-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Primary button pulse animation - DISABLED to prevent cursor flicker */
/* .hero-cta .btn-primary {
  animation: pulse-glow 2s ease-in-out infinite;
} */

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(15, 45, 82, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(15, 45, 82, 0.2);
  }
}

.hero-cta .btn-primary:hover {
  background: var(--color-navy-dark);
  animation: none;
  box-shadow: 0 10px 30px rgba(15, 45, 82, 0.4);
}

/* Secondary button hover */
.hero-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

/* Outline button hover */
.hero-cta .btn-outline:hover {
  background: var(--color-navy);
  color: #fff;
}

/* CTA section specific animations */
.cta-section .btn-primary:hover {
  background: var(--color-navy-dark);
}

.cta-section .btn-secondary:hover {
  background: var(--color-navy-dark);
}

/* Entrance animation for buttons - DISABLED, GSAP handles this */
/* CSS animations were causing cursor flicker due to conflicts */

/* CTA Section buttons entrance */
.cta-section .hero-cta .btn {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.cta-section .hero-cta .btn:nth-child(1) {
  animation-delay: 0.1s;
}

.cta-section .hero-cta .btn:nth-child(2) {
  animation-delay: 0.2s;
}

.cta-section .hero-cta .btn:nth-child(3) {
  animation-delay: 0.3s;
}

.cta-section .hero-cta .btn.btn-primary {
  animation: fadeInUp 0.5s ease 0.1s forwards, pulse-glow 2s ease-in-out 0.6s infinite;
}

/* Why Automate Section */
.why-automate-section {
  padding: 5rem 0;
  background: #f8f9fa;
}

.why-automate-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.why-automate-stat {
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.why-automate-stat-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.why-automate-stat-label {
  font-size: 0.9375rem;
  color: #4a4a4a;
  line-height: 1.4;
}

.why-automate-stat-source {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .why-automate-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .why-automate-stat-value {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .why-automate-stats {
    grid-template-columns: 1fr;
  }

  .why-automate-stat {
    padding: 1.5rem;
  }
}

/* ========================================
   REVIEWS CAROUSEL (CSS-only auto-scroll)
   Matches case-studies.html implementation
   ======================================== */

/* Reviews Carousel */
.reviews-carousel-wrapper {
  position: relative;
  overflow: hidden;
  margin-bottom: 3rem;
}

.reviews-carousel {
  display: flex;
  gap: 1.5rem;
  animation: scrollReviews 30s linear infinite;
  width: max-content;
}

.reviews-carousel:hover {
  animation-play-state: paused;
}

.review-card {
  flex: 0 0 360px;
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem;
  border: 1px solid #eaeaea;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: pointer;
}

.review-card:hover {
  transform: scale(1.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 10;
  position: relative;
}

.review-card .review-stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.review-card .review-stars svg {
  width: 18px;
  height: 18px;
  fill: #f59e0b;
}

.review-card .review-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-body);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.review-card .review-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-card .review-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3a6a9a 0%, #1a4a7a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.review-card .review-author > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.review-card .review-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-navy);
}

.review-card .review-title {
  font-size: 0.8125rem;
  color: #6b6b6b;
}

@keyframes scrollReviews {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Fade edges */
.reviews-carousel-wrapper::before,
.reviews-carousel-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.reviews-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #fff, transparent);
}

.reviews-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #fff, transparent);
}

/* Responsive - smaller cards on mobile */
@media (max-width: 768px) {
  .review-card {
    flex: 0 0 300px;
    padding: 1.25rem;
  }

  .reviews-carousel {
    gap: 1rem;
  }

  .reviews-carousel-wrapper::before,
  .reviews-carousel-wrapper::after {
    width: 40px;
  }
}

@media (max-width: 480px) {
  .review-card {
    flex: 0 0 280px;
  }

  .review-card .review-text {
    font-size: 0.875rem;
  }
}

/* ========================================
   FEATURE SPOTLIGHT SECTIONS
   ======================================== */

.feature-spotlight .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.feature-spotlight.reverse .feature-video { order: 2; }
.feature-spotlight.reverse .feature-copy  { order: 1; }

.feature-video {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card-hover);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-navy-dark);
}

.feature-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-copy .eyebrow { margin-bottom: var(--space-sm); }

.feature-copy h3 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.feature-copy > p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 52ch;
}

.feature-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-green);
  border-radius: var(--border-radius-md);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-body);
  font-weight: var(--weight-medium);
}

@media (max-width: 768px) {
  .feature-spotlight .container {
    grid-template-columns: 1fr;
  }

  .feature-spotlight.reverse .feature-video,
  .feature-spotlight.reverse .feature-copy {
    order: unset;
  }

  .feature-video { order: -1; }
}
