/* macros */
/* usage: var(--custom-name) */
:root { 
  --theme-main: #3666fa;
  --theme-bg: #fbf7ec;
  --theme-link-hover:#6666ff;
  --theme-white: #ffffff;
  --theme-grey-1: #8f8f8f;
  --theme-grey-2: #606060;
  --theme-grey-3: #404040;
  --theme-black: #0f0f0f;
  --center-max-width: 1024px;
}

/* hyperlinks (shared) */
a {
    color: var(--theme-main);
    text-decoration: none;
}

a:hover {
    color: var(--theme-link-hover);
    text-decoration: underline;
}


/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--theme-grey-3);
    background-color: var(--theme-bg);
}

/* ===== NAVIGATION ===== */
nav {
    background-color: var(--theme-main);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .nav-container {
    max-width: var(--center-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--theme-white);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    color: var(--theme-bg);
}

nav a.active {
    color: var(--theme-black);
    background-color: var(--theme-white);
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: var(--center-max-width);
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}

.resume {
    background: var(--theme-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--theme-grey-1);
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-content {
    flex: 1;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    color: var(--theme-grey-3);
    margin-bottom: 0.5rem;
}

.header-content p {
    font-size: 1.1rem;
    color: var(--theme-grey-2);
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--theme-main);
    flex-shrink: 0;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    font-size: 1.8rem;
    color: var(--theme-grey-3);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--theme-main);
}

/* ===== BIO ===== */
.bio {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--theme-grey-2);
}

/* ===== PROJECTS ===== */
.project-item {
    margin-bottom: 1.2rem;
    padding: 0.6rem;
    background: var(--theme-white);
    border-radius: 6px;
    border-left: 4px solid var(--theme-main);
}

.project-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    align-items: stretch;
}

.project-image {
    max-width: 100px;
    width: auto;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
}

.project-info {
    flex: 1;
}

.project-item h3 {
    font-size: 1.2rem;
    color: var(--theme-grey-3);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.project-item p {
    color: var(--theme-grey-2);
    line-height: 1.6;
}

/* ===== EDUCATION ===== */
.education-item {
    margin-bottom: 1.5rem;
}

.education-header {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.education-logo {
    max-width: 100px;
    width: auto;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: contain;
}

.education-info {
    flex: 1;
}

.education-item h3 {
    font-size: 1.1rem;
    color: var(--theme-grey-3);
    margin-bottom: 0.3rem;
}

.education-item .degree {
    font-weight: 600;
    color: var(--theme-grey-2);
    margin-bottom: 0.2rem;
}

.education-item .date {
    color: var(--theme-grey-1);
    font-size: 0.9rem;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, auto));
    gap: 1rem;
}

.skill-category h4 {
    color: var(--theme-grey-3);
    margin-bottom: 0.5rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.3rem 0;
    color: var(--theme-grey-2);
}

.skill-category li:before {
    content: "▸ ";
    color: var(--theme-main);
}

/* ===== CONTACT ===== */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--theme-main);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
    box-shadow: 0 2px 8px var(--theme-grey-1);
    z-index: 99;
    padding: 12px;
}

.back-to-top img {
    width: 100%;
    height: 100%;
    display: block;
    filter: brightness(0) invert(1);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--theme-grey-1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .header {
        flex-direction: column-reverse;
        text-align: center;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .avatar {
        width: 120px;
        height: 120px;
    }

    .header h1 {
        font-size: 2rem;
    }

    nav ul {
        gap: 1rem;
    }

    .resume {
        padding: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}
