/* ============================================================
   responsive.css — Breakpoints at 1024px, 768px, 480px
   + prefers-reduced-motion
   ============================================================ */

/* =========================
   MAX 1024px — Tablets / small desktops
   ========================= */

@media (max-width: 1024px) {
  :root {
    --h1-size: 56px;
    --h2-size: 40px;
    --h3-size: 24px;
    --stat-big-size: 64px;
    --stat-case-size: 56px;
    --section-padding: 96px;
  }

  /* Grids: 3-col → 2-col */
  .grid-2x3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .insights-grid-mid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Industries: 5-col → 3-col */
  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* About: tighter gap */
  .about-grid {
    gap: 48px;
  }

  /* Case layout: tighter gap */
  .case-layout {
    gap: 48px;
  }

  /* Metrics strip: tighter */
  .metrics-strip__item {
    padding: 0 28px;
  }

  .stats-strip__item {
    padding: 0 28px;
  }

  /* Process strip steps */
  .process-step {
    max-width: 180px;
  }
}

/* =========================
   MAX 768px — Mobile landscape / small tablets
   ========================= */

@media (max-width: 768px) {
  :root {
    --h1-size: 40px;
    --h2-size: 32px;
    --h3-size: 22px;
    --body-size: 17px;
    --hero-subtitle-size: 18px;
    --hero-metric-number: 26px;
    --hero-metric-label: 12px;
    --stat-big-size: 56px;
    --stat-case-size: 48px;
    --process-number-size: 26px;
    --section-padding: var(--section-padding-mobile);
    --card-gap: 24px;
    --card-padding: 24px;
    --form-padding: 28px;
  }

  /* --- Prevent horizontal overflow --- */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* --- Navigation: show hamburger, hide desktop links --- */
  .site-nav__links {
    display: none;
  }

  .site-nav__cta-desktop {
    display: none;
  }

  .hamburger {
    display: flex;
    width: 44px;
    height: 44px;
  }

  /* --- Hero --- */
  .hero__split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__featured {
    border-left-width: 3px;
  }

  .hero__buttons {
    flex-direction: column;
    gap: 12px;
  }

  .hero__buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Trending bar: horizontal scroll */
  .trending-bar {
    max-width: 100%;
    overflow: hidden;
  }

  .trending-bar__links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .trending-bar__links::-webkit-scrollbar {
    display: none;
  }

  /* Hero metrics: 2x2 grid */
  .hero__metrics .metrics-strip {
    flex-wrap: wrap;
    gap: 0;
  }

  .hero__metrics .metrics-strip__item {
    width: 50%;
    padding: 12px 16px;
    border-right: none;
  }

  .hero__metrics .metrics-strip__item:nth-child(1),
  .hero__metrics .metrics-strip__item:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .hero__metrics .metrics-strip__item:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* --- Brand statement --- */
  .brand-statement__headline {
    font-size: 36px;
  }

  /* --- Trust bar logos: wrap tighter --- */
  .trust-bar__logos {
    gap: 32px;
  }

  /* --- Grids: all go 1-col --- */
  .grid-2,
  .grid-3,
  .grid-2x3,
  .insights-grid-mid,
  .insights-grid-bottom {
    grid-template-columns: 1fr;
  }

  .insights-grid-bottom {
    max-width: 100%;
  }

  /* Insights top: stack */
  .insights-grid-top {
    grid-template-columns: 1fr;
  }

  .insights-grid-top-right {
    grid-template-rows: auto auto;
  }

  /* Industries: horizontal scroll */
  .grid-5 {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 16px;
  }

  .grid-5 > * {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }

  .industry-card {
    min-height: 280px;
    padding: 32px 20px 24px;
  }

  /* Hide scrollbar but keep functionality */
  .grid-5::-webkit-scrollbar {
    height: 4px;
  }

  .grid-5::-webkit-scrollbar-track {
    background: transparent;
  }

  .grid-5::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
  }

  /* --- News grid: 1-col --- */
  .news-grid {
    grid-template-columns: 1fr;
  }

  /* --- Case studies: stack --- */
  .case-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .case-layout--reversed {
    direction: ltr;
  }

  /* Hide decorative SVGs on mobile */
  .case-decorative {
    display: none;
  }

  .case-metric__value {
    font-size: var(--stat-case-size);
  }

  /* --- Process strip: vertical --- */
  .process-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-left: 32px;
    position: relative;
  }

  .process-strip__line {
    top: 0;
    bottom: 0;
    left: 5px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .process-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    max-width: 100%;
    gap: 16px;
    padding: 20px 0;
  }

  .process-step__dot {
    margin-bottom: 0;
    margin-top: 6px;
    position: absolute;
    left: -27px;
  }

  .process-step__content {
    display: flex;
    flex-direction: column;
  }

  /* --- Stats strip: 2x2 on mobile --- */
  .stats-strip {
    flex-wrap: wrap;
    gap: 0;
  }

  .stats-strip__item {
    width: 50%;
    padding: 16px;
    border-right: none;
  }

  .stats-strip__item:nth-child(1),
  .stats-strip__item:nth-child(2) {
    border-bottom: 1px solid var(--border-dark);
  }

  .stats-strip__item:nth-child(odd) {
    border-right: 1px solid var(--border-dark);
  }

  /* --- About: stack --- */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  /* --- Footer: 2x2 grid --- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* --- Split layouts: stack --- */
  .split-60-40 {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* --- Contact split: stack --- */
  .contact-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* --- Highlight stat --- */
  .highlight-stat__value {
    font-size: var(--stat-big-size);
  }

  /* --- Section headers spacing --- */
  .section-header {
    margin-bottom: 40px;
  }

  .section-header--center {
    margin-bottom: 40px;
  }
}

