/* =========================================
   CSS Variables & Theme Setup
========================================= */
:root {
    /* Color Palette */
    --bg-main: #0B1120;        /* Deep Navy Slate */
    --bg-secondary: #12192B;   /* Lighter Navy Slate */
    --text-main: #F8FAFC;      /* Slate White */
    --text-muted: #94A3B8;     /* Slate Gray */
    
    /* Neon Accents */
    --accent-primary: #38BDF8; /* Professional Light Blue */
    --accent-glow: rgba(56, 189, 248, 0.4);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* =========================================
   Reset & Base Styles
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-primary);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   Typography
========================================= */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1.headline {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    background: linear-gradient(to right, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.pre-headline {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.role {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2rem;
}

.sub-headline {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* =========================================
   Layout & Utility
========================================= */
/* Global Background Canvas Network */
.network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2; /* Deep in the background */
    pointer-events: none; /* Let clicks pass through */
    opacity: 0.4; /* Subtle ambient effect */
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
}

.bg-darker {
    background-color: var(--bg-secondary);
}

.w-100 {
    width: 100%;
}

/* =========================================
   Buttons & Inputs
========================================= */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-main);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--glass-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05) translateY(-2px);
}

/* =========================================
   Glassmorphism Card
========================================= */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(0, 243, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0, 0.5), 0 0 15px var(--accent-glow);
}

/* =========================================
   Navigation
========================================= */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-smooth);
    padding: 1.5rem 0;
}

#navbar.scrolled {
    padding: 1rem 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.logo .accent {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Mobile Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-main);
    border-radius: 3px;
}

/* =========================================
   Hero Section
========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 2rem;
    overflow: hidden;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
    text-align: left;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    margin-top: 2rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* =========================================
   About Section
========================================= */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

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

.about-text strong {
    color: var(--accent-primary);
}

.image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper .card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--accent-primary);
    filter: blur(80px);
    opacity: 0.25;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.profile-img {
    width: 100%;
    max-width: 450px; /* Increased for better visibility on desktop */
    height: auto;
    object-fit: cover;
    aspect-ratio: 1 / 1; /* Stable square boundary for the clip-path morph */
    z-index: 1;
    position: relative;
    border: none;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); /* drop-shadow survives clip-path */
    transition: var(--transition-smooth);
}

.profile-img:hover {
    transform: scale(1.02);
    border-color: rgba(0, 243, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0, 0.6), 0 0 20px var(--accent-glow);
}

/* =========================================
   Skills Section
========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    text-align: left;
}

.skill-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   Experience Section (Timeline)
========================================= */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2rem;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
    padding-left: 5rem;
    border: none;
    background: transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.55rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 1;
}

.timeline-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 5px 20px rgba(0,0,0, 0.4), 0 0 15px rgba(0,243,255,0.1);
    transform: translateX(10px);
}

.timeline-content h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.timeline-content .company {
    display: inline-block;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-content p {
    color: var(--text-muted);
}

/* =========================================
   Contact Section
========================================= */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.contact-link:hover {
    color: var(--accent-primary);
}

.contact-form .input-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0,243,255,0.2);
}

/* =========================================
   Footer
========================================= */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   Animations (Intersection Observer)
========================================= */
/* Default Reveal (Fade up) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

/* Fly in from Left */
.reveal-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

/* Fly in from Right */
.reveal-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

/* Scale and Land (for images/cards) */
.reveal-scale {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 1.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce effect */
    will-change: transform, opacity;
}

/* Active states */
.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* =========================================
   Cinematic Load Animations
========================================= */
@keyframes cinematic-landing {
    0% {
        opacity: 0;
        /* Start large and pulled towards center screen */
        transform: scale(1.8) translateX(-10vw); 
        /* 1. Large horizontal rectangle mask */
        clip-path: inset(25% 0% 25% 0% round 16px); 
        filter: drop-shadow(0 0 0 rgba(0,0,0,0));
    }
    15% {
        opacity: 1;
        /* 2. Image remains perfectly still */
        transform: scale(1.8) translateX(-10vw);
        clip-path: inset(25% 0% 25% 0% round 16px);
        filter: drop-shadow(0 30px 60px rgba(0,0,0,0.4));
    }
    50% {
        opacity: 1;
        /* 2. Image STILL remains perfectly still */
        transform: scale(1.8) translateX(-10vw);
        /* 3 & 4. Smoothly morphs into a perfect circle mask */
        clip-path: inset(0% 0% 0% 0% round 50%);
        filter: drop-shadow(0 30px 60px rgba(0,0,0,0.4));
    }
    100% {
        opacity: 1;
        /* 5. Gradually shrinks to final profile size and centers in grid */
        transform: scale(1) translateX(0);
        /* 7. End state is a clean circular profile */
        clip-path: inset(0% 0% 0% 0% round 50%);
        filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5));
    }
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-cinematic {
    animation: cinematic-landing 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    will-change: transform, opacity, box-shadow, border-radius;
}

.animate-fade-up {
    animation: fade-in-up 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    opacity: 0;
}

.animate-fade-down {
    animation: fade-in-down 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    opacity: 0;
}

.load-delay-1 { animation-delay: 0.2s; }
.load-delay-2 { animation-delay: 0.6s; }

/* Stagger Delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* =========================================
   Responsive Design
========================================= */
@media screen and (max-width: 968px) {
    .hero-wrapper,
    .about-content,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .headline {
        font-size: 3rem;
    }
    
    .cta-group {
        justify-content: center;
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-item {
        padding-left: 3rem;
    }
    
    .timeline-item::before {
        left: 0.55rem;
    }
}

@media screen and (max-width: 768px) {
    .headline {
        font-size: 2.3rem;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 2rem 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .cta-group {
        flex-direction: column;
    }
}

/* =========================================
   AI Notification System & Form Overrides
========================================= */
.contact-form textarea {
    resize: none;
}



/* =========================================
   AI Terminal Simulation
========================================= */
.terminal-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid var(--glass-border);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.mac-btns {
    display: flex;
    gap: 8px;
}

.mac-btns span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.mac-btns .close { background: #ff5f56; }
.mac-btns .minimize { background: #ffbd2e; }
.mac-btns .maximize { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-primary);
}

.terminal-body {
    padding: 1.5rem;
    color: #38BDF8;
    height: 250px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

.terminal-body p {
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.terminal-body .prompt {
    color: #10b981;
    margin-right: 10px;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* =========================================
   Notification Bell & Dropdown
========================================= */
.nav-notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: transform 0.3s;
}

.notif-btn:hover {
    transform: scale(1.1);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444; /* Alert red */
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    height: 16px;
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

.notif-dropdown {
    position: absolute;
    top: 130%;
    right: 0;
    width: 340px;
    background: rgba(18, 25, 43, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.notif-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

/* Custom Scrollbar for Dropdown */
.notif-list::-webkit-scrollbar {
    width: 6px;
}
.notif-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-decoration: none;
    transition: background 0.3s;
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(56, 189, 248, 0.05);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item .source {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.notif-item .source.substack {
    color: #FF6719; /* Substack Orange */
}

.notif-item .source.linkedin {
    color: #0A66C2; /* LinkedIn Blue */
}

.notif-item .title {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.3;
}

.notif-item .date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Mobile Adjustments */
@media screen and (max-width: 768px) {
    .nav-notification-wrapper {
        margin: 1rem 0;
    }
    .notif-dropdown {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%) translateY(15px);
        width: 90%;
        right: auto;
    }
    .notif-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* =========================================
   IP Theme Loader
========================================= */
.theme-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #0B1120; /* Hardcoded solid dark to ensure it hides everything */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.theme-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}
