* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1B1B1F;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #458588;
    --border: #30363d;
    --hover: rgba(177, 186, 196, 0.12);
    --emoji: #1f6feb;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-muted: #8c959f;
    --accent: #0969da;
    --border: #d0d7de;
    --hover: rgba(175, 184, 193, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 2rem;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.nav-links .active {
    color: var(--text-primary);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.external-link i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.external-link:hover i {
    opacity: 1;
}

.nav-mobile-links {
    margin-top: 40%;
    list-style-type: none;
}

.nav-mobile-links .pages {
    text-align: center;
}

.nav-mobile-links .pages a {
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-right: 20%;
    text-align: center;
}

.nav-mobile-links a:hover {
    background-color: var(--hover);
    color: var(--text-primary);
    text-decoration: none;
}

.social-mobile-icons {
    margin-top: 20px;
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    position: relative;
    left: -17px;
}

.social-mobile-icons a {
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.social-mobile-icons a:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--hover);
}

.social-icons {
    display: flex;
    gap: 0.8rem;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.social-icons a:hover {
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 4rem;
}

/* Main Content */
main {
    max-width: 800px;
}

section {
    margin-bottom: 4rem;
}

h1, h2, h3 {
    position: relative;
    scroll-margin-top: 6rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    margin-top: 2rem;
    color: var(--text-primary);
}

/* Heading Anchor Links */
h1[id]::before,
h2[id]::before,
h3[id]::before {
    content: '#';
    position: absolute;
    left: -1.4rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: 400;
}

h3[id]::before {
    content: '#';
    position: absolute;
    left: -1.1rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: 400;
}

h1[id]:hover::before,
h2[id]:hover::before,
h3[id]:hover::before {
    opacity: 1;
}

h1[id]:hover,
h2[id]:hover,
h3[id]:hover {
    cursor: pointer;
}

p {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

.highlight {
    display: inline;
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
}

.emoji {
    color: var(--emoji);
}

.star-count {
    margin-left: 0.5rem;
    color: var(--text-muted);
}

ul {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

ul li {
    margin-bottom: 0.5rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 6rem;
    height: fit-content;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-left: 0;
    border-left: 1px solid var(--border);
}

.sidebar h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 1rem;
    border: none;
    margin-top: 0;
}

.sidebar-nav {
    list-style: none;
    position: relative;
}

.sidebar-nav li {
    margin-bottom: 0;
    position: relative;
}

.sidebar-nav a {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
    line-height: 1.4;
    font-weight: 400;
    position: relative;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-nav a.active {
    color: var(--text-primary);
    font-weight: 400;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent);
}

.sidebar-nav .sub-item {
    padding-left: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav .sub-item:hover {
    color: var(--text-secondary);
}

.sidebar-nav .sub-item.active {
    color: var(--text-primary);
}

.sidebar-nav .sub-item.active::before {
    left: -1px;
}

/* Mobile Sidebar */
.mobile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 999;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    main {
        margin-top: 20px;
        max-width: 800px;
    }

    .sidebar {
        display: none;
    }

    .mobile-sidebar {
        display: block;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links li:not(:last-child) {
        display: none;
    }

    .nav-links .left {
        display: flex;
    }

    .nav-links .left button {
        margin-left: 20px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }

    .container {
        padding: 4rem 1rem 2rem;
    }

    main {
        margin-top: 20px;
        max-width: 800px;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links .left {
        display: flex;
    }

    .nav-links .left button {
        margin-left: 20px;
    }

    .nav-links li:not(:last-child) {
        display: none;
    }

    .social-icons {
        gap: 0.6rem;
    }

    .social-icons a {
        font-size: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }
}

/* Smooth transition for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

a, button {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Programming Languages – Resume Style */
.lang-skill {
    margin-bottom: 1.4rem;
}

.lang-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.lang-header span:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.lang-header .level {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.lang-bar {
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.lang-bar span {
    display: block;
    height: 100%;
    background-color: var(--accent);
    opacity: 0.85;
}

/* Skill Groups */
.skill-group {
    margin-bottom: 2.5rem;
}

.skill-group h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: var(--text-primary);
}

/* Skills Container */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

/* Skill Category */
.skill-category {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    transition: border-color 0.2s linear;
}

.skill-category > h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* Skill Subsection */
.skill-subsection {
    margin-bottom: 1.5rem;
}

.skill-subsection:last-child {
    margin-bottom: 0;
}

.skill-subsection h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

.skill-subsection:not(:last-child) {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Language Skills with Bars */
.skill-subsection .lang-skill {
    margin-bottom: 1rem;
}

.skill-subsection .lang-skill:last-child {
    margin-bottom: 0;
}

/* Tech Items */
.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-item {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s linear;
    background-color: var(--bg-primary);
}

.tech-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .skills-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Experience Timeline */
.timeline {
    position: relative;
    margin-top: 2rem;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    left: -2px;
    top: 0.4rem;
    width: 12px;
    height: 12px;
    background-color: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-content {
    padding-left: 1.5rem;
}

.timeline-content p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.3rem;
}

.timeline-place {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.timeline-content ul {
    margin-left: 1.2rem;
    margin-top: 0.8rem;
}


/* Blog Post Styling */
.blog-post {
    margin-bottom: 3rem;
}

.blog-post h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.blog-post p {
    margin-bottom: 0.8rem;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

article.blog-post {
    scroll-margin-top: 6rem;
}

/* Filter Tags */
.filter-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.filter-tag:hover {
    background-color: var(--hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.filter-tag.active {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* Hide filtered posts */
.blog-post.hidden {
    display: none;
}

/* Empty state message */
.no-posts-message {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.tech {
    position: relative;
    cursor: pointer;
    /* animation: colorPulse 4.5s ease-in-out infinite; */
    /* transition: color 0.25s ease; */
}

.notech {
    color: var(--text-secondary)
}

#tech-icon {
    position: fixed;
    width: 40px;
    height: 40px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 1000;
}
