*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --text: #e5e5e5;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #7c5cfc;
    --accent-2: #c084fc;
    --border: #222;
    --border-hover: #444;
    --radius: 12px;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Canvas particle field */
#dotfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* All content above the dot layers */
nav, section, footer { position: relative; z-index: 1; }

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: #e0c4ff; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* NAV */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 16px 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--border); }
nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

/* HERO */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(124,92,252,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(192,132,252,0.06) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; padding-bottom: 60px; }
.hero-label {
    display: inline-block; font-size: 13px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
    font-size: clamp(40px, 7vw, 64px); font-weight: 700;
    line-height: 1.1; letter-spacing: -2px; color: #fff; margin-bottom: 20px;
}
.hero-wavy-wrap {
    display: inline-block;
    -webkit-text-fill-color: initial;
    vertical-align: middle;
    margin: 0 4px;
    position: relative;
    width: 90px;
    height: 32px;
    overflow: visible;
}
.hero-wavy-wrap svg {
    position: absolute;
    top: 0; left: 0;
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(124,92,252,0.5));
}
/* wavy line + pen driven by JS for arc-length-perfect sync */
.hero-desc {
    font-size: 18px; color: var(--text-muted); line-height: 1.7;
    max-width: 540px; margin-bottom: 36px;
}
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 8px;
    font-size: 14px; font-weight: 600; transition: all 0.2s;
    border: none; cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}
.btn-primary:hover {
    color: #fff; transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(124,92,252,0.3);
}
.btn-outline {
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    color: var(--text); border-color: var(--border-hover);
    background: var(--bg-card);
}

/* SECTIONS */
section { padding: 100px 0; }
.section-label {
    font-size: 13px; font-weight: 600; letter-spacing: 2px;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-title {
    font-size: clamp(28px, 4vw, 40px); font-weight: 700;
    letter-spacing: -1px; color: #fff; margin-bottom: 48px;
}

/* PROJECTS */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; perspective: 1200px; }
.project-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all 0.3s ease; display: block; cursor: default;
    transform-style: preserve-3d; will-change: transform;
}
a.project-card { cursor: pointer; }
.project-card:hover {
    border-color: rgba(124,92,252,0.3); transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,92,252,0.1); color: var(--text);
}
.project-image {
    width: 100%; height: 200px; position: relative; overflow: hidden;
}
.project-image img, .project-image video {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease, opacity 0.8s ease;
}
.project-image video {
    position: absolute; top: 0; left: 0;
    opacity: 0;
}
.project-card:hover .project-image img { transform: scale(1.02); }
.project-card:hover .project-image video {
    opacity: 1; transform: scale(1.02);
}
.project-card:hover .project-image img.has-video {
    opacity: 0;
}

