/* ============================================================
   NodeNexus Portfolio — Premium Dark Theme CSS
   Author: Vaishnav Balpande
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg: #0a0e1a;
    --bg-2: #0d1120;
    --bg-3: #111827;
    --card: rgba(17, 24, 39, 0.7);
    --card-solid: #111827;
    --border: rgba(99, 102, 241, 0.18);
    --border-hover: rgba(99, 102, 241, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #06b6d4;
    --accent-4: #f59e0b;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.05) 100%);
    --font-primary: 'Inter', 'Outfit', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'Source Code Pro', monospace;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-accent: 0 8px 32px rgba(99,102,241,0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-h: 70px;
}

/* Light Mode */
[data-theme="light"] {
    --bg: #f8fafc;
    --bg-2: #f1f5f9;
    --bg-3: #e2e8f0;
    --card: rgba(255,255,255,0.8);
    --card-solid: #ffffff;
    --border: rgba(99,102,241,0.2);
    --border-hover: rgba(99,102,241,0.5);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-glow: rgba(99,102,241,0.25);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-accent: 0 8px 32px rgba(99,102,241,0.15);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* --- Animated Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99,102,241,0.08) 0%, transparent 60%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 60%),
                radial-gradient(ellipse 50% 30% at 60% 10%, rgba(6,182,212,0.05) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
    animation: bgPulse 12s ease-in-out infinite;
}
@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Noise overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    z-index: -1;
    pointer-events: none;
}

/* Particle canvas */
#particle-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; opacity: 0.6;
    pointer-events: none;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 10px;
}

/* --- Custom Cursor --- */
.cursor, .cursor-follower {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
}
.cursor {
    width: 8px; height: 8px;
    background: var(--accent);
    transition: transform 0.1s ease;
}
.cursor-follower {
    width: 32px; height: 32px;
    border: 1.5px solid rgba(99,102,241,0.5);
    transition: left 0.08s ease, top 0.08s ease, transform 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.cursor-hover .cursor { transform: translate(-50%, -50%) scale(2.5); }
.cursor-hover .cursor-follower { width: 50px; height: 50px; border-color: var(--accent); }
@media (hover: none) { .cursor, .cursor-follower { display: none; } }

/* --- Navbar --- */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    height: var(--nav-h);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    background: rgba(10, 14, 26, 0.75);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    animation: slideDown 0.6s ease-out;
}
[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.85);
}
.navbar.scrolled {
    box-shadow: 0 2px 30px rgba(99,102,241,0.1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-container {
    max-width: 1200px; margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    gap: 2rem;
}
.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.3rem; font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-logo:hover { color: var(--accent); }
.logo-bracket { color: var(--accent); }

.nav-menu { display: flex; gap: 0.5rem; align-items: center; }
.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem; font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    position: relative;
    transition: var(--transition);
}
.nav-link::after {
    content: ''; position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px; border-radius: 2px;
    background: var(--gradient-main);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(99,102,241,0.08);
}
.nav-link:hover::after, .nav-link.active::after {
    left: 10%; right: 10%;
}

.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.nav-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 0.8rem; font-weight: 600;
    transition: var(--transition);
    gap: 0.4rem;
}
.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.08);
}
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 0.6rem; }
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Command Palette --- */
.cmd-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.cmd-overlay.active { opacity: 1; pointer-events: all; }
.cmd-palette {
    position: fixed;
    top: 20%; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: min(600px, 92vw);
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    z-index: 9001;
    opacity: 0; pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.cmd-palette.active {
    opacity: 1; pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
.cmd-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.cmd-icon { font-size: 1rem; color: var(--accent); }
.cmd-input {
    flex: 1; background: none; border: none;
    color: var(--text-primary); font-size: 1rem;
}
.cmd-input:focus { outline: none; }
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-esc {
    font-size: 0.7rem; padding: 0.2rem 0.5rem;
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-muted); background: var(--bg-2);
}
.cmd-results { max-height: 320px; overflow-y: auto; padding: 0.5rem; }
.cmd-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer; transition: var(--transition);
}
.cmd-item:hover, .cmd-item.selected {
    background: rgba(99,102,241,0.1);
    color: var(--text-primary);
}
.cmd-item-icon { font-size: 1rem; width: 20px; text-align: center; }
.cmd-item-text { font-size: 0.9rem; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
    position: relative; overflow: hidden;
    cursor: pointer;
}
.btn::before {
    content: ''; position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}
