/* ==========================================================
   AiraSystems — Mobile Responsive
   Targets:
     • iPhone 15 / 15 Pro / 15 Plus / 15 Pro Max  (390–430px wide, 844–932px tall)
     • Android flagships: Galaxy S24, Pixel 9       (360–412px wide)
     • iPad / iPad Air / iPad Pro                   (768–1024px wide)
   ========================================================== */

/* ─── Shared mobile base (≤ 1024px) ─── */
@media (max-width: 1024px) {

  /* Sidebar — hide on all tablet/mobile */
  .hero-sidebar {
    display: none;
  }

  /* Hero: remove sidebar indent */
  .hero {
    padding-left: 0;
  }
}


/* ═══════════════════════════════════════════════════════════
   TABLET  — iPad / iPad Air / iPad Pro  (768 – 1024px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) and (min-width: 768px) {

  /* ── Topbar ── */
  .hero-topbar {
    padding: 20px 32px;
  }

  /* ── Hero ── */
  .hero {
    min-height: 100svh;
    padding-left: 0;
  }

  .hero-content {
    padding: 140px 48px 80px;
  }

  .hero h1 {
    font-size: 56px;
    line-height: 60px;
  }

  .hero h1 .line-indent2 {
    padding-left: 24px;
  }

  .hero-sub-block {
    left: 48px;
    bottom: 60px;
    max-width: 260px;
  }

  .hero-cta-circle {
    right: 40px;
  }

  /* ── Sections ── */
  .section,
  .why-section,
  .cta-section {
    padding: 80px 48px;
  }

  hr.divider {
    margin: 0 48px;
  }

  /* ── Services ── */
  .services-grid {
    grid-template-columns: 280px 1fr;
    gap: 40px;
  }

  .service-content h3 {
    font-size: 24px;
  }

  /* ── Why grid ── */
  .why-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
  }

  .why-reasons {
    max-width: 100%;
  }

  .reason h3 {
    font-size: 24px;
  }

  /* ── Cases fence ── */
  .cases-header {
    padding: 0 48px;
  }

  .fence {
    height: 480px;
  }

  .fence-title {
    font-size: 28px;
  }

  .fence-expanded {
    padding: 20px 28px 28px;
    min-width: 280px;
  }

  /* ── Who section ── */
  .who-grid {
    grid-template-columns: 240px 1fr;
  }

  .who-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 32px;
  }

  /* ── CTA ── */
  .cta-section {
    grid-template-columns: 1fr auto;
    gap: 40px;
  }

  /* ── Footer ── */
  footer {
    padding: 40px 48px;
  }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE  — iPhone 15 / Android flagships  (≤ 767px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Global typography scale ── */
  .section-title {
    font-size: 36px !important;
    line-height: 1.15;
  }

  /* ── Topbar ── */
  .hero-topbar {
    padding: 16px 20px;
  }

  .topbar-nav {
    gap: 16px;
  }
  .hero-sub-block {
    display: none;
  }

  .topbar-nav a {
    font-size: 12px;
  }

  .hero-topbar.scrolled {
    padding: 12px 20px;
  }

  /* ── Hero ── */
  .hero {
    min-height: auto;

    align-items: flex-start;
        padding: 60px 24px 80px;
    /* Remove decorative vertical lines — too narrow for them */
    overflow: hidden;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero-content {
    padding: 20px 24px 20px;
    width: 100%;
  }

  .hero h1 {
    font-size: 38px;
    line-height: 42px;
    letter-spacing: -0.5px;
  }

  /* Reset indent — too tight on small screens */
  .hero h1 .line-indent,
  .hero h1 .line-indent2 {
    padding-left: 16px;
  }

  /* Sub-block: pull out of absolute, flow below h1 */
  .hero-sub-block {
    position: static;
    max-width: 100%;
    padding: 0 24px;
    margin-top: -160px; /* re-attach visually after hero-content bottom padding */
  }

  .hero-sub-block p {
    font-size: 15px;
    line-height: 1.5;
    max-width: 340px;
  }

  /* CTA circle: reposition to bottom right */
  .hero-cta-circle {
    position: absolute;
    right: 20px;
    top: auto;
    bottom: 32px;
    transform: none;
    align-items: flex-end;
    gap: 12px;
  }

  .cta-circle {
    width: 84px;
    height: 84px;
  }

  .cta-circle span {
    font-size: 11px;
  }

  .hero-cta-desc {
    font-size: 11px;
    max-width: 160px;
    text-align: right;
  }

  /* ── Sections ── */
  .section,
  .why-section {
    padding: 44px 24px;
  }

  hr.divider {
    margin: 0 24px;
  }

  /* ── Services ── */
  .services-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .service-list {
    margin-top: 0;
  }

  .service-item {
    padding: 24px 0 24px 56px;
  }

  .service-item:last-child{
    border-bottom: 0
  }

  .service-content h3 {
    font-size: 22px;
    line-height: 1.2;
  }

  .service-content p {
    font-size: 15px;
  }

  /* ── Why Us ── */
  .why-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
  }

  .why-desc {
    font-size: 18px;
    text-align: start;
  }

  .why-reasons {
    grid-column: 1 / -1;
    max-width: 100%;
    gap: 8px;
  }

  .reason {
    padding: 16px;
  }

  .reason h3 {
    font-size: 22px;
  }

  .reason p {
    font-size: 15px;
  }

  /* ── Cases — convert horizontal fence to vertical stack ── */
  .cases-section {
    padding: 64px 0 0;
  }

  .cases-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 24px;
    margin-bottom: 32px;
  }

  /* On mobile, fence becomes a vertical accordion */
  .fence {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;        /* override fixed 560px */
    max-width: 100%;
    padding: 0 0 32px;
    gap: 0;
  }

  /* Each panel: full width, auto height */
  .fence-panel {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* collapsed height */
    height: 64px;
    transition: height 0.5s cubic-bezier(0.77, 0, 0.175, 1),
                background-color 0.4s ease;
  }

  .fence-panel.active {
    height: auto;           /* auto-height when expanded */
    min-height: 380px;
    cursor: default;
    flex: none;
  }

  /* Collapsed strip: horizontal layout */
  .fence-collapsed {
    position: absolute;
    inset: 0;
    flex-direction: row;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    justify-content: flex-start;
  }

  .fence-label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 15px;
  }

  /* Expanded content */
  .fence-expanded {
    position: relative;   /* break out of absolute for auto height */
    inset: auto;
    padding: 20px 24px 28px;
    opacity: 0;
    min-width: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.3s ease 0.15s;
  }

  .fence-panel.active .fence-expanded {
    opacity: 1;
    pointer-events: auto;
  }

  .fence-num-lg {
    font-size: 40px;
  }

  .fence-title {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .fence-desc {
    font-size: 14px;
    max-width: 100%;
    margin-bottom: 12px;
  }

  .fence-bottom {
    flex-wrap: wrap;
    gap: 14px;
  }

  .fence-badge-bottom {
    font-size: 15px;
  }

  .fence-badge-bottom span {
    font-size: 22px;
  }

  .fence-body {
    gap: 12px;
  }

  /* ── Who We Work With ── */
  .who-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .who-cards {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 0;
  }

  .who-card {
    border-right: none;
    border-bottom: 1px solid var(--mid);
    padding: 24px 0;
  }

  .who-card:last-child {
    border-bottom: none;
  }

  .who-number {
    font-size: 40px;
    margin-bottom: 28px;
  }

  .who-card h3 {
    font-size: 18px;
  }

  .who-card p {
    font-size: 15px;
  }

  /* ── CTA Section ── */
  .cta-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 64px 24px;
  }

  .cta-title {
    font-size: 36px !important;
    letter-spacing: -1px;
    line-height: 1.1;
  }

  .cta-sub {
    font-size: 14px;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
  }

  /* ── Footer ── */
  footer {
    flex-direction: column;
    gap: 24px;
    text-align: center;
    padding: 40px 24px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
  }

  .footer-logo img {
    max-width: 110px;
  }

  .footer-copy {
    font-size: 11px;
  }
}