.grad-1 { background: linear-gradient(135deg, #1a1040 0%, #2d1b69 40%, #7c5cfc 100%); }
.grad-2 { background: linear-gradient(135deg, #0a192f 0%, #112240 40%, #2a6496 100%); }
.grad-3 { background: linear-gradient(135deg, #1a0a2e 0%, #3d1f6d 40%, #c084fc 100%); }
.grad-4 { background: linear-gradient(135deg, #0f0c29 0%, #302b63 40%, #24243e 100%); }
.grad-5 { background: linear-gradient(135deg, #141e30 0%, #243b55 40%, #4a90d9 100%); }
.grad-6 { background: linear-gradient(135deg, #1a0000 0%, #3d0f0f 40%, #c05050 100%); }

.project-body { padding: 24px; }
.project-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.project-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
    background: rgba(124,92,252,0.1); color: var(--accent-2);
    border: 1px solid rgba(124,92,252,0.15);
}

/* ABOUT */
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.about-text { font-size: 16px; color: var(--text-muted); line-height: 1.8; }
.about-text p + p { margin-top: 16px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stat {
    padding: 24px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.stat-number { font-size: 32px; font-weight: 700; color: #fff; letter-spacing: -1px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* SKILLS */
#skills .section-title { margin-bottom: 32px; }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-group {
    padding: 28px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.skill-group-title {
    font-size: 14px; font-weight: 700; color: #fff;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.skill-group-title span {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: var(--accent);
}
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
    font-size: 12px; padding: 4px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.04); color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.25s ease; cursor: default;
}

/* TIMELINE */
.timeline { position: relative; padding-left: 32px; z-index: 1; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 1px; background: var(--border);
}
.timeline-item {
    position: relative; padding: 16px 20px 36px;
    background: rgba(10, 10, 10, 0.85);
    border-radius: 8px; margin-bottom: 8px;
}
.timeline-item:last-child { padding-bottom: 16px; margin-bottom: 0; }
.timeline-item::before {
    content: ''; position: absolute; left: -29px; top: 8px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--bg);
}
.timeline-item.current::before { box-shadow: 0 0 0 4px rgba(124,92,252,0.2); }
.timeline-role { font-size: 16px; font-weight: 700; color: #fff; }
.timeline-company { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.timeline-dates { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.timeline-impact { font-size: 13px; color: var(--text-dim); margin-top: 10px; line-height: 1.7; border-left: 2px solid var(--border); padding-left: 12px; }

/* CONTACT */
.contact-section { text-align: center; padding: 120px 0; }
.contact-section .section-title { margin-bottom: 16px; }
.contact-desc { font-size: 16px; color: var(--text-muted); margin-bottom: 36px; }
.contact-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* FOOTER */
footer {
    padding: 40px 0; border-top: 1px solid var(--border); text-align: center;
}
footer p { font-size: 13px; color: var(--text-dim); }

/* SCROLL INDICATOR */
.scroll-hint {
    position: absolute; bottom: 28px; left: 50%;
    transform: translateX(-50%); z-index: 2;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 22px 10px 18px;
    border-radius: 40px;
    border: 1px solid rgba(124,92,252,0.3);
    background: rgba(124,92,252,0.06);
    color: var(--accent-2); font-size: 12px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s;
    animation: hintFade 2s ease 1.5s both, hintPulse 3s ease-in-out 3.5s infinite;
}
.scroll-hint:hover {
    color: #fff;
    border-color: rgba(124,92,252,0.6);
    background: rgba(124,92,252,0.15);
    box-shadow: 0 0 24px rgba(124,92,252,0.25);
}
.scroll-hint svg {
    animation: bobDown 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes bobDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}
@keyframes hintFade {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes hintPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124,92,252,0); }
    50% { box-shadow: 0 0 20px 4px rgba(124,92,252,0.15); }
}

/* ABOUT SECTION WITH PHOTO */
.about-photo-grid {
    display: grid; grid-template-columns: 180px 1fr;
    gap: 40px; align-items: start; margin-bottom: 40px;
}
.about-portrait {
    width: 100%; border-radius: 12px;
    border: 1px solid var(--border);
    filter: grayscale(20%);
    clip-path: inset(0 100% 0 0);
    transition: filter 0.3s, clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}
.about-portrait:hover { filter: grayscale(0%); }
.about-bio p { margin-bottom: 20px; line-height: 1.8; font-size: 16px; }
.about-bio .highlight {
    font-weight: 500;
    background: linear-gradient(90deg, #7c5cfc, #c084fc, #4ade80, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* CONTACT CTA ENHANCED */
.cta-box {
    background: linear-gradient(135deg, rgba(124,92,252,0.08), rgba(192,132,252,0.05));
    border: 1px solid rgba(124,92,252,0.2);
    border-radius: 16px; padding: 48px; text-align: center;
    margin-top: 32px;
}
.cta-box h3 {
    font-size: 24px; color: var(--text); margin-bottom: 12px; font-weight: 600;
}
.cta-tagline {
    color: var(--text-muted); font-size: 16px; margin-bottom: 28px; line-height: 1.6;
}
.cta-availability {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: #4ade80; margin-top: 20px;
}
.cta-availability::before {
    display: none;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

@media (max-width: 900px) {
    .about-photo-grid { grid-template-columns: 1fr; }
    .about-portrait { max-width: 240px; margin: 0 auto; }
}

/* HERO TYPING EFFECT */
.hero-typed {
    display: block; min-height: 1.2em;
    color: var(--accent-2); font-style: italic; font-weight: 400;
}
.hero-typed .cursor {
    display: inline-block; width: 2px; height: 1em;
    background: var(--accent-2); margin-left: 2px;
    animation: blink 0.7s step-end infinite;
    vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

/* ANIMATIONS */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger > * { transition-delay: calc(var(--i, 0) * 0.08s); }

/* RESPONSIVE */
@media (max-width: 900px) {
    .projects-grid { grid-template-columns: 1fr; }
    .about-content { grid-template-columns: 1fr; gap: 40px; }
    .skills-grid { grid-template-columns: 1fr; }
    .nav-burger { display: block; }
    .nav-links {
        display: none; flex-direction: column; gap: 0;
        position: absolute; top: 100%; left: 0; right: 0;
        background: #0a0a0a;
        padding: 8px 24px 16px; border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--border); }
    .nav-links a:last-child { border-bottom: none; }
}
@media (max-width: 600px) {
    .hero h1 { font-size: 32px; letter-spacing: -1px; }
    .hero-wavy-wrap { width: 54px; height: 20px; }
    .hero-desc { font-size: 15px; }
    section { padding: 60px 0; }
    .container { padding: 0 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 16px; }
    .stat-number { font-size: 24px; }
    .timeline-impact { font-size: 12.5px; }
    .contact-card h2 { font-size: 22px; }
}

/* ── VISUAL POLISH ── */

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    z-index: 1001;
    width: 0%;
    pointer-events: none;
}

/* Staggered hero entrance */
.hero-content > * {
    opacity: 0;
    transform: translateY(24px);
    animation: heroEntrance 0.7s ease forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2) { animation-delay: 0.35s; }
.hero-content > *:nth-child(3) { animation-delay: 0.5s; }
.hero-content > *:nth-child(4) { animation-delay: 0.65s; }
.hero-content > *:nth-child(5) { animation-delay: 0.8s; }
@keyframes heroEntrance {
    to { opacity: 1; transform: translateY(0); }
}

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

/* Skill tags hover glow */
.skill-tag:hover {
    background: rgba(124,92,252,0.15);
    color: var(--accent-2);
    border-color: rgba(124,92,252,0.3);
    box-shadow: 0 0 12px rgba(124,92,252,0.25), 0 0 4px rgba(124,92,252,0.1);
    transform: translateY(-1px);
}

/* Smooth image reveal */
.reveal.visible .about-portrait {
    clip-path: inset(0 0 0 0);
}

/* Section dividers */
#about::before, #skills::before, #experience::before, #contact::before {
    content: '';
    display: block;
    max-width: 200px;
    margin: 0 auto 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124,92,252,0.4), rgba(192,132,252,0.4), transparent);
}
