* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    scroll-behavior: smooth;
    scroll-padding-top: 4.375rem;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: white;
    position: relative;
    z-index: 0;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background:
        linear-gradient(120deg,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(20, 20, 20, 0.8) 35%,
            rgba(40, 40, 40, 0.7) 66%,
            rgba(20, 20, 20, 0.8) 85%,
            rgba(0, 0, 0, 0.9) 100%),
        url('background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-blend-mode: darken;
    z-index: -1;
    pointer-events: none;
}

#header {
    width: 100%;

    background: none;
    background-image: none;
    position: relative;
    padding-top: 4.375rem;

}

#header::before {
    display: none;
}

#header>* {
    position: relative;
    z-index: 2;
}

.logo {
    padding-top: 0.625rem;
    padding-left: 1.25rem;
    font-size: 3.125rem;
    font-weight: 600;
    letter-spacing: 0.0625em;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow:
        0.5em 0.5em 1em rgba(214, 214, 214, 0.45),
        0.125em 0.125em 0.25em rgba(255, 255, 255, 0.25),
        0 0.0625em 0 #fff,
        0 0 0 #ffffff;
    background: linear-gradient(90deg, #fff 0%, #e0e0e0 60%, #bdbdbd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logo-fade-in 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s 1 both;
}

.subtitle {
    font-size: 1.875rem;
    font-weight: 500;
    letter-spacing: 0.0625em;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow:
        0.5em 0.5em 1em rgba(0, 0, 0, 0.45),
        0.125em 0.125em 0.25em rgba(255, 255, 255, 0.25),
        0 0.0625em 0 #fff,
        0 0 0 #000;
    background: linear-gradient(90deg, #fff 0%, #e0e0e0 60%, #bdbdbd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logo-fade-in 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s 1 both;
    padding-left: 1.25rem;
}

.welcome-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-family: 'Quicksand', 'Poppins', Arial, sans-serif;
    font-weight: 700;
    color: rgba(240, 240, 240, 0.7);
    background: rgba(30, 30, 30, 0.92);
    z-index: 1000;
    border-radius: 2rem;
    letter-spacing: 0.125em;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.25);
    background-image: none;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: unset;
    background-clip: border-box;
    animation: welcome-fullscreen-fade 1.5s cubic-bezier(0.77, 0, 0.18, 1) 0s 1 both;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: top;
    padding: 2rem 1.25rem;
    margin: 0 auto;
    width: 100%;

}

.text-content {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9375rem 10vw;
    animation: logo-fade-in 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s 1 both;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4.375rem;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(0.5rem);
    -webkit-backdrop-filter: blur(0.5rem);
    box-shadow: 0 0.125rem 1.25rem rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

.nav-menu .nav-brand {
    display: flex;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.0625em;
    padding: 0.3125em 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0.125rem;
    background: linear-gradient(90deg, #fff 0%, #e0e0e0 60%, #bdbdbd 100%);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu img {
    height: 2.5rem;
    width: auto;
    vertical-align: middle;
    transition: all 0.3s ease;
    max-width: 100%;
    filter: brightness(0) invert(1);
}

.nav-menu img:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

#home {
    animation: logo-fade-in 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s 1 both;
    background: none;
    background-image: none;
    width: 100%;
}

#home,
#about,
#skills,
#projects,
#contact {
    padding: 2em 10vw 1em 10vw;
    box-sizing: border-box;
}

.content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2.5rem;
    gap: 1.5rem;
    font-size: 1.25rem;
    min-width: 21.25rem;
    max-width: 60rem;
    animation: logo-fade-in 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s 1 both;
    width: 100%;
    box-sizing: border-box;
}

.content h1 {
    color: #b88bff;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow:
        -1px -1px 0 #2a1a3a,
        1px -1px 0 #2a1a3a,
        -1px 1px 0 #2a1a3a,
        1px 1px 0 #2a1a3a;
}

.content p {
    font-size: 1.25rem;
    line-height: 1.7;
}

