/* Enhanced Responsive Styles */

* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

/* Extra Large Screens */
@media (max-width: 1440px) {
  .section-container {
    padding: 0 3rem 0 3rem;
  }

  .hero-container {
    padding: 0 3rem;
    margin-bottom: 3rem;
  }
}

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual {
    order: 1; /* Change from -1 to 1 to place it after the content */
    height: 400px;
    margin-top: var(--space-8); /* Change from margin-bottom to margin-top */
    margin-bottom: 0;
  }

  .floating-card {
    position: relative !important;
    display: inline-flex;
    margin: var(--space-4);
    animation: none;
  }

  .visual-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    height: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .contact-info {
    padding-right: 0;
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .nav-links {
    gap: var(--space-4);
    margin-right: var(--space-4);
  }

  .hero-section {
    min-height: calc(100vh - 80px);
    margin-top: 80px;
    padding: var(--space-8) 0;
  }

  .hero-container {
    min-height: auto;
    margin-top: 0;
    text-align: center;
    padding: 0 1rem 0 1rem;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero-description {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
    flex-wrap: wrap;
  }

  .about-section::before {
    width: 100%;
    opacity: 0.02;
    top: -50px;
    height: calc(100% + 50px);
    background-position: center top;
  }

  .about-content-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .about-text-content {
    text-align: center;
  }

  .section-header-left {
    text-align: center;
  }

  .section-header-left .section-title,
  .section-subtitle,
  .about-text {
    text-align: center;
  }

  /* Stack two-column layouts on smaller screens */
  .what-is-triad-layout,
  .about-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .section-container {
    padding: var(--space-12) var(--space-6);
  }

  .what-is-triad-layout {
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
  }
  .what-is-triad-left,
  .what-is-triad-right {
    justify-self: stretch;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .service-card {
    min-height: unset;
    margin-bottom: var(--space-6);
  }

  .about-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .process-timeline.vertical-timeline {
    padding: 0 var(--space-4);
  }
}

@media (max-width: 768px) {
  /* Navigation */
  .nav-links {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--color-bg-primary);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-8) var(--space-4);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    border-top: 1px solid var(--color-border);
    overflow-y: auto;
  }

  .nav-links.mobile-open {
    display: flex;
    transform: translateX(0);
  }

  .nav-link {
    padding: var(--space-4) 0;
    font-size: var(--font-size-lg);
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .mobile-menu-toggle {
    display: flex;
    z-index: 1001;
  }

  /* HERO SECTION: Center all contents horizontally */
  .hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
  }
  .hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100vw;
    padding: 0;
    margin: 0;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100vw;
    margin: 0 0 1.2rem 0;
    text-align: center;
    padding: 0;
  }
  .hero-title,
  .hero-description,
  .title-head-line,
  .title-line {
    text-align: center !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: column;
  }
  .hero-contact-form {
    margin: 0 auto 1.5rem auto;
    width: 100%;
    max-width: 100%;
    float: none;
  }
  .hero-contact-form form {
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
  .hero-contact-form .form-group {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-contact-form .form-input,
  .hero-contact-form .form-textarea {
    text-align: center;
  }

  .hero-visual {
    order: 1; /* Change from -1 to 1 to place it after the content */
    height: auto;
    max-height: 250px;
    margin-top: var(--space-6); /* Change from margin-bottom to margin-top */
    margin-bottom: 0;
  }

  .floating-card {
    min-width: 140px;
    padding: var(--space-3);
    font-size: var(--font-size-sm);
  }

  .card-icon {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-base);
  }

  .card-value {
    font-size: var(--font-size-lg);
  }

  .hero-title {
    font-size: var(--font-size-4xl);
    text-align: left;
    line-height: 1.1;
  }

  .title-line {
    white-space: normal;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .hero-cta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .cta-primary,
  .cta-secondary {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: var(--space-4) var(--space-6);
    margin-right: 0;
  }

  /* Services Section */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .service-card {
    padding: var(--space-6) var(--space-4);
    min-height: auto;
  }

  .service-icon {
    left: var(--space-4);
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }

  /* Process Timeline */
  .process-timeline::before {
    left: 30px;
  }

  .process-step {
    flex-direction: row !important;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .step-content {
    width: 100%;
    margin: 0;
  }

  .step-icon {
    margin-left: var(--space-4);
    align-self: flex-start;
  }

  .process-step:not(:last-child)::after {
    left: 24px;
    top: 50px;
    height: calc(100% - 30px);
  }

  .process-timeline.vertical-timeline::before {
    left: 30px;
  }

  .step-number {
    position: absolute;
    left: 0;
    margin-right: 0;
    margin-bottom: 0;
    width: 50px;
    height: 50px;
    font-size: var(--font-size-lg);
  }

  .step-content h3 {
    font-size: var(--font-size-lg);
  }

  /* Results and Stats */
  .results-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .result-card {
    padding: var(--space-6);
  }

  /* CONTACT SECTION: Center content and form, ensure full width and spacing */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    justify-items: center;
  }
  .contact-info {
    padding-right: 0;
    text-align: center;
    margin: 0 0 1.5rem 0;
    width: 90%;
    max-width: 100%;
  }
  .contact-form-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
    float: none;
    padding: 0;
    box-sizing: border-box;
  }
  .contact-form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
  }

  .contact-methods {
    margin-top: var(--space-8);
  }

  .contact-method {
    padding: var(--space-4) 0;
  }

  /* Footer */
  .footer-links {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  /* Section Spacing */
  .section-container {
    padding: var(--space-12) var(--space-4);
  }

  .section-header {
    margin-bottom: var(--space-8);
  }

  /* HERO TITLE: Force Triad and auto-type to always be on the same line, no wrap */
  .hero-title .title-head-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4em;
    width: 100%;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden;
  }
  .hero-title .triad-primary,
  .hero-title .auto-type {
    display: inline-block !important;
    white-space: nowrap !important;
    margin-bottom: 0 !important;
    text-align: left !important;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1em !important;
  }
  /* HERO DESCRIPTION: Prevent word splitting and improve readability */
  .hero-description {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 90vw !important;
    width: 100%;
    padding: 0 0.5rem;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    line-break: strict;
  }

  .hero-contact-form .form-input,
  .hero-contact-form .form-textarea,
  .hero-contact-form .form-submit {
    width: 98%;
    max-width: 98%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  /* About Stats */
  .about-stats-grid {
    gap: var(--space-4);
  }

  .about-stat-card {
    min-width: unset;
    min-height: unset;
    padding: var(--space-6) var(--space-4);
  }

  .about-stat-icon {
    width: 48px;
    height: 48px;
    font-size: var(--font-size-xl);
  }

  .about-stat-number {
    font-size: var(--font-size-xl);
  }

  /* Results */
  .result-card {
    padding: var(--space-4);
  }

  .result-metrics {
    flex-direction: column;
    gap: var(--space-3);
  }

  .metric {
    text-align: center;
  }

  /* Contact Form */
  .contact-form-container {
    padding: var(--space-4);
  }

  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--space-3);
    font-size: var(--font-size-base);
  }

  /* Typography */
  .section-title {
    font-size: var(--font-size-2xl);
    line-height: 1.2;
  }

  .section-description {
    font-size: var(--font-size-base);
  }

  .hero-description {
    font-size: var(--font-size-base);
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --space-4: 0.75rem;
    --space-6: 1rem;
    --space-8: 1.5rem;
    --space-12: 2.5rem;
    --space-16: 3rem;
  }

  /* Navigation */
  .nav-container {
    padding: 0 var(--space-3);
    height: 70px;
  }

  .navbar {
    height: 70px;
  }

  .hero-section {
    padding: 0.7rem 0.25rem 0.25rem 0.25rem;
  }
  .hero-container {
    padding: 0;
  }
  .hero-content {
    margin: 0 0 1rem 0;
    padding: 0;
  }

  /* Logo */
  .logo-text {
    font-size: var(--font-size-lg);
  }

  .logo-subtitle {
    margin-top: 0;
  }

  /* HERO SECTION: Center all contents horizontally */
  .hero-title,
  .hero-description,
  .title-head-line,
  .title-line {
    text-align: center !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: column;
  }
  .hero-contact-form form {
    padding: 1.5rem 1.5rem;
  }
  
  .hero-bottom-carousel {
    margin: 0 -8px 0 -8px;
  }

  .hero-title {
    font-size: 1.4rem;
    line-height: 1.1;
  }

  .hero-description {
    padding-right: 14rem;
    font-size: var(--font-size-sm);
    margin-bottom: 1.5rem;
  }

  .floating-card {
    min-width: 120px;
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .card-icon {
    width: 28px;
    height: 28px;
    font-size: var(--font-size-sm);
  }

  .card-title {
    font-size: var(--font-size-xs);
  }

  .card-value {
    font-size: var(--font-size-base);
  }

  /* Buttons */
  .cta-primary,
  .cta-secondary {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
    width: 100%;
    max-width: 240px;
  }

  /* Services */
  .service-card {
    padding: var(--space-4) var(--space-3);
  }

  .service-icon {
    left: var(--space-3);
    width: 36px;
    height: 36px;
    font-size: var(--font-size-base);
  }

  .service-card h3 {
    font-size: var(--font-size-lg);
    margin-top: var(--space-6);
  }

  /* Process */
  .process-step {
    padding-left: var(--space-16);
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-base);
  }

  .step-content h3 {
    font-size: var(--font-size-lg);
  }

  .step-icon {
    width: 40px;
    height: 40px;
  }

  .process-step:not(:last-child)::after {
    left: 19px;
  }

  .process-timeline.vertical-timeline::before {
    left: 19px;
  }

  /* Contact */
  .contact-form-container {
    padding: 1rem 0.5rem 1rem 0.5rem;
  }
  .contact-form {
    padding: 0.5rem 0.5rem;
  }

  /* Footer */
  .footer-container {
    padding: var(--space-8) var(--space-3) var(--space-4);
  }

  /* General */
  .section-container {
    padding: var(--space-8) var(--space-3);
  }

  .section-header {
    margin-bottom: var(--space-6);
  }

  .section-title {
    font-size: var(--font-size-xl);
  }

  .section-badge {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }

  .hero-title .title-head-line {
    gap: 0.2em;
  }
  .hero-title .triad-primary,
  .hero-title .auto-type {
    font-size: 1em !important;
  }
  .hero-description {
    max-width: 98vw !important;
    padding: 0 0.2rem;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    line-break: strict;
    }

  .hero-contact-form .form-input,
  .hero-contact-form .form-textarea,
  .hero-contact-form .form-submit {
    width: 99%;
    max-width: 99%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 375px) {
  :root {
    --space-3: 0.5rem;
    --space-4: 0.625rem;
    --space-6: 0.875rem;
    --space-8: 1.25rem;
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }

  .floating-card {
    min-width: 100px;
    padding: var(--space-1);
  }

  .card-title {
    display: none;
  }

  .visual-container {
    gap: var(--space-2);
  }

  .service-card {
    padding: var(--space-3) var(--space-2);
  }

  .contact-form-container {
    padding: var(--space-2);
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: var(--space-4) 0;
  }

  .hero-container {
    min-height: auto;
    padding: var(--space-4);
  }

  .hero-visual {
    height: 200px;
    order: 1; /* Add this to ensure consistency */
  }

  .nav-links {
    height: calc(100vh - 70px);
    padding: var(--space-4);
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav-link,
  .cta-primary,
  .cta-secondary,
  .form-submit {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .service-card,
  .result-card,
  .about-stat-card {
    transition: none;
  }

  .service-card:hover,
  .result-card:hover,
  .about-stat-card:hover {
    transform: none;
  }
}

@media (prefers-contrast: high) {
  :root {
    --color-border: var(--color-gray-400);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  }

  .service-card,
  .result-card,
  .stat-card {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-particles,
  .floating-card,
  .vector-line,
  .vector-dot,
  .connection-line,
  .floating-element {
    animation: none !important;
  }
}

@media print {
  .navbar,
  .hero-particles,
  .floating-card,
  .toast-container,
  .scroll-progress,
  .vector-background {
    display: none !important;
  }

  body {
    color: var(--color-black) !important;
    background: var(--color-white) !important;
  }

  .section-container {
    padding: var(--space-8) 0;
  }
}

/* Ensure nav-links is always flex by default */
/* Removed potentially conflicting rule */
