/*
  Responsive Design
  Mobile-first media queries for tablets and larger screens
*/

/* ============================================
   MOBILE OVERRIDES (max-width: 640px)
   ============================================ */

@media (max-width: 640px) {
  /* Typography scaling */
  :root {
    --text-5xl: 2.5rem;  /* 40px instead of 48px */
    --text-4xl: 2rem;    /* 32px instead of 36px */
    --text-3xl: 1.75rem; /* 28px instead of 30px */
  }

  /* Container padding */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Hero section */
  .hero {
    min-height: 400px;
    padding: var(--space-xl) 0;
  }

  .hero__title {
    font-size: var(--text-3xl);
  }

  .hero__subtitle {
    font-size: var(--text-base);
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .button {
    width: 100%;
  }

  /* Page header */
  .page-header {
    padding: var(--space-xl) 0 var(--space-lg) 0;
  }

  .page-header__title {
    font-size: var(--text-3xl);
  }

  .page-header__subtitle {
    font-size: var(--text-base);
  }

  /* Section spacing */
  .section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  /* Cards and grids */
  .grid {
    gap: var(--space-md);
  }

  /* Stats */
  .stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .stat__value {
    font-size: var(--text-3xl);
  }

  /* Process steps */
  .process-step {
    flex-direction: column;
    padding: var(--space-md);
  }

  .process-step__number {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }

  /* Contact layout */
  .contact-info {
    position: static;
  }

  /* Leadership */
  .leader__image {
    max-width: 250px;
  }

  .leader__name {
    font-size: var(--text-2xl);
  }

  /* Legal content */
  .legal-content__title {
    font-size: var(--text-3xl);
  }

  .legal-section__title {
    font-size: var(--text-xl);
  }

  /* Footer */
  .footer {
    padding: var(--space-xl) 0 var(--space-md) 0;
  }

  .footer__content {
    gap: var(--space-xl);
  }
}

/* ============================================
   TABLET (min-width: 640px)
   ============================================ */

@media (min-width: 640px) {
  /* Container wider padding */
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Two-column grids start */
  .grid--two {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats in 2 columns */
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer 2 columns */
  .footer__content {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Values grid */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Markets grid */
  .markets {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Benefits grid */
  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   TABLET LANDSCAPE (min-width: 768px)
   ============================================ */

@media (min-width: 768px) {
  /* Hero larger */
  .hero {
    min-height: 550px;
  }

  /* Three-column grids */
  .grid--three {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stats in 4 columns */
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Typography sizes increase */
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }

  /* Leader layout side-by-side */
  .leader {
    grid-template-columns: 300px 1fr;
  }

  /* Client profile 2 columns */
  .client-profile {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Process steps larger */
  .process-step__number {
    width: 60px;
    height: 60px;
    font-size: var(--text-2xl);
  }
}

/* ============================================
   DESKTOP (min-width: 1024px)
   ============================================ */

@media (min-width: 1024px) {
  /* Navigation always visible */
  .nav__toggle {
    display: none;
  }

  .nav__menu {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    padding: 0;
    box-shadow: none;
    background-color: transparent;
    right: auto;
  }

  .nav__cta {
    display: inline-block;
  }

  /* Hero full size */
  .hero {
    min-height: 600px;
  }

  /* Page header */
  .page-header {
    padding: var(--space-3xl) 0 var(--space-2xl) 0;
  }

  /* Section spacing */
  .section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  /* Four-column grids */
  .grid--four {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer 4 columns */
  .footer__content {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  /* Markets 3 columns */
  .markets {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Contact layout side-by-side */
  .contact-layout {
    grid-template-columns: 2fr 1fr;
  }

  .contact-info {
    position: sticky;
    top: calc(var(--space-2xl) + 60px);
  }
}

/* ============================================
   LARGE DESKTOP (min-width: 1280px)
   ============================================ */

@media (min-width: 1280px) {
  .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  /* Larger spacing on big screens */
  .section__header {
    margin-bottom: var(--space-2xl);
  }

  .hero {
    min-height: 650px;
  }
}

/* ============================================
   EXTRA LARGE DESKTOP (min-width: 1536px)
   ============================================ */

@media (min-width: 1536px) {
  :root {
    --text-5xl: 4rem;    /* 64px for very large screens */
    --text-4xl: 2.5rem;  /* 40px */
  }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets on touch devices */
  .button {
    min-height: 44px;
    padding: 0.875rem 1.75rem;
  }

  .nav__link {
    padding: var(--space-sm) 0;
  }

  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Remove hover effects on touch devices */
  .card:hover,
  .market:hover,
  .benefit:hover {
    transform: none;
  }

  .button--primary:hover,
  .button--secondary:hover {
    transform: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  /* Remove navigation and footer */
  .header,
  .footer,
  .nav,
  .button,
  .hero__actions {
    display: none;
  }

  /* Adjust colors for print */
  body {
    color: #000;
    background: #fff;
  }

  .hero {
    background: #fff;
    color: #000;
    min-height: auto;
    padding: 1rem 0;
  }

  .section--light,
  .section--dark,
  .section--cta {
    background: #fff;
    color: #000;
  }

  /* Remove shadows */
  .card,
  .contact-form,
  .leader__image img {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  /* Page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  .legal-section {
    page-break-inside: avoid;
  }

  /* Links */
  a {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

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

  .card:hover,
  .market:hover,
  .process-step:hover {
    transform: none;
  }

  .button:hover {
    transform: none;
  }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
  :root {
    --color-primary: #0000ff;
    --color-primary-dark: #000000;
  }

  .button--primary {
    border-width: 3px;
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    border-width: 3px;
  }
}
