/* Resume: one column of plain text, same palette as the home page.
   Print rules at the end give A4 on white (or dark with ?print=dark). */

:root {
    color-scheme: dark light;
    --bg: #121110;
    --fg: #f3efe8;
    --fg-2: #b4ada2;
    --line: #2c2824;
    --accent: #f2b85a;
    --measure: 44rem;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #fff;
        --fg: #1a1a1a;
        --fg-2: #555;
        --line: #ddd;
        --accent: #8a5a00;
    }
}

* { box-sizing: border-box; }

html { background: var(--bg); color: var(--fg); }

body {
    margin: 0;
    padding: 24px 16px 64px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.5;
}

main { max-width: var(--measure); margin: 0 auto; }

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

a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, var(--fg-2) 60%, transparent);
    text-underline-offset: 0.18em;
    overflow-wrap: anywhere;
}

a:hover { text-decoration-color: var(--accent); }

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

.print { display: none; }
.dim { color: var(--fg-2); }

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 48px;
    color: var(--fg-2);
}

.topbar a { display: inline-block; padding: 12px 0; } /* 44px tap target */

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.role { margin-top: 4px; }

.contact {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    color: var(--fg-2);
    line-height: 1.8;
}

.summary { margin-top: 24px; max-width: 40rem; }

/* The head: a splat viewer (js/head.js) over a poster still. It floats
   right of the name; text wraps round it. Hidden in print. A soft oval
   mask fades the shoulders, so no splat edge meets the box edge. */
.me {
    float: right;
    width: 104px;
    margin: 0 0 12px 16px;
    text-align: center;
}

.me-stage {
    position: relative;
    aspect-ratio: 1;
    touch-action: pan-y;               /* a vertical swipe still scrolls the page */
    user-select: none;
    -webkit-user-select: none;
    -webkit-mask-image: radial-gradient(ellipse 50% 56% at 50% 42%, #000 72%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 56% at 50% 42%, #000 72%, transparent 100%);
}
.me-stage.live { cursor: grab; }
.me-stage.dragging { cursor: grabbing; }
.me-stage img, .me-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.4s;
}
.me-stage canvas { opacity: 0; }
.me-stage.live canvas { opacity: 1; }
.me-stage.live img { opacity: 0; }

.me figcaption {
    margin-top: 4px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--fg-2);
}

.me-how { display: block; }

/* splat or mesh: inline words in the caption, 44 px hit box from padding */
.me-switch button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    display: inline-block;
    min-width: 44px;
    padding: 14px 0;
    margin: -14px -8px;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--fg-2) 60%, transparent);
    text-underline-offset: 0.18em;
}
.me-switch button:hover { text-decoration-color: var(--accent); }
.me-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.me-switch button[aria-pressed="true"] { color: var(--fg); text-decoration-color: var(--accent); cursor: default; }
.me-switch button[aria-busy="true"] { opacity: 0.6; }

@media (min-width: 40rem) {
    .me { width: 160px; margin-left: 24px; }
}

section { margin-top: 40px; }

h2 {
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.head { margin-top: 14px; }
.head:first-of-type { margin-top: 0; }
.head .dates { display: block; color: var(--fg-2); }

@media (min-width: 40rem) {
    .head { display: flex; justify-content: space-between; gap: 16px; }
    .head .dates { white-space: nowrap; }
}

/* Body text is 0.9 of the base size; <strong> keeps the base size. */
.summary, li, .note, .line { font-size: 0.9em; }
.summary strong, li strong, .note strong, .line strong { font-size: calc(1em / 0.9); font-weight: 600; }

.note { color: var(--fg-2); margin-top: 2px; }
.line { margin-top: 2px; }

ul { padding-left: 1.2rem; margin-top: 10px; }
li { margin-top: 8px; }

.credit {
    margin-top: 48px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--fg-2);
    font-size: 0.95rem;
}

/* ---------- print: A4 ---------- */

@media print {
    @page {
        size: A4;
        margin: 15mm 17mm 16mm;
    }

    :root {
        --bg: #fff;
        --fg: #1a1a1a;
        --fg-2: #444;
        --line: #bbb;
        --accent: #8a5a00;
    }

    /* resume-dark.pdf, built with ?print=dark. Chrome paints the page
       margins in its dark canvas colour; the background matches it. */
    html.print-dark {
        --bg: #121212;
        --fg: #e6e2db;
        --fg-2: #a8a197;
        --line: #3a3733;
        --accent: #f2b85a;
    }

    html { color-scheme: light; }
    html.print-dark { color-scheme: dark; }

    html, body {
        background: var(--bg);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        padding: 0;
        font-size: 10pt;
        line-height: 1.4;
    }

    main { max-width: none; }

    .topbar, .screen, .me { display: none; }
    .print { display: inline; }

    a { text-decoration: none; }

    h1 { font-size: 19pt; }
    .role { margin-top: 1pt; }
    .contact { margin-top: 3pt; gap: 0 9pt; font-size: 9pt; line-height: 1.5; }
    .contact > * + *::before { content: '|'; margin-right: 9pt; color: var(--fg-2); }
    .summary { margin-top: 8pt; max-width: none; }

    section { margin-top: 12pt; }
    h2 { font-size: 10pt; padding-bottom: 2pt; margin-bottom: 5pt; break-after: avoid; }
    .head { margin-top: 5pt; display: flex; justify-content: space-between; gap: 9pt; }
    .head .dates { white-space: nowrap; }
    .note { margin-top: 1pt; }
    .line { margin-top: 1pt; }
    ul { margin-top: 3pt; padding-left: 11pt; }
    li { margin-top: 3pt; break-inside: avoid; }
    .credit { margin-top: 10pt; padding-top: 5pt; font-size: 8.5pt; }
}