/* ═══════════════════════════════════════════════════════════
   SMALL MOBILE  — tight devices  (≤ 390px)
   iPhone SE, older Androids, Galaxy A series
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 390px) {

  .hero h1 {
    font-size: 32px;
    line-height: 37px;
  }

  .hero h1 .line-indent,
  .hero h1 .line-indent2 {
    padding-left: 8px;
  }

  .hero-content {
    padding: 110px 18px 190px;
  }

  .hero-sub-block {
    padding: 0 18px;
    margin-top: -170px;
  }

  .hero-cta-circle {
    right: 16px;
    bottom: 24px;
  }

  .cta-circle {
    width: 72px;
    height: 72px;
  }

  .hero-cta-desc {
    max-width: 130px;
    font-size: 10px;
  }

  .section,
  .why-section,
  .cta-section {
    padding: 52px 18px;
  }

  hr.divider {
    margin: 0 18px;
  }

  .cases-header {
    padding: 0 18px;
  }

  .fence-expanded {
    padding: 18px 18px 24px;
  }

  .service-item {
    padding: 20px 0 20px 48px;
  }

  .service-content h3 {
    font-size: 20px;
  }

  footer {
    padding: 32px 18px;
  }
}


/* ═══════════════════════════════════════════════════════════
   JS SUPPORT — fence accordion on mobile
   These classes are toggled by updated main.js logic
   ═══════════════════════════════════════════════════════════ */

/* Utility: smooth height transition helper (mobile fence) */
@media (max-width: 767px) {
  .fence-panel.active .fence-collapsed {
    opacity: 0;
    pointer-events: none;
  }
}


/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY — reduce motion
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .fence-panel,
  .fence-expanded,
  .hero-cta-circle,
  .cta-circle,
  .scroll-circle {
    transition: none !important;
    animation: none !important;
  }

  .bar {
    animation: none !important;
  }
}
