:root {
    --bg: #f3f0ea;
    --text: #121212;
    --accent: #54b8d6;
    --accent2: #a567ff;
    --border: var(--text);
}

:root.night {
    --bg: #121212;
    --text: #f3f0ea;
    --accent: #1f79ad;
    --accent2: #431e9c;
    --border: var(--text);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "JetBrains Mono", monospace, sans-serif, system-ui;
    margin: 0;
    padding: clamp(1rem, 4vw, 2.5rem) 1rem;
    line-height: 1.6;
}

header {
    max-width: 800px;
    margin: 0 auto clamp(2rem, 5vw, 3rem) auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;

    & h1 {
        font-size: clamp(2.2rem, 8vw, 3rem);
        font-weight: 900;
        margin: 0;
        letter-spacing: -2px;

        & span {
            background-color: var(--accent);
            color: var(--bg);
            padding: 0 .3rem;
        }
    }

    & nav {
        display: flex;
        gap: .5rem;

        & button, & a {
            background: var(--bg);
            border: 2px solid var(--border);
            padding: .4rem .4rem;
            font-family: inherit;
            font-size: .9rem;
            font-weight: bold;
            cursor: pointer;
            text-decoration: none;
            color: var(--text);
            box-shadow: 2px 2px 0px var(--border);
            transition: transform .1s, box-shadow .1s;
            border-radius: 0 10px 0 10px;

            &:hover {
                transform: translate(-1px, -1px);
                box-shadow: 3px 3px 0px var(--border);
            }
        }
    }
}

main {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 4vw, 2rem);

    & section {
        border: 2px solid var(--border);
        background: var(--bg);
        box-shadow: 4px 4px 0px var(--border);

        & header {
            background-color: var(--accent);
            color: var(--bg);
            margin: 0;
            padding: .6rem 1rem;
            font-weight: bold;
            letter-spacing: 1px;
            font-size: .85rem;
            border-bottom: 2px solid var(--border);
            display: block;
        }

        & div {
            padding: clamp(1rem, 4vw, 1.125rem);

            & h2 {
                margin-top: 0;
                font-size: clamp(1.25rem, 4vw, 1.5rem);
            }

            & p {
                margin-bottom: 1rem;

                &:first-child {
                    margin-top: 0;
                }

                &:last-child {
                    margin-bottom: 0;
                }
            }
        }

        & ul { /* PRA TERMINAR */
            list-style: none;
            margin: 0;
            padding: clamp(1rem, 4vw, 1.5rem);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
            gap: 1rem;

            & li {
                & a {
                    display: flex;
                    flex-direction: column;
                    aspect-ratio: 1 / 1;
                    padding: 1.25rem;
                    border: 2px solid var(--border);
                    background: var(--bg);
                    color: var(--text);
                    text-decoration: none;
                    box-shadow: 3px 3px 0px var(--border);
                    transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;

                    & h3 {
                        margin: 0;
                        font-size: 1.2rem;
                        text-decoration: underline;
                        text-decoration-thickness: 2px;
                    }

                    & p {
                        margin: 0.75rem 0;
                        font-size: 0.9rem;
                        line-height: 1.4;
                    }

                    & span {
                        align-self: flex-start;
                        background: var(--accent-teal);
                        color: var(--text);
                        padding: 0.25rem 0.6rem;
                        font-size: 0.8rem;
                        font-weight: bold;
                        border: 2px solid var(--border);
                    }

                    &:hover {
                        background: var(--accent-yellow);
                        transform: translate(-2px, -2px);
                        box-shadow: 5px 5px 0px var(--border);
                    }

                    @media (max-width: 480px) {
                        aspect-ratio: auto;
                    }
                }
            }
        }
    }

    & article {
        border: 2px solid var(--border);
        background: var(--accent2);
        padding: clamp(1rem, 4vw, 1.5rem);
        box-shadow: 4px 4px 0px var(--border);
        display: flex;
        gap: .85rem;
        align-items: flex-start;

        & span {
            font-size: clamp(1.5rem, 5vw, 2rem);
            line-height: 1;
        }

        & div {
            & h3 {
                margin-top: 0;
                margin-bottom: .5rem;
                font-size: clamp(1.1rem, 3.5vw, 1.25rem);
            }

            & p {
                margin: 0;
            }
        }
    }
}

footer {
    max-width: 800px;
    margin: clamp(2.5rem, 6vw, 4rem) auto 0 auto;
    text-align: center;
    font-size: .85rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    & hr {
        border: none;
        border-top: 1px dashed var(--border);
        width: 100%;
    }

    & p {
        margin: 0;
    }

    & nav {
        display: flex;
        justify-content: center;
        gap: .75rem;
        flex-wrap: wrap;

        & a {
            border: 2px solid var(--border);
            padding: .5rem 1rem;
            font-weight: bold;
            text-decoration: none;
            color: var(--text);
            box-shadow: 3px 3px 0px var(--border);
            transition: transform .1s, box-shadow .1s;

            &:hover {
                transform: translate(-2px, -2px);
                box-shadow: 5px 5px 0px var(--border);
            }

            @media (max-width: 480px) {
                flex: 1 1 calc(50% - .75rem);
            }
        }
    }

    & small {
        color: #555;
    }
}

#self {
    display: flex;
    gap: 1rem;
    margin-inline: auto;

    & img:first-of-type {
        width: 125px;
        height: 125px;
        border: 2px solid var(--border);
        box-shadow: 4px 4px 0px var(--border);
        object-fit: cover;
        flex-shrink: 0;
        border-radius: 0 10px 0 10px;
    }

    & div:last-of-type {
        display: flex;
        flex-direction: column;
    }
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem 1.25rem;

    & > div {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        padding: 1rem;

        & div {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            padding: 0;
        }

        & progress {
            width: 100%;
            height: 6px;
            border: 1px solid var(--border);
            background: var(--bg);
            accent-color: var(--accent);
        }
    }
}

.contact {
    & form {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;

        & p {
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;

            & label {
                font-size: 0.8rem;
                font-weight: bold;
            }

            & input, & textarea {
                width: 100%;
                padding: 0.4rem 0.6rem;
                border: 2px solid var(--border);
                background: var(--bg);
                color: var(--text);
                font-family: inherit;
                font-size: 0.9rem;
                box-shadow: 2px 2px 0px var(--border);

                &:focus {
                    outline: none;
                    background: var(--bg);
                }
            }
        }

        & .foot {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-top: 0.5rem;
            flex-wrap: wrap;

            & button[type="submit"] {
                background: var(--accent);
                color: var(--text);
                border: 2px solid var(--border);
                padding: 0.5rem 1rem;
                font-family: inherit;
                font-weight: bold;
                cursor: pointer;
                box-shadow: 2px 2px 0px var(--border);
                transition: transform 0.1s, box-shadow 0.1s;

                &:hover {
                    transform: translate(-1px, -1px);
                    box-shadow: 3px 3px 0px var(--border);
                }
            }

            & span {
                font-size: 0.8rem;
                opacity: 0.7; /* Subtle default state */
            }
        }
    }
}