/* Ion Global Analytics - Sophisticated Motion System */

/* Reveal animations on scroll */
.service-row, 
.about-copy, 
.about-photo, 
.expert-box, 
.team-title, 
.team-card, 
.faq-image, 
.faq-right, 
.cta-box, 
.tech-photo, 
.tech-step-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.service-row.in-view, 
.about-copy.in-view, 
.about-photo.in-view, 
.expert-box.in-view, 
.team-title.in-view, 
.team-card.in-view, 
.faq-image.in-view, 
.faq-right.in-view, 
.cta-box.in-view, 
.tech-photo.in-view, 
.tech-step-item.in-view {
  opacity: 1;
  transform: none;
}

/* Delay configurations for structured rhythms */
.service-row:nth-child(2), 
.team-card:nth-child(2),
.tech-step-item:nth-child(2) {
  transition-delay: 0.1s;
}

.service-row:nth-child(3),
.tech-step-item:nth-child(3) {
  transition-delay: 0.2s;
}

.service-row:nth-child(4) { transition-delay: 0.1s; }
.service-row:nth-child(5) { transition-delay: 0.2s; }
.service-row:nth-child(6) { transition-delay: 0.3s; }

/* Staggered Hero Entrance Sequence (60–90ms Stagger) */
.hero-section .kicker {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-fade-in 0.65s 0.06s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-section h1 {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-fade-in 0.65s 0.14s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-section p {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-fade-in 0.65s 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-section .actions {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-fade-in 0.65s 0.30s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.quote-card {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-fade-in 0.7s 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.metric-card {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-fade-in 0.7s 0.46s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes hero-fade-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Elegant micro-hover transitions */
.service-row {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.service-row:hover {
  background: rgba(255, 255, 255, 0.015) !important;
}

.team-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.team-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: var(--shadow-lg), var(--shadow-glow) !important;
  border-color: var(--accent-glow) !important;
}

.questions details {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.questions details:hover {
  border-color: var(--accent-glow);
}

/* Modals & Backdrop */
body.modal-open {
  overflow: hidden;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.contact-modal.open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(640px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 48px;
  color: #0F172A;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}

.contact-modal.open .modal-panel {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  right: 24px;
  top: 24px;
  border: 0;
  background: none;
  font-size: 28px;
  color: #64748B;
  cursor: pointer;
  line-height: 1;
  transition: color 0.18s ease;
}

.modal-close:hover {
  color: #0F172A;
}

.modal-panel h2 {
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #0F172A;
}

.modal-intro {
  color: #475569;
  font-size: 14px;
  margin-bottom: 32px;
}

.modal-panel form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.modal-panel label {
  display: grid;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
}

.modal-panel input, 
.modal-panel select, 
.modal-panel textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  border-radius: 4px;
  padding: 12px 16px;
  font: 14px "Manrope", sans-serif;
  color: #0F172A;
  outline: none;
  transition: border-color 0.25s ease;
}

.modal-panel input:focus, 
.modal-panel select:focus, 
.modal-panel textarea:focus {
  border-color: #1E40AF;
  background: #FFFFFF;
}

.modal-panel .full {
  grid-column: 1 / -1;
}

.modal-panel button.pill {
  border: 0;
  width: 100%;
  margin-top: 12px;
}

.form-status {
  font-size: 13px;
  color: #1E40AF;
  margin-top: 12px;
}

@media(max-width: 600px) {
  .modal-panel {
    padding: 32px 20px;
  }
  .modal-panel h2 {
    font-size: 26px;
  }
  .modal-panel form {
    grid-template-columns: 1fr;
  }
  .modal-panel .full {
    grid-column: 1;
  }
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.consent {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500 !important;
  line-height: 1.5;
  color: var(--grey) !important;
  text-transform: none !important;
}

.consent input {
  width: 16px !important;
  height: 16px !important;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Reduced Motion Override */
@media(prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  
  .service-row, 
  .about-copy, 
  .about-photo, 
  .expert-box, 
  .team-title, 
  .team-card, 
  .faq-image, 
  .faq-right, 
  .cta-box, 
  .tech-photo, 
  .tech-step-item,
  .hero-section .kicker, 
  .hero-section h1, 
  .hero-section p, 
  .hero-section .actions,
  .quant-panel {
    opacity: 1 !important;
    transform: none !important;
  }
}
