/* ==========================================================================
   DR. ABHAY KUMAR SHARMA — ADVANCED RESPONSIVE DESIGN SYSTEM
   Editorial, Minimalist, Masterfully Adaptive across Desktop, Tablet & Mobile
   Breakpoints:
     - Large Desktop: 1440px+
     - Standard Desktop: 1200px - 1439px
     - Tablet / Small Laptop: 768px - 1199px
     - Large Mobile / Phablet: 480px - 767px
     - Compact Mobile: 320px - 479px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Large Desktop Optimization (1440px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  :root {
    --max-width: 1360px;
    --section-py: 130px;
  }

  .hero-headline {
    font-size: clamp(3.75rem, 5.5vw, 5.5rem);
  }
}

/* --------------------------------------------------------------------------
   2. Standard Desktop / Small Laptop (1024px - 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .research-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .speaking-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .articles-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .footer-top {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 36px;
  }
}

/* --------------------------------------------------------------------------
   3. Tablet & Small Laptop (<= 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    --section-py: 90px;
    --container-px: 32px;
  }

  /* Header & Navigation */
  .nav-container {
    height: 72px;
  }

  .site-nav {
    border-bottom: 1px solid var(--color-border);
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - 72px);
    background-color: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 32px var(--container-px) 48px;
    gap: 16px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    border-bottom: 1px solid var(--color-border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1.35rem;
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--color-text-primary);
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--color-accent);
  }

  .nav-cta {
    width: 100%;
    justify-content: center;
    padding: 16px;
    margin-top: 20px;
    font-size: 0.875rem;
  }

  /* Hero Section */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-headline {
    font-size: clamp(2.6rem, 5.8vw, 3.8rem);
  }

  .hero-portrait-card {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  /* Trust Strip */
  .trust-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .trust-divider {
    display: none;
  }

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

  /* Services Accordion */
  .service-content-grid {
    grid-template-columns: 1fr;
    padding-left: 0;
    gap: 24px;
  }

  /* Consulting Method — Vertical Transformation on Tablet & Mobile */
  .method-flow {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-left: 32px;
    border-left: 1px solid var(--color-border);
    margin-top: 36px;
    position: relative;
  }

  .method-flow::before {
    display: none;
  }

  .method-step {
    padding: 0;
    position: relative;
  }

  .method-node {
    width: 40px;
    height: 40px;
    font-size: 0.75rem;
    margin-bottom: 12px;
    position: relative;
    left: -53px;
    margin-bottom: -32px;
  }

  .method-name {
    margin-left: 0;
    padding-top: 4px;
  }

  .method-desc {
    margin-left: 0;
  }

  /* Experience & Education Layout */
  .experience-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  /* Case Studies */
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Featured Insight Card */
  .featured-insight-card {
    grid-template-columns: 1fr;
  }

  .featured-insight-img {
    min-height: 280px;
    max-height: 380px;
  }

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

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* --------------------------------------------------------------------------
   4. Mobile Devices (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --container-px: 20px;
    --section-py: 70px;
  }

  /* Header adjustments */
  .nav-container {
    height: 66px;
  }

  .brand-name {
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
  }

  .brand-sub {
    font-size: 0.625rem;
    letter-spacing: 0.12em;
  }

  .nav-menu {
    top: 66px;
    height: calc(100vh - 66px);
    padding: 24px var(--container-px) 40px;
  }

  /* Hero Section */
  .hero {
    padding-top: 32px;
    padding-bottom: 50px;
  }

  .hero-eyebrow {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .hero-index {
    font-size: 0.6875rem;
  }

  .hero-eyebrow-text {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
  }

  .hero-headline {
    font-size: clamp(2.15rem, 8.5vw, 2.9rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
  }

  .hero-paragraph {
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 28px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 0.8125rem;
  }

  .hero-portrait-card {
    max-width: 100%;
    margin-top: 8px;
  }

  .portrait-caption {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 10px;
  }

  /* Trust Strip: 2-column mobile scorecard */
  .trust-strip {
    padding: 20px 0;
  }

  .trust-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
  }

  .trust-item {
    flex-direction: column;
    gap: 2px;
  }

  .trust-pill {
    font-size: 0.8125rem;
    color: var(--color-accent);
  }

  .trust-desc {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  /* Section Headers */
  .section-header {
    margin-bottom: 36px;
  }

  .section-eyebrow {
    font-size: 0.6875rem;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: clamp(1.85rem, 6.5vw, 2.45rem);
    line-height: 1.2;
  }

  .section-lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 12px;
  }

  /* About */
  .about-summary {
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .about-meta-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 24px;
    margin-top: 24px;
  }

  .about-action {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* Expertise Cards */
  .expertise-grid,
  .expertise-grid-2col {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .expertise-card {
    padding: 26px 20px;
    min-height: auto;
  }

  .card-title {
    font-size: 1.35rem;
    margin-bottom: 12px;
  }

  .card-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 18px;
  }

  /* Services Accordion */
  .service-header {
    padding: 20px 0;
  }

  .service-header-left {
    gap: 16px;
  }

  .service-num {
    font-size: 0.75rem;
    min-width: 32px;
  }

  .service-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .service-sublist {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .service-item.open .service-body {
    padding-bottom: 24px;
  }

  /* Timeline */
  .timeline {
    padding-left: 20px;
    gap: 28px;
  }

  .timeline-dot {
    left: -25px;
    width: 8px;
    height: 8px;
  }

  .timeline-role {
    font-size: 1.25rem;
  }

  /* Research Filter Bar: Native horizontal swipe */
  .research-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 12px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .research-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .research-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .research-card {
    padding: 24px 20px;
  }

  .research-card-title {
    font-size: 1.25rem;
  }

  /* Articles Row */
  .articles-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-card {
    padding: 24px 20px;
  }

  /* Speaking Grid */
  .speaking-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Consultation Form */
  .consultation-form-card {
    padding: 28px 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    padding: 12px;
  }

  /* Profile Download Bar */
  .profile-download-bar {
    padding: 24px 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .profile-download-actions button,
  .profile-download-actions a {
    width: 100%;
    justify-content: center;
  }

  /* Modal */
  .modal-card {
    padding: 32px 20px;
  }

  /* Footer */
  .site-footer {
    padding-top: 50px;
    padding-bottom: 32px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-legal-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   5. Compact Mobile Devices (<= 380px)
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  :root {
    --container-px: 16px;
  }

  .hero-headline {
    font-size: 1.95rem;
  }

  .brand-name {
    font-size: 0.75rem;
  }

  .brand-sub {
    font-size: 0.5625rem;
  }

  .trust-items {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .service-title {
    font-size: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   6. Accessibility & 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;
  }
}
