/*
 * Site home page (plan 008). Static, no JavaScript. Dark by default,
 * light from the system setting, one column on phones.
 */
:root {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #121821;
    --border: #2a3644;
    --text: #e6edf3;
    --muted: #9fadbb;
    --link: #7cb8ff;
    --focus: #ffd866;
    --accent: #3fb950;
    --icon-bg: #1c2733;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f3f5f8;
        --surface: #ffffff;
        --border: #d0d7de;
        --text: #1f2328;
        --muted: #57606a;
        --link: #0550ae;
        --focus: #9a6700;
        --accent: #1a7f37;
        --icon-bg: #ddf4ff;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

h1, h2, p, ul {
    margin: 0;
}

a {
    color: var(--link);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.home {
    max-width: 60rem;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.home__header {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.home__header h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.2;
}

.home__lead {
    max-width: 40rem;
    color: var(--muted);
    font-size: 1.125rem;
}

/* Tiles: two columns (a 2 x 2 grid) when there is room, one on a phone */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.project {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    transition: border-color 150ms;
}

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

.project__icon {
    align-self: flex-start; /* a badge, not a full-width bar */
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    background: var(--icon-bg);
    color: var(--link);
}

.project__icon svg {
    display: block;
}

.project h2 {
    font-size: 1.375rem;
}

.project__link {
    color: var(--text);
    text-decoration: none;
}

/* The whole tile is clickable; the extra link sits above this layer */
.project__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
}

.project__link:focus-visible {
    outline: none;
}

.project__link:focus-visible::after {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.project__tag,
.project__stack,
.project__more {
    color: var(--muted);
    font-size: 0.875rem;
}

.project__tag {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
}

.project__more {
    margin-top: auto;
}

.project__more a {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .project {
        transition: none;
    }
}
