/* ==========================================================================
   Matheus Azevedo — portfolio
   A ledger, set in type. Hard edges, hairline grid, one accent, 8-bit punctuation.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('fonts/bricolage-grotesque-var.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/plex-sans-var.woff2') format('woff2');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/plex-mono-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/plex-mono-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */

/* Ivory & Ash.
   Ivory Ash #e7eae0 · Chalk #f0f2ec · Slate Sage #d5d9cc · Lichen #c8ccbf
   Deep Space Blue #153243 · Harbour #5a7d90 · Ash Grey #b4b8ab.

   Ivory Ash is the ground the page is read on. Deep Space Blue is the ink and
   the primary: headings, buttons, bars, focus rings — anything that has to be
   seen at a hairline's width. Ash Grey is the mark, and only ever a fill:
   it sits at 1.66:1 against this ground, which is a highlighter's job, not a
   signal's, so it goes behind text (the block in the headline, a selection, a
   struck link) and never becomes text, a rule or a ring. Whatever the mark
   fills carries --mark-tx on top of it, which clears 6.6:1.

   Dark is the same families with the ground and the ink swapped, and there the
   mark and the primary coincide — Ash Grey is legible on Deep Space Blue, so
   it does both jobs. Dark is opt-in: the toggle below sets data-theme and
   nothing else does, so ivory is what a visitor lands on. */

:root,
:root[data-theme='light'] {
    --bg: #e7eae0;
    --bg-2: #f0f2ec;
    --bg-3: #d5d9cc;
    --bg-blur: rgba(231, 234, 224, .86);

    --tx: #153243;
    --tx-2: #1e3d51;
    --tx-3: #3d5f72;

    --line: #c8ccbf;
    --line-2: #5a7d90;

    --accent: #153243;
    --accent-tx: #e7eae0;

    --mark: #b4b8ab;
    --mark-tx: #153243;

    --shadow: rgba(21, 50, 67, .18);
}

:root[data-theme='dark'] {
    --bg: #153243;
    --bg-2: #1a3c50;
    --bg-3: #102734;
    --bg-blur: rgba(21, 50, 67, .84);

    --tx: #eef1e8;
    --tx-2: #dfe3d9;
    --tx-3: #9fa79b;

    --line: #2a4c62;
    --line-2: #587f94;

    --accent: #b4b8ab;
    --accent-tx: #153243;

    --mark: #b4b8ab;
    --mark-tx: #153243;

    --shadow: rgba(0, 0, 0, .4);
}

:root {
    --f-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
    --f-body: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --bar-h: 3.5rem;
    --shell: 1180px;
    --pad: clamp(1.25rem, 5vw, 3rem);

    --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------------------------------------------------------------- reset -- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bar-h) + 1.25rem);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--tx-2);
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--tx);
    font-family: var(--f-display);
    font-weight: 700;
    text-wrap: balance;
}

p {
    margin: 0;
}

ul,
ol,
dl,
dd {
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style: none;
}

img,
canvas {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

::selection {
    background: var(--mark);
    color: var(--mark-tx);
}

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

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.skip-link {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    padding: .75rem 1.25rem;
    background: var(--accent);
    color: var(--accent-tx);
    font-family: var(--f-mono);
    font-size: .8rem;
    transform: translateY(-110%);
    transition: transform .2s var(--ease);
}

.skip-link:focus-visible {
    transform: translateY(0);
}

/* --------------------------------------------------------- shared bits -- */

.eyebrow,
.sec-note,
.card__tag,
.role__when,
.stack span,
.window__bar,
figcaption,
.nav a,
.btn,
.brand,
.foot__in,
.channels__k,
.about__meta dt,
.skillset h3,
.scale-legend {
    font-family: var(--f-mono);
    letter-spacing: .08em;
}

.dot {
    display: inline-block;
    flex: none;
    width: .4rem;
    height: .4rem;
    margin-top: .45em;
    background: var(--accent);
    vertical-align: middle;
    animation: blink 2.4s steps(1) infinite;
}

@keyframes blink {

    0%,
    72% {
        opacity: 1;
    }

    73%,
    100% {
        opacity: .25;
    }
}

/* the pixel-stepped underline used on inline links */
.contact__pitch a,
.card__links a,
.foot a {
    position: relative;
}

.contact__pitch a::after,
.card__links a::after,
.foot a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.28em;
    height: 2px;
    background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 6px);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--ease);
}

