/* =========================================================
   cv. its own style, has nothing to do with the wooden rest of the site:
   dark, mono, 1px lines, three greys of text instead of bold/not-bold.
   ========================================================= */

:root {
    --bg: #08080a;
    --surface: #0d0d10;
    --line: #1d1d23;
    --line-bright: #2a2a32;

    --text: #ededf0;
    --text-2: #9b9ba4;
    --text-3: #5e5e68;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);

    font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Geist Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 90px;
}

/* links are underlined, that is clearer than any icon */
a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text-3);
    text-underline-offset: 3px;
}
a:hover {
    text-decoration-color: var(--text);
}

h1,
h2,
h3 {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.back {
    margin: 0 0 40px;
}
.back a {
    color: var(--text-3);
}
.back a:hover {
    color: var(--text);
}

/* ---------- head ---------- */
.head {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--line);
}

/* the image is already dithered and has a black ground, so it bleeds out
   into the page by itself - no frame needed.
   the height comes from the text next to it, the image gets cropped to fit */
.portrait {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    min-height: 190px;
}
.portrait img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* the file is already exactly as big as the box on a 2x display,
       so the browser has nothing left to scale. no image-rendering:
       pixelated here - that would only throw pixels away again */
}

.head h1 {
    font-size: 15px;
}
.role {
    margin: 2px 0 0;
    color: var(--text-2);
}
.location {
    margin: 0;
    color: var(--text-3);
}
.summary {
    margin: 14px 0 0;
    max-width: 68ch;
    color: var(--text-2);
}
.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 18px 0 0;
}
.socials a {
    color: var(--text-2);
}
.socials a:hover {
    color: var(--text);
}

/* ---------- block scaffolding ---------- */
.block {
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.block-head h2 {
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text-3);
    font-size: 11px;
}
.legend a,
.legend button {
    color: var(--text-3);
    font-size: 11px;
}

/* =========================================================
   timeline: on the left thin lines run downwards, one track per
   simultaneous entry. per row one line branches off to the right to the
   card. everything in em/px relative to the row - no heights, no
   percentages, the thing just grows with the content.
   ========================================================= */
.timeline {
    --track-line: 16px; /* distance from track to track */
    --joint: 22px; /* how far the branch runs to the right */
    --thick: 5px; /* thickness of the vertical lines */
    --thick-cross: 2px; /* thickness of the branch to the right, stays thin */
    --node: 10px; /* how far below the start the branch goes off */
}

.row {
    display: grid;
    grid-template-columns: calc(var(--tracks) * var(--track-line) + var(--joint)) 1fr;
}

.tracks {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--tracks), var(--track-line));
}

/* a piece of line in one track. the piece knows itself where it starts */
.track {
    position: relative;
}
.track::before {
    content: "";
    position: absolute;
    left: 0;
    width: var(--thick);
    background-color: var(--c);
    transition: opacity 0.12s ease-out;
}
.track-through::before,
.track-start::before,
.track-arrow::before {
    top: 0;
    bottom: 0;
}

/* here the line ends. it stops just short of the row edge, so that
   a new entry in the same track does not stick right onto it */
.track-through-end::before,
.track-start-end::before {
    top: 0;
    bottom: 5px;
}

/* the cross stroke at the end */
.track-through-end::after,
.track-start-end::after,
.track-arrow::after {
    content: "";
    position: absolute;
    left: -4px;
    bottom: 5px;
    width: calc(var(--thick) + 8px);
    height: var(--thick-cross);
    background-color: var(--c);
}

/* still running: the stroke sits at the height of "still running", and the
   line goes on a bit after it - so not a real end point */
.track-arrow::after {
    top: var(--node);
    bottom: auto;
}

/* the branch to the right to the card, sits a little below the start of the line */
.branch {
    position: absolute;
    top: var(--node);
    left: calc(var(--i) * var(--track-line));
    right: 0;
    height: var(--thick-cross);
    background-color: var(--c);
    transition: opacity 0.12s ease-out;
}

/* ---------- the cards on the right ---------- */
/* no frame on the card: the branch is already the connection, a
   second colored stroke next to it only makes it restless */
.card {
    padding: 0 0 32px 14px;
    transition: opacity 0.12s ease-out;
}
.row:last-child .card {
    padding-bottom: 0;
}

.card-time {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 4px;
    color: var(--text-3);
    font-size: 11px;
}
.duration {
    color: var(--line-bright);
}

.card h3 {
    font-size: 13px;
}

/* ---------- the row under the last card ---------- */
/* only so tall that the line keeps running a little under its stroke */
.row-foot .tracks {
    min-height: 24px;
}
.foot-text {
    margin: 0;
    padding-left: 10px;
    color: var(--text-3);
    font-size: 10px;
}
.where {
    margin: 2px 0 0;
    color: var(--text-2);
}

/* summary from the cv.json: its own paragraph, whole sentences stand here */
.task {
    margin: 10px 0 0;
    max-width: 68ch;
    color: var(--text-2);
}