/* =========================
   MAX 480px — Mobile portrait
   ========================= */

@media (max-width: 480px) {
  :root {
    --h1-size: 32px;
    --h2-size: 28px;
    --h3-size: 20px;
    --body-size: 16px;
    --hero-subtitle-size: 16px;
    --hero-metric-number: 22px;
    --stat-big-size: 44px;
    --stat-case-size: 40px;
    --process-number-size: 22px;
    --container-padding: 16px;
    --card-padding: 20px;
    --form-padding: 20px;
    --card-gap: 20px;
  }

  /* Hero buttons: smaller */
  .hero__buttons .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  /* Trust bar logos: smaller gap, stacked feel */
  .trust-bar__logos {
    gap: 24px;
  }

  .trust-bar__logo svg {
    height: 22px;
  }

  /* Industry cards: narrower in scroll */
  .grid-5 > * {
    flex: 0 0 220px;
  }

  /* Footer: single column */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* About stats: single column */
  .about-stats {
    grid-template-columns: 1fr;
  }

  /* Metrics strip items: full width stack */
  .hero__metrics .metrics-strip {
    flex-direction: column;
    align-items: center;
  }

  .hero__metrics .metrics-strip__item {
    width: 100%;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
  }

  .hero__metrics .metrics-strip__item:last-child {
    border-bottom: none;
  }

  /* Stats strip: also stack */
  .stats-strip {
    flex-direction: column;
    align-items: center;
  }

  .stats-strip__item {
    width: 100%;
    border-right: none !important;
    border-bottom: 1px solid var(--border-dark);
    padding: 16px 0;
  }

  .stats-strip__item:last-child {
    border-bottom: none;
  }

  /* Nav CTA in overlay: smaller */
  .mobile-overlay__link {
    font-size: 24px;
  }

  /* Contact form card: less padding */
  .form-card {
    padding: var(--form-padding);
  }

  /* Card titles */
  .card-light__title--featured {
    font-size: 22px;
  }

  .industry-card__title {
    font-size: 22px;
  }

  /* Case study metric */
  .case-metric__value {
    font-size: var(--stat-case-size);
  }

  .case-metric__subtitle {
    font-size: 16px;
  }
}

/* =========================
   PREFERS 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;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-in-section {
    opacity: 1;
    transform: none;
  }

  .fade-in-card {
    opacity: 1;
    transform: none;
  }

  .card-dark:hover,
  .card-light:hover,
  .industry-card:hover {
    transform: none;
  }
}