.contact__pitch a:hover::after,
.contact__pitch a:focus-visible::after,
.card__links a:hover::after,
.card__links a:focus-visible::after,
.foot a:hover::after,
.foot a:focus-visible::after {
    transform: scaleX(1);
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.stack span {
    padding: .25rem .5rem;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--tx-3);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

/* --------------------------------------------------------------- topbar -- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-blur);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.topbar__in {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--bar-h);
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-right: auto;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--tx);
}

.brand__face {
    width: 1.625rem;
    height: 1.625rem;
    border: 1px solid var(--line-2);
    image-rendering: pixelated;
}

.brand__role {
    padding-left: .625rem;
    border-left: 1px solid var(--line);
    color: var(--tx-3);
    font-size: .68rem;
    letter-spacing: .08em;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    position: relative;
    color: var(--tx-3);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    transition: color .2s var(--ease);
}

.nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.5rem;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 6px);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--ease);
}

.nav a:hover,
.nav a.is-active {
    color: var(--tx);
}

.nav a:hover::after,
.nav a.is-active::after,
.nav a:focus-visible::after {
    transform: scaleX(1);
}

.topbar__tools {
    display: flex;
    gap: .5rem;
}

.btn-icon {
    display: grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border: 1px solid var(--line);
    color: var(--tx-3);
    transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}

.btn-icon:hover {
    border-color: var(--accent);
    background: var(--bg-2);
    color: var(--accent);
}

/* The button shows the state you are switching *to*, matching its label. */
.btn-icon__glyph {
    display: grid;
    place-items: center;
    width: .75rem;
    height: .75rem;
}

.btn-icon__glyph .icon {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: opacity .3s var(--ease), transform .45s var(--ease);
}

.icon--moon {
    opacity: 0;
    transform: rotate(-90deg) scale(.5);
}

:root[data-theme='light'] .icon--sun {
    opacity: 0;
    transform: rotate(90deg) scale(.5);
}

:root[data-theme='light'] .icon--moon {
    opacity: 1;
    transform: none;
}

.btn-icon--menu {
    display: none;
}

.bars {
    position: relative;
    display: block;
    width: .875rem;
    height: 2px;
    background: currentColor;
    transition: background-color .2s var(--ease);
}

.bars::before,
.bars::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform .3s var(--ease);
}

.bars::before {
    transform: translateY(-.3125rem);
}

.bars::after {
    transform: translateY(.3125rem);
}

.btn-icon--menu[aria-expanded='true'] .bars {
    background: transparent;
}

.btn-icon--menu[aria-expanded='true'] .bars::before {
    transform: rotate(45deg);
}

.btn-icon--menu[aria-expanded='true'] .bars::after {
    transform: rotate(-45deg);
}

.progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
}

.progress i {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
}

/* ----------------------------------------------------------------- hero -- */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: calc(100svh - var(--bar-h));
    padding-block: clamp(3.5rem, 9vw, 6rem);
    overflow: hidden;
}

.grid-dots {
    position: absolute;
    inset: 0;
    color: var(--line);
    background-image: radial-gradient(currentColor .5px, transparent .5px);
    background-size: 1.75rem 1.75rem;
    background-position: 0 calc(var(--par, 0) * 1px);
    opacity: .85;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
    pointer-events: none;
}

