/* ========================================
   TYC Website - Responsive Stylesheet
   Mobile-First Responsive Breakpoints
   ======================================== */

/* ----------------------------------------
   Large Desktop (max-width: 1400px)
   ---------------------------------------- */
@media screen and (max-width: 1400px) {
    :root {
        --container-max-width: 1140px;
    }

    .hero__logo-float {
        width: 300px;
    }
}

/* ----------------------------------------
   Desktop (max-width: 1200px)
   ---------------------------------------- */
@media screen and (max-width: 1200px) {
    :root {
        --container-max-width: 960px;
    }

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

    .topic__card--large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .topic__card--wide {
        grid-column: span 2;
    }

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

    .footer__grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .footer__newsletter {
        grid-column: 1 / -1;
    }
}

/* ----------------------------------------
   Tablet & Below (max-width: 1024px)
   ---------------------------------------- */
@media screen and (max-width: 1024px) {
    :root {
        --container-max-width: 720px;
        --spacing-3xl: 5rem;
    }

    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__content {
        padding: var(--spacing-3xl) 0 var(--spacing-lg);
    }

    .hero__description {
        max-width: 100%;
        margin: 0 auto var(--spacing-xl);
    }

    .hero__buttons {
        justify-content: center;
    }

    .hero__stats {
        justify-content: center;
    }

    .hero__image {
        display: none;
    }

    .about__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .about__images {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }

    .about__text .section__subtitle,
    .about__text .section__title {
        text-align: center;
    }

    .about__text .section__subtitle::after {
        display: inline-block;
    }

    .about__description {
        text-align: center;
    }

    .about__features {
        max-width: 400px;
        margin: var(--spacing-xl) auto;
    }

    .about__text .btn {
        display: block;
        width: fit-content;
        margin: 0 auto;
    }

    .values__grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .value__card--featured {
        transform: none;
    }

    .value__card--featured:hover {
        transform: translateY(-10px);
    }

    .testimonials__grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }

    .testimonial__card--featured {
        transform: none;
    }

    .testimonial__card--featured:hover {
        transform: translateY(-5px);
    }

    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 180px);
    }

    .gallery__item--tall {
        grid-row: span 2;
    }

    .community__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .community__text .section__subtitle,
    .community__text .section__title {
        text-align: center;
    }

    .community__text .section__subtitle::after {
        display: inline-block;
    }

    .community__description {
        text-align: center;
    }

    .community__benefits {
        max-width: 400px;
        margin: 0 auto;
    }

    .community__channels {
        flex-direction: row;
    }

    .channel__card {
        flex: 1;
    }

    .contact__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .contact__info .section__subtitle,
    .contact__info .section__title {
        text-align: center;
    }

    .contact__info .section__subtitle::after {
        display: inline-block;
    }

    .contact__description {
        text-align: center;
    }

    .contact__cards {
        flex-direction: row;
    }

    .contact__card {
        flex: 1;
        flex-direction: column;
        text-align: center;
    }

    .contact__card:hover {
        transform: translateY(-5px);
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }

    .footer__brand {
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer__logo {
        margin: 0 auto var(--spacing-sm);
    }

    .footer__social {
        justify-content: center;
    }

    .footer__bottom .container {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
}

/* ----------------------------------------
   Mobile Landscape & Below (max-width: 768px)
   ---------------------------------------- */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 4rem;
        --spacing-3xl: 4rem;
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }

    /* Floating Shapes - Reduce for performance */
    .shape {
        filter: blur(60px);
        opacity: 0.3;
    }

    .shape--4,
    .shape--5 {
        display: none;
    }

    /* Mobile Navigation */
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--color-bg-card);
        padding: 6rem var(--spacing-lg) var(--spacing-lg);
        transition: right var(--transition-normal);
        box-shadow: var(--shadow-lg);
        z-index: 100;
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .nav__link {
        font-size: 1.125rem;
    }

    .nav__link::after {
        left: 0;
        transform: none;
    }

    .nav__close {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1.75rem;
        color: var(--color-text-primary);
        cursor: pointer;
    }

    .nav__toggle {
        display: block;
    }

    /* Hero */
    .hero__badge {
        font-size: 0.75rem;
    }

    .hero__title {
        font-size: 2.25rem;
    }

    .hero__description {
        font-size: 1rem;
    }

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

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

    .hero__stats {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .hero__stat {
        flex: 1;
        min-width: 100px;
    }

    .hero__stat-number {
        font-size: 2rem;
    }

    /* Section Headers */
    .section__subtitle::before,
    .section__subtitle::after {
        width: 20px;
    }

    .section__title {
        font-size: 2rem;
    }

    /* About */
    .about__image-main img {
        height: 300px;
    }

    .about__image-secondary {
        width: 150px;
        right: -20px;
        bottom: -20px;
    }

    .about__image-secondary img {
        height: 120px;
    }

    .about__experience-badge {
        top: -10px;
        left: -10px;
        padding: var(--spacing-sm);
    }

    .about__experience-number {
        font-size: 2rem;
    }

    /* Topics */
    .topics__grid {
        grid-template-columns: 1fr;
    }

    .topic__card--large,
    .topic__card--wide {
        grid-column: span 1;
    }

    .topics__grid .topic__card {
        min-height: 280px;
    }

    /* Impact */
    .impact__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .impact__stat {
        padding: var(--spacing-md);
    }

    .impact__stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .impact__stat-number {
        font-size: 2rem;
    }

    .impact__stat-suffix {
        font-size: 1.5rem;
    }

    .impact__stat-label {
        font-size: 0.8125rem;
    }

    /* Gallery */
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 150px);
    }

    /* Community */
    .community__channels {
        flex-direction: column;
    }

    /* Contact */
    .contact__cards {
        flex-direction: column;
    }

    .contact__card {
        flex-direction: row;
        text-align: left;
    }

    .contact__card:hover {
        transform: translateX(10px);
    }

    .form__row {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer__links ul {
        align-items: center;
    }

    .footer__newsletter {
        max-width: 400px;
        margin: 0 auto;
    }

    .footer__newsletter-form {
        flex-direction: column;
    }

    .footer__newsletter-btn {
        width: 100%;
        height: auto;
        padding: 0.875rem;
    }

    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 44px;
        height: 44px;
    }
}

