:root {
    --bg-primary: #0a0f14;
    --bg-secondary: #111920;
    --bg-card: #161f29;
    --bg-card-hover: #1c2734;
    --accent: #DC213C;
    --accent-dim: rgba(220, 33, 60, 0.15);
    --accent-glow: rgba(220, 33, 60, 0.4);
    --text-primary: #f0f4f8;
    --text-secondary: #8b9eb3;
    --text-muted: #5a6d7e;
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(220, 33, 60, 0.3);
    --grid-color: rgba(220, 33, 60, 0.03);
    --shadow-color: rgba(220, 33, 60, 0.08);
}

[data-theme="light"] {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --accent: #DC213C;
    --accent-dim: rgba(220, 33, 60, 0.1);
    --accent-glow: rgba(220, 33, 60, 0.25);
    --text-primary: #1a1f26;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(220, 33, 60, 0.3);
    --grid-color: rgba(220, 33, 60, 0.04);
    --shadow-color: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 80px 0 60px;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.header-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header-info h1 span {
    color: var(--accent);
}

.header-info .title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 24px;
}

.header-info .tagline {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
}

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

.header-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-links a:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.header-links a svg {
    width: 18px;
    height: 18px;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg);
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg);
}

/* Filter Section */
.filter-section {
    padding: 40px 0;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    opacity: 0.95;
    z-index: -1;
}

.filter-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Projects Section */
.projects-section {
    padding: 60px 0;
}

.projects-grid {
    display: grid;
    gap: 32px;
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.project-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 40px var(--shadow-color);
    transform: translateY(-4px);
}

.project-header {
    padding: 32px 32px 24px;
    cursor: pointer;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.project-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

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

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

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tech-tag img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Expandable Content */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.project-card.expanded .project-details {
    max-height: 3000px;
}

.project-details-inner {
    padding: 0 32px 32px;
    border-top: 1px solid var(--border);
}

.detail-section {
    padding-top: 28px;
}

.detail-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.detail-section p, .detail-section ul {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.detail-section ul {
    list-style: none;
    padding-left: 0;
}

.detail-section ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.detail-section ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.detail-section ul li strong {
    color: var(--text-primary);
}

/* Architecture Diagram */
.architecture-diagram {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 32px;
    margin-top: 16px;
}

.arch-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.arch-node {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    min-width: 120px;
}

.arch-node.highlight {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.arch-node-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.arch-node-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.arch-arrow {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Screenshots Gallery */
.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.screenshot-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.screenshot-item:hover {
    border-color: var(--border-accent);
    transform: scale(1.02);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-placeholder {
    aspect-ratio: 16/10;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.screenshot-placeholder svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Expand indicator */
.expand-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    transition: all 0.2s ease;
}

.project-card:hover .expand-indicator {
    color: var(--accent);
}

.expand-indicator svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.project-card.expanded .expand-indicator svg {
    transform: rotate(180deg);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.footer-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 60px 0 40px;
    }

    .header-info h1 {
        font-size: 1.8rem;
    }

    .project-header {
        padding: 24px;
    }

    .project-details-inner {
        padding: 0 24px 24px;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .arch-flow {
        flex-direction: column;
    }

    .arch-arrow {
        transform: rotate(90deg);
    }
}