.btn:hover::before { width: 300px; height: 300px; }
.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(99,102,241,0.4);
    animation: btnPulse 2.5s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
    animation: none;
}
.btn-secondary {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.08);
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
    position: relative;
}
.hero-content { animation: heroFadeIn 0.9s ease-out; }
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 100px; font-size: 0.8rem;
    color: var(--green); font-weight: 500;
    margin-bottom: 1.5rem;
}
.badge-dot {
    width: 7px; height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: badgePulse 1.5s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}
.hero-greeting {
    font-size: 1.1rem; color: var(--text-muted);
    font-weight: 500; margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}
.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900; line-height: 1.05;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}
.name-highlight {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200%;
    animation: gradText 4s ease infinite;
}
@keyframes gradText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.hero-roles {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.3rem; font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}
.role-prefix { color: var(--text-muted); font-weight: 400; }
.typing-text { color: var(--accent); }
.typing-cursor {
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-bio {
    color: var(--text-secondary);
    font-size: 1rem; line-height: 1.8;
    max-width: 520px; margin-bottom: 2rem;
}
.hero-cta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    margin-bottom: 2.5rem;
}
.hero-stats {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    width: fit-content;
}
.stat-item { text-align: center; }
.stat-number {
    display: block;
    font-size: 1.8rem; font-weight: 800;
    font-family: var(--font-display);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.stat-label {
    font-size: 0.72rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-top: 0.2rem;
}
.stat-divider {
    width: 1px; height: 40px;
    background: var(--border);
}

/* --- Hero Visual / Code Window --- */
.hero-visual {
    position: relative;
    animation: heroFadeIn 0.9s ease-out 0.2s backwards;
    display: flex; justify-content: center; align-items: center;
}
.code-window {
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
    backdrop-filter: blur(12px);
    width: 100%; max-width: 430px;
    transform: perspective(800px) rotateY(-5deg);
    transition: var(--transition);
}
.code-window:hover { transform: perspective(800px) rotateY(0deg) scale(1.01); }
.window-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}
.window-title {
    margin-left: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem; color: var(--text-muted);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-content { padding: 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.9; }
.code-line { display: flex; flex-wrap: wrap; gap: 0.25em; }
.code-line.pad { padding-left: 1.5em; }
.code-blank { height: 0.5em; }
.code-kw { color: #c792ea; }
.code-var { color: #82aaff; }
.code-op { color: #89ddff; }
.code-key { color: #f07178; }
.code-str { color: #c3e88d; }
.code-bool { color: #ff9cac; }
.code-fn { color: #82aaff; }
.code-comment { color: #546e7a; font-style: italic; }

/* Floating Badges */
.floating-badge {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    white-space: nowrap;
}
.badge-1 { top: -1rem; right: -1rem; animation: float1 3s ease-in-out infinite; }
.badge-2 { bottom: 2rem; right: -2rem; animation: float2 3.5s ease-in-out infinite; }
.badge-3 { bottom: -1rem; left: -1rem; animation: float3 4s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes float2 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }
@keyframes float3 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* Scroll hint */
.hero-scroll-hint {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted);
    font-family: var(--font-mono);
    animation: fadeInUp 1s ease 1s backwards;
}
.scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollLine 1.5s ease-in-out infinite;
}
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Sections Base --- */
.section { padding: 6rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem; font-weight: 600;
    color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.3rem 0.9rem;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 100px;
    margin-bottom: 1rem;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800; margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200%;
    animation: gradText 4s ease infinite;
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem; max-width: 560px;
    margin: 0 auto;
}
.section-cta { text-align: center; margin-top: 3rem; }

/* --- Reveal Animations --- */
[data-reveal] {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* --- Skills --- */
.skills-section { background: linear-gradient(to bottom, transparent, rgba(99,102,241,0.03), transparent); }
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem; margin-bottom: 2rem;
}
.skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.skill-card::before {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.06), transparent);
    transition: left 0.6s ease;
}
.skill-card:hover::before { left: 100%; }
.skill-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-accent);
}
.skill-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.skill-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-primary); }
.skill-bar-wrapper {
    height: 6px; border-radius: 10px;
    background: rgba(255,255,255,0.08);
    overflow: hidden; margin-bottom: 0.4rem;
}
.skill-bar {
    height: 100%; width: 0;
    background: var(--gradient-main);
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.skill-percent { font-size: 0.78rem; color: var(--accent); font-family: var(--font-mono); font-weight: 600; }

.tech-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.tech-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    font-size: 0.8rem; font-weight: 500;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition); cursor: default;
}
.tech-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.08);
    transform: translateY(-2px);
}

