/* =========================================================
   1. Design tokens
   One accent colour, used only for links and the current
   page. Everything else is ink on paper.
   ========================================================= */
:root {
    --paper: #F6F4EF;        /* warm off-white background */
    --ink: #1C1B19;          /* main text: softer than pure black */
    --muted: #6B6760;        /* dates, labels, secondary text */
    --rule: #D9D4CA;         /* thin divider lines */
    --accent: #A8431E;       /* rust: links + current page (5.4:1 contrast on paper) */
    --accent-dark: #7E3015;  /* link hover */

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    --max-width: 52rem;      /* ~70 characters per line: comfortable reading */
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--paper);
}

/* Keeps the footer at the bottom on short pages */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3 {
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.2rem;
    margin: 0;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--accent-dark);
    text-decoration-thickness: 2px;
}

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

/* =========================================================
   3. Header + navigation
   Plain text links. The current page gets the accent
   colour and an underline instead of a coloured box.
   ========================================================= */
.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 2rem;
    padding: 1.75rem 0;
}

.site-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
}

.site-name:hover {
    color: var(--ink);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
}

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

.nav-links a[aria-current="page"] {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* =========================================================
   4. Intro (home page) and page titles
   Big, heavy type does the work a coloured banner used to.
   ========================================================= */
.intro {
    padding: 3.5rem 0 3rem;
}

.intro h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
}

.intro .lede {
    font-size: 1.25rem;
    max-width: 36rem;
    color: var(--ink);
}

.intro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
}

.page-title {
    padding: 2.5rem 0 1.5rem;
}

.page-title h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.page-title p {
    color: var(--muted);
    margin: 0;
}

/* =========================================================
   5. Sections
   Label on the left, content on the right, a thin rule
   between sections. Collapses to one column on phones.
   ========================================================= */
.section {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.5rem 2.5rem;
    border-top: 1px solid var(--rule);
    padding: 2rem 0;
}

.section-label {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0.3rem 0 0;
}

.section-body > :last-child {
    margin-bottom: 0;
}

/* Skills as "Label: items" lines instead of tags */
.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.25rem;
    margin: 0;
}

.facts dt {
    font-weight: 600;
}

.facts dd {
    margin: 0;
}

.plain-list {
    margin: 0;
    padding-left: 1.1rem;
}

.plain-list li + li {
    margin-top: 0.35rem;
}

/* =========================================================
   6. Projects + resume entries
   A list divided by rules, not a grid of boxes.
   ========================================================= */
.entry + .entry {
    border-top: 1px solid var(--rule);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.entry-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0 1rem;
    margin-bottom: 0.4rem;
}

.entry-date {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.entry p {
    margin-bottom: 0.5rem;
}

.tech {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted);
}

.entry-links {
    font-weight: 600;
    margin: 0;
}

/* Project titles link to their write-ups: ink colour so the list
   stays calm, rust on hover so it's clearly clickable */
.entry h3 a {
    color: var(--ink);
    text-decoration: none;
}

.entry h3 a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Bullets inside experience entries */
.entry ul {
    margin: 0.25rem 0 0.5rem;
    padding-left: 1.1rem;
}

.entry li + li {
    margin-top: 0.25rem;
}

/* Small muted footnote, e.g. under benchmarks */
.note {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

.more-link {
    margin-top: 1.5rem;
}

.todo {
    color: var(--muted);
    font-style: italic;
}

/* =========================================================
   7. Project write-up pages
   ========================================================= */
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.project-meta strong {
    color: var(--ink);
    font-weight: 600;
}

/* Screenshots: thin border so light UIs don't blend into the page */
figure {
    margin: 0;
}

figure img {
    display: block;
    border: 1px solid var(--rule);
    border-radius: 4px;
}

figcaption {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.write-up-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    border-top: 1px solid var(--rule);
    padding-top: 1.5rem;
    font-weight: 600;
}

/* Profile photo (About page) */
.portrait {
    width: 9rem;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1.25rem;
}

/* =========================================================
   8. Footer
   ========================================================= */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    border-top: 1px solid var(--rule);
    padding: 1.5rem 0 2.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================================
   9. Small screens
   ========================================================= */
@media (max-width: 40rem) {
    .section {
        grid-template-columns: 1fr;
        padding: 1.5rem 0;
    }

    .intro {
        padding: 2rem 0;
    }

    .facts {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .facts dd + dt {
        margin-top: 0.6rem;
    }
}
