/* Basic page layout and typography */
body {
    font-weight: bold;
    background-size: cover;
    background: url("https://wallpaperaccess.com/full/260170.png") no-repeat fixed center;
    font-family: var(--font), serif;
    color: var(--w);
    display: flex;
    justify-content: center;
    margin: 100px 0;
}

/* Aside positioning and layout */
aside {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Main heading and image styles */
h1 {
    text-align: center;
    text-shadow: 1px 2px 3px black;
    color: var(--r);
}

h1 + img {
    margin: 10px;
    border-radius: 20px;
    box-shadow: 5px 5px 10px black;
}

h2 {
    color: var(--w);
}

/* Icon general styling */
i {
    font-size: 60px;
    margin: 10px;
    color: var(--r);
    text-shadow: 2px 2px 2px black;
    transition: 0.4s ease-in-out;
    opacity: 0.6;
}

i:hover {
    opacity: 1;
    cursor: pointer;
}

/* Main content layout */
main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    width: 80%;
    margin: 1rem 0 6rem;
}

main > article {
    width: 80%;
}

.index {
    max-width: 30rem;
}

/* Card component styling */
.card {
    background: var(--a);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 5px 5px 10px black;
}

/* Card toggle functionality */
.card > :not(div) {
    display: none;
}

.card.active > :not(div) {
    display: flex;
}

.table {
    overflow-x: auto;
}

.card.active > table {
    display: table;
}

.card > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 10px;
}

h2, label {
    text-shadow: 1px 2px 3px black;
}

ul {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

/* Grid styling */
#skills.active ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}

#skills li:last-child {
    grid-column: 2;
}

/* General styling */
nav a {
    font-size: 1.2rem;
    color: var(--w);
    text-shadow: 2px 2px 2px black;
    transition: 0.4s ease-in-out;
    opacity: 0.6;
}

nav a:hover {
    opacity: 1;
    color: var(--r);
}

.card table {
    border-collapse: collapse;
    margin: 1rem 0;
}

.card th, .card td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.4s ease-in-out;
}

/* Contact form styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Form elements styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group input, .form-group textarea {
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--w);
    font-family: inherit;
    font-size: 1rem;
    transition: 0.4s ease-in-out;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    padding: 0.3rem 2rem;
    border: none;
    border-radius: 10px;
    background-color: var(--a);
    color: var(--w);
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem;
    text-shadow: 1px 2px 3px black;
    box-shadow: 0 0 10px 2px black;

    i {
        opacity: 1;
        transition: 0.4s ease-in-out;
    }
}

.submit-btn:hover {
    background-color: var(--r);

    i {
        color: var(--a);
    }
}

::placeholder {
    color: var(--w);
}

/* Navigation menu styling */
.nav-menu {
    width: 100%;
    position: fixed;
    top: 0;
    background: var(--r);
    padding: 1rem;
    box-shadow: 0 0 8px 4px black;
    z-index: 100;
}

.nav-menu ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
}

.nav-menu a:hover {
    color: var(--w);
}

/* Burger menu styling */
.burger-menu {
    box-sizing: unset;
    background: var(--a);
    box-shadow: 0 0 8px 4px black;
    padding: 1rem;
    border-radius: 0 0 0 20px;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 101;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--w);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Animated burger icon when active */
.burger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

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

/* Footer styling */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    position: fixed;
    bottom: 0;
    background: var(--a);
    padding: .3rem 0;
    box-shadow: 0 0 8px 4px black;
    z-index: 100;
}

footer i {
    font-size: 40px;
}

/* Loader styling */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--r);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: hideLoader 1s ease-in-out 1s forwards;
}

.loader {
    width: 50px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid;
    border-color: var(--r) var(--w);
    animation: l1 1s infinite, hideLoader 1s ease-in-out 1s forwards;
}

/* Hide all content except loader initially and show after 2 seconds */
body > *:not(.loader-wrapper) {
    opacity: 0;
    animation: showContent 1s ease-in-out 1s forwards;
}

/* Aside animation */
.animate:hover {
    animation: animate infinite 3s ease-in-out;
}

@keyframes animate {
    50% {
        transform: translateY(50px)
    }
}

@keyframes l1 {
    to {
        transform: rotate(.5turn)
    }
}

@keyframes hideLoader {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes showContent {
    to {
        opacity: 1;
    }
}

/* Mobile styling */
@media screen and (max-width: 768px) {

    .nav-menu {
        position: fixed;
        top: -100%;
        height: 100%;
        background: var(--r);
        padding: 80px 20px;
        transition: 0.4s ease-in-out;
    }

    .nav-menu.active {
        top: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: center;
    }

    .nav-menu ul li {
        margin: 20px 0;
    }

    .burger-menu {
        display: flex;
    }

    main {
        padding: 0 20px;
    }

    main article {
        width: 100%;
    }

    aside {
        margin: 0 0 5rem;
    }

    #skills ul i {
        font-size: 40px;
    }

    table {
        width: 60vh;
    }

    footer {
        gap: 0;
    }
}