/* ========== CSS Variables ========== */
:root {
    --bg: #08090d;
    --bg-secondary: #0f1117;
    --fg: #e8eaed;
    --muted: #6b7280;
    --accent: #00d9b5;
    --accent-dim: rgba(0, 217, 181, 0.15);
    --card: #12141a;
    --border: #1f2937;
    --glow: rgba(0, 217, 181, 0.4);
}

/* ========== Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--fg);
    overflow-x: hidden;
    line-height: 1.6;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

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

.text-center {
    text-align: center;
}

.mt-12 {
    margin-top: 3rem;
}

/* ========== Neural Canvas ========== */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Header ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    background: transparent;
}

.header.scrolled {
    background: rgba(8, 9, 13, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

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

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

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

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--glow);
}

.btn-secondary {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ========== Focus States (Accessibility) ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ========== Mobile Menu ========== */
.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(--fg);
    transition: all 0.3s ease;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.mobile-overlay.open {
    display: block;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 5rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border);
    }

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

/* ========== Hero Section ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 6rem 2rem;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 217, 181, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.hero-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.name-highlight {
    position: relative;
    color: var(--accent);
    cursor: default;
}

.name-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.name-highlight:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.typing-text {
    color: var(--accent);
    border-right: 2px solid var(--accent);
    animation: blink 1s step-end infinite;
    padding-right: 4px;
}

@keyframes blink {
    50% { border-color: transparent; }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 500px;
}

.stat-item {
    text-align: left;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

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

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ========== About Section ========== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.about-image-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.about-image-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}

.about-photo {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3/4;
    object-fit: cover;
    filter: grayscale(20%) contrast(1.1);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.about-image-frame:hover .about-photo {
    filter: grayscale(0%) contrast(1.1);
    transform: scale(1.03);
}

.about-image-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 217, 181, 0.05), transparent 50%);
    pointer-events: none;
}

.about-credentials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.credential-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.credential-badge:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.credential-badge svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.about-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 500px) {
    .about-highlights {
        grid-template-columns: 1fr;
    }
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.highlight-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.highlight-text p {
    font-size: 0.85rem;
    margin: 0;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    .timeline-item {
        width: 50%;
        padding-left: 0;
        padding-right: 3rem;
    }

    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-right: 0;
        padding-left: 3rem;
    }
}

.timeline-dot {
    position: absolute;
    left: -5px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 0 rgba(0, 217, 181, 0.4);
    transition: box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 6px rgba(0, 217, 181, 0.2);
}

@media (min-width: 768px) {
    .timeline-dot {
        left: auto;
        right: -6px;
    }

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

.timeline-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.timeline-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.timeline-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--muted);
}

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

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
}

/* ========== Skills Section ========== */
.skills-container {
    max-width: 1200px;
    margin: 0 auto;
}

.skills-categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.skill-category-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skill-category-btn:hover,
.skill-category-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 0 15px rgba(0, 217, 181, 0.1);
}

.skill-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    color: var(--accent);
}

.skill-name {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.skill-level {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.skill-level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #00ffcc);
    border-radius: 2px;
    transition: width 1s ease;
}

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

@media (max-width: 400px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 217, 181, 0.1);
}

.project-image {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--card));
    overflow: hidden;
}

.project-image-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: 
        linear-gradient(var(--accent) 1px, transparent 1px),
        linear-gradient(90deg, var(--accent) 1px, transparent 1px);
    background-size: 20px 20px;
}

.project-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--accent-dim);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid rgba(0, 217, 181, 0.3);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.project-link:hover {
    opacity: 0.7;
}

.project-link svg {
    width: 14px;
    height: 14px;
}

/* ========== Contact Section ========== */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-top: 3rem;
}

.contact-icon {
    margin: 0 auto 1.5rem;
}

.contact-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-desc {
    color: var(--muted);
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--fg);
    transition: all 0.3s ease;
}

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

.contact-link svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-social a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

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

/* ========== Terminal ========== */
.terminal-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
}

.terminal-btn {
    width: 50px;
    height: 50px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--muted);
}

.terminal-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.terminal-modal {
    display: none;
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 450px;
    max-width: calc(100vw - 2rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    z-index: 60;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.terminal-modal.open {
    display: block;
    animation: slideUp 0.3s ease;
}

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

.terminal-header {
    background: var(--bg);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

.terminal-title {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
}

.terminal-body {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
}

.terminal-line {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.terminal-muted {
    color: var(--muted);
}

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

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 0 1rem 1rem;
    gap: 0.5rem;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
}

.terminal-error {
    color: #ff5f56;
}

.terminal-success {
    color: #27ca40;
}

.terminal-info {
    color: #00d9b5;
}

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

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .typing-text {
        animation: none;
    }

    .avatar-circle {
        animation: none;
    }

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