/* ==========================================================================
   Responsive Design - Mobile First Approach
   Per CLAUDE.md Specifications:
   --breakpoint-sm: 576px;
   --breakpoint-md: 768px;
   --breakpoint-lg: 1024px;
   --breakpoint-xl: 1280px;
   ========================================================================== */

/* ==========================================================================
   Mobile First Base (max-width: 575px)
   ========================================================================== */

@media (max-width: 575px) {
    .container {
        padding: 0 var(--space-sm);
    }

    .section {
        padding: var(--space-xxl) 0;
    }

    /* Navigation Mobile */
    .nav__menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--color-alpha-black);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: var(--space-lg);
        padding: var(--space-xxl) var(--space-md);
        transition: left var(--transition-medium);
        z-index: 999;
    }

    .nav__menu.active {
        left: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--space-lg);
        width: 100%;
        text-align: center;
    }

    .nav__link {
        font-size: 1.125rem;
        padding: var(--space-md) 0;
        display: block;
        width: 100%;
    }

    .nav__connect {
        font-size: 1.125rem;
        padding: var(--space-md) var(--space-lg);
        display: inline-block;
        width: auto;
        margin-top: var(--space-md);
    }

    /* Active state underline for mobile nav links */
    .nav__link.active::after {
        bottom: 0;
    }

    .nav__toggle {
        display: flex;
    }

    /* Hero Mobile */
    .hero__content {
        padding-top: 120px;
        padding-bottom: var(--space-xxl);
    }

    .hero__title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        word-spacing: 0.2em;
        line-height: 1.3;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: center;
    }

    .hero__actions .btn {
        width: 100%;
        max-width: 280px;
    }

    /* About Mobile */
    .about__content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .about__sidebar {
        order: -1;
        text-align: center;
    }

    .about__headshot {
        max-width: 250px;
        margin: 0 auto;
    }

    .about__stats {
        gap: var(--space-sm);
    }

    /* Expertise Mobile */
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .expertise-card {
        padding: var(--space-lg);
    }

    /* Methodology Mobile */
    .methodology__diagram {
        flex-direction: column;
        gap: var(--space-md);
    }

    .methodology__arrow {
        transform: rotate(90deg);
    }

    /* Insights Mobile */
    .insights-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Community Mobile */
    .community__intro {
        font-size: 1rem;
    }

    .community__item {
        padding: var(--space-lg) 0;
    }

    /* Connect Mobile */
    .connect__content {
        padding: 0 var(--space-sm);
    }

    .connect__actions {
        gap: var(--space-lg);
    }

    /* Footer Mobile */
    .footer__content {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .footer__nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-md);
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* ==========================================================================
   Small Tablets (576px to 767px)
   ========================================================================== */

@media (min-width: 576px) and (max-width: 767px) {
    /* Navigation */
    .nav__menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--color-alpha-black);
        flex-direction: column;
        padding: var(--space-xxl) var(--space-lg);
        transition: left var(--transition-medium);
        z-index: 999;
    }

    .nav__menu.active {
        left: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .nav__toggle {
        display: flex;
    }

    /* Hero */
    .hero__content {
        padding-top: 120px;
    }

    .hero__title {
        font-size: clamp(2rem, 6vw, 3rem);
        word-spacing: 0.2em;
        line-height: 1.3;
    }

    /* About */
    .about__content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .about__sidebar {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: var(--space-lg);
        align-items: start;
    }

    .about__headshot {
        width: 100%;
    }

    /* Expertise */
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    /* Insights */
    .insights-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Methodology */
    .methodology__diagram {
        gap: var(--space-md);
    }
}

/* ==========================================================================
   Medium Devices - Tablets (768px to 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 var(--space-lg);
    }

    /* Navigation - Desktop style */
    .nav__menu {
        display: flex;
        gap: var(--space-lg);
    }

    .nav__toggle {
        display: none;
    }

    /* Hero */
    .hero__content {
        padding-top: 120px;
        max-width: 700px;
    }

    .hero__title {
        font-size: clamp(2.25rem, 5vw, 3rem);
        word-spacing: 0.2em;
        line-height: 1.3;
    }

    /* About */
    .about__content {
        grid-template-columns: 1fr 250px;
        gap: var(--space-xl);
    }

    /* Expertise */
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    /* Insights */
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    /* Methodology */
    .methodology__content {
        max-width: 650px;
    }
}

