/* Base and Variables */
:root {
    --bg-main: #0B1120;       /* Deep navy blue almost black */
    --bg-light: #121C30;      /* Slightly lighter techy navy */
    --primary: #F8FAFC;       /* White/Light gray */
    --primary-light: #CBD5E1; /* Muted slate */
    --accent: #0EA5E9;        /* Bright Cyan */
    --accent-hover: #38BDF8;  /* Lighter Cyan */
    --accent-glow: rgba(14, 165, 233, 0.4);
    --cta-color: #10B981;     /* Hacker Emerald Green */
    --cta-hover: #34D399;     /* Lighter Emerald */
    --text-main: #94A3B8;     /* Greyish text */
    --text-muted: #64748B;
    --border-color: #1E293B;  /* Component borders */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 15px var(--accent-glow);
}

.matrix-mode {
    --bg-main: #000000 !important;
    --bg-light: #0d0d0d !important;
    --primary: #0f0 !important;
    --primary-light: #0a0 !important;
    --accent: #0f0 !important;
    --accent-hover: #3f3 !important;
    --accent-glow: rgba(0, 255, 0, 0.4) !important;
    --cta-color: #0f0 !important;
    --cta-hover: #3f3 !important;
    --text-main: #0c0 !important;
    --text-muted: #080 !important;
    --border-color: #050 !important;
    font-family: var(--font-mono) !important;
}
.matrix-mode .hero {
    background: #000 !important;
}
.matrix-mode * {
    font-family: var(--font-mono) !important;
    text-shadow: 0 0 2px #0f0;
}

/* Boot Screen */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    color: #0f0;
    font-family: var(--font-mono);
    font-size: 1rem;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    transition: opacity 1s ease, visibility 1s;
}

.boot-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-text p {
    margin: 2px 0;
    line-height: 1.2;
    text-shadow: 0 0 2px #0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default; /* Change basic cursor */
}

/* Custom Cursor tech feel overrides */
a, button, input {
    cursor: pointer;
}
input[type="text"] {
    cursor: text;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-mono);
}

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

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
.section {
    padding: 100px 0;
}

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

.section-header {
    text-align: left;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: inline-block;
}

.section-header h2::after {
    content: '_';
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.divider {
    height: 2px;
    width: 100px;
    background-color: var(--accent);
    margin: 10px 0 0 0;
    border-radius: 2px;
    box-shadow: var(--shadow-glow);
}

/* Terminal Utility */
.terminal-icon {
    color: var(--accent);
    margin-right: 0.5rem;
}

/* Typography Utility */
.highlight {
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 4px; /* Techy sharper corners */
    font-weight: 600;
    font-family: var(--font-mono);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(14,165,233,0.1);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary-light);
    border: 1px solid var(--text-muted);
}

.btn-secondary:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Navbar */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 17, 32, 0.85); /* Blur dark */
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    height: 80px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
}

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