/* A second, brighter grid lit only where the pointer is. */
.grid-dots::after {
    content: '';
    position: absolute;
    inset: 0;
    color: var(--accent);
    background-image: radial-gradient(currentColor 1px, transparent 1px);
    background-size: 1.75rem 1.75rem;
    background-position: 0 calc(var(--par, 0) * 1px);
    opacity: var(--spot, 0);
    -webkit-mask-image: radial-gradient(13rem 13rem at var(--mx, 50%) var(--my, 50%), #000 0%, transparent 72%);
    mask-image: radial-gradient(13rem 13rem at var(--mx, 50%) var(--my, 50%), #000 0%, transparent 72%);
    transition: opacity .5s var(--ease);
}

.hero__in {
    position: relative;
    display: grid;
    gap: clamp(2.5rem, 6vw, 4.5rem);
    align-items: center;
}

.eyebrow {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    color: var(--tx-3);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.display {
    margin: clamp(1.25rem, 3vw, 2rem) 0 0;
    font-size: clamp(2.75rem, 8.4vw, 5.5rem);
    font-weight: 800;
    line-height: .96;
    letter-spacing: -.038em;
}

.display .line {
    display: block;
    overflow: hidden;
    padding-bottom: .04em;
}

.display .line>span {
    display: block;
    transform: translateY(110%);
    animation: rise .95s var(--ease) forwards;
}

.display .line:nth-child(1)>span {
    animation-delay: .08s;
}

.display .line:nth-child(2)>span {
    animation-delay: .17s;
}

.display .line:nth-child(3)>span {
    animation-delay: .26s;
}

/* This palette has almost no chroma, so emphasis is carried by filling rather
   than by switching hue. The filled block also suits the pixel idiom. */
.display em {
    font-style: normal;
    color: var(--mark-tx);
    background: var(--mark);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    padding: 0 .06em;
    margin: 0 -.02em;
}

@keyframes rise {
    to {
        transform: translateY(0);
    }
}

.lede {
    max-width: 52ch;
    margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--tx-2);
    font-size: clamp(1rem, 1.3vw, 1.14rem);
    line-height: 1.68;
}

.cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .8125rem 1.25rem;
    border: 1px solid var(--line-2);
    background: var(--bg);
    color: var(--tx);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    /* the offsets are driven by the pointer; the hover lift composes on top */
    transform: translate(var(--pull-x, 0px), var(--pull-y, 0px));
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.btn:hover,
.btn:focus-visible {
    transform: translate(calc(var(--pull-x, 0px) - 3px), calc(var(--pull-y, 0px) - 3px));
    box-shadow: 5px 5px 0 var(--accent);
    border-color: var(--accent);
}

.btn.is-pulling {
    transition: transform .12s linear, box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.btn--solid {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-tx);
}

.btn--solid:hover,
.btn--solid:focus-visible {
    box-shadow: 5px 5px 0 var(--line-2);
}

.btn__meta {
    padding-left: .5rem;
    border-left: 1px solid currentColor;
    /* dimmed just enough to sit under the label without dropping below 4.5:1 */
    opacity: .85;
    font-size: .62rem;
}

.facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    background: var(--line);
    border: 1px solid var(--line);
}

.facts>div {
    padding: .875rem 1rem;
    background: var(--bg);
}

.facts dt {
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.facts dd {
    margin-top: .25rem;
    color: var(--tx);
    font-weight: 500;
    font-size: .95rem;
}

/* ------------------------------------------------------------- portrait -- */

.portrait {
    margin: 0;
    justify-self: start;
    max-width: 20rem;
}

.window {
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    box-shadow: 8px 8px 0 var(--shadow);
}

.window__bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem .625rem;
    border-bottom: 1px solid var(--line-2);
    color: var(--tx-3);
    font-size: .62rem;
    text-transform: uppercase;
}

.window__body {
    position: relative;
    padding: .75rem;
    /* transparency checker, the way a sprite editor shows it */
    background-color: var(--bg-3);
    background-image:
        linear-gradient(45deg, var(--bg-2) 25%, transparent 25%, transparent 75%, var(--bg-2) 75%),
        linear-gradient(45deg, var(--bg-2) 25%, transparent 25%, transparent 75%, var(--bg-2) 75%);
    background-size: 1rem 1rem;
    background-position: 0 0, .5rem .5rem;
}

.portrait__img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    image-rendering: pixelated;
}