/* ==========================================================================
   Large Devices - Small Desktops (1024px to 1279px)
   ========================================================================== */

@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        padding: 0 var(--space-xl);
    }

    /* Hero */
    .hero__content {
        max-width: 800px;
    }

    /* About */
    .about__content {
        grid-template-columns: 1fr 280px;
        gap: var(--space-xxl);
    }

    /* Expertise */
    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }

    /* Insights */
    .insights-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }
}

/* ==========================================================================
   Extra Large Devices - Large Desktops (1280px and up)
   ========================================================================== */

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
        padding: 0 var(--space-xl);
    }

    /* Hero */
    .hero__content {
        max-width: 900px;
    }

    /* About */
    .about__content {
        gap: var(--space-xxxl);
    }

    /* Expertise */
    .expertise-grid {
        gap: var(--space-xl);
    }

    /* Insights */
    .insights-grid {
        gap: var(--space-xl);
    }

    /* Community */
    .community__items {
        max-width: 900px;
    }
}

/* ==========================================================================
   Mobile Navigation Animations
   ========================================================================== */

@media (max-width: 767px) {
    .nav__toggle[aria-expanded="true"] .nav__toggle-icon {
        background: transparent;
    }

    .nav__toggle[aria-expanded="true"] .nav__toggle-icon::before {
        transform: rotate(45deg) translate(0, 0);
    }

    .nav__toggle[aria-expanded="true"] .nav__toggle-icon::after {
        transform: rotate(-45deg) translate(0, 0);
    }

    /* Stagger animation for mobile menu items */
    .nav__menu.active .nav__list .nav__item {
        animation: slideInFromTop 0.3s ease forwards;
        opacity: 0;
    }

    .nav__menu.active .nav__list .nav__item:nth-child(1) {
        animation-delay: 0.05s;
    }

    .nav__menu.active .nav__list .nav__item:nth-child(2) {
        animation-delay: 0.1s;
    }

    .nav__menu.active .nav__list .nav__item:nth-child(3) {
        animation-delay: 0.15s;
    }

    .nav__menu.active .nav__list .nav__item:nth-child(4) {
        animation-delay: 0.2s;
    }

    .nav__menu.active .nav__list .nav__item:nth-child(5) {
        animation-delay: 0.25s;
    }

    @keyframes slideInFromTop {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================================================
   Touch-Friendly Adjustments
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 48px;
        padding: var(--space-md) var(--space-lg);
    }

    .nav__link,
    .nav__connect {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Prevent iOS zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px;
    }

    /* Remove hover effects on touch devices */
    .expertise-card:hover,
    .insight-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .header,
    .nav__toggle,
    .hero__actions,
    .footer {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: var(--space-lg) 0;
        background: white !important;
        color: black !important;
    }

    .hero__title,
    .hero__subtitle {
        color: black !important;
    }

    .section {
        padding: var(--space-lg) 0;
        page-break-inside: avoid;
    }

    .section--dark,
    .expertise,
    .community {
        background: white !important;
        color: black !important;
    }

    .section__title--light,
    .expertise-card__title,
    .expertise-card__description,
    .community__intro,
    .community__item-title,
    .community__item-description {
        color: black !important;
    }

    .expertise-card,
    .insight-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .nav__link[href]:after,
    .footer__link[href]:after,
    .insight-card__link[href]:after,
    .methodology__link[href]:after {
        content: "";
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .btn--primary,
    .btn--outline,
    .btn--outline-light {
        border-width: 3px;
    }

    .expertise-card {
        border: 2px solid var(--color-gold-primary);
    }
}

/* ==========================================================================
   Reduced Motion Support - Per CLAUDE.md guidelines
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }

    .hero__background {
        background-image: none;
    }
}
