:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --subtle-text-color: #808080;
    --hover-color: #000000;
    --scrollbar-thumb-color: #c1c1c1;
    --scrollbar-thumb-hover-color: #a8a8a8;
    --scrollbar-track-color: #f1f1f1;
    --bar-bg: #e0e0e0;
    --fill-color: linear-gradient(90deg, #4e7cff, #2a52c2);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --subtle-text-color: #a0a0a0;
    --hover-color: #ffffff;
    --scrollbar-thumb-color: #555;
    --scrollbar-thumb-hover-color: #777;
    --scrollbar-track-color: #2c2c2c;
    --bar-bg: #333;
    --nav-bg: rgba(18, 18, 18, 0.8);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 4rem 2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover-color);
}

.content {
    max-width: 650px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1rem 0;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    margin-bottom: 3rem;
    box-shadow: var(--header-shadow);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

.about {
    font-size: 1.1rem;
    max-width: 45ch;
    margin-bottom: 4rem;
    color: var(--text-color);
}

h2 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: lowercase;
    margin-bottom: 1rem;
    color: var(--subtle-text-color);
}

section {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }


ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    margin-bottom: 0.75rem;
}

a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

a:hover {
    color: var(--hover-color);
    transform: translateX(5px);
}

#languages {
    margin-top: 2rem;
}

.lang {
    margin-bottom: 1rem;
}

.lang span {
    font-weight: 600;
    display: block;
    margin-bottom: 0.3rem;
}

.bar {
    width: 100%;
    background: var(--bar-bg);
    border-radius: 8px;
    overflow: hidden;
    height: 10px;
}

.fill {
    height: 100%;
    background: var(--fill-color);
    border-radius: 8px;
    transition: width 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

footer {
    margin-top: 5rem;
    font-size: 0.9rem;
    color: var(--subtle-text-color);
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--nav-bg);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.3s;
    box-shadow: var(--header-shadow);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
