/* ─── Reset ──────────────────────────────────────────────── */
*, html, body {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* ─── Tokens / Light mode ─────────────────────────────────── */
:root {
    --bg-from:              #fff;
    --bg-to:                #f1f5f9;

    --text-primary:         #374151;
    --text-body:            #111827;
    --text-section:         #1f2937;

    --hero-span-from:       #3b82f6;
    --hero-span-to:         #1e3a8a;

    --nav-hover:            #f1f4f8;
    --nav-footer-mobile:    #f2f6fa;

    --card-border:          #cdd8e4;
    --card-border-hover:    #81acf3;
    --card-bg-skills:       #fcfcfd;

    --skills-btn-text:      #5f6f8a;
    --skills-btn-bg:        #ffffff;
    --skills-icon:          #7d8594;
    --skills-link:          #6b7280;

    --contact-bg:           #ffffff;
    --contact-form-bg:      #ffffff;
    --contact-label:        #4b5563;
    --contact-input-bg:     #fff;
    --contact-input-border: #cbd5e1;

    --footer-copyright-bg:  #e9eef3;
    --divider:              #e5e7eb;
}

/* ─── Tokens / Dark mode ──────────────────────────────────── */
body.dark {
    --bg-from:              #0E141A;
    --bg-to:                #17212B;

    --text-primary:         #f9fafb;
    --text-body:            #f9fafb;
    --text-section:         #f9fafb;

    --hero-span-from:       #bfdbfe;
    --hero-span-to:         #3b82f6;

    --nav-hover:            #1e2b38;
    --nav-footer-mobile:    #162029;

    --card-border:          #364c63;
    --card-border-hover:    #1e3a8a;
    --card-bg-skills:       #1e2b38;

    --skills-btn-text:      #dbdee0;
    --skills-btn-bg:        #17212b;
    --skills-icon:          #dbdee0;
    --skills-link:          #dbdee0;

    --contact-bg:           #1e2b38;
    --contact-form-bg:      #17212b;
    --contact-label:        #f9fafb;
    --contact-input-bg:     #131c24;
    --contact-input-border: #334155;

    --footer-copyright-bg:  #040608;
    --divider:              #1f2937;
}

/* ─── Base ────────────────────────────────────────────────── */
html, body {
    font-family: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(170deg, var(--bg-from), var(--bg-to));
    scroll-behavior: smooth;
    color: var(--text-body);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ─── Navbar ──────────────────────────────────────────────── */
.navbar {
    z-index: 999;
    position: relative;
    width: 100%;
    padding: 1.563rem 0;
    background-color: transparent;
    transition: all 0.3s ease;
}

.navbar .content {
    max-width: 1536px;
    margin: auto;
    padding: 0 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo a {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.navbar .menu-list {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-list li {
    list-style: none;
}

.menu-list li a {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.menu-list li a:hover {
    background-color: var(--nav-hover);
}

.icon {
    display: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}

.menu-list .cancel-btn {
    position: absolute;
    top: 1.563rem;
    right: 1.875rem;
    width: 1.125rem;
    height: 1.125rem;
}

.icon.menu-btn {
    width: 1.125rem;
    height: 1.125rem;
}

/* ─── Layout ──────────────────────────────────────────────── */
main {
    min-height: calc(100vh - 14.375rem);
}

.page {
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dividing-line {
    height: 1px;
    width: 100%;
    border-radius: 9999px;
    background-color: var(--divider);
}

/* ─── Hero ────────────────────────────────────────────────── */
#hero {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1536px;
    padding: 0 10rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title {
    color: var(--text-body);
    margin-top: 5rem;
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
}

.title span {
    font-weight: 700;
    background: linear-gradient(to top right,
        var(--hero-span-from) 0%,
        var(--hero-span-to) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift ease 5s infinite;
}

@keyframes gradient-shift {
    0%   { background-size: 200% 200%; background-position: left center; }
    50%  { background-size: 200% 200%; background-position: right center; }
    100% { background-size: 200% 200%; background-position: left center; }
}

.paragraph-hero {
    width: 60%;
    margin-top: 2.5rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 300;
    text-align: center;
    color: var(--text-body);
    letter-spacing: 0.02em;
}

.italic-bold {
    font-weight: 700;
    font-style: italic;
}

.container-buttons-hero {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 1rem;
    align-items: center;
    margin-top: 2.5rem;
    margin-bottom: 5rem;
}

.button-left-hero {
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 9999px;
    background-color: #cdd8e4;
    padding: 0.5rem 1rem;
    color: #374151;
}

.button-left-hero:hover,
.button-right-hero:hover {
    transform: scale(1.02);
    transition: all ease 100ms;
}

.button-right-hero {
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    color: #ffffff;
    background-image: linear-gradient(to top right, #3b82f6 0%, #1e3a8a 100%);
    animation: gradient-shift ease 5s infinite;
}

/* ─── Skills ──────────────────────────────────────────────── */
#skills {
    display: flex;
    width: 100%;
    color: var(--text-section);
    justify-content: center;
}

.container-skills {
    width: 100%;
    max-width: 1536px;
    padding: 0 5rem;
}

.subtitle-skills {
    margin-top: 4rem;
    font-weight: 300;
    font-size: 2rem;
    line-height: 2.25rem;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    justify-content: center;
}

.paragraph-content {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 250;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-section);
}

.grid-skills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    justify-content: center;
    margin-bottom: 5rem;
}

.item-grid-skills {
    display: flex;
    justify-content: center;
}

.item-grid-skills article {
    box-sizing: border-box;
    border-style: solid;
    position: relative;
    margin-bottom: 1rem;
    display: flex;
    max-width: 36rem;
    border-radius: 1rem;
    border-width: 1.5px;
    border-color: var(--card-border);
    background-color: var(--card-bg-skills);
    flex-direction: row;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    transition: border-color 0.1s;
}

.item-grid-skills article:hover {
    border-color: var(--card-border-hover);
}

.article-image-skills {
    min-height: 100%;
    margin: 4px;
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    width: 14rem;
    background-size: cover;
    background-position: center;
}

.article-content-skills {
    height: 240px;
    flex: 1 1 0%;
    overflow: hidden;
    padding: 1rem 1.5rem;
    text-align: left;
}

.article-content-title-skills {
    margin-bottom: 1.2rem;
}

.article-content-title-skills h2 {
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 400;
}

.article-content-paragraph-skills {
    margin-bottom: 2.5rem;
    height: 5rem;
}

.article-content-paragraph-skills p {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    font-weight: 300;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5rem;
}

.article-content-exp {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.article-content-exp svg {
    display: block;
    stroke: var(--skills-icon);
}

.article-content-exp span {
    font-size: 0.9rem;
    color: var(--skills-link);
    margin-left: 0.3rem;
}

/* ─── Contact ─────────────────────────────────────────────── */
#contact {
    display: flex;
    width: 100%;
    justify-content: center;
    background-color: var(--contact-bg);
    text-align: center;
    color: var(--text-section);
}

.container-contact {
    width: 100%;
    max-width: 1536px;
    padding: 0 10rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container-contact h2 {
    margin-top: 5rem;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 300;
}

.container-contact p {
    margin-bottom: 3rem;
    margin-top: 0.5rem;
    text-align: center;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 200;
    font-size: 1.25rem;
    line-height: 1.75rem;
    max-width: 80rem;
    color: var(--text-section);
}

.container-contact-form {
    margin: 0 auto;
    width: 70%;
    margin-bottom: 6rem;
}

.contact-form {
    border: 1.5px solid var(--card-border);
    border-radius: 1rem;
    background-color: var(--contact-form-bg);
    padding: 2rem 2.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
}

.contact-form form {
    display: flex;
    flex-direction: column;
}

.label-contact {
    margin-bottom: 0.5rem;
    display: flex;
    width: 100%;
    align-items: flex-start;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 300;
    color: var(--contact-label);
}

.input-contact,
.input-contact-textarea {
    box-sizing: border-box;
    appearance: none;
    width: 100%;
    background-color: var(--contact-input-bg);
    border: 1px solid var(--contact-input-border);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 300;
    color: var(--contact-label);
    margin-bottom: 2rem;
}

.input-contact:focus,
.input-contact-textarea:focus {
    outline-color: #00ADEF;
}

.input-contact-textarea {
    height: 120px;
    max-height: 300px;
    resize: vertical;
}

.span-required {
    font-size: 0.85rem;
    margin-top: -1.5rem;
    margin-bottom: 1.5rem;
    color: red;
    display: none;
}

.response.show-response {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 2rem 1rem;
    color: var(--text-section);
    font-size: 0.85rem;
    background-color: rgba(83, 80, 248, 0.1);
    transition: padding 0.5s;
}

.container-button-contact {
    width: 100%;
}

.contact-button {
    width: 50%;
    border: none;
    font-family: inherit;
    font-weight: inherit;
    margin-top: 1rem;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: rgb(82 130 255);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #ffffff;
    transition: opacity 0.2s;
}

.contact-button:hover {
    opacity: 0.9;
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
    display: block;
    width: 100%;
}

.container-footer {
    margin: 0 auto;
    max-width: 80rem;
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links {
    display: flex;
    width: 12%;
    justify-content: space-around;
}

.social-links span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.social-links a {
    color: #9ca3af;
}

.social-links svg {
    display: block;
    height: 1.5rem;
    width: 1.5rem;
}

.copyright {
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--footer-copyright-bg);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 300;
    color: var(--text-primary);
}

.footer-navbar {
    display: none;
}

/* ─── Dark mode toggle ────────────────────────────────────── */
#darkmode {
    width: 0;
    height: 0;
    opacity: 0;
}

.label-toggle {
    display: block;
    height: 22px;
    width: 45px;
    position: relative;
    cursor: pointer;
    top: 2px;
    left: 23%;
}

span.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f3f3f3;
    border-radius: 9999px;
}

span.slide:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    background: #fff url('../img/icons/sun.svg') no-repeat center / 80%;
    border-radius: 9999px;
    top: 0.125rem;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 0 7px 1px rgba(0, 0, 0, 0.21);
}

#darkmode:checked + span.slide:before {
    transform: translateX(23px);
    background: #272727 url('../img/icons/moon.svg') no-repeat center / 50%;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1280px) {
    .container           { padding: 0 3rem; }
    .container-skills    { padding: 0 3rem; }
    .container-contact   { padding: 0 3rem; }
    .container-contact-form { width: 80%; }
    .label-toggle        { left: 16%; }
}

@media (max-width: 1024px) {
    .container           { padding: 0 1.5rem; }
    .container-skills    { padding: 0 1.5rem; }
    .container-contact   { padding: 0 1.5rem; }
    .container-contact-form { width: 90%; }
    .title               { font-size: 2.5rem; }
    .grid-skills         { grid-template-columns: 1fr; }
    .social-links        { width: 20%; }
    .label-toggle        { left: 0; }
}

@media (max-width: 768px) {
    body.disabled        { overflow: hidden; }

    .icon                { display: block; }
    .icon.hide           { display: none; }

    .navbar .content     { padding: 0 2rem; }

    .navbar .menu-list {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        height: calc(100vh - 9.7rem);
        width: 100%;
        padding: 2.5rem 0;
        text-align: center;
        background: linear-gradient(170deg, var(--bg-from), var(--bg-to));
        transition: all 0.3s ease;
        overflow-y: auto;
    }

    .navbar.show .menu-list { left: 0; }

    .navbar .menu-list li    { margin-top: 2.813rem; }
    .navbar .menu-list li a  { margin-left: -100%; font-size: 1.125rem; }
    .navbar.show .menu-list li a { margin-left: 0; }

    .footer-navbar {
        display: block;
        position: fixed;
        bottom: 0;
        left: -100%;
        width: 100%;
        text-align: center;
        transition: all 0.3s ease;
        background-color: var(--nav-footer-mobile);
    }
    .footer-navbar.show { left: 0; }

    .container           { padding: 0 1.5rem; }
    .title               { font-size: 2rem; margin-top: 4rem; }
    .paragraph-hero      { width: 70%; }
    .container-buttons-hero { flex-direction: column; }
    .container-contact-form { width: 100%; }
    .social-links        { width: 30%; }

    .item-grid-skills article {
        flex-direction: column;
        max-width: 36rem;
    }
    .article-image-skills {
        height: 10rem;
        width: auto;
        border-top-left-radius: 0.75rem;
        border-top-right-radius: 0.75rem;
        border-bottom-left-radius: 0;
    }
}

@media (max-width: 640px) {
    .container           { padding: 0 2rem; }
    .container-skills    { padding: 0 2rem; }
    .title               { font-size: 1.8rem; }
    .paragraph-hero      { width: 90%; }
    .social-links        { width: 40%; }
    .contact-button      { width: 100%; }
}
