/* Tablet & Below (≤ 1024px): sidebar collapses to a normal top block, stops being fixed */
@media (max-width: 1024px) {
    .page-layout {
        padding: 2.5rem 1.5rem;
    }

    .sidebar {
        position: static;
        left: auto;
        width: auto;
        max-height: none;
        overflow: visible;
    }

    main.content-column {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    section {
        scroll-margin-top: 80px;
    }

    nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
        height: auto;
        max-height: none;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 18px;
        padding: 0.6rem;
        box-shadow: 0 16px 40px var(--shadow-color);
        overflow: visible;
        z-index: 99;
    }

    nav.active {
        display: flex;
        animation: fadeInUp 0.2s ease-out;
    }

    nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        width: 100%;
    }

    nav a {
        display: block;
        padding: 0.85rem 1.1rem;
        border-radius: 12px;
        font-size: 1rem;
        text-align: center;
    }

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

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

    .project-content {
        padding: 1.5rem;
    }

    .hero-text {
        align-items: center;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.1rem;
    }

    .hero-image {
        width: 160px;
        height: 160px;
        align-self: center;
    }

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

    .skills-tile-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

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

    .education-item {
        padding: 1.5rem;
    }

    section {
        margin-bottom: 4.5rem;
    }

    footer {
        padding: 1.5rem 0 0;
    }
}

/* Mobile (< 640px) */
@media (max-width: 640px) {
    .page-layout {
        padding: 2rem 1.25rem;
    }

    .logo {
        font-size: 1rem;
    }

    .theme-toggle,
    .header-btn {
        width: 2.2rem;
        height: 2.2rem;
    }

    section {
        margin-bottom: 3.5rem;
    }

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

    .hero-text h1 {
        font-size: 1.7rem;
        line-height: 1.25;
    }

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

    .hero-buttons {
        justify-content: center;
        width: 100%;
        gap: 0.65rem;
    }

    .hero-buttons .btn {
        width: auto;
    }

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

    .hero-image {
        width: 170px;
        height: 170px;
    }

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

    .skills-tile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .education-item {
        grid-template-columns: 56px 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }

    .education-icon {
        width: 56px;
        height: 56px;
    }

    .education-icon img {
        width: 46px;
        height: 46px;
    }

    .education-title {
        font-size: 1.05rem;
    }

    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    footer {
        text-align: center;
        padding: 1.25rem 0 0;
    }
}