.content button {
    padding: 0.22em 0.5em;
    font-size: 1.25rem;
    font-weight: 600;
    border: 0.16em solid #8711cb;
    border-radius: 2em;
    background: linear-gradient(90deg, #8a0ca3 0%, #8711cb 100%);
    color: #fff;
    box-shadow: 0 0.375em 1.5em rgba(58, 12, 163, 0.18), 0 0.125em 0.5em rgba(0, 0, 0, 0.13);
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s, border-color 0.3s;
    width: 100%;
    max-width: 100%;
}

.content button:hover {
    background: linear-gradient(90deg, #6a11cb 0%, #3a0ca3 100%);
    border-color: #3a0ca3;
    transform: translateY(-0.125em) scale(1.04);
    box-shadow: 0 0.625em 2em rgba(58, 12, 163, 0.25), 0 0.1875em 0.75em rgba(0, 0, 0, 0.16);
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 2rem;
    height: 0.25rem;
    margin: 0.25rem 0;
    background: #fff;
    border-radius: 2px;
    transition: 0.4s cubic-bezier(0.77, 0, 0.18, 1);
    position: relative;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(0.5rem) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-0.5rem) rotate(-45deg);
}

.nav-menu ul li.active-section,
.nav-menu ul li.active-section a {
    background: linear-gradient(135deg, rgba(120, 60, 255, 0.18) 60%, rgba(80, 80, 120, 0.25) 100%);
    color: #fff;
    border-radius: 0.7em;
    font-weight: 600;
    transition: background 0.3s, color 0.3s;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
}

.skill-category ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 1.2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-category h3 {
    color: #e0e0e0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 1.2em;
}

.skill-category li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.735rem;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.85) 60%, rgba(40, 40, 40, 0.7) 100%);
    border: 1.5px solid rgba(120, 120, 120, 0.18);
    border-radius: 1em;
    box-sizing: border-box;
    padding: 0.7em 0.14em 0.7em 0.14em;
    transition:
        box-shadow 0.25s cubic-bezier(0.77, 0, 0.18, 1),
        border-color 0.25s cubic-bezier(0.77, 0, 0.18, 1),
        background 0.25s cubic-bezier(0.77, 0, 0.18, 1),
        transform 0.18s cubic-bezier(0.77, 0, 0.18, 1);
    box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.12);
    cursor: pointer;
    max-width: 15em;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.skill-category li:hover {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.95) 60%, rgba(80, 80, 80, 0.7) 100%);
    border-color: #a97fff;
    box-shadow: 0 4px 32px 0 rgba(169, 127, 255, 0.18), 0 2px 16px 0 rgba(0, 0, 0, 0.18);
    transform: translateY(-4px) scale(1.04);
}

.skill-category img {
    width: 2.6em;
    height: 2.6em;
    margin-bottom: 0.49em;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0.06em 0.25em rgba(80, 0, 120, 0.12));
}

.skill-category li span,
.skill-category li {
    margin-top: 0.3em;
}

.project-content {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.85) 60%, rgba(40, 40, 40, 0.7) 100%);
    border: 1.5px solid rgba(120, 120, 120, 0.18);
    border-radius: 1em;
    box-sizing: border-box;
    padding: 1.5em 1.2em 1.2em 1.2em;
    margin-bottom: 2em;
    box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.12);
    transition:
        box-shadow 0.4s cubic-bezier(0.77, 0, 0.18, 1),
        border-color 0.4s cubic-bezier(0.77, 0, 0.18, 1),
        background 0.5s cubic-bezier(0.77, 0, 0.18, 1),
        transform 0.3s cubic-bezier(0.77, 0, 0.18, 1);
}

.project-content:last-child {
    margin-bottom: 0;
}

.project-content:hover {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.95) 60%, rgba(80, 80, 80, 0.7) 100%);
    border-color: #a97fff;
    box-shadow: 0 8px 40px 0 rgba(169, 127, 255, 0.22), 0 2px 16px 0 rgba(0, 0, 0, 0.18);
    transform: translateY(-6px) scale(1.045);
}

.project-content h3 {
    margin-bottom: 0.7em;
    font-size: 1.3rem;
    color: #beace1;
    letter-spacing: 0.03em;
}

.project-content ul {
    margin: 0.5em 0 0.5em 1.2em;
    padding-left: 1em;
}

.project-content p,
.project-content ul {
    user-select: none;
}

.project-content li {
    margin-bottom: 0.4em;
    font-size: 1.05rem;
}

.project-content a {
    color: #a179f0;
    text-decoration: none;
    transition: color 0.2s;
}

.project-content a:hover {
    color: #4fc3f7;
    /* light blue */
    text-decoration: underline;
}

.external-link-icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-left: 0.3em;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.project-content a:hover .external-link-icon {
    opacity: 1;
}

.github-logo {
    width: 1.1em;
    height: 1.1em;
    vertical-align: middle;
    margin-right: 0.4em;
    display: inline-block;
    border-radius: 30%;
}