/* ----------------------------------------
   Mobile Portrait (max-width: 480px)
   ---------------------------------------- */
@media screen and (max-width: 480px) {
    :root {
        --spacing-2xl: 3rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .section__title {
        font-size: 1.75rem;
    }

    .section__subtitle {
        font-size: 0.75rem;
    }

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

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }

    /* Hero */
    .hero__title {
        font-size: 1.875rem;
    }

    .hero__stat-number {
        font-size: 1.75rem;
    }

    .hero__stat-label {
        font-size: 0.75rem;
    }

    /* About */
    .about__image-main img {
        height: 250px;
    }

    .about__image-secondary {
        width: 120px;
    }

    .about__image-secondary img {
        height: 100px;
    }

    /* Values */
    .value__card-image {
        height: 150px;
    }

    .value__icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-top: -45px;
    }

    .value__title {
        font-size: 1.25rem;
    }

    /* Topics */
    .topics__grid .topic__card {
        min-height: 250px;
    }

    .topic__title {
        font-size: 1.125rem;
    }

    /* Impact */
    .impact__stat-number {
        font-size: 1.75rem;
    }

    .impact__stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* Testimonials */
    .testimonial__card {
        padding: var(--spacing-md);
    }

    .testimonial__quote {
        font-size: 2rem;
    }

    /* Gallery */
    .gallery__grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(4, 120px);
    }

    .gallery__item--tall {
        grid-row: span 2;
    }

    .gallery__item--wide {
        grid-column: span 2;
    }

    /* Channel */
    .channel__card {
        padding: var(--spacing-md);
    }

    .channel__icon {
        font-size: 2.5rem;
    }

    .channel__avatars img,
    .channel__avatars-more {
        width: 30px;
        height: 30px;
    }

    /* Contact */
    .contact__form-wrapper {
        padding: var(--spacing-md);
    }

    .form__input {
        padding: 0.875rem 1rem;
    }

    /* Footer */
    .footer__top {
        padding: var(--spacing-2xl) 0;
    }

    .footer__logo {
        width: 100px;
    }

    .footer__social a {
        width: 40px;
        height: 40px;
    }
}

/* ----------------------------------------
   Touch Device Optimizations
   ---------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .btn--glow {
        animation: none;
    }

    .value__card:hover,
    .topic__card:hover,
    .testimonial__card:hover,
    .channel__card:hover,
    .impact__stat:hover,
    .contact__card:hover {
        transform: none;
    }

    .hero__logo-float {
        animation: none;
    }

    .shape {
        animation: none;
    }
}

/* ----------------------------------------
   Reduced Motion Preference
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero__logo-float,
    .hero__scroll-btn i,
    .shape,
    .btn--glow {
        animation: none;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ----------------------------------------
   High Contrast Mode
   ---------------------------------------- */
@media (prefers-contrast: high) {
    :root {
        --color-text-secondary: #D4D4E4;
        --color-text-muted: #9090A4;
    }

    .btn--glass {
        border-width: 2px;
    }

    .form__input {
        border-width: 2px;
    }

    .channel__card,
    .contact__form-wrapper {
        border-width: 2px;
    }
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */
@media print {
    .header,
    .hero__buttons,
    .hero__scroll,
    .floating-shapes,
    .back-to-top,
    .community__channels .btn,
    .instagram,
    .contact__form-wrapper,
    .footer__social,
    .footer__newsletter,
    .nav__toggle {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        padding: 2rem 0;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero__background {
        display: none;
    }

    a {
        text-decoration: underline;
    }

    .text-gradient,
    .hero__title-accent,
    .footer__tagline {
        background: none;
        -webkit-text-fill-color: currentColor;
        color: #8B5CF6;
    }

    img {
        max-width: 300px;
    }
}