.portrait__canvas {
    position: absolute;
    top: .75rem;
    left: .75rem;
    /* A canvas is a replaced element: `inset` alone leaves it at its intrinsic
       64×64 instead of stretching. Size it off the padding box to match the img. */
    width: calc(100% - 1.5rem);
    height: auto;
    aspect-ratio: 1;
    image-rendering: pixelated;
}

.portrait figcaption {
    margin-top: .875rem;
    color: var(--tx-2);
    font-size: .68rem;
    line-height: 1.6;
}

/* the second line is the aside; it steps down in colour rather than in opacity,
   which would have taken it under 4.5:1 on this ground */
.portrait figcaption span {
    display: block;
    color: var(--tx-3);
}

/* ------------------------------------------------------------- sections -- */

.section {
    padding-block: clamp(4.5rem, 10vw, 8rem);
    border-top: 1px solid var(--line);
}

.sec-head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .5rem 1.5rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.sec-head h2 {
    grid-column: 1;
    grid-row: 1;
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    letter-spacing: -.025em;
}

.sec-head::after {
    content: '';
    grid-column: 2;
    grid-row: 1;
    height: 1px;
    background: var(--line);
}

.sec-note {
    grid-column: 1 / -1;
    grid-row: 2;
    color: var(--tx-3);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.sub-head {
    margin: clamp(3rem, 7vw, 4.5rem) 0 1.25rem;
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .74rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
}

/* ----------------------------------------------------------- experience -- */

.role {
    display: grid;
    gap: .75rem 2.5rem;
    padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
    border-top: 1px solid var(--line);
}

.role:last-child {
    border-bottom: 1px solid var(--line);
}

.role__when {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--tx-3);
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.role__dash {
    width: .75rem;
    height: 1px;
    background: var(--line-2);
}

.role__now {
    color: var(--accent);
}

.is-current .role__now::after {
    content: '';
    display: inline-block;
    width: .375rem;
    height: .375rem;
    margin-left: .4rem;
    background: var(--accent);
    vertical-align: middle;
    animation: blink 2.4s steps(1) infinite;
}

/* The company is the brightest thing in the row, so the ledger scans by employer. */
.role__what h3 {
    color: var(--tx-2);
    font-size: clamp(1.15rem, 2.1vw, 1.45rem);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.3;
}

.role__what h3 b {
    position: relative;
    color: var(--tx);
    font-weight: 700;
}

.role__what h3 b::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.12em;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transform: scaleX(.3);
    transform-origin: left;
    transition: opacity .3s var(--ease), transform .4s var(--ease);
}

.role:hover h3 b::after {
    opacity: 1;
    transform: scaleX(1);
}

.role__what .at {
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .04em;
}

.org-note {
    display: inline-block;
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .02em;
}

.role__what p {
    max-width: 62ch;
    margin-top: .625rem;
    color: var(--tx-2);
    line-height: 1.7;
}

.role__what ul {
    display: grid;
    gap: .5rem;
    margin-top: .875rem;
}

.role__what li {
    position: relative;
    max-width: 66ch;
    padding-left: 1.125rem;
    color: var(--tx-2);
    font-size: .95rem;
    line-height: 1.65;
}

.role__what li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .62em;
    width: .3125rem;
    height: .3125rem;
    background: var(--accent);
    opacity: .8;
}

.role__what .stack {
    margin-top: 1.125rem;
}

/* ---------------------------------------------------------------- cards -- */

/* Column counts are explicit, not auto-fit: six cards must always divide evenly
   or the hairline ground shows through as an empty slab. */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: inset 0 0 0 1px transparent;
    transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}