.contact-form {
    margin-top: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.92) 60%, rgba(60, 60, 80, 0.7) 100%);
    border: 1.5px solid rgba(120, 120, 120, 0.13);
    border-radius: 1em;
    padding: 1.2em 1em 1em 1em;
    box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.10);
    width: 100%;
    max-width: 100%;
}

.form-row {
    display: flex;
    gap: 1em;
    align-items: center;
    width: 100%;
}

.form-row label {
    min-width: 70px;
    font-weight: 600;
    color: #9a9494;
    margin-bottom: 0;
    flex-shrink: 0;
}

.form-row input {
    flex: 1 1 0;
    background: #23243a;
    color: #fff;
    border: 1px solid #3a2d5c;
    border-radius: 0.5em;
    padding: 0.7em;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-row input[type="email"]:not(:placeholder-shown):invalid {
    border-color: #ff4f4f;
    background: #2a1a2a;
}

.form-row input[type="email"]:not(:placeholder-shown):valid {
    border-color: #4fc3f7;
}

.form-row input:focus {
    border-color: #a97fff;
    outline: none;
}

.contact-form label[for="contact-message"] {
    font-weight: 600;
    color: #9a9494;
    margin-bottom: 0.3em;
    display: block;
}

.contact-form textarea {
    background: #23243a;
    color: #fff;
    border: 1px solid #3a2d5c;
    border-radius: 0.5em;
    padding: 0.7em;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s;
    width: 100%;
    min-height: 100px;
}

.contact-form textarea:focus {
    border-color: #a97fff;
    outline: none;
}

.contact-form button {
    align-self: center;
    background: #7f61bc;
    color: #e1e2fa;
    font-weight: 700;
    border: none;
    border-radius: 2em;
    padding: 0.6em 1.5em;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    max-width: 50%;
}

.contact-form button:hover {
    background: linear-gradient(90deg, #ffffff 0%, #aea2c5 100%);
    color: #000000;
}

#form-success {
    background: #23243a;
    border-radius: 0.5em;
    padding: 0.7em 1em;
    text-align: center;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.10);
}

#form-success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #23243a;
    color: #d5d8d9;
    font-weight: 700;
    border-radius: 0.7em;
    padding: 1.2em 2.2em;
    text-align: center;
    box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.22);
    font-size: 1.3rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#form-success-popup.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
    animation: fadeOutPopup 0.5s 2.5s forwards;
}

@keyframes fadeOutPopup {
    to {
        opacity: 0;
    }
}

#footer {
    width: 100%;
    background: #181828;
    border-top: 0.1rem solid rgba(120, 120, 120, 0.18);
    box-shadow: 0 -0.125rem 1rem 0 rgba(0, 0, 0, 0.12);
    padding: 3.5vw 0 2.5vw 0;
    margin-top: 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#footer ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 3vw;
    padding: 0;
    margin: 0;
    align-items: center;
}

#footer li {
    display: flex;
    align-items: center;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: #b88bff;
    gap: 0.5vw;
}

#footer a {
    color: #a179f0;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    font-size: inherit;
}

#footer a:hover {
    color: #4fc3f7;
    text-decoration: underline;
}

#footer .external-link-icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-left: 0.4em;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#footer a:hover .external-link-icon {
    opacity: 1;
}

#footer .copyright {
    width: 100%;
    text-align: center;
    color: #bdbdbd;
    font-size: 0.95rem;
    margin-top: 1.5vw;
    letter-spacing: 0.04em;
    font-weight: 400;
    user-select: none;
}

.footer-logo {
    width: 0.8em;
    height: 0.8em;
    min-width: 3.5vw;
    min-height: 3.5vw;
    max-width: 6vw;
    max-height: 6vw;
    vertical-align: middle;
    border-radius: 30%;
    display: inline-block;
    object-fit: contain;
    transition: width 0.2s, height 0.2s;
}

