/* ==========================================================================
   TECH STEWARD DIGITAL AI — RESPONSIVE & MOBILE DESIGN SYSTEM
   ==========================================================================
   Clean, comprehensive responsiveness for all screen sizes:
   1. Fluid Container & Base Mobile Rules
   2. Tablet & Small Laptops (<= 1024px)
   3. Small Tablets & Phablets (<= 900px)
   4. Standard Mobile Phones (<= 768px)
   5. Compact Smartphones (<= 640px)
   6. Ultra-Compact Phones (<= 480px)
   7. Touchscreen & Pointer Adaptations (@media hover: none)
   ========================================================================== */

/* ==========================================================================
   1. FLUID VIEWPORT TOKENS & BASE ADAPTIVE RULES
   ========================================================================== */
:root {
  --app-height: 100vh;
  --testi-card-width: 540px;
}

/* Ensure no horizontal scrollbar leakage across any mobile device */
html, body {
  max-width: 100vw;
  overflow-x: clip;
}

/* Hide mobile-only drawer action link on desktop */
.nav-mobile-cta {
  display: none;
}

/* Mobile backdrop for navigation drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Body scroll lock when mobile drawer is open */
body.nav-locked {
  overflow: hidden !important;
  touch-action: none;
}


/* ==========================================================================
   2. TABLET & SMALL LAPTOPS (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }

  /* Hero Section */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .display-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .display-headline {
    font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  }

  .sec-label {
    justify-content: center;
  }

  /* Services Cards */
  .svc-card {
    padding: 30px 28px 32px;
    position: relative;
    top: auto !important;
  }

  .svc-features {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Works Bento Grid */
  .works-bento-grid {
    gap: 22px;
  }

  .card-lawfirm,
  .card-tutorial,
  .card-staycation,
  .card-travel,
  .card-fb-messenger {
    grid-column: span 12;
    height: 360px;
  }

  .card-collab {
    grid-column: span 6;
    height: 330px;
  }

  .card-collab.card-slack {
    grid-column: span 12;
    height: 350px;
  }

  /* Certificates Carousel */
  .cert-carousel-card {
    flex: 0 0 230px;
    width: 230px;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}


/* ==========================================================================
   3. SMALL TABLETS & PHABLETS (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
  /* About Section */
  .about-hero-container {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .about-hero-text-col {
    align-items: center;
  }

  .about-hero-image-col {
    max-width: 420px;
    margin: 0 auto;
  }

  /* Done-For-You Capsules Grid */
  .dfy-capsules-grid {
    gap: 16px 18px;
  }

  .dfy-capsule-card {
    padding: 18px 28px;
  }

  /* Daily Drivers Tool Kit Banner */
  .daily-drivers-banner {
    border-radius: 28px;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
    gap: 12px;
  }

  .driver-sep {
    display: none;
  }

  .driver-carousel-wrap {
    width: 100%;
  }
}


/* ==========================================================================
   4. STANDARD MOBILE PHONES (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Global Header & Nav */
  header {
    top: 10px;
    padding: 0 14px;
  }

  .nav {
    padding: 8px 16px;
    border-radius: 24px;
    background: #090f1f;
    border: 1px solid rgba(0, 210, 255, 0.28);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 210, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.62rem;
  }

  /* User requested: remove the button on mobile view */
  .nav .btn {
    display: none !important;
  }

  /* Mobile Drawer Menu */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(146, 209, 79, 0.12);
    border: 1px solid rgba(146, 209, 79, 0.35);
    border-radius: var(--radius-pill);
    color: var(--lime);
    font-size: 1.15rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.25s ease;
  }

  .menu-toggle:hover,
  .menu-toggle:focus-visible {
    background: rgba(146, 209, 79, 0.25);
    border-color: var(--lime);
    box-shadow: 0 0 15px rgba(146, 209, 79, 0.3);
  }

  nav ul {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 14px;
    right: 14px;
    background: #090f1f;
    border-radius: 22px;
    border: 1.5px solid rgba(0, 210, 255, 0.32);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.85), 0 0 28px rgba(0, 210, 255, 0.18);
    flex-direction: column;
    padding: 18px 14px;
    gap: 8px;
    z-index: 100;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  }

  nav ul.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
  }

  nav ul li a:hover,
  nav ul li a:active {
    background: rgba(0, 210, 255, 0.12);
    border-color: rgba(0, 210, 255, 0.4);
    color: var(--cyan-glow);
  }

  /* Mobile Drawer Primary Action Button */
  .nav-mobile-cta {
    display: block !important;
    margin-top: 6px;
    width: 100%;
  }

  .nav-mobile-cta a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--lime) !important;
    color: #070d1f !important;
    font-weight: 800 !important;
    border: 1.5px solid var(--lime) !important;
    box-shadow: 0 0 20px rgba(146, 209, 79, 0.45);
    border-radius: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .nav-mobile-cta a:hover,
  .nav-mobile-cta a:active {
    background: var(--lime-bright) !important;
    color: #070d1f !important;
    box-shadow: 0 0 25px rgba(146, 209, 79, 0.7);
  }

  /* Display Hero Section */
  .display-hero {
    padding-top: 105px;
    padding-bottom: 45px;
    text-align: center;
  }

  .display-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  /* Centered, Tightly Aligned 3-Card Fan Stack (Rock-Solid Alignment) */
  .hero-image-stack {
    position: relative;
    width: 170px;
    height: 140px;
    margin: 0 auto 28px;
    display: block;
    perspective: 1200px;
  }

  .hero-image-stack .card {
    position: absolute;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
  }

  /* Center Front Card (Hero1) */
  .hero-image-stack .card.card-center {
    width: 90px;
    height: 124px;
    top: 12px;
    left: 40px;
    right: auto;
    bottom: auto;
    z-index: 5;
    border-color: rgba(146, 209, 79, 0.4);
    transform: rotate(0deg);
  }

  /* Back-Left Card (Hero2) */
  .hero-image-stack .card.card-back-left {
    width: 92px;
    height: 126px;
    top: 2px;
    left: -10px;
    right: auto;
    bottom: auto;
    transform: rotate(-7deg);
    z-index: 2;
  }

  /* Back-Right Card (Hero3) */
  .hero-image-stack .card.card-back-right {
    width: 92px;
    height: 126px;
    top: 2px;
    right: -10px;
    left: auto;
    bottom: auto;
    transform: rotate(7deg);
    z-index: 2;
  }

  .display-headline {
    font-size: clamp(1.85rem, 7.5vw, 2.7rem);
    line-height: 1.15;
  }

  .display-lead {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .display-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .display-cta-group .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Done-For-You Business Automation System */
  .dfy-system-showcase {
    margin-bottom: 38px;
  }

  .dfy-capsules-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dfy-capsule-card {
    border-radius: 26px;
    padding: 18px 22px;
  }

  /* On single column mobile, left-align both columns for standard readability */
  .dfy-col-right {
    text-align: left;
  }

  .dfy-main-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .dfy-subhead {
    font-size: 1.05rem;
  }

  .dfy-section-divider {
    margin: 36px auto 32px;
  }

  .dfy-divider-badge {
    font-size: 10px;
    padding: 5px 14px;
  }

  /* Services Standalone Cards (Non-sticky, full details visible) */
  .svc-card {
    position: relative !important;
    top: auto !important;
    border-radius: 22px;
    padding: 24px 20px 26px;
    margin-bottom: 24px;
    width: 100%;
  }

  /* Works Section */
  .works-section {
    padding: 30px 0 60px;
  }

  .works-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
  }

  .works-header-right {
    width: 100%;
  }

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

  .card-collab {
    grid-column: span 12;
    height: 310px;
  }

  /* Testimonials Single Card Mobile Carousel */
  .testi-slide {
    width: calc(100vw - 36px);
    flex: 0 0 calc(100vw - 36px);
    padding: 0 4px;
  }

  .testi-showcase-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 18px;
    text-align: center;
  }

  .testi-visual-col {
    margin: 0 auto;
  }

  .testi-image-circle {
    width: 125px;
    height: 125px;
  }

  .testi-accent-bubble {
    width: 100px;
    height: 100px;
  }

  .testi-quote-icon {
    margin: 0 auto 6px;
  }

  .testi-headline {
    font-size: 1.15rem;
    line-height: 1.35;
  }

  .testi-narrative {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  /* Certificates Carousel */
  .cert-carousel-card {
    flex: 0 0 200px;
    width: 200px;
  }

  /* CTA Section & Contact Form */
  .cta-inner {
    padding: 28px 20px;
    text-align: center;
    flex-direction: column;
    gap: 20px;
  }

  .contact-form .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contact-form,
  .calendly-slide-card {
    padding: 26px 18px;
  }
}