.card:hover,
.card:focus-within {
    background: var(--bg-2);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.card__shot {
    position: relative;
    display: block;
    aspect-ratio: 1200 / 750;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--bg-3);
}

/* The screenshot resolves out of a coarse pixel grid as the card scrolls in.
   The canvas backing store really is 6px wide at first; CSS does the scaling. */
.card__shot .dither {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    transition: opacity .3s linear;
}

.card__shot.is-resolving img {
    opacity: 0;
}

.card__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.8);
    transition: transform .6s var(--ease), filter .4s var(--ease);
}

.card:hover .card__shot img {
    transform: scale(1.045);
    filter: saturate(1);
}

.card--quiet .card__shot img {
    object-fit: contain;
    transform: scale(.94);
}

.card--quiet:hover .card__shot img {
    transform: scale(.99);
}

.card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(1.25rem, 2.6vw, 1.75rem);
}

.card__tag {
    color: var(--tx-3);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.card__body h3 {
    margin-top: .5rem;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.card__body h3 a {
    transition: color .2s var(--ease);
}

.card:hover h3 a {
    color: var(--accent);
}

.card__desc {
    margin-top: .625rem;
    color: var(--tx-2);
    font-size: .92rem;
    line-height: 1.65;
}

.card__body .stack {
    margin-top: 1rem;
}

.card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

.card__links a {
    color: var(--accent);
    font-family: var(--f-mono);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.card__links a span {
    margin-left: .3rem;
}

/* ---------------------------------------------------------------- repos -- */

.repos {
    border-top: 1px solid var(--line);
}

.repos li {
    border-bottom: 1px solid var(--line);
}

.repos a {
    position: relative;
    display: grid;
    grid-template-columns: 13rem 1fr 8rem;
    align-items: baseline;
    gap: .25rem 1.5rem;
    padding: 1rem .25rem 1rem 0;
    transition: padding-left .3s var(--ease);
}

.repos a::before {
    content: '\2192';
    position: absolute;
    left: -.25rem;
    top: 1rem;
    color: var(--accent);
    font-family: var(--f-mono);
    font-size: .8rem;
    opacity: 0;
    transition: opacity .3s var(--ease);
}

.repos a:hover,
.repos a:focus-visible {
    padding-left: 1.5rem;
}

.repos a:hover::before,
.repos a:focus-visible::before {
    opacity: 1;
}

.repos__name {
    color: var(--tx);
    font-family: var(--f-mono);
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: .01em;
    transition: color .2s var(--ease);
}

.repos a:hover .repos__name {
    color: var(--accent);
}

.repos__desc {
    color: var(--tx-2);
    font-size: .88rem;
    line-height: 1.55;
}

.repos__lang {
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-align: right;
}

/* --------------------------------------------------------------- skills -- */

.scale-legend {
    display: flex;
    align-items: center;
    gap: .625rem;
    max-width: 15rem;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    color: var(--tx-3);
    font-size: .64rem;
    letter-spacing: .1em;
}

.scale-legend__rule {
    flex: 1;
    height: .375rem;
    background: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 12.5%);
    border-bottom: 1px solid var(--line);
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: clamp(2rem, 4.5vw, 3.5rem);
}

.skillset h3 {
    padding-bottom: .625rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--line);
    color: var(--tx-3);
    font-size: .68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.skillset li {
    display: grid;
    grid-template-columns: 1fr 5.5rem 1.5rem;
    align-items: center;
    gap: .75rem;
    padding-block: .5rem;
}

.skillset li span {
    color: var(--tx-2);
    font-size: .88rem;
}

.skillset li i {
    position: relative;
    height: .625rem;
    background: var(--bg-3);
    border: 1px solid var(--line);
}

.skillset li i::before {
    content: '';
    position: absolute;
    inset: 0;
    width: calc(var(--y) / 8 * 100%);
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .9s var(--ease) .15s;
}

.skillset.is-in li i::before {
    transform: scaleX(1);
}

/* segment gutters painted over the fill, so the cells stay aligned */
.skillset li i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), var(--bg) calc(12.5% - 1px) 12.5%);
    pointer-events: none;
}

