/* ════════════════════════════════════════════════════════════════
   RESPONSIVE STYLESHEET  —  Mobile-first media queries
   Breakpoints: 1200 | 992 | 768 | 576 | 400
════════════════════════════════════════════════════════════════ */

/* ─── Large Devices (Desktops / Laptops ≤1200px) ─── */
@media (max-width: 1200px) {
    .container {
        padding: 0 3rem;
    }
}

/* ─── Medium Devices (Tablets / Small Laptops ≤992px) ─── */
@media (max-width: 992px) {
    /* Hero: Clean breathing room below fixed ticker + header (111px) */
    .hero {
        padding-top: calc(36px + 75px + 2.5rem);
        padding-bottom: 4rem;
        min-height: auto;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
    }

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

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

    /* About */
    .about-skills-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Contact */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

/* ─── Small Devices (Landscape Phones / Tablets ≤768px) ─── */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    /* ── HERO: Spacious separation below ticker(36) + header(75) = 111px ── */
    .hero {
        padding-top: calc(36px + 75px + 2.75rem);
        padding-bottom: 3.5rem;
        min-height: auto;
    }

    .hero-container {
        gap: 2.75rem;
    }

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

    .status-badge {
        margin-bottom: 1.25rem;
    }

    /* ── NAVIGATION ── */

    /* Hamburger visible */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        z-index: 1200;
        padding: 4px;
    }

    /* X animation */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Fullscreen slide-in menu */
    .navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100dvh;
        background-color: var(--bg-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1100;
    }

    .navbar.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .nav-links a {
        font-size: 1.35rem;
        font-weight: 600;
    }

    /* Show mobile-only links (CV, Contact) */
    .mobile-only {
        display: block !important;
    }

    /* Hide desktop actions when menu open not needed */
    .btn-nav-talk {
        display: none;
    }
    .nav-icon-link {
        display: none;
    }

    /* ── HERO TEXT ── */
    .hero-title {
        font-size: clamp(2.1rem, 7.5vw, 2.75rem);
        line-height: 1.25;
        margin-bottom: 0.85rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
        margin-bottom: 1.25rem;
        max-width: 90%;
    }

    .hero-description {
        font-size: 0.98rem;
        line-height: 1.6;
        max-width: 90%;
        margin-bottom: 1.75rem;
    }

    .hero-skills {
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 2rem;
        max-width: 95%;
    }

    .skill-tag {
        font-size: 0.82rem;
        padding: 0.4rem 0.85rem;
    }

    .hero-cta {
        justify-content: center;
        margin-bottom: 2rem;
        gap: 1rem;
    }

    .hero-socials {
        justify-content: center;
        gap: 1.5rem;
    }

    /* Hero image stage */
    .image-stage {
        width: min(340px, 85vw);
        height: calc(min(340px, 85vw) * 1.20);
    }

    .fl-1 { left: -8%; }
    .fl-2 { right: -8%; }

    /* ── PROJECTS RESPONSIVE ── */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-info {
        padding: 1.75rem 1.5rem;
    }

    .project-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .project-links .btn {
        flex: 1 1 140px;
    }

    /* ── SECTIONS ── */
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    /* ── BLOG PAGE ── */
    .blog-page-wrapper {
        padding-top: 120px;
    }

    .blog-main-heading {
        font-size: clamp(2rem, 7vw, 2.75rem);
    }

    /* ── ARTICLE PAGES ── */
    .article-page-wrapper {
        padding-top: 120px;
    }

    /* ── FOOTER ── */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ─── Extra Small Devices (Phones ≤576px) ─── */
@media (max-width: 576px) {
    /* Hero paddings */
    .hero {
        padding-top: calc(36px + 75px + 2.25rem);
        padding-bottom: 3rem;
    }

    .hero-container {
        gap: 2.25rem;
    }

    .hero-title {
        font-size: clamp(1.85rem, 8.5vw, 2.35rem);
    }

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

    .hero-description {
        font-size: 0.92rem;
        line-height: 1.55;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .hero-skills {
        max-width: 100%;
        gap: 0.45rem;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        gap: 0.75rem;
    }

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

    .project-links .btn {
        width: 100%;
        flex: 1 1 100%;
    }

    /* Section titles */
    .section-title {
        font-size: 1.85rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* Hero image: shrink further */
    .image-stage {
        width: min(280px, 80vw);
        height: calc(min(280px, 80vw) * 1.20);
    }

    /* Hide side floating badges on small phones */
    .fl-1, .fl-2 { display: none; }
    .fl-3 { font-size: 0.72rem; padding: 0.4rem 0.8rem; }
    .clean-code-badge { font-size: 0.72rem; }

    /* Blog */
    .blog-page-wrapper {
        padding-top: 115px;
    }
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
    .blog-featured-grid {
        grid-template-columns: 1fr;
    }
    .featured-card-content {
        padding: 1.5rem;
    }

    /* Article */
    .article-page-wrapper {
        padding-top: 115px;
    }
    .article-container {
        padding: 0 1rem;
    }

    /* Contact cards */
    .contact-info-card {
        padding: 1.75rem;
    }

    .contact-form-wrapper {
        padding: 1.75rem;
    }

    /* ── CERTIFICATES ── */
    .cert-card-v2 {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        padding: 1.6rem 1.35rem 1.25rem;
        min-height: 330px;
    }

    .cert-section-header {
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .cert-header-controls {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .certificates::before,
    .certificates::after {
        width: 28px;
    }

    .cert-modal-dialog {
        border-radius: 16px;
    }

    .cert-modal-header,
    .cert-modal-body {
        padding: 1.15rem;
    }

    .cert-modal-frame-wrapper {
        height: 44vh;
        min-height: 250px;
    }

    .cert-modal-footer {
        padding: 1rem 1.15rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cert-modal-actions {
        flex-direction: column;
        width: 100%;
    }

    .cert-modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── Tiny Phones (≤400px) ─── */
@media (max-width: 400px) {
    .hero {
        padding-top: calc(36px + 75px + 1.75rem);
        padding-bottom: 2.5rem;
    }

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

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

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

    .skill-tag {
        font-size: 0.74rem;
        padding: 0.32rem 0.65rem;
    }

    .nav-links a {
        font-size: 1.15rem;
    }

    .blog-page-wrapper,
    .article-page-wrapper {
        padding-top: 120px;
    }

    .image-stage {
        width: min(240px, 78vw);
        height: calc(min(240px, 78vw) * 1.20);
    }
}