/* ==========================================================================
   5. COMPACT SMARTPHONES (<= 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  /* Services */
  .svc-card {
    padding: 20px 16px 22px;
    border-radius: 18px;
  }

  .svc-card h3 {
    font-size: 1.25rem;
  }

  .svc-lead {
    font-size: 0.9rem;
  }

  .svc-feature-text {
    font-size: 0.88rem;
  }

  /* Works Bento Grid */
  .works-bento-grid {
    gap: 16px;
  }

  .card-lawfirm,
  .card-tutorial,
  .card-staycation,
  .card-travel,
  .card-collab {
    grid-column: span 12;
    height: 270px;
    border-radius: 20px;
  }

  .works-card-overlay {
    padding: 18px 16px;
    opacity: 1;
    background: linear-gradient(180deg, rgba(5, 10, 24, 0) 15%, rgba(5, 10, 24, 0.55) 55%, rgba(4, 8, 20, 0.95) 100%);
  }

  .works-card-content {
    transform: translateY(0);
    opacity: 1;
    gap: 6px;
  }

  .works-card-title {
    font-size: 1.4rem;
  }

  .works-card-arrow {
    width: 36px;
    height: 36px;
  }

  .works-card-arrow svg {
    width: 16px;
    height: 16px;
  }

  /* Trust Compact Badges */
  .trust-badges-row {
    gap: 8px;
  }

  .trust-mini-badge {
    padding: 5px 12px;
    font-size: 0.7rem;
  }

  /* Lightbox Modal */
  .hero-zoom-wrap {
    width: 94vw;
    padding: 12px;
  }
}


