/* Responsive Design */

/* Modern iPhones (with notch/dynamic island) */
@media screen and (device-width: 430px) and (device-height: 932px),
       screen and (device-width: 393px) and (device-height: 852px),
       screen and (device-width: 428px) and (device-height: 926px),
       screen and (device-width: 390px) and (device-height: 844px) {
    .header {
        padding-top: env(safe-area-inset-top);
    }

    .nav-links.active {
        padding-bottom: env(safe-area-inset-bottom);
    }

    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Large Devices (Desktops) */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 960px;
        padding: 0 30px;
    }
}

/* Medium Devices (Tablets) */
@media screen and (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .two-column-grid {
        gap: 2rem;
    }

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

/* Small Devices (Landscape Phones) */
@media screen and (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 20px;
    }

    /* Header & Navigation */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .mobile-menu {
        display: block;
        position: relative;
        z-index: 1000;
        padding: 10px;
        margin: -10px;
    }

    .mobile-menu span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--primary-color);
        margin: 5px 0;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .mobile-menu span:nth-child(1).active {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-menu span:nth-child(2).active {
        opacity: 0;
    }

    .mobile-menu span:nth-child(3).active {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem 1.5rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 0.75rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links .cta-button {
        width: 100%;
        margin: 1rem 0;
    }

    /* Timeline Adjustments */
    .timeline {
        padding: 20px 0;
    }

    .timeline-line {
        left: 30px;
    }

    .timeline-block {
        width: 100%;
        padding-left: 70px !important;
        padding-right: 20px !important;
        text-align: left !important;
        float: none !important;
        margin: 30px 0;
    }

    .timeline-block::after {
        left: 20px !important;
        right: auto !important;
    }

    .timeline-block .node {
        left: 15px;
    }

    /* Hero Section */
    .hero {
        min-height: 80vh;
        padding: 80px 0 60px;
        margin-top: var(--header-height);
    }

    .hero .container {
        text-align: center;
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }

    .hero .tagline {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    /* Grid Layouts */
    .skills-grid,
    .two-column-grid,
    .three-column-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .skill-item {
        padding: 1.5rem;
    }

    /* Section Spacing */
    section {
        padding: 3rem 0;
    }

    /* CTA Groups */
    .cta-group {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }
}

/* Extra Small Devices (Portrait Phones) */
@media screen and (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .logo span {
        font-size: 1.2rem;
    }

    .logo-image {
        width: 40px;
        height: 40px;
    }

    .skill-item {
        padding: 1.25rem;
    }

    .skill-item h3 {
        font-size: 1.25rem;
    }

    /* Form Elements */
    .contact-form input,
    .contact-form textarea {
        font-size: 16px;
        padding: 12px;
    }

    /* Footer Adjustments */
    .footer-content {
        text-align: center;
    }

    .footer-image {
        margin: 0 auto 1rem;
    }
}
