:root {
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.5);
    --secondary: #6366f1;
    --accent: #22d3ee;
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-blue: #00f3ff;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

body.light-mode {
    --bg-dark: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-border: rgba(14, 165, 233, 0.2);
    --primary-glow: rgba(14, 165, 233, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Progressive Enhancement for Scrollbars */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Futuristic Background */
.geometric-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
}

.geometric-bg::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 20%, transparent 80%);
    mask-image: radial-gradient(circle at 50% 50%, black 20%, transparent 80%);
}

.glow-circle {
    position: absolute;
    width: 500px;
    height: 500px;
    filter: blur(120px);
    opacity: 0.2;
    border-radius: 50%;
}

.glow-1 {
    background: var(--primary);
    top: -10%;
    right: -5%;
    animation: float 15s infinite alternate;
}

.glow-2 {
    background: var(--secondary);
    bottom: -10%;
    left: -5%;
    animation: float 18s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Navigation */
.nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: rgba(15, 23, 42, 0.7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.nav.scrolled {
    top: 0;
    width: 100%;
    border-radius: 0;
    background: rgba(2, 6, 23, 0.9);
}

body.light-mode .nav.scrolled {
    background: rgba(241, 245, 249, 0.9);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
}

@media (max-width: 500px) {
    .theme-switch-wrapper {
        margin-left: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.slider i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.slider:before {
    background-color: var(--primary);
    bottom: 3px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    z-index: 2;
}

input:checked+.slider {
    background-color: var(--primary-glow);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Mobile Nav Button */
.mobile-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    transition: var(--transition-smooth);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 50px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-tagline {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-tagline::before,
.hero-tagline::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--neon-blue);
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 6rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 900;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Hero Image Blending */
.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    justify-self: center;
}

.hero-image-wrapper {
    position: relative;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px var(--primary-glow);
    animation: morph 8s ease-in-out infinite;
    background: var(--bg-card);
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    /* Alignment for headshots */
    transform: scale(1.05);
    /* Slightly enlarged to prevent edge gaps during morphing */
    filter: brightness(1.05) contrast(1.02);
    transition: var(--transition-smooth);
}

.hero-image-wrapper:hover img {
    transform: scale(1.1);
}

.hero-image-container::after {
    content: '';
    position: absolute;
    inset: -15px;
    border: 1px dashed var(--neon-blue);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.3;
    animation: spin 20s linear infinite;
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 66% 34% 33% 67% / 65% 57% 43% 35%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Sections */
.section {
    padding: 10rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 3rem;
    margin-bottom: 5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 2px;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
    filter: blur(2px);
}

/* Cards & Components */
.card {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.card:hover::before {
    transform: translateX(100%);
}

.gradient-text {
    background: linear-gradient(to right, var(--neon-blue), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--neon-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-outline {
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

/* Grid System */
.grid {
    display: grid;
    gap: 2.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    border-left: 2px solid var(--primary);
    padding-left: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.timeline-date {
    color: var(--neon-blue);
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Skills */
.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.4rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

.skill-tag:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Projects */
.project-img {
    height: 240px;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

#project-img-1 {
    background: url('https://images.unsplash.com/photo-1485827404703-89b55fcc595e?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

#project-img-2 {
    background: url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.card:hover .project-img {
    transform: scale(1.05);
}

.project-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(2, 6, 23, 0.8));
}

/* Footer & Social */
.footer {
    padding: 5rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.social-icon:hover {
    color: var(--neon-blue);
    transform: translateY(-5px);
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-blue), var(--secondary));
    z-index: 2000;
}

/* Responsive */
@media (max-width: 992px) {
    .mobile-btn {
        display: block;
        padding: 0.5rem;
        margin-left: 0.5rem;
    }

    .nav-content {
        gap: 0.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        width: 100%;
        background: rgba(15, 23, 42, 0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        border-radius: 20px;
        border: 1px solid var(--glass-border);
        text-align: center;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-smooth);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    body.light-mode .nav-links {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        pointer-events: all;
        transform: translateX(-50%) translateY(15px);
    }
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-content {
        align-items: center;
        text-align: center;
    }

    .hero-image-container {
        order: -1;
        max-width: 300px;
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 3rem;
    }

    .nav {
        width: 95%;
        padding: 0.75rem 1rem;
        top: 10px;
    }

    .section-title {
        font-size: 2.22rem;
    }
}

/* Cleanup & Utility Classes */
.info-list {
    list-style: none;
    margin-top: 1rem;
    text-align: left;
}

.info-item {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-details {
    padding: 2rem;
    text-align: left;
}

.project-card-compact {
    padding: 0 !important;
}

.project-meta {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.project-details-block {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    line-height: 1.5;
}

.project-details-block p {
    margin-bottom: 0.5rem;
}

.project-details-block p:last-child {
    margin-bottom: 1rem;
}

.skill-tag-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.skills-card-centered {
    text-align: center;
}

.skills-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.skills-title {
    margin-bottom: 1rem;
}

.experience-list {
    padding-left: 1.25rem;
    color: var(--text-muted);
    text-align: left;
}

.education-item {
    margin-bottom: 2rem;
    text-align: left;
}

.education-subjects {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.cert-grid {
    display: grid;
    gap: 1.5rem;
}

.cert-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition-smooth);
}

.cert-card-link:hover {
    transform: translateX(5px);
}

.cert-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.cert-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.contact-card {
    text-align: center;
    padding: 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-section-spacer {
    padding-bottom: 10rem;
}

.contact-text {
    margin-bottom: 3rem;
    color: var(--text-muted);
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Light Mode Adjustments */
body.light-mode .geometric-bg {
    background: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #e2e8f0 100%) !important;
}

body.light-mode .geometric-bg::before {
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.1) 1px, transparent 1px);
}

body.light-mode .glow-circle {
    opacity: 0.1;
}

body.light-mode .hero-image-wrapper {
    background: white;
}

body.light-mode .card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-mode .nav-links a,
body.light-mode .logo,
body.light-mode .mobile-btn {
    color: #0f172a;
}

body.light-mode .nav-links a:hover {
    color: var(--primary);
    text-shadow: none;
}

body.light-mode .hero-tagline {
    color: var(--primary);
}