:root {
    /* Colors */
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #00f3ff;
    /* Cyan */
    --accent-glow: rgba(0, 243, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(10, 10, 10, 0.8);

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --section-spacing: 120px;
    --container-width: 1100px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="light"] {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --text-muted: #86868b;
    --accent-color: #007aff;
    /* Apple Blue-ish */
    --accent-glow: rgba(0, 122, 255, 0.15);
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-border: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(245, 245, 247, 0.8);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-spacing) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
    line-height: 1.2;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.text-center {
    text-align: center;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--glass-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 20px 0;
    transition: padding 0.3s ease;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo {
    display: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-btn {
    padding: 8px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    color: var(--accent-color) !important;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color) !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

#theme-toggle {
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    position: absolute;
    right: 20px;
}

#theme-toggle:hover {
    background-color: var(--card-bg);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-name {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--text-color), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--accent-color);
    min-height: 1.6em;
}

/* Custom Cursor */
.cursor-dot {
    width: 5px;
    height: 5px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent-color);
}

.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-outline {
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}

/* Hover state for cursor */
body.hovering .cursor-outline {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 243, 255, 0.05);
    border-color: transparent;
}

.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--accent-color);
    animation: blink 1s infinite;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

/* About Section */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Profile Image Styles */
.about-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
}

.about-profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    filter: grayscale(20%);
    /* Optional: adds to the vibe */
}

.about-profile-img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 40px var(--accent-glow);
    filter: grayscale(0%);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.skill-category h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
}

.skill-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Tooltip-ish effect for skills */
.skill-card::after {
    content: attr(data-desc);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--glass-bg);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    border: 1px solid var(--card-border);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.skill-card:hover::after {
    opacity: 0.95;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Projects Section (Stacked) */
/* =========================
   PROJECTS SECTION (STACKED SCROLL – FULL FIX)
   Requirement:
   - On scroll, cards stack
   - All previous cards remain visible
   - No card goes behind another
========================= */

.projects-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-bottom: 60px;
}

/* Base card */
.project-card-stacked {
    position: sticky;
    top: 120px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s ease, border-color 0.3s ease;
    will-change: transform;
    isolation: isolate;
    /* prevents stacking context bugs */
}

/* Stacking offsets + guaranteed order */
.project-card-stacked:nth-child(1) {
    top: 120px;
    z-index: 10;
}

.project-card-stacked:nth-child(2) {
    top: 145px;
    z-index: 20;
}

.project-card-stacked:nth-child(3) {
    top: 170px;
    z-index: 30;
}

.project-card-stacked:nth-child(4) {
    top: 195px;
    z-index: 40;
}

.project-card-stacked:nth-child(5) {
    top: 220px;
    z-index: 50;
}

/* Depth effect while stacked */
.project-card-stacked:not(:first-child) {
    transform: scale(0.97);
}

/* Active card focus */
.project-card-stacked:hover {
    transform: translateY(-3px) scale(1);
    border-color: var(--accent-color);
}

/* Project content */
.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.project-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    max-width: 800px;
    line-height: 1.65;
}

.project-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* =========================
   MOBILE: disable stacking cleanly
========================= */
@media (max-width: 768px) {
    .project-card-stacked {
        position: relative;
        top: unset;
        transform: none !important;
    }

    .projects-stack {
        padding-bottom: 0;
    }
}

/* Certifications Section */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 25px;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    /* Clickable */
}

.cert-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.cert-icon {
    color: var(--accent-color);
    background: rgba(0, 243, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-content h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cert-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.cert-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0.8;
}

/* Timeline Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    left: 15px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-content p {
    color: var(--text-muted);
}

/* Contact Section */
.contact-intro {
    font-size: 1.15rem;
    margin-bottom: 50px;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Contact Form Styles */
.contact-form-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    font-family: var(--font-mono);
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-color);
    font-family: var(--font-main);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    background: rgba(0, 243, 255, 0.03);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 12px;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.submit-btn:hover {
    background: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.form-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-status.success {
    display: block;
    background: rgba(0, 255, 100, 0.1);
    color: #00ff64;
    border: 1px solid rgba(0, 255, 100, 0.3);
}

.form-status.error {
    display: block;
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* Contact Info Card */
.contact-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    height: fit-content;
}

.contact-info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.contact-info-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.contact-detail svg {
    color: var(--accent-color);
    flex-shrink: 0;
}

.contact-detail a {
    color: var(--text-color);
    font-size: 0.9rem;
    word-break: break-all;
    transition: color 0.3s ease;
}

.contact-detail a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.social-link:hover {
    border-color: var(--accent-color);
    background: rgba(0, 243, 255, 0.1);
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: 80px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    width: 90%;
    max-width: 600px;
    padding: 40px;
    border-radius: 20px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.modal-section p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes scroll {
    0% {
        top: 6px;
        opacity: 1;
    }

    100% {
        top: 20px;
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Reveal Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-name {
        font-size: 3rem;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .about-cards {
        display: none;
        /* Hide floating cards on mobile for simplicity or stack them */
    }

    .nav-links {
        display: none;
    }

    /* Simple mobile menu handling omitted for brevity, or can add hamburger */
    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-dot {
        left: 5px;
    }

    /* Contact Form Mobile */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-form-wrapper,
    .contact-info-card {
        padding: 25px;
    }

    .social-links {
        gap: 10px;
    }

    .social-link {
        width: 45px;
        height: 45px;
    }
}

/* Certification Tabs */
.cert-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cert-tab {
    padding: 10px 20px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cert-tab:hover,
.cert-tab.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Filter Animation */
.cert-card.hide {
    display: none;
}

.cert-card.show {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}