@layer global {
    @font-face {
        font-display: Calibre-Medium;
        font-family: 'Calibre-Medium';
        font-style: normal;
        src: url('./fonts/Calibre-Medium.ttf')
    }

    html {
        scroll-behavior: smooth;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: Calibre-Medium, Arial, sans-serif;
    }
}

@layer component {
    .container {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        height: 124px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        @media (width > 62em) {
            width: min(calc(100% - 24px), calc(1200 / 16 * 1rem));
        }
    }

    .navbar {
        width: min(100% - 48px, 1200px);

        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        width: 35px;
        display: block;
        border-radius: 6px;
    }

    .nav-links {
        display: flex;
        gap: 2rem;
        list-style: none;
        gap: 50px;
    }

    .nav-links a {
        text-decoration: none;
        color: black;
        font-family: 'Calibre-Medium' 'Courier New', Courier, monospace;
        font-size: 13px;
        line-height: 7;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #3178c6;
    }

    .navbar button {
        background: none;
        border: none;
        padding: 0;

        @media (width > 62em) {
            display: none;
        }

    }

    .navbar button:hover {
        cursor: pointer;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 50px;
        font-weight: bolder;

        transform: translateY(100%);
        transition: transform 0s;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;

        @media (width < 62em) {
            gap: 24px;
        }
    }

    .nav-links--open {
        transform: translateX(0);
    }

    .nav-links a {
        line-height: normal;
        font-size: 16px;
    }

    .topnav__close {
        position: absolute;
        top: 46px;
        right: 76px;
    }

    .nav-logo {
        position: absolute;
        top: 45px;
        left: 24px;
    }

    .nav-logo img {
        width: 35px;
        display: block;
        border-radius: 6px;

        @media (width > 62em) {
            display: none;
        }
    }

    /* Desktop layout — reset the mobile panel styles */
    @media (width > 62em) {
        .nav-links {
            position: static;
            height: auto;
            width: auto;
            flex-direction: row;
            padding: 0;
            transform: none;
            box-shadow: none;
            background: transparent;
        }

        .nav-links a {
            font-size: 13px;
            line-height: 7;
        }
    }


    /* Main section */
    .hero {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        margin-top: clamp(40px, 8vw, 80px);

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: clamp(24px, 5vw, 60px);
    }

    .headline {
        flex: 1;
        min-width: 0;
    }

    .headline .p1 {
        font-size: clamp(1.5rem, 4.5vw, 2.8rem);
        line-height: 1.3;
        font-family: Calibre-Medium, 'Courier New', Courier, monospace;
    }

    .headline .p2 {
        margin-top: 0.75rem;
        font-size: clamp(1rem, 2vw, 1.25rem);
        color: #495057;
    }

    .headline .p2 a {
        color: #e8590c;
        text-decoration: none;
        font-weight: 500;
    }

    .headline .p2 a:hover {
        text-decoration: underline;
    }

    .backend-engineer {
        color: #ff2d75;
    }

    .ts {
        color: #3178C6;
    }

    .img {
        flex-shrink: 0;
    }

    .img img {
        width: clamp(200px, 25vw, 350px);
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 10px;
        box-shadow: #3178c6 clamp(6px, 1vw, 10px) clamp(6px, 1vw, 10px);
    }

    @media (width <= 62rem) {
        .hero {
            flex-direction: column;
            align-items: flex-start;
        }

        .img {
            width: 100%;
            display: flex;
            justify-content: center;
        }

        .img img {
            width: min(100%, 300px);
        }
    }

    .section-title {
        font-size: clamp(1.25rem, 3vw, 1.75rem);
        font-weight: 600;
        margin-bottom: 2rem;
        letter-spacing: 0.02em;
    }

    .skills {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        margin-top: clamp(60px, 10vw, 120px);
    }

    .skills-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
    }

    .skill-category {
        background: #f8f9fa;
        border-radius: 12px;
        padding: clamp(1.5rem, 3vw, 2.5rem);
        border: 1px solid #e9ecef;
        flex: 1 1 260px;
    }

    .skill-category h3 {
        font-size: 0.9375rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: #212529;
    }

    .skill-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .skill-tags span {
        background: #e9ecef;
        color: #495057;
        font-size: 0.8125rem;
        padding: 0.25rem 0.75rem;
        border-radius: 6px;
    }

    .projects {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        margin-top: clamp(60px, 10vw, 120px);
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .project-card {
        background: #f8f9fa;
        border-radius: 12px;
        padding: clamp(1.25rem, 2.5vw, 2rem);
        border: 1px solid #e9ecef;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .project-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .project-info h3 {
        font-size: clamp(1.125rem, 2vw, 1.375rem);
        margin-bottom: 0.5rem;
    }

    .project-description {
        font-size: clamp(0.9375rem, 1.5vw, 1rem);
        line-height: 1.6;
        color: #495057;
        margin-bottom: 1rem;
    }

    .project-tech {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }

    .project-tech span {
        background: #e9ecef;
        color: #495057;
        font-size: 0.8125rem;
        padding: 0.25rem 0.75rem;
        border-radius: 6px;
        letter-spacing: 0.01em;
    }

    .project-link {
        display: inline-block;
        font-size: 0.875rem;
        color: #3178c6;
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid transparent;
        transition: border-color 0.2s;
    }

    .project-link:hover {
        border-bottom-color: #3178c6;
    }

    .resume {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        margin-top: clamp(60px, 10vw, 120px);
    }

    .resume-text {
        font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
        color: #495057;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }

    .resume-link {
        display: inline-flex;
        align-items: center;
        padding: 0.75rem 1.5rem;
        background: #3178c6;
        color: #fff;
        font-size: 0.9375rem;
        font-weight: 500;
        text-decoration: none;
        border-radius: 8px;
        transition: background 0.2s, transform 0.2s;
    }

    .resume-link:hover {
        background: #255a9c;
        transform: translateY(-2px);
    }

    .contact {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        margin-top: clamp(60px, 10vw, 120px);
    }

    .contact-text {
        font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
        color: #495057;
        margin-bottom: 2rem;
        line-height: 1.6;
    }

    .contact-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .contact-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.25rem;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        text-decoration: none;
        transition: transform 0.2s, box-shadow 0.2s;
        max-width: 480px;
    }

    .contact-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .contact-label {
        font-size: 0.8125rem;
        font-weight: 600;
        color: #3178c6;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        min-width: 64px;
    }

    .contact-value {
        font-size: 0.9375rem;
        color: #212529;
    }

    .footer {
        width: min(calc(100% - 48px), calc(1200 / 16 * 1rem));
        margin-inline: auto;
        padding: 2rem 0;
        border-top: 1px solid #e9ecef;
        margin-top: 3rem;
        text-align: center;
        color: #868e96;
        font-size: 0.875rem;
    }
}