@media screen and (max-width: 576px) {
    .skill-category ul {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 900px) {
    .logo {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.25rem;
    }

    .nav-menu a {
        font-size: 1.1rem;
    }

    .content {
        padding: 1rem 2vw;
        gap: 1.1rem;
        font-size: 1.1rem;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content p {
        font-size: 1.5rem;
    }

    .content button {
        font-size: 1.1rem;
        padding: 0.12em 0.1em;
        border-radius: 1.5em;
    }

    .welcome-message {
        font-size: 1.5rem;
    }

    #home,
    #about,
    #skills,
    #projects,
    #contact {
        padding: 2em 1vw 1em 1vw;
    }

    .nav-toggle {
        display: flex;
        position: absolute;
        top: 1rem;
        right: 1.2rem;
        z-index: 1200;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.9);
        overflow: visible;
    }

    .nav-menu ul {
        display: flex;
        flex-direction: column;
        gap: 0rem;
        background: rgba(20, 20, 20, 0.98);
        position: fixed;
        top: 0;
        right: -100vw;
        width: 50vw;
        max-width: 320px;
        height: 100vh;
        padding: 4.375rem 0rem 2rem 0rem;
        z-index: 1100;
        box-shadow: -2px 0 16px rgba(0, 0, 0, 0.2);
        transition: right 0.5s cubic-bezier(0.77, 0, 0.18, 1);
        align-items: center;
        overflow-y: auto;
    }

    .nav-menu ul li:first-child {
        margin-top: 2.5rem;
    }

    .nav-menu ul.active {
        right: 0;
    }

    .nav-menu ul li {
        margin-top: 0;
        margin-bottom: 0;
        width: 100%;
        border: none;
        border-radius: 0.5em;
        background: rgba(30, 30, 30, 0.7);
        box-sizing: border-box;
    }

    .nav-menu ul li a {
        display: block;
        padding: 1rem 0rem 1rem 0rem;
        text-align: center;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3em;
    }

    .form-row label {
        min-width: 0;
    }
}

@media screen and (min-width: 901px) {
    .nav-menu ul {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2.2rem;
        background: transparent;
        position: static;
        height: auto;
        box-shadow: none;
        padding: 0;
    }

    .nav-menu ul li {
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        position: relative;
        transition: none;
    }

    .nav-menu ul li a {
        color: #fff;
        font-weight: 500;
        padding: 0.5em 0.7em;
        text-decoration: none;
        position: relative;
        transition: color 0.2s;
    }

    .nav-menu ul li.active-section a::after {
        width: 100%;
        background: #fff;
    }

    .nav-menu ul li.active-section a {
        color: #fff;
    }

    .nav-menu ul li.active-section,
    .nav-menu ul li.active-section a {
        background: none;
        color: #fff;
        border-radius: 0;
        font-weight: 600;
        transition: background 0.3s, color 0.3s;
    }
}

@media screen and (max-width: 1024px) {
    .header-content {
        padding: 1.5rem 2.5vw;
        max-width: 95vw;
    }

    .nav-menu {
        padding: 0.9375rem 5vw;
    }

    .nav-menu ul {
        gap: 1.5rem;
    }

    .content {
        padding: 2rem 2vw;
        min-width: unset;
        max-width: 100vw;
    }

    #home,
    #about,
    #skills,
    #projects,
    #contact {
        padding: 4em 4vw 2em 4vw;
    }
}

@media screen and (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
        padding-left: 0;
    }

    .subtitle {
        font-size: 1.5rem;
        padding-left: 0;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
        padding-top: 5rem;
    }

    .nav-menu {
        padding: 0.75rem 1.25rem;
    }

    .nav-menu ul {
        gap: 1rem;
    }

    .nav-menu a {
        font-size: 1rem;
    }

    .welcome-message {
        font-size: 2rem;
        padding: 0 1.25rem;
    }

    .content {
        padding: 1.25rem 2vw;
        gap: 1.25rem;
        font-size: 1.1rem;
    }

    .content h1 {
        font-size: 2rem;
    }

    .content p {
        font-size: 1rem;
    }

    .content button {
        font-size: 1.1rem;
        padding: 0.18em 0.15em;
    }

    #home,
    #about,
    #skills,
    #projects,
    #contact {
        padding: 3em 2vw 1.5em 2vw;
    }

    .skill-category ul {
        grid-template-columns: repeat(2, 1fr);
    }

    #footer ul {
        flex-direction: column;
        gap: 2vw;
        align-items: center;
    }

    #footer li {
        justify-content: center;
        width: 100%;
    }

    #footer {
        padding: 5vw 0 4vw 0;
        gap: 2vh;
    }
}

@media screen and (max-width: 380px) {
    .logo {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .nav-menu a {
        font-size: 0.9rem;
    }

    .nav-menu img {
        height: 1.5rem;
    }

    .welcome-message {
        font-size: 1rem;
    }

    .content {
        gap: 0.7rem;
    }
}