:root {
    --bg-dark: hsl(0, 0%, 90%);
    --bg: hsl(0, 0%, 95%);
    --bg-light: hsl(0, 0%, 100%);

    --border: hsl(0, 0%, 80%);

    --text-dark: hsl(0, 0%, 0%);
    --text: hsl(0, 0%, 10%);
    --text-light: hsl(0, 0%, 20%);

    --primary-dark: hsl(158, 83%, 16%);
    --primary: hsl(158, 83%, 24%);
    --primary-light: hsl(158, 83%, 32%);

    --header-height: 64px;
}
html {
    scroll-behavior: smooth;
}
body {
    background: var(--bg-dark);
    width: 100%;
    display: flex;
    margin: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "Montserrat", sans-serif;
    color: var(--text-light);
}

header {
    box-sizing: border-box;
    height: var(--header-height);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(40, 40, 40, 0.2);
    background-color: var(--bg-dark); 
    transition: background-color 0.3s ease;

    display: flex;
    justify-content: center;
    align-items: center;
}
nav {
    display: none;
    margin: 0 auto;
    position: relative;
    z-index: 1001;
}
nav a {
    display: block;
    text-decoration: none;
    color: var(--text-light);
    padding: 0px 12px;
    font-size: 16px;
    cursor: pointer;
}
nav a:hover {
    color: var(--primary);
}
header.active {
    background-color: rgb(40, 40, 40);
}
header.active h3 {
    color: white;
}
header #rubik {
    width: 44px;
    margin: 0 4px 0px 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
header #rubik img {
    width: 44px;
    margin: 0;
}
header #rubik:hover { transform: scale(1.10); }
header #rubik:active { transform: scale(.90); }
header h3 {
    margin: 0;
    font-weight: normal;
}
#resume-link-container { 
    display: none;
    margin: 0 12px;
    padding: 8px 16px;
    border-radius: 10px;
    background-color: var(--primary-light);
}
#resume-link-container:hover {
    background-color: var(--primary);
}
#resume-link-container a {
    color: white;
    font-size: 16px; 
    text-decoration: none;
    font-weight: light;
}
header #menu-icon {
    display: block;
    margin: 0 20px 0 auto;
    cursor: pointer;
}
header #menu-icon #bar1, 
header #menu-icon #bar2, 
header #menu-icon #bar3 {
    width: 24px;
    height: 2px;
    background-color: black;
    margin: 4px 0px;
    transition: all 0.4s ease;
}
header #menu-icon.change #bar1 { 
    transform: translate(0, 6px) rotate(-45deg); 
    background-color: white;
}
header #menu-icon.change #bar2 { opacity: 0; }
header #menu-icon.change #bar3 { 
    transform: translate(0, -6px) rotate(45deg); 
    background-color: white;
}
.menu-overlay {
    z-index: 999;
    position: fixed;
    inset: 0;
    background-color: rgb(40, 40, 40);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    visibility: hidden;
    opacity: 0;

    transition-duration: 0.2s;
}
.menu-overlay a {
    text-decoration: none;
    color: white;
    font-size: 28px;
    margin: 16px 0px;
}
.menu-overlay.active {
    visibility: visible;
    opacity: 1;
}

main {
    width: 100%;
    box-sizing: border-box;
}

/* ========== LANDING PAGE ========== */
#landing {
    box-sizing: border-box;
    background: var(--bg-dark);
    width: 100%;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);; /* For mobile devices. Dynamic view height. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#headshot-container {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 12px 30px;

    animation-name: spin;
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0,0,0,1.2);
}
@keyframes spin {
    from { transform: scale(0) rotate(0deg); }
    to { transform: scale(1) rotate(360deg); }
}
#headshot{
    width: min(64%, 260px, 30vh);
    border-radius: 50%;
    margin: 0;
}

#intro {
    width: fit-content;
    margin: 0px 30px 48px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
}
#intro div {
    height: min(56px, 8vh); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-align: center;
}
#intro h2 {
    font-size: min(28px, 4vh);
    font-weight: normal;
    width: fit-content;
    margin: 0;
}
#intro h4 {
    font-size: min(16px, 2.5vh);
    margin-top: min(12px, 1vh);
    margin-bottom: 0px;
    margin-right: auto;
    color: var(--primary-light);
}
#intro p {
    font-size: min(16px, 2.5vh);
    margin: 0px;
    color: var(--text-light);
}
#intro a {
    border-radius: 10px;
    padding: min(12px, 2vh); 
    margin-top: 16px;
    font-size: min(12px, 2vh);
    text-decoration: none;
    color: white;
    background-color: var(--primary-light);
    transition: transform 0.2s ease;
}
#intro a:hover {
    background-color: var(--primary);
    transform: scale(1.05);
}
#intro a:active { transform: scale(.9); }

#arrow-container {
    position: absolute; 
    bottom: 2px;
    height: fit-content;
    cursor: pointer;
    opacity: 0.4;
}
#arrow-container:hover {
    opacity: 80%;
}
#arrow-container #arrow-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: black;
}
#arrow-container #arrow-link p {
    margin: -4px;
    font-size: 12px;
}
#arrow-container #arrow-link #arrow {
    width: 28px;
    height: 20px;
    animation: bounce 1.5s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}


@media (min-width: 850px) {
    header #menu-icon { display: none; }
    nav { display: flex; }
    #resume-link-container { display: block; }

    #landing {
        flex-direction: row;
        padding-bottom: 6%;
    }
    #headshot-container {
        margin: 0;
        flex-grow: 0;
        width: max(28vw, 400px);
    }
    #headshot {
        width: min(32vw, 300px);
    }
    #intro {
        margin-left: 0;
        margin-bottom: 0;
        flex-grow: 0;
        width: 36vw;
    }
}

/* ========== WORK EXPERIENCE & EDUCATION ========== */

.timeline {
    padding-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.timeline h1 {
    margin: 0;
}
#experience { scroll-margin-top: calc(var(--header-height)); }
#experience-container {
    position: relative;
    margin: 5vh auto;
    padding-left: 32px;
    width: min(80vw, 500px);
    border-left: 2px solid var(--border);
}
.experience-dot {
    position: absolute;
    left: -41px;
    width: 16px;
    height: 16px;
    background: var(--primary-light);
    border-radius: 50%;
}
#education { scroll-margin-top: calc(var(--header-height)); }
#edu-container {
    position: relative;
    margin: 5vh auto;
    padding-right: 32px;
    width: min(80vw, 500px);
    border-right: 2px solid var(--border);
}
.edu-dot {
    position: absolute;
    right: -41px;
    width: 16px;
    height: 16px;
    background: var(--primary-light);
    border-radius: 50%;
}


.timeline-item {
    position: relative;
    margin-bottom: 32px;
}
.timeline-content {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
}
.timeline-content h3 {
    margin: 0;
}
.timeline-content .date {
    font-size: 12px;
    color: var(--text-light);
}
.timeline-content p {
    margin: 10px 0px;
    color: var(--text);
}
.timeline-content ul {
    margin: 10px 0px;
    padding-left: 16px;
    list-style-position:outside;
}

/* ========== CONTACT ========== */
#contact-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 28vh;
    width: 100%;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background-color: var(--text-light);
    color: white;
    scroll-margin-top: calc(var(--header-height));
}
#contact-container div {
    width: fit-content;
    margin: auto auto auto 8vw;
}
#contact-container div h2, 
#contact-container div p {
    margin: 0;
    font-weight: normal;
}
#contact-container div a {
    color: hsl(140, 100%, 50%);
    font-size: 16px;
}
#contact-container div a:hover {
    color: hsl(60, 100%, 50%);
}
