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

:root {
    --bg: #f7f5f0;
    --bg-card: #ffffff;
    --text: #1a1917;
    --text-muted: #6b6760;
    --text-faint: #a09d98;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --accent: #1a1917;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141412;
        --bg-card: #1e1d1b;
        --text: #f0ede8;
        --text-muted: #948f89;
        --text-faint: #5a5652;
        --border: rgba(255, 255, 255, 0.07);
        --border-strong: rgba(255, 255, 255, 0.12);
        --accent: #f0ede8;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Nav ── */
header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

nav {
    max-width: 50%;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-name {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.nav-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ── Hero ── */
main {
    max-width: 50%;
    margin: 0 auto;
    padding: 0 2rem;
    flex: 1;
}

.hero {
    padding: 5rem 0 4rem;
    border-bottom: 1px solid var(--border);
}

.hero-label {
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 400;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-bio {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 100%;
    line-height: 1.8;
}

/* ── Projects ── */
.projects {
    padding: 3rem 0 4rem;
}

.section-label {
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

/* ── Project card ── */
.project {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.project:last-child {
    border-bottom: none;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Image box */
.project-image {
    aspect-ratio: 4/3;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.project-image img {
    @media (min-width: 700px) {
        .project-image {
            max-width: 500px;
        }
    }

    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Placeholder when image is missing */
.project-image.placeholder {
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image.placeholder::after {
    content: '[ screenshot ]';
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 0.05em;
}

.project-image.placeholder img {
    display: none;
}

/* Project text */
.project-info {
    padding-top: 0.25rem;
}

.project-info h2 {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.project-info p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1.2rem;
    max-width: 100%;
}

.project-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.arrow {
    transition: transform 0.2s;
}

.project-link:hover .arrow {
    transform: translate(2px, -2px);
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    max-width: 50%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-faint);
}

footer a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ── Mobile ── */
@media (max-width: 540px) {

    nav,
    main,
    footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

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

    .project-image {
        aspect-ratio: 16/9;
    }
}