:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-surface: #1a1a2e;
    --bg-terminal: #0d0d1a;
    --border: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.15);
    --text-primary: #e2e2e8;
    --text-secondary: #8888a0;
    --text-dim: #555570;
    --green: #00ff41;
    --green-dim: #00cc33;
    --cyan: #00d4ff;
    --purple: #a855f7;
    --pink: #ec4899;
    --red: #ff3355;
    --yellow: #ffaa00;
    --orange: #ff6600;
    --glow-green: 0 0 20px rgba(0, 255, 65, 0.15);
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.1);
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--cyan);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--green);
}

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

.section {
    padding: 100px 0;
    position: relative;
}

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

.section-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--green);
    margin: 0 0 8px;
    position: relative;
    display: inline-block;
}

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

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 600;
}

.topbar-links {
    display: flex;
    gap: 32px;
}

.topbar-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.topbar-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--green);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.topbar-link:hover {
    color: var(--green);
}

.topbar-link:hover::after {
    transform: scaleX(1);
}

.topbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.topbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    position: relative;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

.hero .container {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Terminal */
.terminal {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal-bar {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.terminal-dot.red { background: var(--red); }
.terminal-dot.yellow { background: var(--yellow); }
.terminal-dot.green { background: var(--green); }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-left: 8px;
    flex: 1;
}

.terminal-body {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    min-height: 120px;
}

.terminal-line {
    margin-bottom: 4px;
}

.prompt {
    color: var(--green);
    font-weight: 600;
    margin-right: 12px;
}

.cursor {
    color: var(--green);
    animation: blink 0.8s step-end infinite;
    font-weight: 200;
}

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

.typed-text {
    color: var(--text-primary);
}

.typed-line {
    color: var(--text-secondary);
    margin: 2px 0;
    padding-left: 0;
    opacity: 0;
    animation: fadeInLine 0.3s ease forwards;
}

@keyframes fadeInLine {
    to { opacity: 1; }
}

.typed-line .highlight {
    color: var(--cyan);
}

.typed-line .highlight-green {
    color: var(--green);
}

.typed-line .highlight-purple {
    color: var(--purple);
}

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease 6s forwards;
}

.scroll-hint i {
    animation: bounce 2s ease infinite;
}

@keyframes fadeInUp {
    to { opacity: 1; }
}

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

/* Project Section */
.projects-section {
    background: var(--bg-secondary);
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.filter-btn.active {
    border-color: var(--green);
    color: var(--green);
    box-shadow: var(--glow-green);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition);
    cursor: default;
    transform-style: preserve-3d;
    perspective: 800px;
}

.project-card:hover {
    border-color: var(--border-active);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.project-card.hidden {
    display: none;
}

.card-bar {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-dim);
}

.status-dot.experimental {
    background: var(--yellow);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.4);
}

.card-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.card-lang {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 16px;
}

.card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.7;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

.card-links {
    display: flex;
    gap: 16px;
}

.card-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

.card-links i {
    margin-right: 4px;
}

/* Resume Section */
.resume-section {
    background: var(--bg-primary);
}

.resume-terminal {
    max-width: 800px;
    margin: 0 auto;
}

.resume-toggle-icon {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color var(--transition);
    padding: 0 4px;
}

.resume-toggle-icon:hover {
    color: var(--green);
}

.resume-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 24px;
}

.resume-body.open {
    max-height: 3000px;
    padding: 24px;
}

.resume-content {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.8;
}

.resume-section-block {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.resume-section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.resume-section-block h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.resume-section-block h4 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--cyan);
    margin: 0 0 16px;
}

.resume-contact {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 0 0 4px;
}

.resume-contact a {
    color: var(--text-dim);
}

.resume-contact a:hover {
    color: var(--green);
}

.resume-item {
    margin-bottom: 20px;
}

.resume-item-header {
    margin-bottom: 8px;
}

.resume-role {
    color: var(--text-primary);
    font-weight: 600;
}

.resume-org {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.resume-date {
    display: inline-block;
    color: var(--text-dim);
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.resume-item ul {
    margin: 0;
    padding-left: 16px;
}

.resume-item li {
    margin-bottom: 3px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.resume-certs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cert-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.05);
}

.prompt-return {
    color: var(--text-dim);
}

/* Footer */
.footer {
    padding: 48px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-links a {
    font-size: 1.3rem;
    color: var(--text-dim);
    transition: all var(--transition);
}

.footer-links a:hover {
    color: var(--green);
    transform: translateY(-2px);
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin: 0;
}

.footer-text i {
    color: var(--pink);
}

/* Responsive */
@media (max-width: 768px) {
    .topbar-links {
        display: none;
    }

    .topbar-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(12px);
        padding: 16px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }

    .topbar-toggle {
        display: flex;
    }

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

    .section {
        padding: 60px 0;
    }

    .hero {
        padding: 100px 16px 40px;
    }

    .resume-body.open {
        padding: 16px;
    }

    .filters {
        gap: 6px;
    }

    .filter-btn {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
}