.skillset li b {
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .74rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stack--wide {
    margin-top: 1.25rem;
}

.edu div {
    padding-block: .75rem;
    border-bottom: 1px solid var(--line);
}

.edu dt {
    color: var(--tx);
    font-size: .92rem;
    font-weight: 500;
}

.edu dd {
    margin-top: .25rem;
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .7rem;
    letter-spacing: .04em;
}

/* ---------------------------------------------------------------- about -- */

.about__grid {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
}

.about__open {
    max-width: 26ch;
    color: var(--tx);
    font-family: var(--f-display);
    font-size: clamp(1.3rem, 2.6vw, 1.75rem);
    font-weight: 500;
    line-height: 1.32;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.about__text p+p {
    max-width: 62ch;
    margin-top: 1.125rem;
    color: var(--tx-2);
    line-height: 1.75;
}

.about__side {
    align-self: start;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--line);
    background: var(--bg-2);
}

.about__face {
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--line-2);
    image-rendering: pixelated;
}

.about__meta div {
    padding-block: .75rem;
    border-top: 1px solid var(--line);
}

.about__meta dt {
    color: var(--tx-3);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.about__meta dd {
    margin-top: .25rem;
    color: var(--tx);
    font-size: .88rem;
}

/* -------------------------------------------------------------- contact -- */

.contact__pitch {
    max-width: 28ch;
    color: var(--tx);
    font-family: var(--f-display);
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    font-weight: 500;
    line-height: 1.24;
    letter-spacing: -.025em;
    text-wrap: balance;
}

/* At display size the link needs a mark of its own, not just a colour shift.
   text-decoration rather than a pseudo-element, because the link wraps lines. */
.contact__pitch a {
    color: var(--tx);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 3px;
    text-underline-offset: .14em;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.contact__pitch a::after {
    display: none;
}

.contact__pitch a:hover,
.contact__pitch a:focus-visible {
    color: var(--mark-tx);
    background: var(--mark);
}

.channels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    background: var(--line);
    border: 1px solid var(--line);
}

.channels a {
    display: block;
    height: 100%;
    padding: 1.25rem 1.375rem;
    background: var(--bg);
    transition: background-color .25s var(--ease);
}

.channels a:hover,
.channels a:focus-visible {
    background: var(--bg-2);
}

.channels__k {
    display: block;
    color: var(--tx-3);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.channels__v {
    display: block;
    margin-top: .375rem;
    color: var(--tx);
    font-size: 1rem;
    font-weight: 500;
    overflow-wrap: anywhere;
    transition: color .25s var(--ease);
}

.channels a:hover .channels__v,
.channels a:focus-visible .channels__v {
    color: var(--accent);
}

.channels__v span {
    margin-left: .3rem;
    color: var(--tx-3);
}

.channels li {
    position: relative;
}

.channels__copy {
    position: absolute;
    top: .5rem;
    right: .5rem;
    padding: .3rem .5rem;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--tx-3);
    font-family: var(--f-mono);
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: 0;
    transform: translateY(-.25rem);
    transition: opacity .2s var(--ease), transform .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.channels li:hover .channels__copy,
.channels__copy:focus-visible {
    opacity: 1;
    transform: none;
}

.channels__copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------------------------------------------------------------- toast -- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 300;
    padding: .75rem 1.125rem;
    border: 1px solid var(--accent);
    background: var(--bg-2);
    color: var(--tx);
    font-family: var(--f-mono);
    font-size: .72rem;
    letter-spacing: .08em;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 1rem);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
    pointer-events: none;
}

