@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    /* Dark Mode (Default) */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
    --accent: #bb86fc;
    --accent-hover: #3700b3;
    --tag-bg: #333333;
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-main: #202020;
    --text-dim: #707070;
    --accent: #6c63ff;
    --accent-hover: #5146d8;
    --tag-bg: #e8e8ff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    text-align: center;
    overflow: hidden;
    /* Remove scroll-snap properties */
}

.container {
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: none;
    scroll-behavior: smooth;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.container::-webkit-scrollbar {
    display: none;
}

.page {
    min-height: 100vh;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    position: relative;
    /* Added for positioning context */
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-top: 0;
}

.main-nav {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.main-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 1.1rem;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--accent);
}

.links {
    margin-top: 2rem;
}

.links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.1rem;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.links a:hover,
.links a:focus {
    color: var(--accent-hover);
}

.links a i {
    margin-right: 0.5rem;
}

.content-section {
    margin-top: 0;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    overflow-y: auto;
}

.content-section h2 {
    font-size: 2rem;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    position: relative;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.4rem;
}

.card h3 a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card h3 a:hover {
    color: var(--accent);
}

.card-sub-header {
    color: var(--text-dim);
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.card p {
    line-height: 1.6;
}

.tags {
    margin-top: 1rem;
}

.tags span {
    display: inline-block;
    background-color: var(--tag-bg);
    color: var(--text-main);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-category h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.skill-category p {
    margin-top: 0;
    color: var(--text-dim);
    line-height: 1.5;
}

#side-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    background-color: var(--text-dim);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-dot:hover {
    background-color: var(--accent);
}

.nav-dot.active {
    background-color: var(--accent);
    transform: scale(1.2);
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* ── Mobile fixes ── */
@media (max-width: 768px) {

    /* 1. Fix the notorious mobile 100vh / address-bar bug */
    .container {
        height: 100dvh;
        /* dynamic viewport height where supported */
    }

    /* 2. Let content-heavy pages grow beyond one screen */
    .page {
        height: auto;
        min-height: 100dvh;
        padding: 4rem 1.25rem 2rem;
        /* extra top padding so content clears the toggle btn */
    }

    /* 3. Hide side nav – there's no room for it */
    #side-nav {
        display: none;
    }

    /* 4. Move theme toggle so it doesn't overlap nav links */
    #theme-toggle {
        top: 12px;
        right: 12px;
    }

    /* 5. Scale down headline */
    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
    }

    /* 6. Stack nav links vertically */
    .main-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .main-nav a {
        margin: 0;
        font-size: 0.95rem;
    }

    /* 7. Section headings */
    .content-section h2 {
        font-size: 1.5rem;
    }

    /* 8. Cards */
    .card {
        padding: 1rem;
    }

    .card h3 {
        font-size: 1.15rem;
    }

    /* 9. Skills grid – single column on small screens */
    .skills-container {
        grid-template-columns: 1fr;
    }
}

.card-github {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-dim);
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.card-github:hover {
    color: var(--accent);
}