/* --- Timeline --- */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
    content: ''; position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border), var(--accent), var(--border), transparent);
    transform: translateX(-50%);
}
.timeline-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem; align-items: start;
    margin-bottom: 3rem; position: relative;
}
.timeline-item:nth-child(even) .timeline-card { grid-column: 1; grid-row: 1; order: -1; text-align: right; }
.timeline-item:nth-child(even) .timeline-date { text-align: left; }
.timeline-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 2px solid var(--border);
    justify-self: center;
    margin-top: 0.4rem;
    transition: var(--transition);
    position: relative;
}
.timeline-dot.active {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 16px rgba(99,102,241,0.6);
}
.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem; color: var(--accent);
    font-weight: 600; padding-top: 0.25rem;
}
.timeline-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}
.timeline-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-accent); }
.timeline-card.highlight { border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.05); }
.timeline-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-primary); }
.timeline-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 0.75rem; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.timeline-card:nth-child(even) .timeline-tags { justify-content: flex-end; }
.timeline-tags span {
    font-size: 0.72rem; padding: 0.2rem 0.6rem;
    border-radius: 100px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--accent);
    font-family: var(--font-mono);
}

/* --- Featured Projects --- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}
.featured-skeleton {
    height: 220px; border-radius: var(--radius);
    background: linear-gradient(90deg, var(--card) 25%, rgba(99,102,241,0.08) 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
    border: 1px solid var(--border);
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Page Hero (Projects / Contact) --- */
.page-hero {
    padding: 5rem 0 3rem;
    text-align: center;
    position: relative;
}
.page-hero::after {
    content: ''; position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}
.page-hero-content { max-width: 680px; margin: 0 auto; }
.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900; margin: 0.5rem 0 1rem;
    color: var(--text-primary);
}
.page-subtitle { color: var(--text-secondary); font-size: 1rem; line-height: 1.8; }
.projects-main, .contact-main { padding: 3rem 2rem 6rem; }

/* --- Projects Toolbar --- */
.projects-toolbar {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 2.5rem; flex-wrap: wrap;
}
.search-wrapper {
    position: relative; flex: 1; min-width: 200px;
}
.search-icon {
    position: absolute; left: 0.9rem; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted);
    pointer-events: none;
}
.search-input {
    width: 100%; padding: 0.65rem 2.5rem 0.65rem 2.5rem;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text-primary);
    font-size: 0.9rem; transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
    position: absolute; right: 0.75rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-muted); font-size: 1.2rem;
    cursor: pointer; transition: var(--transition);
    line-height: 1;
}
.search-clear:hover { color: var(--text-primary); }

.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--card); color: var(--text-secondary);
    transition: var(--transition);
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active {
    background: rgba(99,102,241,0.15);
    border-color: var(--accent);
    color: var(--accent);
}
.results-count { font-size: 0.82rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }

/* --- Project Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex; flex-direction: column;
    backdrop-filter: blur(15px);
    transition: var(--transition);
    opacity: 0;
    animation: cardIn 0.6s ease forwards;
    position: relative; overflow: hidden;
    cursor: default;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.project-card::after {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.06), transparent);
    transition: left 0.7s ease;
    pointer-events: none;
}
.project-card:hover::after { left: 140%; }
.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-accent);
}
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.project-icon { font-size: 1.5rem; }
.project-stars {
    display: flex; align-items: center; gap: 0.25rem;
    font-size: 0.78rem; color: var(--yellow);
    font-family: var(--font-mono);
}
.project-card h3 {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}
.project-card:hover h3 { color: var(--accent); }
.project-description {
    color: var(--text-secondary);
    font-size: 0.875rem; line-height: 1.6;
    flex: 1; margin-bottom: 1.25rem;
}
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-mono);
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--accent);
    transition: var(--transition);
}
.tag:hover { background: rgba(99,102,241,0.2); transform: translateY(-1px); }
.project-links {
    display: flex; justify-content: space-between;
    align-items: center; gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.btn-view-details {
    padding: 0.45rem 1rem;
    border-radius: 7px; font-size: 0.82rem; font-weight: 600;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--accent);
    transition: var(--transition);
}
.btn-view-details:hover {
    background: rgba(99,102,241,0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.project-link {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.82rem; color: var(--text-muted);
    transition: var(--transition);
}
.project-link:hover { color: var(--text-primary); }
.project-link svg { width: 14px; height: 14px; }

.no-results {
    text-align: center; padding: 4rem 2rem;
    grid-column: 1 / -1;
}
.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.no-results p { color: var(--text-muted); }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 9000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.project-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: min(820px, 94vw);
    max-height: 85vh;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    z-index: 9001;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden; display: flex; flex-direction: column;
}
.project-modal.active {
    opacity: 1; pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h2 { font-size: 1.3rem; font-weight: 700; }
.modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--text-muted);
    transition: var(--transition);
}
.modal-close:hover { background: rgba(99,102,241,0.1); color: var(--accent); transform: rotate(90deg); }
.modal-body {
    padding: 1.5rem; overflow-y: auto;
    flex: 1;
}
.modal-body h1,.modal-body h2,.modal-body h3 { color: var(--text-primary); margin: 1.5rem 0 0.5rem; }
.modal-body p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.7; }
.modal-body a { color: var(--accent); }
.modal-body a:hover { text-decoration: underline; }
.modal-body code {
    background: rgba(99,102,241,0.1); padding: 0.15rem 0.4rem;
    border-radius: 4px; font-family: var(--font-mono); font-size: 0.85em;
}
.modal-body pre {
    background: var(--bg-3); padding: 1rem; border-radius: 8px;
    overflow-x: auto; margin: 1rem 0;
}
body.modal-open { overflow: hidden; }

/* --- Contact Page --- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}
.contact-form-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.form-input {
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem; transition: var(--transition);
    resize: none;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--red); }
.form-error { font-size: 0.78rem; color: var(--red); min-height: 1em; }
.form-submit { justify-content: center; margin-top: 0.5rem; }
.form-status {
    text-align: center; font-size: 0.88rem;
    padding: 0.5rem; border-radius: 6px;
    transition: var(--transition);
}
.form-status.success { color: var(--green); background: rgba(16,185,129,0.1); }
.form-status.error { color: var(--red); background: rgba(239,68,68,0.1); }

.contact-cards { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1.5rem; }
.contact-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}
.contact-card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}
.contact-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.contact-card-icon svg { width: 20px; height: 20px; }
.github-icon  { background: rgba(255,255,255,0.08); color: #f0f0f0; }
.linkedin-icon { background: rgba(10,102,194,0.15); color: #0a66c2; }
.twitter-icon  { background: rgba(29,161,242,0.1); color: #1da1f2; }
.email-icon    { background: rgba(99,102,241,0.12); color: var(--accent); }
.whatsapp-icon { background: rgba(37,211,102,0.12); color: #25d366; }
.contact-card-info { flex: 1; }
.contact-card-info h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.15rem; }
.contact-card-info p { font-size: 0.78rem; color: var(--text-muted); }
.contact-card-arrow { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; transition: var(--transition); }
.contact-card:hover .contact-card-arrow { color: var(--accent); transform: translateX(3px); }

.availability-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(16,185,129,0.05);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius);
}
.avail-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--green); flex-shrink: 0;
    animation: badgePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16,185,129,0.5);
}
.avail-text { display: flex; flex-direction: column; gap: 0.1rem; }
.avail-text strong { font-size: 0.88rem; color: var(--green); }
.avail-text span { font-size: 0.78rem; color: var(--text-muted); }

/* --- Social Sidebar --- */
.social-sidebar {
    position: fixed; left: 1.5rem; bottom: 0;
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    z-index: 100;
    animation: fadeInUp 1s ease 0.8s backwards;
}
.social-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border-radius: 8px;
    transition: var(--transition);
}
.social-icon svg { width: 18px; height: 18px; }
.social-icon:hover { color: var(--accent); transform: translateY(-3px); }
.social-line {
    width: 1px; height: 60px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    margin-top: 0.25rem;
}