.nav-list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 5px;
    color: var(--primary-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

/* Nav Tool Buttons for Easter Eggs */
.tools-li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}
.nav-tool-btn {
    background: transparent;
    border: none;
    color: var(--cta-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-tool-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 10px rgba(16,185,129,0.3);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative; /* Essential for particles absolute positioning */
    background: radial-gradient(circle at 15% 50%, rgba(14,165,233,0.06), transparent 25%), radial-gradient(circle at 85% 30%, rgba(16,185,129,0.04), transparent 25%);
}

#particles-js, .particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

.greeting {
    font-size: 1.1rem;
    font-family: var(--font-mono);
    color: var(--cta-color);
    display: block;
    margin-bottom: 1rem;
}

.name {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

/* Glitch Hover Effect */
.glitch-hover {
    position: relative;
    display: inline-block;
}

.glitch-hover::before,
.glitch-hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.glitch-hover:hover::before {
    left: 3px;
    text-shadow: -2px 0 #F87171;
    animation: glitch-anim-1 0.4s infinite linear alternate-reverse, glitch-fade 1s forwards;
}

.glitch-hover:hover::after {
    left: -3px;
    text-shadow: 2px 0 var(--accent);
    animation: glitch-anim-2 0.3s infinite linear alternate-reverse, glitch-fade 1s forwards;
}

@keyframes glitch-fade {
    0%, 90% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); }
    20% { clip-path: inset(60% 0 10% 0); }
    40% { clip-path: inset(40% 0 50% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(10% 0 70% 0); }
    100% { clip-path: inset(30% 0 20% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(15% 0 60% 0); }
    20% { clip-path: inset(70% 0 20% 0); }
    40% { clip-path: inset(5% 0 80% 0); }
    60% { clip-path: inset(50% 0 30% 0); }
    80% { clip-path: inset(25% 0 55% 0); }
    100% { clip-path: inset(85% 0 10% 0); }
}

.title {
    font-size: 2rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    min-height: 2.4rem; /* Prevent layout shift during typing */
}

.typewriter-text::after {
    content: '█';
    animation: blink 1s step-start infinite;
    color: var(--accent);
}

.summary {
    font-size: 1.1rem;
    color: var(--text-main);
    max-width: 650px;
    margin-bottom: 2.5rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* About Section */
.about-content {
    max-width: 800px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.about-content p {
    margin-bottom: 1.5rem;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 1px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 14px;
    top: 5px;
    width: 13px;
    height: 13px;
    background-color: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    background-color: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.timeline-content {
    background: var(--bg-light);
    padding: 1.8rem;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.timeline-content:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.4);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header h3 {
    font-size: 1.25rem;
    color: var(--primary);
}

.timeline-header span {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.company {
    font-size: 1.05rem;
    color: var(--cta-color);
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.timeline-content ul {
    list-style-type: none;
}

.timeline-content li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2rem;
    font-size: 0.95rem;
}

.timeline-content li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: bold;
}

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

.skill-category {
    background: var(--bg-main);
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.skill-category:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-glow);
}

.skill-category h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    border: 1px solid rgba(14, 165, 233, 0.2);
    transition: var(--transition);
}

.tag:hover {
    background-color: var(--accent);
    color: var(--bg-main);
    box-shadow: var(--shadow-glow);
}

.tag-alt .tag {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--cta-color);
    border-color: rgba(16, 185, 129, 0.2);
}

.tag-alt .tag:hover {
    background-color: var(--cta-color);
    color: var(--bg-main);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.tag-db .tag {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--primary-light);
    border-color: rgba(148, 163, 184, 0.2);
}

.tag-db .tag:hover {
    background-color: var(--primary-light);
    color: var(--bg-main);
}

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

.edu-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 6px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.edu-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.edu-icon {
    font-size: 1.5rem;
    color: var(--accent);
    background: rgba(14, 165, 233, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    flex-shrink: 0;
}

.edu-details h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.edu-details h4 {
    color: var(--primary-light);
    font-size: 1rem;
    font-weight: 500;
}

.edu-date {
    font-size: 0.85rem;
    color: var(--cta-color);
    font-family: var(--font-mono);
    margin: 0.5rem 0 1rem;
    display: inline-block;
}

/* Contact Section */
.contact-subtitle {
    margin: 0 0 3rem;
    color: var(--cta-color);
    font-family: var(--font-mono);
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: var(--bg-main);
    padding: 2.5rem 1.5rem;
    border-radius: 6px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.contact-card:hover .icon-wrapper {
    background: var(--accent);
    color: var(--bg-main);
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.icon-wrapper {
    width: 70px;
    height: 70px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--accent);
    transition: var(--transition);
}

.contact-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.contact-card p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: #060B14;
    color: var(--text-muted);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer a {
    color: var(--text-muted);
    font-size: 1.3rem;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--accent);
    transform: scale(1.2);
    display: inline-block;
    filter: drop-shadow(0 0 5px var(--accent));
}

/* Floating Elements */
.floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent);
    color: var(--bg-main);
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow-glow);
    z-index: 99;
    transition: var(--transition);
}

.floating-cta:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1) translateY(-5px);
    color: #fff;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 35px;
    right: 110px;
    background-color: var(--cta-color);
    color: var(--bg-main);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    font-size: 1.4rem;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 98;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn:hover {
    background-color: var(--cta-hover);
    transform: translateY(-5px);
    color: #000;
}

.scroll-top-btn.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

/* ---------------- JSON View Overlay ---------------- */
.json-overlay {
    position: fixed;
    top: 80px; /* Below header */
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px);
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(5px);
    z-index: 999;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.json-overlay.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}
.json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--cta-color);
    font-family: var(--font-mono);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.json-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.json-header button:hover {
    color: var(--cta-color);
}
#jsonOutput {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-grow: 1;
}

/* ---------------- Terminal Easter Egg ---------------- */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7); /* dark focus */
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}
.terminal-overlay.hide {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}
.terminal-window {
    width: 800px;
    max-width: 95%;
    height: 500px;
    max-height: 90vh;
    background: #000;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(16, 185, 129, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.terminal-header {
    background: #111;
    color: #888;
    padding: 5px 15px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    user-select: none;
    border-bottom: 1px solid #222;
}
.terminal-close {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
}
.terminal-close:hover {
    color: #F87171;
}
.terminal-body {
    padding: 15px;
    font-family: var(--font-mono);
    color: var(--cta-color);
    font-size: 0.95rem;
    flex-grow: 1;
    overflow-y: auto;
}
.terminal-body p {
    margin-bottom: 5px;
}
.terminal-input-line {
    display: flex;
    padding: 0 15px 15px 15px;
    font-family: var(--font-mono);
    align-items: center;
}
.terminal-input-line .prompt {
    color: var(--cta-color);
    margin-right: 10px;
}
#terminalInput {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    flex-grow: 1;
    outline: none;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-list {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-main);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-list.active {
        left: 0;
    }
    
    .tools-li {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 1rem;
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .name {
        font-size: 3rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .cta-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .timeline::before {
        left: 0;
    }
    
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-dot {
        left: -7px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    
    .floating-cta {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}
