:root {
    --radius: 14px;
    --b-width: 2px;
    --border-main: var(--foreground) var(--b-width) solid;
    --shadow-main: 2px 2px var(--foreground);
    --transition-main: 150ms ease-in-out;
}

.light-theme {
    --background: #ffeacb;
    --bg1: #fff4e4;
    --foreground: #0f0f0f;
    --hover: #121212;
}

.dark-theme {
    --background: #0f0f0f;
    --bg1: #181818;
    --foreground: #ffeacb;
    --hover: #fff4e4;
}

@font-face {
    font-family: Verela;
    src: url(../fonts/VarelaRound-Regular.ttf);
}

@font-face {
    font-family: glamatrix;
    src: url(../fonts/Glamatrix.ttf);
}

::selection {
    background-color: var(--foreground);
    color: var(--background);
}

/* ===== Scrollbar CSS ===== */
/* Firefox */
* {
    scrollbar-width: 9px;
    scrollbar-color: var(--bg1) var(--background);
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
    width: 9px;
}

*::-webkit-scrollbar-track {
    background: var(--background);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--bg1);
    border-radius: 14px;
    border: 2px solid var(--foreground);
    transition: all 250ms ease-in-out;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--background);
    box-shadow: var(--shadow-main);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
}

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

body {
    background: var(--background);
    color: var(--foreground);
    margin: 0;

    font-family: Verela;

    transition: background var(--transition-main);
}

.theme-wrapper {
    z-index: 99;

    background: var(--bg1);
    width: 4rem;
    height: 4rem;
    position: fixed;
    bottom: 0;
    margin: 0.5rem;

    display: flex;
    justify-content: center;
    align-items: center;

    border: var(--border-main);
    border-radius: var(--radius);

    transition: all var(--transition-main);
}

.theme-wrapper:hover {
    box-shadow: var(--shadow-main);
}

#theme-switch {
    display: none;
}

#theme-switch + label {
    cursor: pointer;
}

main {
    min-height: 100vh;
    padding-left: 0.5rem;
    padding-right: 0.5rem;

    display: flex;
    justify-content: center;
    align-items: center;
}

.wrapper-main {
    max-width: 40rem;
    padding-top: 6rem;
    padding-bottom: 6rem;

    flex-grow: 1;
}

.card {
    background-color: var(--bg1);
    border: var(--border-main);
    border-radius: var(--radius);
    overflow: hidden;
}

.card img {
    border-right: var(--border-main);
}

.top-main {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.3rem;
}

.profile {
    display: flex;
    flex-grow: 1;
}

.profile-info {
    align-self: center;
    text-align: center;
    margin: 0 auto;
}

.link-card-2 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.3rem;
}

.link-card-2 span {
    font-family: glamatrix;
}

.card-header {
    padding: 1rem;
    height: 2rem;
    border-bottom: var(--border-main);

    display: flex;
    align-items: center;
}

.card .card-body {
    padding: 1rem;
}

.card-shadow {
    cursor: pointer;
    transition: box-shadow var(--transition-main);
}

.card-shadow:hover {
    box-shadow: var(--shadow-main);
}

.spacer {
    height: 0.3rem;
}

.link-card {
    display: flex;
    justify-content: end;
    gap: 0.3rem;
}

.link-cards .card {
    max-width: 4rem;
}

@media (max-width: 360px) {
    .link-card {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .link-cards .card {
        max-width: 4rem;
        justify-self: center;
    }
}

.link-cards .card-body {
    height: 2rem;
    width: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

hr {
    border: var(--border-main);
    border-radius: var(--radius);
    height: 0.5rem;
}

.link {
    position: relative;
    text-decoration: none;
    display: inline-block;
    color: var(--foreground);
    padding: 0 1px;
    transition: color ease 0.3s;
}

.link::before,
.link::after {
    content: "";
    position: absolute;
    background-color: var(--foreground);
    z-index: 1;
    height: 2px;
}

.link::before {
    width: 0%;
    left: 0;
    bottom: 0;
    transition: width ease 0.4s;
}

.link::after {
    width: 100%;
    left: 0;
    bottom: 0;
    transition: all ease 0.6s;
}

.link:hover::before {
    width: 100%;
}

.link:hover::after {
    left: 100%;
    width: 0%;
    transition: all ease 0.2s;
}

@media (max-width: 383px) {
    #about .link::before,
    #about .link::after {
        background-color: rgb(0, 0, 0, 0);
    }

    #about a {
        text-decoration: underline;
    }
}