.toast.is-up {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- footer -- */

.foot {
    padding-block: 2rem;
    border-top: 1px solid var(--line);
}

.foot__in {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem 2rem;
    color: var(--tx-3);
    font-size: .68rem;
    letter-spacing: .06em;
}

.foot__built {
    order: 4;
    flex-basis: 100%;
}

.foot__keys kbd {
    display: inline-block;
    min-width: 1.25rem;
    padding: .1rem .3rem;
    margin: 0 .1rem;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--tx-2);
    font-family: var(--f-mono);
    font-size: .64rem;
    text-align: center;
}

/* ------------------------------------------------------- micro-behaviour -- */

.num {
    font-variant-numeric: tabular-nums;
}

/* Buttons lean a few pixels toward the pointer. */
.magnet {
    will-change: transform;
}

/* -------------------------------------------------------- scroll reveal -- */

.reveal {
    opacity: 0;
    transform: translateY(.875rem);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---------------------------------------------------------- breakpoints -- */

@media (min-width: 34em) {
    .channels {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 38em) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 40em) {
    .facts {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 62em) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .channels {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 48em) {
    .role {
        grid-template-columns: 11rem 1fr;
    }

    .role__when {
        padding-top: .35rem;
        align-items: flex-start;
    }
}

@media (min-width: 60em) {
    .about__grid {
        grid-template-columns: 1fr 19rem;
    }
}

@media (min-width: 64em) {
    .hero__in {
        grid-template-columns: 1fr 20rem;
    }

    .portrait {
        justify-self: end;
    }
}

/* --- compact: fold the nav into an overlay ------------------------------- */

@media (max-width: 61.99em) {
    .brand__role {
        display: none;
    }

    .btn-icon--menu {
        display: grid;
    }

    .nav {
        position: fixed;
        top: var(--bar-h);
        left: 0;
        right: 0;
        z-index: 99;
        flex-direction: column;
        gap: 0;
        padding: .5rem var(--pad) 1.5rem;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-.75rem);
        transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
    }

    .nav.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .nav a {
        padding-block: .9rem;
        border-bottom: 1px solid var(--line);
        font-size: .8rem;
        opacity: 0;
        transform: translateY(-.375rem);
        transition: opacity .3s var(--ease), transform .3s var(--ease), color .2s var(--ease);
    }

    .nav.is-open a {
        opacity: 1;
        transform: none;
    }

    .nav.is-open a:nth-child(1) {
        transition-delay: .04s;
    }

    .nav.is-open a:nth-child(2) {
        transition-delay: .08s;
    }

    .nav.is-open a:nth-child(3) {
        transition-delay: .12s;
    }

    .nav.is-open a:nth-child(4) {
        transition-delay: .16s;
    }

    .nav.is-open a:nth-child(5) {
        transition-delay: .2s;
    }

    .nav a::after {
        bottom: .5rem;
    }
}

/* Below the two-column hero, the face leads: it is the most recognisable thing
   on the page and it must not sit under the fold. */
@media (max-width: 63.99em) {
    .hero__in {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: clamp(1.75rem, 5vw, 2.5rem);
    }

    .portrait {
        order: -1;
        max-width: 11rem;
    }

    .portrait figcaption span {
        display: none;
    }
}

@media (max-width: 47.99em) {
    .repos a {
        grid-template-columns: 1fr;
        gap: .375rem;
    }

    .repos__lang {
        text-align: left;
    }

    .window__bar {
        gap: .5rem;
        font-size: .58rem;
    }
}

@media (max-width: 29.99em) {
    .skillset li {
        grid-template-columns: 1fr 3.5rem 1.5rem;
    }

    .cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }
}

/* ------------------------------------------------------- reduced motion -- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .display .line>span {
        transform: none;
    }

    .skillset li i::before {
        transform: scaleX(1);
    }

    .grid-dots::after {
        display: none;
    }

    .card__shot .dither {
        display: none;
    }

    .card__shot.is-resolving img {
        opacity: 1;
    }
}

/* ---------------------------------------------------------------- print -- */

@media print {

    .topbar,
    .grid-dots,
    .cta,
    .foot__up,
    .card__shot,
    .portrait {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .section {
        break-inside: avoid;
    }
}
