/* ==========================================================================
   RESPONSIVE OVERRIDES
   Comprehensive responsive rules for all device sizes
   ========================================================================== */

/* --- Global overflow safety --- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.c-value,
.cert-id,
.detail-val,
.project-card-desc,
.timeline-desc,
.hero-description,
.about-paragraph,
.modal-desc,
.timeline-role,
.vol-card p,
.vol-card h4,
.vol-card h5,
.project-card-title,
.hero-badge {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Constrain ambient glow blobs on smaller viewports */
.ambient-glow {
    max-width: 100vw;
}

/* ========== 1100px — Narrower desktops ========== */
@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-menu {
        gap: 18px;
    }

    .nav-link {
        font-size: 0.88rem;
    }
}

/* ========== 992px — Tablets / small laptops ========== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        order: -1;
    }

    .hero-section {
        padding-top: 120px;
        padding-bottom: 60px;
        min-height: auto;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 50px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .skills-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .timeline-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

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

    .full-width-card {
        grid-column: span 2;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .project-filters {
        flex-wrap: wrap;
    }

    .about-section,
    .skills-section,
    .projects-section,
    .experience-section,
    .volunteering-section,
    .contact-section {
        padding: 70px 0;
    }

    .terminal-window {
        margin: 50px 0;
    }
}

/* ========== 768px — Tablets portrait / large phones ========== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .header {
        height: 64px;
    }

    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.35rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .profile-card-wrapper {
        width: 270px;
    }

    .profile-image-container {
        width: 150px;
        height: 150px;
    }

    .content-wrapper {
        padding: 0 16px;
    }

    .header-container {
        padding: 0 16px;
    }

    .project-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .vol-icon-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .terminal-body {
        height: 240px;
        padding: 16px;
    }

    .terminal-header {
        padding: 10px 14px;
    }

    .terminal-title {
        font-size: 0.7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 160px;
    }

    .terminal-footer {
        padding: 8px 14px;
    }

    .modal-wrapper {
        width: 95%;
        max-height: 90vh;
        border-radius: 18px;
    }

    .modal-media-container {
        height: 240px;
    }

    .modal-media-container-portrait {
        height: min(64vh, 520px);
    }

    .modal-info {
        padding: 22px;
    }

    .modal-title {
        font-size: 1.6rem;
    }
}

/* ========== 600px — Phones ========== */
@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .hero-section {
        padding-top: 100px;
        padding-bottom: 40px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

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

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-socials {
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .stat-icon {
        font-size: 1.4rem;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .personal-details-grid {
        grid-template-columns: 1fr;
    }

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

    .project-filters {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

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

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 20px;
    }

    .contact-col-title {
        font-size: 1.2rem;
    }

    .contact-desc {
        font-size: 0.92rem;
    }

    .c-info-card {
        padding: 14px 16px;
        gap: 14px;
    }

    .c-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .c-value {
        font-size: 0.88rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer {
        margin-top: 40px;
        padding: 24px 0;
    }

    .about-section,
    .skills-section,
    .projects-section,
    .experience-section,
    .volunteering-section,
    .contact-section {
        padding: 50px 0;
    }

    .terminal-window {
        margin: 40px 0;
    }

    .info-card {
        padding: 18px;
    }

    .profile-card-wrapper {
        width: 240px;
    }

    .profile-image-container {
        width: 130px;
        height: 130px;
    }

    .profile-info h3 {
        font-size: 1.2rem;
    }

    .profile-tags {
        flex-wrap: wrap;
    }

    .section-title {
        font-size: 1.55rem;
    }

    .about-subtitle {
        font-size: 1.15rem;
    }

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

    .timeline-desc {
        font-size: 0.82rem;
    }

    .timeline-bullets {
        font-size: 0.8rem;
    }

    .vol-card {
        padding: 18px;
    }

    .vol-card h4 {
        font-size: 1rem;
    }

    .project-card-title {
        font-size: 1.1rem;
    }

    .project-card-desc {
        font-size: 0.82rem;
    }

    .project-details {
        padding: 18px;
    }

    .modal-wrapper {
        width: 96%;
        max-height: 92vh;
        border-radius: 16px;
    }

    .modal-media-container {
        height: 200px;
    }

    .modal-media-container-portrait {
        height: min(60vh, 480px);
    }

    .modal-info {
        padding: 18px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }

    .modal-footer-actions {
        margin-top: 24px;
        padding-top: 18px;
    }

    .modal-footer-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.88rem;
    }

    .modal-codeblock {
        font-size: 0.72rem;
    }

    .btn {
        padding: 10px 22px;
        font-size: 0.88rem;
    }

    /* Mobile drawer full width on small phones */
    .mobile-drawer {
        width: 280px;
        right: -300px;
    }
}

/* ========== 400px — Very small phones ========== */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        flex-direction: row;
        padding: 12px 14px;
    }

    .profile-card-wrapper {
        width: 210px;
    }

    .profile-image-container {
        width: 110px;
        height: 110px;
    }

    .profile-card {
        padding: 18px;
    }

    .content-wrapper {
        padding: 0 12px;
    }

    .header-container {
        padding: 0 12px;
    }

    .project-img-container {
        height: 160px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .project-card-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-info {
        padding: 14px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-media-container {
        height: 170px;
    }

    .contact-form {
        padding: 16px;
    }

    .terminal-body {
        height: 200px;
        padding: 12px;
        font-size: 0.78rem;
    }

    .t-cmd-btn {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .mobile-drawer {
        width: 260px;
        right: -280px;
    }

    .drawer-link {
        font-size: 1rem;
    }
}
