/* ============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================ */

@media (max-width: 1024px) {
  .hero {
    padding: 100px 32px 60px;
  }

  .container {
    padding: 80px 32px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .models-heading,
  .models-shell-header,
  .mobile-menu-top {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-menu-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================ */

@media (max-width: 768px) {

  .nav,
  .hero,
  .stats-bar,
  .container,
  .trust-section,
  .cta-section,
  .footer,
  .page-hero,
  .page-content {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  /* Nav */
  .nav {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: 16px;
  }
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }

  /* Hero */
  .hero {
    padding-top: calc(100px + env(safe-area-inset-top));
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    min-height: auto;
  }
  .hero h1 {
    font-size: clamp(36px, 10vw, 52px);
    line-height: 1.05;
    margin-bottom: 24px;
  }
  .hero-eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 20px;
  }
  .hero-sub {
    font-size: 15px;
    margin-bottom: 36px;
  }
  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
  .hero-line { display: none; }
  .hero .neural-container {
    inset: 6% -10% 12% 24%;
    opacity: 0.54;
    mix-blend-mode: normal;
    filter: none;
  }
  .scroll-cue {
    bottom: calc(24px + env(safe-area-inset-bottom));
    width: 92px;
    gap: 7px;
  }
  .scroll-cue-label {
    width: 100%;
    justify-content: center;
  }
  .scroll-cue-icon {
    width: 32px;
    height: 60px;
  }

  /* Section typography */
  .container {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .section-title {
    font-size: clamp(28px, 7vw, 42px);
    margin-bottom: 16px;
  }
  .section-desc {
    font-size: 15px;
    margin-bottom: 40px;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
  }

  /* Stats */
  .stats-bar {
    padding-top: 32px;
    padding-bottom: 32px;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .stat-num { font-size: 36px; }
  .stat-label { font-size: 10px; letter-spacing: 1.5px; }

  /* Services — horizontal scrolling tabs */
  .services-grid {
    grid-template-columns: 1fr;
    border: none;
  }
  .services-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--biolum-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }
  .services-tabs::-webkit-scrollbar { display: none; }

  .service-tab {
    white-space: nowrap;
    padding: 16px 20px;
    font-size: 13px;
    min-height: 48px;
    border-bottom: none;
    border-right: 1px solid rgba(168, 199, 108, 0.05);
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .service-tab::before {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 3px;
    transform: scaleX(0);
  }
  .service-tab.active::before { transform: scaleX(1); }
  .service-tab-icon { font-size: 14px; }

  .service-detail {
    padding: 28px 20px;
  }
  .service-detail h3 { font-size: 24px; }
  .service-tagline { font-size: 11px; }
  .service-desc { font-size: 14px; }
  .service-outcome { font-size: 13px; }

  /* Process — stack & auto-expand */
  .process-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .process-card { padding: 28px 24px; }
  .process-card .process-desc {
    max-height: 200px;
    opacity: 1;
  }
  .process-title { font-size: 22px; }
  .process-icon { font-size: 24px; }

  /* Trust */
  .trust-section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .trust-point { padding: 24px 0; }
  .trust-point h4 { font-size: 19px; gap: 10px; }
  .trust-point p { font-size: 14px; }

  /* Models */
  .model-landscape {
    overflow: clip;
  }
  .models-heading {
    margin-bottom: 28px;
    align-items: flex-start;
  }
  .models-meta {
    justify-content: flex-start;
  }
  .models-shell-header {
    padding: 24px 20px 18px;
  }
  .models-shell-header h3 {
    font-size: 28px;
  }
  .models-shell-note {
    max-width: none;
  }
  .models-table-wrap {
    margin: 0 -20px;
    padding: 0 20px;
  }
  .models-table {
    min-width: 860px;
  }
  .models-table th {
    backdrop-filter: none;
  }

  /* CTA */
  .cta-section {
    padding-top: 80px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .cta-section h2 { font-size: clamp(32px, 8vw, 48px); }
  .cta-sub { font-size: 15px; margin-bottom: 32px; }
  .cta-main-btn {
    width: 100%;
    font-size: 14px;
    padding: 16px 32px;
  }

  /* Footer */
  .footer {
    padding-top: 40px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-brand p { max-width: 100%; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .mobile-menu-shell {
    gap: 18px;
  }
  .mobile-menu-title {
    font-size: clamp(30px, 11vw, 46px);
  }
  .mobile-menu-card {
    min-height: 132px;
    padding: 18px;
  }
  .mobile-menu-card-title {
    font-size: 24px;
  }
  .mobile-menu-card-links {
    flex-direction: column;
  }
  .mobile-menu-card-link {
    width: 100%;
  }
  .mobile-menu-footer {
    align-items: flex-start;
  }

  /* Touch targets */
  .btn-primary,
  .btn-secondary {
    min-height: 48px;
    font-size: 13px;
  }

  /* Page inner content */
  .page-hero {
    padding-top: calc(120px + env(safe-area-inset-top));
    padding-bottom: 60px;
  }
  .page-hero .neural-container {
    inset: 0 -8% 0 18%;
    opacity: 0.42;
    mix-blend-mode: normal;
  }
  .page-hero h1 {
    font-size: clamp(32px, 8vw, 48px);
  }
  .page-hero .lead {
    font-size: 15px;
  }
  .page-content {
    padding-top: 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .page-content h2 {
    margin-top: 48px;
  }

  .page-cta {
    padding: 64px 0;
  }

  .nav.scrolled,
  .mobile-menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-menu::after,
  .hero::before,
  .cta-section::before,
  .cta-section::after,
  .page-hero::before,
  .page-hero::after {
    animation: none;
  }

  .mobile-menu::after,
  .page-hero::before,
  .page-hero::after,
  .cta-section::after {
    display: none;
  }
}


/* ============================================
   RESPONSIVE — SMALL PHONE (≤ 380px)
   ============================================ */

@media (max-width: 380px) {
  .hero h1 { font-size: 32px; }

  .stats-bar { grid-template-columns: 1fr; }
  .stat-item {
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 12px;
  }
  .stat-num { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal.visible {
    opacity: 1;
    transform: none;
  }
}
