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

:root {
    --bg: #0e0e0e;
    --surface: #161616;
    --border: #2a2a2a;
    --text: #f0f0f0;
    --muted: #888888;
    --green: #22c55e;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Skip link (accessibility) ---- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    z-index: 100;
    transition: top 200ms ease;
}

.skip-link:focus {
    top: 0;
}

/* ---- Layout ---- */
.wrapper {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- Back link ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    transition:
        color 200ms ease,
        background-color 200ms ease;
    margin-top: 2rem;
}

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

.back-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ---- Hero ---- */
.hero {
    padding: 5rem 0 3rem;
}

.hero--project {
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.tagline {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    max-width: 580px;
}

.bio {
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 1.75rem;
    max-width: 580px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.location {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

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

/* ---- Links row ---- */
.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    transition:
        color 200ms ease,
        background-color 200ms ease;
}

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

.links a svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ---- Tags ---- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.card .tags {
    margin-top: 0.875rem;
}

.tag {
    font-size: 0.6875rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    transition:
        background-color 200ms ease,
        border-color 200ms ease;
}

/* ---- Projects ---- */
.projects {
    padding: 2rem 0 4rem;
}

.projects h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    transition:
        transform 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #444;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card .ext-icon {
    color: var(--muted);
    opacity: 0;
    transition: opacity 200ms ease;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

.card:hover .ext-icon {
    opacity: 1;
}

.card-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

/* ---- Demo ---- */
.demo {
    padding: 2rem 0;
    text-align: center;
}

.demo video {
    border-radius: 12px;
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.demo-caption {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

/* ---- Sections (project detail) ---- */
.section {
    padding: 2rem 0;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.section p {
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 640px;
}

/* ---- Features grid ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.feature-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ---- How it works ---- */
.steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.6;
}

.step-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

/* ---- Footer ---- */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 2rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero {
        padding: 3.5rem 0 2rem;
    }

    .hero--project {
        padding: 3rem 0 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

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

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

    .meta-row {
        gap: 0.75rem;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }
}
