:root {
    --bg-color: #0d1117;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.5);
    --secondary-accent: #bc8cff;
    --card-bg: rgba(22, 27, 34, 0.6);
    --border-color: rgba(48, 54, 61, 0.6);
    --font-family: 'Inter', sans-serif;
    --glass-bg: rgba(13, 17, 23, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Ambient Background */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(100px);
    opacity: 0.4;
    border-radius: 50%;
    animation: floating 20s infinite alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    animation-duration: 25s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-accent), transparent 70%);
    animation-duration: 30s;
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #238636, transparent 70%);
    animation-duration: 28s;
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes floating {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(100px, 50px) rotate(20deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Glass Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.socials a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.socials a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Main Content */
main {
    padding-top: 8rem;
    /* Reduced from 12rem to reduce gap */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    /* Ensure absolute positioning of scroll indicator works relative to this */
    min-height: calc(100vh - 8rem);
    /* Take remaining height */
    padding-bottom: 4rem;
    /* Space for scroll indicator */
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    animation: fadeUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.highlight {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

/* Optional glowing underline or effect for highlight */
.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--accent-glow);
    filter: blur(15px);
    z-index: -1;
    opacity: 0.6;
}

.subtitle {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 400;
    animation: fadeUp 0.8s ease-out 0.1s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.bio {
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 2.5rem;
    font-size: 1.15rem;
    line-height: 1.7;
    animation: fadeUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1rem;
    animation: fadeUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #0d1117;
    border: 1px solid transparent;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* Profile Image */
.hero-image-wrapper {
    display: flex;
    justify-content: center;
    animation: fadeUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.profile-placeholder {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-bg), var(--border-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;

    /* Breathing animation */
    animation: floatProfile 6s ease-in-out infinite;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Glowing ring behind the profile */
.profile-placeholder::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-accent));
    z-index: -1;
    opacity: 0.5;
    filter: blur(20px);
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes floatProfile {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulseGlow {
    0% {
        opacity: 0.3;
        filter: blur(20px);
    }

    100% {
        opacity: 0.6;
        filter: blur(30px);
    }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

/* Tech Stack */
.tech-stack {
    text-align: center;
}

.tech-stack h2,
.featured-work h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.tech-item {
    background: var(--card-bg);
    /* Use semi-transparent card bg */
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-secondary);
    /* Separate transitions: fast for hover, slow for scroll reveal */
    transition:
        background 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
    backdrop-filter: blur(10px);
}

/* Old Manual Staggering removed */


.tech-item:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(88, 166, 255, 0.15);
}

/* Featured Work */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy spring */
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(88, 166, 255, 0.1);
}

.project-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.85rem;
    color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    margin-top: auto;
    width: fit-content;
    transition: color 0.2s ease;
    font-size: 1.1rem;
}

.btn-link .arrow {
    transition: transform 0.2s ease;
    display: inline-block;
}

.btn-link:hover {
    color: var(--accent-color);
}

.btn-link:hover .arrow {
    transform: translateX(5px);
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: rgba(13, 17, 23, 0.4);
    backdrop-filter: blur(5px);
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 4rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .bio {
        margin: 0 auto 2.5rem;
    }

    .cta-group {
        justify-content: center;
    }

    .shape {
        filter: blur(60px);
        /* Reduce blur calculation for mobile performance */
    }
}

@media (max-width: 768px) {

    .container,
    header .container {
        padding: 0 1.5rem;
    }

    main {
        padding-top: 8rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Scroll Animations */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for manual control if needed with js, 
   but tech-items usually better with just css definition or loop in js.
   For now, we will rely on finding them in order or CSS nth-child delays if they all appear at once.
*/
.tech-item:nth-child(1) {
    transition-delay: 0.1s;
}

.tech-item:nth-child(2) {
    transition-delay: 0.2s;
}

.tech-item:nth-child(3) {
    transition-delay: 0.3s;
}

.tech-item:nth-child(4) {
    transition-delay: 0.4s;
}

.tech-item:nth-child(5) {
    transition-delay: 0.5s;
}

.tech-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    /* Separate fade in from bounce to avoid transform conflict */
    animation: bounce 2s infinite, fadeIn 1s ease-out 1.5s forwards;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(10px);
    }

    60% {
        transform: translateX(-50%) translateY(5px);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
}