/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    --bg: #0a0a0f;
    --surface: #1a1a26;
    --surface-border: #2a2a3a;
    --accent: #00e87b;
    --accent-glow: rgba(0, 232, 123, 0.15);
    --ios: #4a9eff;
    --ai-badge: #8b5cf6;
    --text: #e0e0e8;
    --text-muted: #8888a0;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

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

/* ── Nav ───────────────────────────────────────────────────── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    transition: background var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--surface-border);
}

.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--accent);
}

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

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

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

.nav-links .github-link svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill var(--transition);
    vertical-align: middle;
}

.nav-links .github-link:hover svg { fill: var(--text); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    animation: glow-pulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
}

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

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 540px;
}

.hero-cta {
    margin-top: 2.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition), color var(--transition);
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

.hero-cta svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.hero-cta:hover svg { transform: translateY(3px); }

/* ── Section ───────────────────────────────────────────────── */
.section-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.section-heading h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-heading p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1.05rem;
}

#projects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

/* ── Project Cards Grid ────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

/* ── Card ──────────────────────────────────────────────────── */
.project-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    opacity: 0;
    transform: translateY(24px);
}

.project-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out,
                box-shadow var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.project-card.revealed:hover {
    transform: translateY(-4px);
}

/* Preview area */
.card-preview {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.card-preview.gradient-fpga {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.card-preview.gradient-ios {
    background: linear-gradient(135deg, #1a1040, #2d1b69, #4a2fbd);
}

.card-preview.gradient-dotnet {
    background: linear-gradient(135deg, #1a0a2e, #3d1f6d, #5b2d8e);
}

.card-preview.gradient-webgl {
    background: linear-gradient(135deg, #001a0a, #003d1a, #00662b);
}

.card-preview.gradient-plasma {
    background: linear-gradient(135deg, #1a0a00, #3d1f00, #664700);
}

.card-preview.gradient-ai {
    background: linear-gradient(135deg, #0a0a1a, #1a1040, #2d1b69);
}

/* Badge */
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-opensource {
    background: rgba(0, 232, 123, 0.15);
    color: var(--accent);
    border: 1px solid rgba(0, 232, 123, 0.3);
}

.badge-live {
    background: rgba(74, 158, 255, 0.15);
    color: var(--ios);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.badge-coming {
    background: rgba(136, 136, 160, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(136, 136, 160, 0.3);
}

.badge-ai {
    background: rgba(139, 92, 246, 0.15);
    color: var(--ai-badge);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Card body */
.card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

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

/* Tech tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.card-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Action buttons */
.card-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition);
    border: 1px solid var(--surface-border);
}

.btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-muted);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover {
    background: #00ff88;
    border-color: #00ff88;
}

.btn-primary svg { fill: var(--bg); }
.btn svg { fill: var(--text-muted); }
.btn:hover svg { fill: var(--text); }
.btn-primary:hover svg { fill: var(--bg); }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--surface-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--accent);
    transition: opacity var(--transition);
}

.site-footer a:hover { opacity: 0.8; }

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

.footer-links svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    vertical-align: middle;
    transition: fill var(--transition);
}

.footer-links a:hover svg { fill: var(--text); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 820px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

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

    .site-nav { padding: 0.75rem 1rem; }
    .card-preview { height: 140px; }
    #projects { padding: 3rem 1rem 4rem; }
}
