/* Modern Premium Design System */
:root {
    --bg-color: #fafafa;
    --text-color: #1a1a1a;
    --secondary-text: #525252;
    --accent-color: #000000;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --gradient-text: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    --container-width: 1000px;
    --transition-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0a0a0a;
        --text-color: #ededed;
        --secondary-text: #a1a1a1;
        --accent-color: #ffffff;
        --border-color: rgba(255, 255, 255, 0.1);
        --glass-bg: rgba(20, 20, 20, 0.7);
        --glass-border: rgba(255, 255, 255, 0.1);
        --card-bg: #141414;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
        --gradient-text: linear-gradient(135deg, #ffffff 0%, #a1a1a1 100%);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 0, 0, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 0, 0, 0.03) 0%, transparent 25%);
}

@media (prefers-color-scheme: dark) {
    body {
        background-image:
            radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 25%),
            radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 25%);
    }
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-color);
    line-height: 1.1;
}

h1 {
    font-size: 4.5rem;
    margin-bottom: 24px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 0.1em;
    /* Fix for cut off gradient */
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

p {
    margin-bottom: 24px;
    color: var(--secondary-text);
    font-size: 1.1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Header & Glassmorphism */
header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: var(--container-width);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

header:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(120, 120, 120, 0.2);
}

.logo strong {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-text);
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--text-color);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s var(--transition-spring);
    border-radius: 2px;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Sections */
main {
    padding-top: 180px;
    /* Space for fixed header */
    padding-bottom: 120px;
}

section {
    margin-bottom: 120px;
}

.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.profile-img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 4px solid var(--card-bg);
    transition: transform 0.3s var(--transition-spring);
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.hero p.bio {
    font-size: 1.5rem;
    max-width: 700px;
    color: var(--secondary-text);
    margin-bottom: 48px;
    font-weight: 400;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--secondary-text);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.social-links a:hover {
    color: var(--text-color);
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-md);
    background: var(--bg-color);
    border-color: var(--text-color);
}

.social-links a::before {
    display: none;
    /* Remove previous underline effect */
}

/* Download Button */
.download-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cards (Experience, Projects, Blog) */
.experience-item,
.project-item,
.blog-item {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    transition: transform 0.3s var(--transition-spring), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: default;
}

.experience-item:hover,
.project-item:hover,
.blog-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(120, 120, 120, 0.2);
}

.date {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-text);
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 12px;
    border-radius: 100px;
}

@media (prefers-color-scheme: dark) {
    .date {
        background: rgba(255, 255, 255, 0.06);
    }
}

.tags {
    display: none;
    /* Hide old tags */
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
}

.skill-card i {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.skill-card span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(120, 120, 120, 0.3);
}

.skill-card:hover i {
    transform: scale(1.1);
    color: var(--text-color);
    /* Ensure contrast */
}

/* Contact Section */
#contact a {
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
}

#contact a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: 0;
    left: 0;
    background: var(--gradient-text);
    transition: height 0.2s ease;
}

#contact a:hover::after {
    height: 100%;
    opacity: 0.1;
}

/* Blog Slider Section */
.blog-slider-container {
    position: relative;
    padding: 24px 0;
}

.blog-slider {
    display: flex;
    overflow-x: auto;
    gap: 24px;
    padding-bottom: 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.blog-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.blog-card {
    min-width: 300px;
    max-width: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    scroll-snap-align: start;
    transition: all 0.3s var(--transition-spring);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(120, 120, 120, 0.3);
}

.blog-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-left: 12px;
}

.blog-date::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.blog-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.blog-content p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    margin-top: auto;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.read-more i {
    transition: transform 0.3s ease;
}

.blog-card:hover .read-more i {
    transform: translateX(4px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --container-width: 100%;
    }

    .container {
        padding: 0 20px;
    }

    header {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        padding: 12px 20px;
        flex-direction: column;
        gap: 16px;
        background: rgba(255, 255, 255, 0.85);
        /* Slightly more opaque for mobile */
    }

    /* Mobile Navigation - Scrollable Row */
    nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        /* Space for scrollbar if visible */
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    nav ul {
        gap: 24px;
        padding: 0 4px;
        white-space: nowrap;
        /* Keep items in a row */
    }

    nav a {
        font-size: 0.9rem;
        padding: 4px 0;
    }

    /* Hero adjustments */
    .hero {
        padding-top: 140px;
        /* More space for double-row header */
        min-height: auto;
        padding-bottom: 60px;
    }

    h1 {
        font-size: 2.5rem;
        /* Smaller font for mobile */
        line-height: 1.1;
    }

    .hero p.bio {
        font-size: 1.1rem;
        margin-bottom: 32px;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }

    /* Resume Content */
    section {
        margin-bottom: 80px;
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 32px;
    }

    /* Skills Grid - Smaller cards */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns */
        gap: 12px;
    }

    .skill-card {
        padding: 16px;
    }

    .skill-card i {
        font-size: 1.5rem;
    }

    .skill-card span {
        font-size: 0.8rem;
    }

    /* Blog Slider Adjustments */
    .blog-card {
        min-width: 260px;
        /* Slightly narrower */
        max-width: 260px;
        padding: 20px;
    }

    /* Print Button */
    .download-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .social-links {
        gap: 16px;
    }

    .social-links a {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Print Styles */
@media print {

    header,
    footer,
    .download-btn,
    #latest-posts {
        display: none !important;
    }

    main {
        padding-top: 0;
    }

    body {
        background: white;
        color: black;
    }

    h1,
    h2,
    h3,
    p {
        color: black;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .experience-item,
    .project-item {
        border: none;
        padding: 0;
        margin-bottom: 32px;
        box-shadow: none;
    }

    .tag {
        border: 1px solid #ccc;
    }
}