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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: white;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background-color: #1f1f1f;
    color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: white;
    color: black;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode header,
body.dark-mode footer,
body.dark-mode .hero,
body.dark-mode .work,
body.dark-mode .about,
body.dark-mode .contact {
    background-color: #2a2a2a;
    color: #f5f5f5;
}

.navbar {
    padding: 1rem 0;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#theme-toggle {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    background-color: #111;
    color: white;
    font-weight: 600;
}

body.dark-mode #theme-toggle {
    background-color: #f5f5f5;
    color: #111;
}

header .container {
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

.logo-link {
    margin-left: 0;
}

.logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

body.dark-mode #site-logo {
    content: url('assets/icons/es-dark.svg');
}

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

.nav-links a {
    color: black;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark-mode .nav-links a,
body.dark-mode .hero h2,
body.dark-mode .hero p,
body.dark-mode .work h2,
body.dark-mode .work p,
body.dark-mode .about h2,
body.dark-mode .about p:not(.about-black-line),
body.dark-mode .contact h2,
body.dark-mode .contact p,
body.dark-mode footer p {
    color: #f5f5f5;
}

.about-black-line {
    color: #000000 !important;
    font-weight: 600;
}

.nav-links a:hover {
    color: #666;
}

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

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #111;
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle .bar:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.nav-toggle .bar:nth-child(3) {
    top: 10px;
}

.nav-toggle .bar:nth-child(4) {
    bottom: 10px;
}

.nav-toggle.open .bar:nth-child(3) {
    transform: translateX(-50%) rotate(45deg);
}

.nav-toggle.open .bar:nth-child(4) {
    transform: translateX(-50%) rotate(-45deg);
}

.nav-toggle.open .bar:nth-child(2) {
    opacity: 0;
}

body.dark-mode .nav-links a:hover {
    color: #cfcfcf;
}

.theme-menu {
    position: relative;
    margin-left: auto;
}

.theme-menu-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-menu-button::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

body.dark-mode .theme-menu-button::after {
    border-right-color: #fff;
    border-bottom-color: #fff;
}

.theme-menu.open .theme-menu-button::after {
    transform: rotate(-135deg);
}

.theme-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 140px;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    display: none;
    z-index: 10;
}

.theme-menu.open .theme-menu-panel {
    display: block;
}

.theme-menu-panel button {
    width: 100%;
    border: none;
    background: #111;
    color: white;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
}

body.dark-mode .theme-menu-panel button {
    background: #f5f5f5;
    color: #111;
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

section {
    padding: 4rem 0;
    border-bottom: 1px solid #e0e0e0;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

section p {
    font-size: 1.1rem;
    color: #555;
}

/* Hero Section */
.hero {
    background: white;
    color: black;
    text-align: center;
    padding: 6rem 0;
}

.hero h2,
.hero p {
    color: black;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.3rem;
}

/* About Section */
.work {
    background-color: white;
    color: black;
    padding: 10rem 0;
    text-align: center;
}

.work h2,
.work p {
    color: black;
}

.work-title {
    max-width: 40%;
    height: auto;
    display: inline-block;
    margin-bottom: 1rem;
}

.contact-title {
    max-width: 50%;
    height: auto;
    display: inline-block;
    margin-bottom: 1rem;
}

/* About Section */
.about {
    background-color: white;
    color: black;
    padding: 10rem 0;
}

.about h2,
.about p {
    color: black;
}

/* Contact Section */
.contact {
    background-color: white;
    color: black;
    padding: 10rem 0;
    text-align: center;
}

.contact h2,
.contact p {
    color: black;
}

/* Footer */
footer {
    background-color: white;
    color: black;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

footer p {
    color: black;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 1rem;
        align-items: center;
    }

    .nav-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 1rem;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }

    #theme-toggle {
        order: 1;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 1rem 0;
        border-top: 1px solid #e0e0e0;
        order: 3;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        text-align: center;
    }

    .nav-links a {
        padding: 0.75rem 0;
        width: 100%;
    }

    section h2 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}