/* --- WhatsApp Button --- */
.whatsapp-btn {
    position: fixed; right: 1.5rem; bottom: 2rem;
    width: 48px; height: 48px;
    background: #25d366;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; box-shadow: 0 4px 20px rgba(37,211,102,0.35);
    transition: var(--transition); z-index: 200;
    animation: btnPulse 2s ease-in-out infinite;
}
.whatsapp-btn svg { width: 26px; height: 26px; }
.whatsapp-btn:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(37,211,102,0.5); }

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center; position: relative; z-index: 10;
}
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.footer-brand { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; }
.footer-copy { font-size: 0.82rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.82rem; color: var(--text-muted); transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }

/* --- Misc Animations --- */
@keyframes ripple { to { transform: translate(-50%, -50%) scale(4); opacity: 0; } }

/* --- Media Queries --- */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; text-align: center; padding: 3rem 2rem 5rem; }
    .hero-content { order: 2; }
    .hero-visual { order: 1; }
    .hero-bio, .hero-cta, .hero-stats { margin-left: auto; margin-right: auto; }
    .hero-cta { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-roles { justify-content: center; }
    .code-window { max-width: 380px; }
    .timeline::before { left: 20px; }
    .timeline-item { grid-template-columns: 40px 1fr; }
    .timeline-date { display: none; }
    .timeline-item:nth-child(even) .timeline-card { grid-column: 2; grid-row: 1; order: unset; text-align: left; }
    .timeline-card:nth-child(even) .timeline-tags { justify-content: flex-start; }
    .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    :root { --nav-h: 64px; }
    .nav-menu {
        position: fixed; top: var(--nav-h); left: 0; right: 0;
        background: var(--card-solid);
        border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 1rem;
        transform: translateY(-120%); opacity: 0;
        transition: var(--transition);
        backdrop-filter: blur(20px);
    }
    .nav-menu.open { transform: translateY(0); opacity: 1; }
    .hamburger { display: flex; }
    .cmd-btn { display: none; }
    .hero-name { font-size: clamp(2.5rem, 10vw, 4rem); }
    .hero-roles { font-size: 1rem; }
    .floating-badge { display: none; }
    .hero-visual { width: 100%; }
    .code-window { transform: none; }
    .timeline::before { left: 14px; }
    .timeline-item { grid-template-columns: 28px 1fr; gap: 0.75rem; }
    .timeline-dot { width: 10px; height: 10px; margin-top: 0.6rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .featured-grid { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr; }
    .projects-toolbar { flex-direction: column; align-items: stretch; }
    .filter-tabs { justify-content: flex-start; }
    .social-sidebar { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .hero-cta { flex-direction: column; }
    .hero-stats { gap: 1rem; padding: 1rem; }
    .stat-number { font-size: 1.4rem; }
    .contact-layout { gap: 2rem; }
    .btn { padding: 0.65rem 1.25rem; font-size: 0.85rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}