/* ==========================================================================
   6. ULTRA-COMPACT PHONES (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  /* Ultra-small phones like iPhone SE / Galaxy Mini */
  .brand-subtitle {
    display: none; /* Keep header compact on small screens */
  }

  .display-headline {
    font-size: 1.8rem;
  }

  .hero-image-stack {
    width: 156px;
    height: 132px;
    margin: 0 auto 22px;
    position: relative;
    display: block;
  }

  .hero-image-stack .card.card-center {
    width: 82px;
    height: 116px;
    top: 10px;
    left: 37px;
    right: auto;
    bottom: auto;
    z-index: 5;
    transform: rotate(0deg);
  }

  .hero-image-stack .card.card-back-left {
    width: 86px;
    height: 118px;
    top: 2px;
    left: -10px;
    right: auto;
    bottom: auto;
    transform: rotate(-7deg);
    z-index: 2;
  }

  .hero-image-stack .card.card-back-right {
    width: 86px;
    height: 118px;
    top: 2px;
    right: -10px;
    left: auto;
    bottom: auto;
    transform: rotate(7deg);
    z-index: 2;
  }

  .dfy-main-title {
    font-size: 1.25rem;
  }

  .dfy-card-title {
    font-size: 1.08rem;
  }

  .dfy-card-desc {
    font-size: 0.85rem;
  }

  .dfy-capsule-card {
    padding: 15px 18px;
    border-radius: 22px;
  }

  .driver-title {
    font-size: 1rem;
  }

  .driver-chip {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .testi-headline {
    font-size: 1.05rem;
  }

  .testi-image-circle {
    width: 110px;
    height: 110px;
  }

  .testi-accent-bubble {
    width: 90px;
    height: 90px;
  }

  .chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
  }
}


/* ==========================================================================
   7. TOUCHSCREEN & POINTER ADAPTATIONS (@media hover: none)
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  /* On touchscreens, ensure interactive cards show content without needing hover */
  .works-card-overlay {
    opacity: 1 !important;
    background: linear-gradient(180deg, rgba(5, 10, 24, 0) 20%, rgba(5, 10, 24, 0.6) 60%, rgba(4, 8, 20, 0.95) 100%);
  }

  .works-card-content {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }

  /* Make sure buttons and chips have accessible tap feedback */
  .btn,
  .driver-chip,
  .dfy-capsule-card,
  .cert-carousel-card {
    -webkit-tap-highlight-color: transparent;
  }

  .dfy-capsule-card:active {
    transform: scale(0.98);
    border-color: var(--lime-bright);
  }

  .btn:active {
    transform: scale(0.97);
  }
}
