:root {
    --fg: #1a1a1a;       /* headings, names */
    --text: #2f2f2f;     /* body copy */
    --muted: #707070;    /* meta, labels, dates */
    --accent: #000;
    --bg: #fdfdfc;
    --line: #e6e6e2;

    --size-meta: 0.82rem;

    --space-section: 38px;
    --space-entry: 18px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 15px;
    line-height: 1.65;
}

::selection {
    background: #111;
    color: #fff;
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 80px 24px 64px;
}

/* ---- Header ---- */

header {
    margin-bottom: var(--space-section);
}

h1 {
    font-size: 1.6rem;
    color: var(--fg);
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--muted);
    margin: 0 0 18px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.links a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: border-color 0.15s ease;
}

.links a:hover {
    border-bottom-color: var(--accent);
}

/* ---- Sections ---- */

section {
    margin-bottom: var(--space-section);
}

section:last-of-type {
    margin-bottom: 0;
}

h2 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin: 0 0 14px;
    font-weight: 600;
}

p {
    margin: 0 0 8px;
    color: var(--text);
}

p:last-child {
    margin-bottom: 0;
}

/* ---- Entry lists (experience, projects, awards) ---- */

.entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.entries li {
    padding: var(--space-entry) 0;
    border-top: 1px solid var(--line);
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.role {
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
}

a.role {
    border-bottom: 1px solid var(--line);
    transition: border-color 0.15s ease;
}

a.role:hover {
    border-bottom-color: var(--accent);
}

.meta {
    color: var(--muted);
    font-size: var(--size-meta);
    white-space: nowrap;
}

.company {
    color: var(--muted);
    font-size: var(--size-meta);
    margin: 2px 0 0;
}

/* description paragraph following a row/company */
.row + p,
.company + p {
    margin-top: 10px;
}

/* ---- Nested roles within one company ---- */

.sub {
    margin-top: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--line);
}

.sub + .sub {
    margin-top: 18px;
}

.subrow {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.subrole {
    font-weight: 600;
    color: var(--fg);
}

.subrow + p {
    margin-top: 8px;
}

/* ---- Footer ---- */

footer {
    margin-top: var(--space-section);
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--size-meta);
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
    main {
        padding: 48px 20px 40px;
    }
    .row,
    .subrow {
        flex-direction: column;
        gap: 2px;
    }
}

/* ---- Print (clean PDF export) ---- */

@media print {
    :root {
        --bg: #fff;
    }
    main {
        padding: 24px 0;
        max-width: 100%;
    }
    .links a,
    a.role {
        border-bottom: none;
    }
    /* keep a single entry/role together, but allow sections to flow
       across pages so tall sections don't leave a blank first page */
    .entries li,
    .sub {
        break-inside: avoid;
    }
    h2 {
        break-after: avoid;
    }
}
