/* ===== Variables ===== */
:root {
    --bg-primary: #050508;
    --bg-secondary: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-purple: #a78bfa;
    --accent-blue: #60a5fa;
    --accent-cyan: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #22d3ee 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 60px rgba(167, 139, 250, 0.15);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

/* ===== Particle Canvas ===== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 48px;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.brand-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    letter-spacing: 0.02em;
}

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

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

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
}

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

.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
}

.hero-content { z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--accent-purple);
    margin-bottom: 32px;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero-title { margin-bottom: 24px; }

.title-greeting {
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.title-name {
    display: block;
    font-size: 4.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.hero-summary {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 24px rgba(167, 139, 250, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(167, 139, 250, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Avatar */
.hero-visual {
    display: flex;
    justify-content: center;
    z-index: 1;
}

.avatar-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
}

.avatar-glow {
    position: absolute;
    inset: -40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.05); }
}

.avatar-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-purple), var(--accent-blue), var(--accent-cyan), var(--accent-purple));
    animation: rotate 12s linear infinite;
    opacity: 0.6;
}

@keyframes rotate { to { transform: rotate(360deg); } }

.avatar-wrapper img,
.avatar-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent-purple);
}

.avatar-wrapper img:not([src]),
.avatar-wrapper img[src=""] { display: none; }

.avatar-wrapper img:not([src]) + .avatar-fallback,
.avatar-wrapper img[src=""] + .avatar-fallback,
.avatar-wrapper img.error + .avatar-fallback { display: flex; }

/* Info Strip */
.info-strip-wrap {
    padding-bottom: 80px;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.info-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.info-strip-item {
    padding: 24px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
    transition: var(--transition);
}

.info-strip-item:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.info-strip-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.info-strip-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-strip-value a { color: var(--accent-cyan); transition: opacity 0.3s; }
.info-strip-value a:hover { opacity: 0.8; }

/* ===== Sections ===== */
main {
    position: relative;
    z-index: 2;
}

section {
    padding: 120px 0;
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(167, 139, 250, 0.3), transparent);
    opacity: 0.5;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-purple);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== About ===== */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.about-main {
    padding: 40px;
}

.about-main h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.about-main p {
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 0.95rem;
}

.about-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.about-card {
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--shadow-glow);
}

.about-card-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.about-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.about-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Skills ===== */
.skills-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.skills-main {
    padding: 40px;
}

.skill-category {
    margin-bottom: 32px;
}

.skill-category:last-child { margin-bottom: 0; }

.skill-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.skill-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: var(--transition);
}

.skill-item:hover {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.2);
    transform: translateX(4px);
}

.skill-name { font-size: 0.9rem; color: var(--text-secondary); }

.skill-level {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-family: var(--font-mono);
}

.skill-highlight {
    padding: 32px;
    position: sticky;
    top: 100px;
}

.skill-highlight h3 {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.skill-highlight ul { list-style: none; }

.skill-highlight li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.skill-highlight li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
    font-size: 1.2rem;
    line-height: 1;
}

/* ===== Works ===== */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.work-card {
    padding: 32px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.work-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--shadow-glow);
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.work-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
}

.work-type {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}

.work-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.work-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 18px;
}

.work-qr {
    width: 100px;
    height: 100px;
    margin-bottom: 18px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.work-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.work-links {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.work-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.work-link:hover {
    background: rgba(167, 139, 250, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-tech span {
    padding: 4px 10px;
    background: rgba(167, 139, 250, 0.08);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--accent-purple);
    font-family: var(--font-mono);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-blue), transparent);
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px 40px 0;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 40px 40px;
}

.timeline-dot {
    position: absolute;
    right: -5px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--accent-purple);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.timeline-item:nth-child(even) .timeline-dot { right: auto; left: -5px; }

.timeline-content {
    padding: 28px;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--shadow-glow);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-purple);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.timeline-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.timeline-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.timeline-desc li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    list-style: none;
}

.timeline-desc li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

/* ===== Projects ===== */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-card {
    padding: 36px;
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--shadow-glow);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.project-title-group h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.project-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    font-family: var(--font-mono);
}

.project-role {
    padding: 6px 14px;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--accent-purple);
    white-space: nowrap;
    font-family: var(--font-mono);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.project-section { margin-bottom: 18px; }
.project-section:last-child { margin-bottom: 0; }

.project-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    font-family: var(--font-mono);
}

.project-section-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    list-style: none;
}

.project-section-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.project-tech span {
    padding: 5px 12px;
    background: rgba(167, 139, 250, 0.08);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-purple);
    font-family: var(--font-mono);
}

/* ===== Footer ===== */
.footer {
    padding: 48px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

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

.footer-tech {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem !important;
    color: var(--text-muted);
}

/* ===== Scroll Reveal Animation ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.animate {
    opacity: 0;
    transform: translateY(30px);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero-summary { margin-left: auto; margin-right: auto; }

    .avatar-wrapper { width: 280px; height: 280px; }
    .title-name { font-size: 3.2rem; }

    .info-strip { grid-template-columns: repeat(3, 1fr); }
    .about-layout { grid-template-columns: 1fr; }
    .about-cards { grid-template-columns: repeat(2, 1fr); }
    .skills-layout { grid-template-columns: 1fr; }
    .skill-highlight { position: static; }
    .skill-items { grid-template-columns: 1fr; }
    .works-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar { padding: 16px 24px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(5, 5, 8, 0.98);
        padding: 20px;
        gap: 16px;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: flex; }

    .hero { padding-top: 120px; }
    .avatar-wrapper { width: 220px; height: 220px; }
    .title-name { font-size: 2.6rem; }
    .section-title { font-size: 2.2rem; }

    .info-strip { grid-template-columns: repeat(2, 1fr); }
    .about-cards { grid-template-columns: 1fr; }
    .works-grid { grid-template-columns: 1fr; }

    .timeline::before { left: 20px; }
    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding-left: 48px;
        padding-right: 0;
    }
    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot { left: 16px; right: auto; }

    .project-header { flex-direction: column; gap: 10px; }
    .section-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .info-strip { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .title-name { font-size: 2.2rem; }
}
