@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=Inter:wght@100..900&family=Space+Grotesk:wght@300..700&display=swap');

:root {
    --bg-dark: #020617;
    --bg-surface: #0f172a;
    --accent: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* --- Noise Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.15;
    pointer-events: none;
    z-index: 10000;
}

/* --- Mouse Follower --- */
#cursor-spotlight {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease;
}

h1,
h2,
h3,
h4,
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

/* --- Animated Background --- */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-dark);
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: move 20s infinite alternate;
    opacity: 0.5;
}

.blob-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.2) 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    animation-duration: 30s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 100px) scale(1.2);
    }
}

/* --- Scroll Reveal Classes --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Navigation --- */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 4%;
    position: fixed;
    width: 100vw;
    /* Ensure it covers whole viewport */
    left: 0;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(2, 6, 23, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    flex: 1;
    /* Take up space on the left */
    display: flex;
    justify-content: flex-start;
    font-size: 1.8rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -1px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

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

nav ul {
    flex: 2;
    /* Take up more space in the middle */
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 3rem;
}

.btn-nav-wrapper {
    flex: 1;
    /* Take up equal space on the right to balance the logo */
    display: flex;
    justify-content: flex-end;
}

.btn-nav {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent);
    transition: var(--transition);
    display: inline-block;
    position: relative;
    z-index: 1;
}

nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--text-primary);
}

nav ul li a:hover::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 8% 60px;
    /* Added padding to clear the fixed navbar */
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero h4 {
    color: var(--accent);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero h1 span {
    background: linear-gradient(to right, var(--accent), var(--accent-secondary), var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    to {
        background-position: 200% center;
    }
}

.typewriter {
    border-right: 2px solid var(--accent);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent);
    }
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.btn-primary {
    display: inline-block;
    position: relative;
    z-index: 1;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px var(--accent-glow);
}

.btn-secondary {
    display: inline-block;
    position: relative;
    z-index: 1;
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--glass-border);
    border-color: var(--text-secondary);
}

/* --- About Section --- */
section {
    padding: 120px 8%;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-img-wrapper {
    position: relative;
}

.about-img-wrapper::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 30px;
    z-index: -1;
}

.about-img {
    width: 100%;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.about-img:hover {
    transform: scale(1.02);
}

.about-content h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* --- Cards Support --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--glass-bg);
    padding: 3rem 2rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(56, 189, 248, 0.05));
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-15px);
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.card i {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 2rem;
    display: block;
}

.card h5 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- Project Cards --- */
.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem !important;
}

.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.project-card:hover .project-img {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.project-card .tag {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.project-card .link {
    margin-top: auto;
    padding-top: 2rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.project-actions .link {
    margin-top: 0;
}

.details-toggle {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0;
}

.details-toggle i {
    font-size: 0.75rem;
    margin: 0;
    transition: var(--transition);
}

.details-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.project-details {
    border-top: 1px solid var(--glass-border);
    margin-top: 1.5rem;
    padding-top: 1.25rem;
}

.project-details p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.project-details strong {
    color: var(--text-primary);
}

.repo-link {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.repo-link i {
    display: inline;
    font-size: 0.8rem;
    margin: 0 0 0 0.3rem;
}

.project-card .link i {
    font-size: 1rem;
    margin: 0;
    transition: var(--transition);
}

.project-card:hover .link i {
    transform: translateX(5px);
}

/* --- Footer --- */
footer {
    padding: 100px 8% 50px;
    background: var(--bg-surface);
    text-align: center;
}

.cta-footer {
    max-width: 600px;
    margin: 0 auto 5rem;
}

.cta-footer h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
    transform: scale(1.2);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

/* --- Language / Tech Badges --- */
.lang-strip {
    margin-top: 2.5rem;
}

.lang-label {
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent) !important;
    font-weight: 600;
    margin-bottom: 1rem !important;
}

.lang-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(56, 189, 248, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: default;
}

.lang-badge i {
    font-size: 0.95rem;
    color: var(--accent);
    display: inline;
    margin: 0;
}

.lang-badge:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px -8px var(--accent-glow);
}

/* --- Project Hero Thumbnails (styled gradient placeholders) --- */
.project-hero {
    width: 100%;
    height: 180px;
    border-radius: 15px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    overflow: hidden;
    position: relative;
}

.project-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.project-hero i {
    font-size: 2.8rem;
    display: block;
    margin: 0;
    transition: var(--transition);
}

.project-card:hover .project-hero {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.project-card:hover .project-hero i {
    transform: scale(1.1);
}

/* Driver Watch — dark navy/cyan theme */
.driverwatch-hero {
    background: linear-gradient(135deg, #010b1e 0%, #031e3f 50%, #051428 100%);
    color: rgba(56, 189, 248, 0.7);
}

.driverwatch-hero i {
    color: #38bdf8;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
}

/* Student Buddy — deep purple/violet theme */
.studentbuddy-hero {
    background: linear-gradient(135deg, #0d0720 0%, #1e0f4e 50%, #2a1060 100%);
    color: rgba(167, 139, 250, 0.7);
}

.studentbuddy-hero i {
    color: #a78bfa;
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.6));
}

/* Jobs. — warm signal for the API case study */
.jobs-hero {
    background: linear-gradient(135deg, #24140b 0%, #61301b 55%, #9a4f25 100%);
    color: rgba(255, 221, 177, 0.8);
}

.jobs-hero i {
    color: #ffd19a;
    filter: drop-shadow(0 0 12px rgba(255, 172, 92, 0.6));
}

/* --- Responsiveness --- */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero h1 {
        font-size: 4rem;
    }

    section {
        padding: 80px 5%;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-btns {
        flex-direction: column;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

    .project-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}