/* Core Variables & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&family=Fira+Code:wght@400;700&display=swap');

:root {
    --bg-color: #0f172a;
    --text-color: #94a3b8;
    --heading-color: #f8fafc;
    --accent-color: #38bdf8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --footer-bg: rgba(11, 17, 32, 0.9);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

html,
body {
    overflow-x: hidden;
}

/* Interactive Cursor Background Glow */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    /* Stops it from blocking clicks */
    transform: translate(calc(var(--mouse-x, 0) * 1px - 300px), calc(var(--mouse-y, 0) * 1px - 300px));
    transition: transform 0.15s ease-out;
    /* Makes it follow the mouse smoothly */
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--heading-color);
}

.highlight {
    color: var(--accent-color);
}

.mono {
    font-family: 'Fira Code', monospace;
}

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

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

nav a {
    color: var(--heading-color);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Status Link & Pulsing Dot */
.status-link {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e !important;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-link:hover {
    background: rgba(34, 197, 94, 0.3);
}

.status-indicator {
    height: 8px;
    width: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* General Sections */
section {
    padding: 7rem 1.5rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

section h2.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
}

section h2.section-title::after {
    content: "";
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    flex-grow: 1;
    margin-left: 20px;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.hero-content {
    flex: 1;
    max-width: 650px;
    width: 100%;
}

#hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.dynamic-heading {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
    color: var(--text-color);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#hero p.lead {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    max-width: 550px;
}

.hero-image-container {
    flex: 0 0 320px;
    position: relative;
}

.profile-img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 2px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

.profile-img:hover {
    border-color: var(--accent-color);
}

/* Typing Effect */
.typewriter {
    border-right: 3px solid var(--accent-color);
    white-space: nowrap;
    overflow: hidden;
    color: var(--accent-color);
    animation: blink 0.75s step-end infinite;
    display: inline-block;
    max-width: 100%;
    /* Add this line */
    vertical-align: bottom;
    /* Add this line */
}

.typewriter::before {
    content: '\200b';
    /* Injects a zero-width space */
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Cards & Layouts */
.card-container {
    display: grid;
    gap: 2rem;
}

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

.card,
.skill-card,
.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.card:hover,
.skill-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.8);
    border-color: rgba(56, 189, 248, 0.6);
}

.card header {
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
}

.card .date {
    font-family: 'Fira Code', monospace;
    color: var(--accent-color);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Nested Roles Timeline */
.role-timeline {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sub-role {
    padding-left: 1.2rem;
    border-left: 2px solid rgba(56, 189, 248, 0.3);
}

.sub-role h4 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.sub-role .sub-date {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: 'Fira Code', monospace;
    margin-bottom: 0.4rem;
    display: block;
}

.sub-role p {
    font-size: 0.95rem;
}

/* Skills Section specific */
.skill-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.skill-card h4 {
    margin-bottom: 0.75rem;
}

.skill-card p {
    font-size: 0.95rem;
}

/* Projects Section Specific */
.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img-container img {
    transform: scale(1.05);
}

.project-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.project-content p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.project-status {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    width: fit-content;
}

.status-current {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-past {
    background: rgba(244, 63, 94, 0.2);
    color: #f43f5e;
}

.project-links a {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.project-links a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--footer-bg);
    backdrop-filter: blur(10px);
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-group h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--heading-color);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.footer-links a,
.footer-links span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: color 0.3s, transform 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-links i {
    color: var(--accent-color);
    width: 20px;
}

.copyright {
    font-size: 0.9rem;
    color: #64748b;
}

/* Scroll Animation Classes (Staggered) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* Delays for children to create cascade effect */
.card-container .card:nth-child(1),
.projects-container .project-card:nth-child(1),
.skills-container .skill-card:nth-child(1) {
    transition-delay: 0.1s;
}

.card-container .card:nth-child(2),
.projects-container .project-card:nth-child(2),
.skills-container .skill-card:nth-child(2) {
    transition-delay: 0.2s;
}

.card-container .card:nth-child(3),
.projects-container .project-card:nth-child(3),
.skills-container .skill-card:nth-child(3) {
    transition-delay: 0.3s;
}

.card-container .card:nth-child(4),
.skills-container .skill-card:nth-child(4) {
    transition-delay: 0.4s;
}

.skills-container .skill-card:nth-child(5) {
    transition-delay: 0.5s;
}

/* Responsive Fixes */
@media (max-width: 1024px) {
    #hero {
        flex-direction: column-reverse;
        text-align: left;
        padding-top: 8rem;
        justify-content: center;
    }

    .hero-image-container {
        flex: 0 0 auto;
        width: 280px;
        margin-bottom: 2rem;
    }

    .dynamic-heading {
        min-height: auto;
    }

    section h2.section-title::after {
        display: none;
    }

    .cursor-glow {
        display: none;
    }

    /* Disable cursor tracking on mobile/tablets */
}

@media (max-width: 600px) {
    nav {
        padding: 1rem;
        gap: 1rem;
    }

    section {
        padding: 6rem 1rem 2rem;
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    .dynamic-heading {
        font-size: 1.5rem;
    }

    .card,
    .skill-card {
        padding: 1.5rem;
    }

    .card-container .card,
    .projects-container .project-card,
    .skills-container .skill-card {
        transition-delay: 0s !important;
    }
}