:root {
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-card: #1a1a1a;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #7c6df0;
    --accent-hover: #9486f7;
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ── Nav ── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

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

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

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

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

/* ── Hero ── */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 0;
}

.hero-inner {
    max-width: 720px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    font-weight: 300;
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.hero-cta {
    display: inline-block;
    padding: 12px 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
}

.hero-cta:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 109, 240, 0.25);
}

/* ── Project Grid ── */

.projects {
    padding: 40px 24px 80px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
    color: var(--text);
}

.project-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    color: var(--text);
}

.project-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-elevated);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.project-image[src$=".svg"] {
    object-fit: contain;
    padding: 8px;
    background: #0f0f17;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

/* Hover overlay */
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-overlay-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Card info below image */
.project-info {
    padding: 14px 16px;
}

.project-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 500;
}

.project-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: -0.01em;
}

/* Placeholder thumbnails */
.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, #1e1e2e 100%);
}

.placeholder-icon {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dim);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Project Detail ── */

.project-detail {
    padding: 100px 24px 80px;
}

.project-detail-inner {
    max-width: 760px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.back-link:hover {
    color: var(--text);
}

.project-detail-header {
    margin-bottom: 24px;
}

.project-detail-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 8px;
}

.project-detail-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 12px;
    font-weight: 300;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.tech-tag {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 400;
}

.project-detail-image {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.project-detail-image[src$=".svg"] {
    background: #0f0f17;
    padding: 16px;
}

.project-placeholder-large {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    margin-bottom: 32px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, #1e1e2e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.placeholder-icon-large {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dim);
    opacity: 0.4;
    text-transform: uppercase;
}

.placeholder-text {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.project-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.project-description h2,
.project-description h3 {
    color: var(--text);
    margin-top: 28px;
    margin-bottom: 12px;
}

.project-description p {
    margin-bottom: 16px;
}

.project-description ul,
.project-description ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.project-description li {
    margin-bottom: 8px;
}

.project-description strong {
    color: var(--text);
    font-weight: 500;
}

.project-description code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ── Generic Pages ── */

.page-section {
    padding: 120px 24px 80px;
}

.page-inner {
    max-width: 720px;
    margin: 0 auto;
}

.page-inner h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.page-inner h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
}

.page-lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.page-inner p {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.contact-email {
    margin-top: 32px;
}

.contact-email a {
    font-size: 1.5rem;
    font-weight: 500;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.tech-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.tech-area h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 500;
}

.tech-area p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ── Footer ── */

.footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

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

.footer a:hover {
    color: var(--text-muted);
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .nav-links {
        gap: 16px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .hero {
        min-height: 80vh;
    }
}
