/* =====================
   CSS Variables for Theming
   ===================== */
:root {
    --bg-primary: #fefbff;
    --bg-secondary: #f5f5f9;
    --bg-tertiary: #ececf1;
    --text-primary: #1c1b1f;
    --text-secondary: #49454f;
    --text-tertiary: #79747e;
    --accent-primary: #6750a4;
    --accent-secondary: #7f67be;
    --accent-gradient: linear-gradient(135deg, #6750a4 0%, #7f67be 100%);
    --border-color: #e7e0ec;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
    --card-bg: #ffffff;
    --code-bg: #f5f5f9;
    --nav-bg: rgba(254, 251, 255, 0.95);
    --success-color: #006e1c;
    --error-color: #ba1a1a;
}

[data-theme="dark"] {
    --bg-primary: #1c1b1f;
    --bg-secondary: #2b2930;
    --bg-tertiary: #36343b;
    --text-primary: #e6e1e5;
    --text-secondary: #cac4d0;
    --text-tertiary: #938f99;
    --accent-primary: #d0bcff;
    --accent-secondary: #ccc2dc;
    --accent-gradient: linear-gradient(135deg, #d0bcff 0%, #ccc2dc 100%);
    --border-color: #49454f;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.5);
    --card-bg: #2b2930;
    --code-bg: #36343b;
    --nav-bg: rgba(28, 27, 31, 0.95);
    --success-color: #6fdd8b;
    --error-color: #ffb4ab;
}

/* =====================
   Reset & Base Styles
   ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* =====================
   Container & Layout
   ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
}

/* =====================
   Buttons
   ===================== */
.btn {
    padding: 14px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-block {
    width: 100%;
}

/* =====================
   Theme Toggle
   ===================== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.theme-toggle .sun-icon {
    display: none;
    color: var(--accent-primary);
}

.theme-toggle .moon-icon {
    display: block;
    color: var(--accent-primary);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* =====================
   Navigation
   ===================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.logo-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* =====================
   Footer
   ===================== */
.footer {
    padding: 40px 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* =====================
   Section Title (Common)
   ===================== */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.subsection-title {
    font-size: 1.875rem;
    margin: 60px 0 40px;
    color: var(--text-primary);
}

/* =====================
   Animations
   ===================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

button, a, input, textarea, select {
    transition: all 0.3s ease;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* =====================
   Responsive — Common
   ===================== */
@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-toggle {
        display: flex;
        /* Clears the fixed .theme-toggle button (56px wide, 24px from the right edge)
           so the hamburger icon doesn't render underneath it. */
        margin-right: 72px;
    }

    .section-title {
        font-size: 2rem;
    }

    .subsection-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .btn {
        width: 100%;
    }

    /* Free up room so "Ashutosh Gupta" doesn't wrap next to the hamburger +
       fixed theme-toggle button — the small profile photo here is redundant
       with the large hero photo just below it anyway. */
    .nav-brand img.logo-image:last-of-type {
        display: none;
    }

    .nav-brand {
        gap: 8px;
    }
}