/* ======================
   CSS Variables & Reset
   ====================== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-tertiary: #1f1f1f;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --border-color: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* ======================
   Visual Interactions
   ====================== */

/* Custom cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    top: -4px;
    left: -4px;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.3s, width 0.2s, height 0.2s, background 0.2s;
    will-change: transform;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(99,102,241,0.6);
    border-radius: 50%;
    position: fixed;
    top: -18px;
    left: -18px;
    pointer-events: none;
    z-index: 99998;
    transition: opacity 0.3s, width 0.3s, height 0.3s, border-color 0.3s;
    will-change: transform;
}

.cursor-dot.cursor-hover {
    width: 14px;
    height: 14px;
    top: -7px;
    left: -7px;
    background: var(--accent-secondary);
}

.cursor-ring.cursor-hover {
    width: 52px;
    height: 52px;
    top: -26px;
    left: -26px;
    border-color: rgba(139,92,246,0.5);
}

/* Page spotlight */
.page-spotlight {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transition: background 0.08s ease;
}

/* Click ripple */
.click-ripple {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(99,102,241,0.6);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 99997;
    animation: rippleOut 0.6s ease-out forwards;
}

@keyframes rippleOut {
    to {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

/* Restore cursor on touch/mobile */
@media (hover: none) {
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
}

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

button {
    cursor: none;
}

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

/* ======================
   Navigation
   ====================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

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

.menu-toggle {
    position: absolute;
    right: 2rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

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

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

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.4rem;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

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

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

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

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.hero-animation {
    flex: 1;
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    top: 50px;
    right: 50px;
    animation-delay: 2s;
}

.floating-card:nth-child(3) {
    bottom: 0;
    left: 100px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

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

/* ======================
   Section Styles
   ====================== */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

/* ======================
   About Section
   ====================== */
.about {
    background: var(--bg-secondary);
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.skill-tag {
    padding: 0.5rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ======================
   Experience Section
   ====================== */
.experience {
    background: var(--bg-primary);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease backwards;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.2s;
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px var(--accent-primary);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.3);
}

.timeline-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--border-color);
}

.timeline-content::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 7px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 7px solid var(--bg-secondary);
}

.timeline-item:hover .timeline-content {
    transform: translateX(5px);
    border-color: var(--accent-primary);
    box-shadow: 0 5px 20px var(--shadow);
}

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

.experience-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.experience-company {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1rem;
}

.company-link {
    color: var(--accent-primary);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.company-link::after {
    content: '↗';
    font-size: 0.85rem;
    opacity: 0.7;
}

.company-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.experience-duration {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.experience-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.experience-highlights {
    list-style: none;
    margin: 1rem 0 1.5rem 0;
    padding: 0;
}

.experience-highlights li {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.6;
}

.experience-highlights li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
    line-height: 1.6;
}

.experience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.experience-certificate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.certificate-icon {
    font-size: 1.2rem;
}

.certificate-link {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.certificate-link::after {
    content: ' →';
    transition: transform 0.3s ease;
    display: inline-block;
}

.certificate-link:hover {
    color: var(--accent-secondary);
}

.certificate-link:hover::after {
    transform: translateX(3px);
}

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

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.4rem;
}

.project-status {
    padding: 0.25rem 0.75rem;
    background: var(--success);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-status.ongoing {
    background: var(--warning);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

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

.link-btn {
    flex: 1;
    text-align: center;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.link-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ======================
   Blog Section
   ====================== */
.page-header {
    padding: 8rem 0 4rem;
    text-align: center;
    background: var(--bg-secondary);
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.blog-section {
    padding: 4rem 0;
}

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

.blog-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-primary);
}

.blog-date {
    color: var(--accent-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--accent-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--accent-secondary);
    transform: translateX(5px);
}

/* ======================
   Blog Post Page
   ====================== */
.post-header {
    padding: 8rem 0 2rem;
    background: var(--bg-secondary);
}

.post-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.post-content h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

.post-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-content code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
}

.post-content pre {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content ul, .post-content ol {
    color: var(--text-secondary);
    margin: 1rem 0 1.5rem 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 2rem 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    transform: translateX(-5px);
}

/* ======================
   Project Detail Page
   ====================== */
.project-detail {
    padding: 8rem 0 4rem;
}

.project-detail .container {
    max-width: 900px;
}

.project-overview {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.project-section {
    margin-bottom: 3rem;
}

.project-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.project-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.diagram-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.diagram-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* ======================
   Contact Section
   ====================== */
.contact {
    background: var(--bg-secondary);
    text-align: center;
}

.contact-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.contact-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.contact-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.contact-btn:hover svg {
    transform: scale(1.1);
}

/* ======================
   Footer
   ====================== */
.footer {
    background: var(--bg-primary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-secondary);
}

/* ======================
   Responsive Design
   ====================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        transition: left 0.3s ease;
    }

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

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        padding-left: 2rem;
    }

    .experience-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .experience-duration {
        align-self: flex-start;
    }

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-animation {
        display: none;
    }

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

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

    .section-title {
        font-size: 2rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}
