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

:root {
    --bg: #0a0a0f;
    --bg-secondary: #0d0d1a;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e0e0e0;
    --text-muted: #666;
    --cyan: #00f0ff;
    --magenta: #e040fb;
    --green: #00ff41;
    --violet: #6c63ff;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-body: 'Inter', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) var(--bg);
}

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

a { color: var(--cyan); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--magenta); }

/* ========== GRID BACKGROUND ========== */
.grid-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--cyan);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--cyan); }

.nav-separator {
    color: var(--text-muted);
    opacity: 0.3;
    font-family: var(--font-mono);
}

.lang-switch {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-switch:hover,
.lang-switch.active {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--cyan);
    transition: all 0.3s;
}

/* ========== SECTIONS COMMON ========== */
section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--cyan);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '// ';
    color: var(--text-muted);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

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

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

/* ========== HERO ========== */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 4rem;
    max-width: none;
}

/* Matrix rain canvas */
#matrix-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.06;
    pointer-events: none;
}

.terminal-window {
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-width: 850px;
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(0, 240, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: auto;
}

.terminal-body {
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    line-height: 2;
    min-height: 240px;
    position: relative;
    overflow: hidden;
}

/* Scanlines overlay */
.terminal-body::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 240, 255, 0.01) 2px,
        rgba(0, 240, 255, 0.01) 4px
    );
    pointer-events: none;
}

.terminal-line {
    margin-bottom: 0.3rem;
}

.terminal-prompt {
    color: var(--green);
}

.terminal-command {
    color: var(--text);
}

.terminal-output {
    color: var(--cyan);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--green);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-status {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-muted);
    z-index: 1;
}

.status-dot {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 255, 65, 0); }
}

.hero-scroll-cta {
    margin-top: 3rem;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

.hero-scroll-cta a {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hero-scroll-cta svg {
    stroke: var(--cyan);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ========== ABOUT ========== */
#about {
    text-align: center;
}

.about-text {
    max-width: 750px;
    margin: 0 auto 2rem;
    font-size: 1.2rem;
    color: var(--text);
    line-height: 1.9;
}

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

.about-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}

.about-links a:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* ========== EXPERIENCE TIMELINE ========== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 6px;
    width: 10px;
    height: 10px;
    background: var(--bg);
    border: 2px solid var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--magenta);
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.timeline-company {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--cyan);
    margin-bottom: 0.3rem;
}

.timeline-role {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.7rem;
}

.timeline-details {
    list-style: none;
}

.timeline-details li {
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ========== PROJECTS ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

/* HUD corner cuts */
.project-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 30px; height: 30px;
    background: linear-gradient(135deg, transparent 50%, var(--bg) 50%);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.project-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

/* Scanline on hover */
.project-card:hover::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 240, 255, 0.02) 3px,
        rgba(0, 240, 255, 0.02) 6px
    );
    pointer-events: none;
    animation: scanline-move 4s linear infinite;
}

@keyframes scanline-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.project-title {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--text);
}

.project-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-hackathon {
    background: rgba(224, 64, 251, 0.15);
    color: var(--magenta);
    border: 1px solid rgba(224, 64, 251, 0.3);
}

.badge-wip {
    background: rgba(255, 189, 46, 0.1);
    color: #ffbd2e;
    border: 1px solid rgba(255, 189, 46, 0.3);
}

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

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

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--cyan);
    padding: 2px 8px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 3px;
    background: rgba(0, 240, 255, 0.05);
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.project-stat {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

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

.project-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-link:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.project-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.project-link.disabled:hover {
    color: var(--text-muted);
    border-color: var(--border);
}

/* ========== CV VIEWER ========== */
.cv-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cv-tab {
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cv-tab:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.cv-tab.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.cv-viewer-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}

.cv-iframe {
    width: 100%;
    height: 120vh;
    border: none;
    display: block;
}

.cv-mobile-fallback {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
}

.cv-mobile-fallback a {
    font-family: var(--font-mono);
    padding: 12px 24px;
    border: 1px solid var(--cyan);
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s;
}

.cv-mobile-fallback a:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

/* ========== SPOTIFY WIDGET ========== */
.spotify-widget {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 999;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    max-width: 380px;
    transition: all 0.3s;
}

.spotify-widget:hover {
    border-color: #1db954;
    box-shadow: 0 0 30px rgba(29, 185, 84, 0.25);
}

.spotify-icon {
    color: #1db954;
    flex-shrink: 0;
}

.spotify-info {
    overflow: hidden;
    white-space: nowrap;
}

.spotify-track {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.spotify-artist {
    color: var(--text-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-idle {
    color: var(--text-muted);
    font-style: italic;
}

.spotify-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 30px;
    flex-shrink: 0;
}

.spotify-bar {
    width: 4px;
    background: #1db954;
    border-radius: 2px;
    animation: bar-bounce 1.2s ease-in-out infinite;
}

.spotify-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.spotify-bar:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.spotify-bar:nth-child(3) { height: 6px; animation-delay: 0.4s; }
.spotify-bar:nth-child(4) { height: 12px; animation-delay: 0.6s; }

@keyframes bar-bounce {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.2); }
}

.spotify-bars.paused .spotify-bar {
    animation: none;
    opacity: 0.4;
}

/* ========== CONTACT ========== */
#contact {
    text-align: center;
    padding-bottom: 8rem;
}

.contact-email {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--cyan);
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}

.contact-email:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    color: var(--magenta);
}

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

.contact-icons a {
    color: var(--text-muted);
    transition: all 0.3s;
}

.contact-icons a:hover {
    color: var(--cyan);
    transform: translateY(-2px);
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    section {
        padding: 4rem 1.2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-separator {
        display: none;
    }

    .terminal-window {
        max-width: 95%;
    }

    .terminal-body {
        font-size: 0.75rem;
        padding: 1rem;
    }

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

    .about-links {
        flex-wrap: wrap;
    }

    .cv-iframe {
        display: none;
    }

    .cv-mobile-fallback {
        display: block;
    }

    .spotify-widget {
        bottom: 0.8rem;
        left: 0.8rem;
        padding: 10px 14px;
        gap: 10px;
        max-width: 260px;
        font-size: 0.7rem;
    }

    .hero-status {
        font-size: 0.7rem;
    }

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

    .timeline {
        padding-left: 1.5rem;
    }

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

@media (max-width: 480px) {
    .terminal-body {
        font-size: 0.65rem;
    }

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