/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-terminal: #0d1117;
    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --accent-blue: #00d4ff;
    --accent-purple: #a855f7;
    --border: #1e293b;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition: all 0.3s ease;
}

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

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

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

a {
    text-decoration: none;
    color: inherit;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

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

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 0;
}

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

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    letter-spacing: 0.5px;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 6rem 2rem 3rem 2rem;
}

.hero-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 3rem;
}

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

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.6s 0.3s forwards;
}

.terminal-prompt {
    color: var(--accent);
    margin-right: 0.5rem;
}

.hero-name {
    font-size: clamp(2.3rem, 5vw, 4.2rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.6s 0.6s forwards;
    line-height: 1.1;
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--text-primary);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: var(--accent-blue);
    animation: glitch-1 3s infinite linear;
    clip-path: inset(0 0 0 0);
}

.glitch::after {
    color: var(--accent);
    animation: glitch-2 3s infinite linear;
    clip-path: inset(0 0 0 0);
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 100% 0 0); }
    5% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 2px); }
    10% { clip-path: inset(0 100% 0 0); transform: translate(0); }
    45% { clip-path: inset(0 100% 0 0); }
    50% { clip-path: inset(50% 0 20% 0); transform: translate(3px, -1px); }
    55% { clip-path: inset(0 100% 0 0); transform: translate(0); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 100% 0 0); }
    15% { clip-path: inset(0 100% 0 0); }
    20% { clip-path: inset(40% 0 30% 0); transform: translate(3px, 1px); }
    25% { clip-path: inset(0 100% 0 0); transform: translate(0); }
    60% { clip-path: inset(0 100% 0 0); }
    65% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 3px); }
    70% { clip-path: inset(0 100% 0 0); transform: translate(0); }
}

.hero-tagline-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.6s 0.9s forwards;
}

.hero-tagline-prefix {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.2rem;
}

.hero-tagline {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.cursor {
    font-family: var(--font-mono);
    color: var(--accent);
    animation: blink 1s infinite;
    font-weight: 100;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    opacity: 0;
    animation: fadeInUp 0.6s 1.2s forwards;
}

/* 3D Cyber Core Canvas Container */
.hero-3d-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s 0.5s forwards;
}

.hero-3d-canvas-container {
    width: 100%;
    max-width: 460px;
    height: 440px;
    position: relative;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.05) 0%, rgba(10, 14, 23, 0.7) 70%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.1), inset 0 0 30px rgba(0, 212, 255, 0.05);
    overflow: hidden;
    cursor: grab;
}

.hero-3d-canvas-container:active {
    cursor: grabbing;
}

.hero-3d-tag {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: blink 1.5s infinite;
}

.btn {
    padding: 0.85rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeInUp 0.6s 1.5s forwards;
}

.scroll-indicator p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--accent);
    border-radius: 3px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; top: 6px; }
    100% { opacity: 0; top: 22px; }
}

/* ===== Section Base ===== */
.section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.title-hash {
    color: var(--accent);
    font-family: var(--font-mono);
    margin-right: 0.3rem;
}

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

.about-terminal {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-terminal);
}

.terminal-header {
    background: #161b22;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.prompt {
    color: var(--accent);
}

.highlight {
    color: var(--accent);
    font-weight: 600;
}

.cursor-blink {
    animation: blink 1s infinite;
    color: var(--accent);
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

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

.stat-card i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.stat-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
}

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

.skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.skill-tag {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    transition: var(--transition);
}

.skill-tag:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent);
    transform: translateY(-2px);
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s ease-out, box-shadow 0.25s ease, border-color 0.25s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(0, 255, 136, 0.2), 0 0 15px rgba(0, 212, 255, 0.15);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-terminal);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-terminal), var(--bg-card));
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.4;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
    transition: var(--transition);
}

.project-link:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.project-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--accent-blue);
    border-radius: 4px;
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-text {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-terminal);
}

.contact-terminal {
    font-size: 0.82rem;
}

.json-display {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 2;
    color: var(--text-secondary);
}

.json-key {
    color: var(--accent-blue);
}

.json-value {
    color: var(--accent);
}

.json-value a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    display: block;
}

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

.contact-card i {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.contact-card h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.contact-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

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

.footer-logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 600;
}

.footer-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.footer-socials a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-socials a:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-tagline-wrapper {
        justify-content: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-3d-canvas-container {
        max-width: 360px;
        height: 340px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: var(--transition);
        border-left: 1px solid var(--border);
    }

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

    .hamburger {
        display: flex;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
    }

    .section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1rem;
    }
}
