/*
 * Responsive breakpoints (mobile-first overrides in responsive.css)
 * — Mobile:  ≤599px
 * — Tablet:  600px–899px
 * — Laptop:  900px–1199px
 * — Desktop: ≥1200px
 */

html {
  scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (min-width: 900px) {
  html {
    scroll-padding-top: 112px;
  }
}

@media (min-width: 1200px) {
  :root {
    --container: min(1140px, 88vw);
    --header-h: 76px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .dual-pillars,
  .it-services-section,
  .emp-services-section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }
}

@media (min-width: 900px) {
  .nav-sub--wide {
    min-width: 18rem;
    width: max-content;
    max-width: min(440px, calc(100vw - 2rem));
    max-height: min(70vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.35rem;
  }

  .nav-sub--wide > li:first-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .header-inner {
    padding-inline: max(3vw, env(safe-area-inset-left, 0), env(safe-area-inset-right, 0));
  }
}

body {
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.container {
  padding-inline: max(0px, env(safe-area-inset-left, 0), env(safe-area-inset-right, 0));
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* —— Tablet & below (≤899px) —— */
@media (max-width: 899px) {
  :root {
    --header-h: 64px;
    --container: min(1120px, 94vw);
  }

  body {
    font-size: 1rem;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0));
  }

  .header-inner {
    padding: 0.65rem max(4vw, env(safe-area-inset-left, 0));
    min-height: var(--header-h);
  }

  .logo-img {
    height: 30px;
    max-width: min(170px, 42vw);
  }

  .logo-badge {
    padding: 0.28rem 0.6rem;
  }

  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .nav-menu {
    inset: var(--header-h) 0 auto 0;
    max-height: min(70vh, calc(100dvh - var(--header-h)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
  }

  .nav-menu a,
  .nav-sub-trigger {
    min-height: 44px;
    display: flex;
    align-items: center;
    width: 100%;
  }

  .nav-has-sub .nav-sub {
    display: none;
    padding-left: 0.75rem;
    margin-top: 0.25rem;
  }

  .nav-has-sub.is-expanded .nav-sub {
    display: block;
  }

  .nav-has-sub.is-expanded .nav-sub-trigger {
    color: var(--text);
    background: var(--surface);
  }

  /* Hero slider: stack + natural height (fix clipped content) */
  .hero.hero-slider-wrap {
    min-height: 0;
    padding-top: calc(var(--header-h) + 1rem);
    padding-bottom: 1.25rem;
  }

  .hero-slider-viewport {
    min-height: 0;
  }

  .hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    height: auto;
    max-height: none;
    overflow: visible;
    pointer-events: none;
    transform: translateX(16px);
  }

  .hero-slide.is-active {
    position: relative;
    inset: auto;
    z-index: 2;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .hero-slide:not(.is-active) {
    z-index: 1;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-slide-visual {
    margin-top: 0.25rem;
  }

  .hero-slide-title {
    font-size: clamp(1.55rem, 5.8vw, 2rem);
    margin-bottom: 0.85rem;
  }

  .hero-lead,
  .hero-slide-extra {
    font-size: 0.92rem;
    max-width: none;
  }

  .hero-slide-points {
    max-width: none;
    font-size: 0.88rem;
  }

  .hero-slide-chips span {
    font-size: 0.62rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .hero-slider-controls {
    margin-top: 1rem;
    padding-inline: 0.25rem;
  }

  .hero-slider-dots {
    max-width: min(220px, 50vw);
  }

  .hero-scroll {
    display: none;
  }

  .hero-orb--1 {
    width: 260px;
    height: 260px;
    right: -80px;
  }

  .hero-orb--2 {
    width: 200px;
    height: 200px;
  }

  .section {
    padding: 3.25rem 0;
  }

  .dual-pillars,
  .it-services-section,
  .emp-services-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .pillars-head,
  .about-head-grid,
  .it-services-head,
  .emp-services-head {
    gap: 1.25rem;
  }

  .pillars-intro,
  .about-lead,
  .it-services-intro,
  .emp-services-intro {
    font-size: 0.95rem;
  }

  .pillar-card,
  .about-card,
  .it-service-card,
  .emp-service-card {
    padding: 1.35rem 1.25rem;
  }

  .pillar-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .pillar-metric-val {
    font-size: 1.15rem;
  }

  .support-layout {
    gap: 1.75rem;
  }

  .support-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .support-actions .btn {
    width: 100%;
    min-height: 48px;
    text-align: center;
  }

  .testimonial-layout {
    gap: 2rem;
  }

  .testimonial-slide p {
    font-size: 1rem;
  }

  .contact-layout {
    gap: 2rem;
  }

  .contact-form {
    padding: 1.35rem 1.15rem;
  }

  .form-row input,
  .form-row textarea,
  .form-row select {
    font-size: 16px;
  }

  .float-cta {
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0));
    right: max(0.85rem, env(safe-area-inset-right, 0));
    left: max(0.85rem, env(safe-area-inset-left, 0));
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .float-cta-btn {
    min-height: 48px;
  }

  .float-cta-btn--primary {
    padding-inline: 1rem;
    font-size: 0.82rem;
  }

  .page-glow {
    width: 280px;
    height: 280px;
    opacity: 0.14;
  }

  .it-services-head,
  .emp-services-head {
    grid-template-columns: 1fr;
  }

  .it-services-cta,
  .emp-services-cta,
  .portfolio-page-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .it-services-cta .btn,
  .emp-services-cta .btn,
  .portfolio-page-cta .btn {
    width: 100%;
    min-height: 48px;
  }

  .nav-sub--wide {
    min-width: 0;
    width: 100%;
    display: block;
    max-height: none;
  }

  .service-hero,
  .inner-page-hero {
    padding-top: calc(var(--header-h) + 1.25rem);
    padding-bottom: 2.25rem;
  }

  .service-hero-lead,
  .inner-page-hero-lead {
    font-size: 0.98rem;
    max-width: none;
  }

  .service-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .service-hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .service-hero-media,
  .inner-page-hero-media {
    max-width: 100%;
  }

  .service-hero-media img,
  .inner-page-hero-media img {
    max-height: min(52vw, 280px);
    width: 100%;
    object-fit: cover;
  }

  .service-block-title {
    font-size: 1.12rem;
  }

  .contact-page .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* —— Tablet portrait / small tablet (600–899px) —— */
@media (min-width: 600px) and (max-width: 899px) {
  :root {
    --container: min(1120px, 92vw);
  }

  .it-services-grid,
  .emp-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .service-related-grid--emp {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

  .pillar-metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .hero-actions .btn {
    width: auto;
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 140px;
  }

  .it-services-cta,
  .emp-services-cta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
  }

  .it-services-cta .btn,
  .emp-services-cta .btn {
    width: auto;
  }

  .service-hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .service-hero-actions .btn {
    width: auto;
  }
}

/* —— Phones (≤599px) —— */
@media (max-width: 599px) {
  .service-related-grid,
  .service-related-grid--emp {
    grid-template-columns: 1fr;
  }

  .portfolio-page-grid,
  .faq-quick-grid {
    grid-template-columns: 1fr;
  }

  .inner-page-hero-layout .inner-page-hero-media {
    order: -1;
  }

  .service-hero-layout .service-hero-media {
    order: -1;
  }

  .section-title,
  .inner-page-hero .heading-accent,
  .service-hero .heading-accent {
    font-size: clamp(1.65rem, 7vw, 2.15rem);
  }
}

/* —— Small phones (≤480px) —— */
@media (max-width: 480px) {
  :root {
    --header-h: 60px;
  }

  .header-meta {
    display: none;
  }

  .eyebrow--pill {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    line-height: 1.35;
    align-items: flex-start;
  }

  .heading-accent {
    display: block;
  }

  .marquee-track span {
    font-size: 0.75rem;
  }

  .pillar-bridge-badge {
    margin-inline: 0.35rem;
    padding: 0.65rem 0.75rem;
  }

  .pillar-bridge-tagline {
    font-size: 0.68rem;
  }

  .it-services-highlights li,
  .emp-services-highlights li,
  .pillars-unified li {
    font-size: 0.78rem;
  }

  .emp-exam-chips span {
    font-size: 0.58rem;
  }

  .stats-grid {
    gap: 0.75rem;
  }

  .glass-stat {
    padding: 1.25rem 0.75rem;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .float-cta-btn--primary {
    flex: 1;
    max-width: calc(100% - 56px);
  }
}

/* —— Very small (≤360px) —— */
@media (max-width: 360px) {
  .hero-slide-chips {
    gap: 0.35rem;
  }

  .hero-slider-btn {
    width: 40px;
    height: 40px;
  }

  .logo-text--fallback {
    font-size: 1.45rem;
  }
}

/* —— Laptop (900–1199px) —— */
@media (min-width: 900px) and (max-width: 1199px) {
  :root {
    --container: min(1080px, 90vw);
  }

  .pillar-showcase {
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
  }

  .pillar-bridge {
    min-width: 72px;
    padding-inline: 0.35rem;
  }

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

  .emp-services-grid--eight {
    grid-template-columns: repeat(3, 1fr);
  }

  .it-services-grid,
  .emp-services-grid {
    gap: 1rem;
  }

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

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

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

  .service-hero-layout,
  .inner-page-hero-layout {
    grid-template-columns: 1fr min(44%, 460px);
    gap: 2rem;
  }
}

/* —— Touch: reduce hover-dependent motion —— */
@media (hover: none) and (pointer: coarse) {
  .pillar-card:hover,
  .about-card:hover,
  .it-service-card:hover,
  .emp-service-card:hover,
  .portfolio-item:hover,
  .team-card:hover {
    transform: none;
  }

  .btn-primary:hover,
  .btn-ghost:hover {
    transform: none;
  }
}

/* —— Landscape phones —— */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-slider-viewport {
    min-height: 0;
  }

  .hero-slide-points,
  .hero-slide-chips {
    display: none;
  }

  .hero-slide-extra {
    display: none;
  }

  .nav-menu {
    max-height: calc(100dvh - var(--header-h));
  }
}