/* featured entries. the box sits as a pseudo-element BEHIND the text,
   that way nothing shifts: all cards start on the same left
   edge, and the branch still hits exactly the first line of text */
.card-featured {
    position: relative;
}
.card-featured::before {
    content: "";
    position: absolute;
    inset: -14px -16px 18px -1px;
    z-index: -1;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}
/* in case no entry is running any more, the foot row does not exist */
.row:last-child .card-featured::before {
    bottom: -14px;
}
.card-featured h3 {
    font-weight: 700;
}
.card-featured .where,
.card-featured .task {
    color: var(--text);
}


/* a dash instead of bullets. an own ::before instead of list-style-type, so that the
   spacing is right and wrapped lines stay hanging-indented */
.card ul {
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
    color: var(--text-2);
}
.card li {
    position: relative;
    margin: 7px 0;
    padding-left: 18px;
}
.card li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--color);
}

/* **bold** from the cv.json. in grey text bold needs more brightness too,
   otherwise it does not come across */
.card strong {
    font-weight: 700;
    color: var(--text);
}
.card li::marker {
    color: var(--color);
}

/* =========================================================
   skills, languages, interests: category right-aligned against a vertical
   hairline, values to the right of it. the axis is the same gesture as the rails
   in the timeline above - and it closes the space that short labels otherwise
   leave standing next to them as a hole. no separator line per row, the
   line spacing separates.

   three levels, three means, no overlap:
   block title  caps, letter-spaced, 11px, --text-3
   category     normal casing, bold, --text
   values       normal, --text-2
   ========================================================= */
.body {
    position: relative;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 16px 0;
}

/* the axis sits on the container, not on the cells: on the cells it would have
   a gap in every line spacing and would be dashed */
.body::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 170px;
    width: 1px;
    background-color: var(--line);
}

/* subgrid: the row takes over the columns of the container, so that all labels
   end on the same axis - no matter how tall the row gets */
.pair {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
}
/* no bold: the category already stands right-aligned against the axis and one
   grey step brighter than its values. that is enough - the page separates levels via
   brightness, not via weight */
.pair-name {
    margin: 0;
    padding-right: 20px;
    text-align: right;
}
.right {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-left: 20px;
}

/* flex, so that it can wrap between the keywords at all: the
   separator sits as a pseudo-element in the word before it and has no whitespace
   around it, otherwise the whole line would be a single unbreakable word.
   the pipe is a tall character, it needs more air than a middot
   and a darker step - otherwise it chops up the list instead of separating it */
.pair-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    color: var(--text-2);
}
.pair-list span:not(:last-child)::after {
    content: "|";
    margin: 0 8px;
    color: var(--line-bright);
}

/* a single value instead of a list, e.g. the language level */
.value {
    margin: 0;
    color: var(--text-2);
}

/* the sentence that brackets the keywords underneath it together */
.intro {
    margin: 0;
    max-width: 68ch;
}

/* ---------- raw json ---------- */
/* sets itself apart from the cv above, it is a different topic after all */
.block-json {
    margin-top: 50px;
    border-bottom: 0;
}

.hint {
    margin: -10px 0 16px;
    color: var(--text-3);
    max-width: 68ch;
}

.codeblock {
    position: relative;
}

#copy-button {
    position: absolute;
    top: 10px;
    right: 12px; /* room for the scrollbar of the pre */
    z-index: 1;

    padding: 2px 8px;
    border: 1px solid var(--line-bright);
    border-radius: 3px;
    background-color: var(--surface);
    color: var(--text-3);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}
#copy-button:hover {
    color: var(--text);
    border-color: var(--text-3);
}

/* the block is focusable - only show a ring for the keyboard,
   when clicking in, the ring would only be loud */
pre:focus {
    outline: none;
}
pre:focus-visible {
    outline: 1px solid var(--text-3);
    outline-offset: -1px;
}

/* json colors: keys red, values grey */
.j-key {
    color: #e06c75;
}
.j-text {
    color: #8b949e;
}
.j-word {
    color: #d19a66;
}
.j-number {
    color: #d19a66;
}

pre {
    margin: 0;
    padding: 18px 20px;
    max-height: 460px;
    overflow: auto;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.55;
}

/* ---------- narrow ---------- */
@media (max-width: 620px) {
    .head {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .portrait {
        aspect-ratio: 1 / 1;
        min-height: 0;
    }
    /* axis gone, everything below each other: for a label column plus values there is
       no room here, and right-aligned without an axis would only be strange */
    .body {
        grid-template-columns: 1fr;
        gap: 18px 0;
    }
    .body::before {
        display: none;
    }
    .pair {
        display: block;
    }
    .pair-name {
        margin-bottom: 4px;
        padding-right: 0;
        text-align: left;
    }
    .right {
        padding-left: 0;
    }
    /* the lines stay, they just need less room */
    .timeline {
        --track-line: 13px;
        --joint: 14px;
    }
    .card {
        padding-left: 12px;
    }
}