#skills {
    /* Removed grid layout - now each section takes full width */
}

#work-experience {
    /* New section for work experience */
}

.card .card-divider {
    background-color: var(--foreground);
    height: 2px;
}

.hire {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
}

@media (max-width: 381px) {
    .hire {
        grid-template-columns: 1fr;
    }
}

.hire .card-body {
    display: flex;
    align-items: center;
    height: 2rem;
}

.hire-btn {
    display: flex;
    gap: 0.3rem;
}

.hire-btn .card {
    flex-grow: 1;
}

.hire-btn .card-body {
    display: flex;
    justify-content: center;
}

footer {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

footer .card {
    margin: 0 auto;
    max-width: 40rem;
}

/* Timeline styles for work experience */
.timeline {
    position: relative;
    margin: 2rem 0;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--foreground);
    border-radius: 2px;
    z-index: 0;
    box-sizing: border-box;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    box-sizing: border-box;
}

.timeline-item.left {
    left: 0;
    text-align: right;
    display: flex;
    justify-content: flex-end;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
    display: flex;
    justify-content: flex-start;
}

.timeline-item .card {
    width: 100%;
    max-width: 600px;
    z-index: 1;
    background: var(--bg1);
    border: var(--border-main);
    border-radius: var(--radius);
}

.card-body {
    padding: 1.25rem;
}

.timeline-role {
    font-size: 1rem;
    color: var(--foreground);
    opacity: 0.8;
}

.timeline-date {
    font-size: 0.95rem;
    color: var(--foreground);
    opacity: 0.7;
    white-space: nowrap;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: var(--background);
    border: 4px solid var(--foreground);
    border-radius: 50%;
    z-index: 2;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .timeline-item::before {
        left: 20px;
        transform: translateY(-50%);
    }
}

/* Remove old .timeline-dot rules */
.timeline-dot { display: none !important; }

.timeline-item.left::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-left: -16px; /* half the dot width */
    width: 32px;
    height: 32px;
    background: var(--background);
    border: 4px solid var(--foreground);
    border-radius: 50%;
    z-index: 2;
    box-sizing: border-box;
}

.timeline-item.right::before {
    content: '';
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-left: 16px; /* half the dot width */
    width: 32px;
    height: 32px;
    background: var(--background);
    border: 4px solid var(--foreground);
    border-radius: 50%;
    z-index: 2;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .timeline-item.left::before,
    .timeline-item.right::before {
        left: 0;
        margin-left: 0;
        transform: translateY(-50%);
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
}

.project-card {
    position: relative;
    background: var(--bg1);
    border: var(--border-main);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    transition: box-shadow var(--transition-main);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 220px;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--radius);
    transition: opacity 0.3s;
    cursor: pointer;
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-title {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    background: var(--bg1);
    padding: 0.5rem 0 0.7rem 0;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    z-index: 1;
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .project-card {
        height: 160px;
    }
}

html {
    scroll-behavior: smooth;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg1);
    border-bottom: var(--border-main);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.navbar {
    max-width: 60rem;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    padding: 1rem 0.5rem;
}

.navbar a {
    color: var(--foreground);
    font-family: Verela, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.navbar a:hover, .navbar a:focus {
    background: var(--foreground);
    color: var(--background);
}

/* Add top padding to main content so it's not hidden under the header */
.wrapper-main {
    padding-top: 8rem;
}

@media (max-width: 600px) {
    .navbar {
        gap: 1rem;
        font-size: 1rem;
        flex-wrap: wrap;
    }
    .wrapper-main {
        padding-top: 7rem;
    }
}
