/* KevanGilbert.com
   Classic, timeless, vintage web, played loud: saturated type colours, a
   generated paperback-style cover for everything, and plain HTML underneath.

   Contents: 1 fonts · 2 tokens · 3 base · 4 header · 5 statement & quote
             6 covers · 7 tiles & rows · 8 banners (page heads) · 9 meta & chips
             10 bars, boxes & lists · 11 prose · 12 Ghost cards · 13 footer
             14 small screens · 15 motion */

/* ---------- 1. Fonts (IBM Plex, self-hosted, SIL OFL) ---------- */
@font-face { font-family: "Plex Serif"; src: url("../fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("../fonts/ibm-plex-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("../fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("../fonts/ibm-plex-serif-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- 2. Tokens ---------- */
:root {
  --read: "Plex Serif", Georgia, serif;   /* headings and reading */
  --ui: "Plex Sans", Arial, sans-serif;   /* menus, captions, tables */
  --mono: "Plex Mono", Menlo, monospace;  /* labels, dates */

  --bg: #FFFFFF; --ink: #111111; --muted: #555555; --line: #DDDDDD; --soft: #F5F4F0; --paper: #FFFDF6;
  --link: #0000EE; --visited: #551A8B;

  /* Type colours, and the text that sits on each (all pairs WCAG AA). */
  --c-writing: #2E5BFF; --on-writing: #FFFFFF;
  --c-music:   #FF2D8A; --on-music: #111111;
  --c-video:   #FF6B00; --on-video: #111111;
  --c-podcasts: #00BFA5; --on-podcasts: #111111;
  --c-built:   #00C26E; --on-built: #111111;
  --c-work:    #FFC400; --on-work: #111111;
  --c-weblog:  #A866FF; --on-weblog: #111111;
  --c-photos:  #00B5E2; --on-photos: #111111;
  --c-ink:     #111111; --on-ink: #FFFFFF;

  --wrap: 1180px;
  --read-max: 680px;
}
[data-type="writing"] { --c: var(--c-writing); --on: var(--on-writing); --on-rgb: 255,255,255; }
[data-type="music"]   { --c: var(--c-music);   --on: var(--on-music);   --on-rgb: 17,17,17; }
[data-type="video"]   { --c: var(--c-video);   --on: var(--on-video);   --on-rgb: 17,17,17; }
[data-type="podcasts"] { --c: var(--c-podcasts); --on: var(--on-podcasts); --on-rgb: 17,17,17; }
[data-type="built"]   { --c: var(--c-built);   --on: var(--on-built);   --on-rgb: 17,17,17; }
[data-type="work"]    { --c: var(--c-work);    --on: var(--on-work);    --on-rgb: 17,17,17; }
[data-type="weblog"]  { --c: var(--c-weblog);  --on: var(--on-weblog);  --on-rgb: 17,17,17; }
[data-type="photos"]  { --c: var(--c-photos);  --on: var(--on-photos);  --on-rgb: 17,17,17; }
[data-type="ink"]     { --c: var(--c-ink);     --on: var(--on-ink);     --on-rgb: 255,255,255; }

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--read); font-size: 19px; line-height: 1.55; font-kerning: normal; }
a { color: var(--link); text-underline-offset: 2px; }
a:visited { color: var(--visited); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--bg); padding: 8px 12px; font-family: var(--ui); font-weight: 600; }
.skip:focus { top: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { display: block; padding-bottom: 24px; }
.section { padding-top: 56px; }

/* ---------- 4. Header: wordmark + coloured menu chips ---------- */
.head { padding: 22px 0; border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mark { font-family: var(--read); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark:visited { color: var(--ink); }
.mark span { display: inline-block; width: 14px; height: 14px; margin-left: 3px; background: var(--c-music); }
.nav { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; font-family: var(--ui); font-weight: 600; font-size: 15px; line-height: 1.3; padding: 6px 12px; background: var(--c); color: var(--on); text-decoration: none; transition: transform .1s, box-shadow .1s; }
.nav a:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px, -2px); }
.nav a[aria-current="page"] { box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px, -2px); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 5. Statement, highlighted links, the rotating quote ---------- */
.hero { padding: 64px 0 0; }
/* The intro: one size throughout, so no single line (or link) dominates. */
.statement { font-size: clamp(25px, 3.1vw, 38px); line-height: 1.25; font-weight: 400; max-width: 25em; letter-spacing: -0.015em; margin: 0; }
.statement--more { margin-top: .5em; }
.statement-more { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; max-width: 30em; margin-top: 22px; letter-spacing: -0.01em; }
.hl { color: var(--ink); text-decoration: none; background: linear-gradient(transparent 72%, var(--c) 72%, var(--c) 94%, transparent 94%); padding: 0 .06em; transition: background .12s, color .12s; }
.hl:visited { color: var(--ink); }
.hl:hover { background: var(--c); color: var(--on); }

/* The rotating line: set in a black highlight that wraps line by line. */
.quote { margin: 24px 0 0; display: flex; gap: 12px; align-items: flex-start; max-width: 46em; }
.quote__list { list-style: none; margin: 0; padding: 0; display: grid; font-family: var(--ui); font-size: 18px; line-height: 1.75; }
.quote__list li { grid-area: 1 / 1; transition: opacity .5s; }
.quote__list li[hidden] { display: block; visibility: hidden; opacity: 0; }
.quote__list span { background: var(--ink); color: var(--bg); padding: 3px 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.quote button { flex: none; margin-top: 4px; font-family: var(--mono); font-size: 12px; background: none; border: 1px solid var(--line); padding: 1px 7px; cursor: pointer; color: var(--muted); }
.quote button:hover { border-color: var(--ink); color: var(--ink); }
.latest { margin-top: 14px; font-family: var(--ui); font-size: 16px; }

/* ---------- 6. Covers: generated paperback, or a chosen image ---------- */
.cover { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--c); color: var(--on); isolation: isolate; container-type: inline-size; }
.cover > img, .cover > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__gen { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
.cover__band, .banner__band { position: relative; overflow: hidden; }
/* Patterns vary by position and angle (never by rotating the layer, which leaves bare edges). */
.cover__band::before, .banner__band::before { content: ""; position: absolute; inset: 0; }
.cover__plate { background: var(--paper); color: #111; padding: 4cqi 7cqi; border-top: 3px solid #111; border-bottom: 3px solid #111; }
/* Always two lines tall, so short and long titles line up across a grid. */
.cover__title { font-family: var(--read); font-weight: 700; font-size: clamp(10px, 8cqi, 40px); line-height: 1.12; height: 2.24em; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; text-wrap: balance; }
.cover__foot { display: flex; justify-content: space-between; gap: 8px; padding: 2.6cqi 7cqi; font-family: var(--mono); font-size: clamp(8px, 4.4cqi, 14px); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.cover--wide .cover__title { font-size: clamp(18px, 7.4cqi, 46px); }

/* One pattern per type, from the vintage web and the print shop. */
[data-type="writing"] :is(.cover__band, .banner__band)::before { /* ruled paper with a margin line */
  background: linear-gradient(90deg, transparent 0 18%, rgba(255,90,120,.8) 18% calc(18% + 2px), transparent 0),
              repeating-linear-gradient(transparent 0 21px, rgba(var(--on-rgb), .28) 21px 22px);
}
[data-type="music"] :is(.cover__band, .banner__band)::before { /* record grooves */
  background: repeating-radial-gradient(circle at var(--x, 70%) var(--y, 60%), transparent 0 5px, rgba(var(--on-rgb), .16) 5px 6px);
}
[data-type="video"] :is(.cover__band, .banner__band)::before { /* CRT static: ants and zebras, over scanlines */
  background:
    repeating-linear-gradient(transparent 0 2px, rgba(var(--on-rgb), .16) 2px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.6 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") var(--gx, 0) var(--gy, 0) / 180px 180px;
  opacity: .55;
}
/* On hover the static flickers, like a tuned-out channel. */
@keyframes kg-static { 0% { background-position: 0 0, 0 0; } 25% { background-position: 0 1px, -40px 30px; } 50% { background-position: 0 0, 60px -50px; } 75% { background-position: 0 1px, -20px 80px; } }
a:hover [data-type="video"] .cover__band::before, .tile[data-type="video"] a:hover .cover__band::before { animation: kg-static .32s steps(1) infinite; }
[data-type="podcasts"] :is(.cover__band, .banner__band)::before { /* radio tuning dial: ticks, big ticks, and the needle */
  background:
    linear-gradient(90deg, transparent calc(var(--x, 70%) - 2px), #FF2D8A calc(var(--x, 70%) - 2px) calc(var(--x, 70%) + 1px), transparent 0),
    repeating-linear-gradient(90deg, rgba(var(--on-rgb), .55) 0 2px, transparent 2px 60px) 0 100% / 100% 70% no-repeat,
    repeating-linear-gradient(90deg, rgba(var(--on-rgb), .35) 0 1px, transparent 1px 12px) 0 100% / 100% 38% no-repeat;
}
[data-type="built"] :is(.cover__band, .banner__band)::before { /* pixel grid */
  background: conic-gradient(rgba(var(--on-rgb), .14) 25%, transparent 0 50%, rgba(var(--on-rgb), .14) 0 75%, transparent 0) 0 0 / 24px 24px;
}
[data-type="work"] :is(.cover__band, .banner__band)::before { /* graph paper */
  background: linear-gradient(rgba(var(--on-rgb), .22) 1px, transparent 1px) var(--gx, 0) var(--gy, 0) / 80px 80px,
              linear-gradient(90deg, rgba(var(--on-rgb), .22) 1px, transparent 1px) var(--gx, 0) var(--gy, 0) / 80px 80px,
              linear-gradient(rgba(var(--on-rgb), .10) 1px, transparent 1px) 0 0 / 16px 16px,
              linear-gradient(90deg, rgba(var(--on-rgb), .10) 1px, transparent 1px) 0 0 / 16px 16px;
}
[data-type="weblog"] :is(.cover__band, .banner__band)::before { background: repeating-linear-gradient(var(--angle, 45deg), transparent 0 12px, rgba(var(--on-rgb), .14) 12px 24px); }
[data-type="photos"] :is(.cover__band, .banner__band)::before { background: radial-gradient(rgba(var(--on-rgb), .3) 30%, transparent 32%) 0 0 / 14px 14px; }
[data-type="ink"] :is(.cover__band, .banner__band)::before { background: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1.5px) 0 0 / 10px 10px; }
/* Per-item variation (from a hash of the slug). */
[data-v="1"] { --x: 20%; --y: 30%; --bars-y: 100%; --gx: 24px; --gy: 40px; --angle: -45deg; }
[data-v="2"] { --x: 85%; --y: 85%; --bars-y: 50%; --gx: 56px; --gy: 8px; --angle: 90deg; }

/* ---------- 7. Tiles (grid) and rows (list) ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile a { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.tile a:hover .cover { outline: 3px solid var(--ink); outline-offset: 3px; }
.tile__title { font-weight: 600; font-size: 19px; line-height: 1.25; }
.tile a:hover .tile__title { text-decoration: underline; }
.tile__meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tile--feature { grid-column: span 2; grid-row: span 2; }
/* A generated cover already shows the title; the caption repeats it only under a real image. */
.tile .cover:not(:has(> img, > picture)) ~ .tile__title { display: none; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows a.row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 18px; padding: 12px 0; text-decoration: none; color: var(--ink); align-items: center; }
.row__title { display: block; font-weight: 600; font-size: 19px; line-height: 1.25; }
.row:hover .row__title { text-decoration: underline; }
.row__meta { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- 8. Banners: page heads built from the cover system ---------- */
.banner { color: var(--on); background: var(--c); display: grid; grid-template-rows: 150px auto auto; }
.banner__plate { background: var(--paper); color: #111; border-top: 4px solid #111; border-bottom: 4px solid #111; }
.banner__plate .wrap { padding-top: 26px; padding-bottom: 26px; display: flex; flex-direction: column; gap: 10px; }
.banner__title { font-size: clamp(36px, 6vw, 68px); line-height: 1.04; font-weight: 700; letter-spacing: -0.025em; max-width: 18em; }
.banner__desc { font-family: var(--ui); font-size: 18px; color: #333; max-width: 42em; }
.banner__foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding-top: 10px; padding-bottom: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.banner__foot a, .banner__foot a:visited { color: var(--on); }
.banner--short { grid-template-rows: 70px auto auto; }
.crumbs { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.crumbs a { color: inherit; }

/* ---------- 9. Meta line and chips ---------- */
.chip { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; background: var(--c); color: var(--on); padding: 2px 8px; text-decoration: none; line-height: 1.5; }
a.chip:visited { color: var(--on); }
a.chip:hover { box-shadow: 2px 2px 0 var(--ink); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; font-family: var(--ui); font-size: 15px; color: var(--muted); padding: 18px 0; border-bottom: 1px solid var(--line); }
.meta b { font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin-right: 6px; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- 10. Section bars, boxes, lists, tables ---------- */
.bar { background: var(--c); color: var(--on); font-family: var(--ui); font-weight: 600; font-size: 21px; line-height: 1.3; padding: 7px 12px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar a, .bar a:visited { color: var(--on); font-size: 15px; font-weight: 400; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols--even > :only-child { grid-column: 1 / -1; }
.article--single { grid-template-columns: minmax(0, var(--read-max)); }
.box { border: 2px solid var(--ink); padding: 16px; font-family: var(--ui); font-size: 16px; box-shadow: 6px 6px 0 var(--c, var(--ink)); }
.box h2 { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.box ul { margin: 0; padding-left: 1.1em; list-style: square; }
.box li + li { margin-top: 4px; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.log time { display: block; font-family: var(--ui); font-weight: 600; font-size: 16px; }
.collections { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.collections > li { border: 2px solid var(--ink); padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 6px 6px 0 var(--c); background: var(--bg); }
.collections h3 { font-size: 21px; line-height: 1.2; }
.collections h3 a { color: var(--ink); text-decoration: none; }
.collections h3 a:hover { text-decoration: underline; }
.collections ul { margin: 0; padding-left: 1.1em; list-style: square; font-family: var(--ui); font-size: 15px; }
.table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: 15px; }
.table th { font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 8px 12px 8px 0; border-bottom: 2px solid var(--ink); }
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.table td:first-child { font-weight: 600; }
.table__roles { color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; font-family: var(--mono); font-size: 12px; }
.tools button { font: inherit; background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; cursor: pointer; color: var(--ink); }
.tools button:hover { border-color: var(--ink); }
.tools button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Homepage Weblog list: generous, dated, with the opening line. */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-bottom: 1px solid var(--line); }
.post { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 4px 24px; padding: 20px 0; text-decoration: none; color: var(--ink); }
.post__date { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 8px; grid-row: span 2; }
.post__title { font-family: var(--read); font-weight: 600; font-size: 28px; line-height: 1.2; color: var(--link); }
.post:hover .post__title { text-decoration: underline; }
.projects-intro { font-family: var(--ui); font-size: 17px; max-width: 46em; margin: -4px 0 18px; }
.projects-thanks { font-family: var(--ui); font-size: 15px; color: var(--muted); max-width: 46em; margin-top: 18px; }
.post__opening { font-family: var(--ui); font-size: 16px; line-height: 1.5; color: #333; max-width: 46em; }

/* Archive: filter chips in each type's colour, big year labels down the side. */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.filters button { display: inline-flex; align-items: center; gap: 9px; font-family: var(--ui); font-weight: 600; font-size: 16px; line-height: 1.2; padding: 5px 13px 5px 5px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.filters button span { font-family: var(--mono); font-size: 12px; font-weight: 500; opacity: .65; }
/* The icon sits on a little sticker in the type's colour. */
.filters i { display: grid; place-items: center; width: 34px; height: 34px; background: var(--c); color: var(--on); border: 2px solid var(--ink); transition: transform .15s; }
.filters button:hover { box-shadow: 4px 4px 0 var(--c); transform: translate(-2px, -2px); }
.filters button:hover i { animation: kg-wiggle .4s ease-in-out; }
.filters button[aria-pressed="true"] { background: var(--c); color: var(--on); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.filters button[aria-pressed="true"] i { background: var(--bg); color: var(--ink); transform: rotate(-6deg); }
@keyframes kg-wiggle { 25% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
.year { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; border-top: 3px solid var(--ink); padding-top: 22px; margin-top: 44px; }
.year[hidden] { display: none; }
.year__label { font-family: var(--read); font-weight: 700; font-size: 60px; line-height: .9; letter-spacing: -0.03em; position: sticky; top: 18px; align-self: start; }
.at-home { margin-bottom: 36px; }
.at-home h2, .prose .at-home h2 { margin-top: 0; font-family: var(--mono); font-size: 13px; line-height: 1.4; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.at-home p { font-family: var(--read); font-size: 18px; line-height: 1.55; }

/* ---------- 11. Prose ---------- */
.article { display: grid; grid-template-columns: minmax(0, var(--read-max)) minmax(220px, 300px); gap: 56px; justify-content: space-between; align-items: start; padding-top: 36px; }
.prose { max-width: var(--read-max); overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 30px; line-height: 1.2; margin-top: 1.6em; }
.prose h3 { font-size: 23px; line-height: 1.25; margin-top: 1.4em; }
.prose h4, .prose h5 { font-family: var(--ui); font-size: 15px; text-transform: uppercase; letter-spacing: .05em; margin-top: 1.4em; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 22px; border-left: 6px solid var(--c, var(--ink)); font-style: italic; }
.prose hr { border: 0; height: 8px; background: var(--c, var(--ink)); margin: 2.2em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { font-family: var(--ui); font-size: 15px; color: var(--muted); margin-top: 8px; }
.prose img, .prose video, .prose iframe { max-width: 100%; }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--soft); padding: 0 .25em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: 15px; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.aside { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 24px; }
.aside .cover { box-shadow: 6px 6px 0 var(--ink); }
.credits { margin-top: 2.4em; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--ui); font-size: 15px; }
.credits h2 { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.credits ul { margin: 0; padding-left: 1.1em; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--ui); font-size: 16px; padding: 22px 0; border-top: 1px solid var(--line); margin-top: 40px; }

/* ---------- 12. Ghost cards inside posts, restyled to match ---------- */
.prose figure.kg-card { margin-top: 32px; margin-bottom: 32px; }
.prose .kg-width-wide, .prose .kg-width-full { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
.prose .kg-embed-card { width: 100%; }
.prose iframe[src*="youtube.com"], .prose iframe[src*="youtube-nocookie.com"], .prose iframe[src*="vimeo.com"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose .kg-image-card img, .prose .kg-gallery-image img { border-radius: 0; }
.prose .kg-bookmark-card { width: 100%; }
.prose .kg-bookmark-container { display: flex; border: 2px solid var(--ink); border-radius: 0; box-shadow: 5px 5px 0 var(--c, var(--ink)); color: var(--ink); text-decoration: none; background: var(--bg); min-height: 0; }
.prose .kg-bookmark-container:hover .kg-bookmark-title { text-decoration: underline; }
.prose .kg-bookmark-content { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }
.prose .kg-bookmark-title { font-family: var(--read); font-weight: 600; font-size: 18px; line-height: 1.3; color: var(--link); }
.prose .kg-bookmark-description { font-family: var(--ui); font-size: 15px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.prose .kg-bookmark-metadata { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.prose .kg-bookmark-icon { width: 16px; height: 16px; margin: 0; }
.prose .kg-bookmark-thumbnail { flex: 0 0 30%; max-width: 220px; position: relative; border-left: 2px solid var(--ink); }
.prose .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.prose .kg-bookmark-thumbnail picture { display: contents; }

/* Our own link card, for links to posts on this site. */
.prose .linkcard-figure { margin: 28px 0; }
.linkcard { display: grid; grid-template-columns: 168px minmax(0, 1fr); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--c); background: var(--bg); color: var(--ink); text-decoration: none; transition: transform .1s, box-shadow .1s; }
.linkcard:visited { color: var(--ink); }
.linkcard:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--c); }
.linkcard .cover { aspect-ratio: auto; height: 100%; min-height: 112px; border-right: 2px solid var(--ink); }
.cover--strip .cover__gen { grid-template-rows: minmax(0, 1fr) auto; }
.cover--strip .cover__foot { border-top: 3px solid #111; }
.linkcard__text { padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.linkcard__title { font-family: var(--read); font-weight: 700; font-size: 20px; line-height: 1.2; color: var(--link); }
.linkcard:hover .linkcard__title { text-decoration: underline; }
.linkcard__meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.linkcard__desc { font-family: var(--ui); font-size: 15px; line-height: 1.45; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }

.linkcard__arrow { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--ui); font-weight: 600; font-size: 54px; line-height: 1; color: var(--c-work); }
.linkcard--out:hover .linkcard__arrow { transform: translate(3px, -3px); transition: transform .12s; }

/* About: the photobooth strip. */
.booth { margin: 0; background: #fff; padding: 12px 12px 6px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--c-video); width: 100%; max-width: 230px; transform: rotate(-1.5deg); }
.booth ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.booth img, .booth picture { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.booth figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 8px 0 4px; color: var(--muted); }

/* ---------- 13. Footer: the colour bars, dripping off the bottom of the page ---------- */
.drips { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 96px; padding-bottom: 150px; overflow: hidden; }
.drips > span { position: relative; height: 140px; background: var(--c); color: var(--on); padding: 14px 14px; font-family: var(--mono); font-size: 13px; font-weight: 500; line-height: 1.4; }
.drips a, .drips a:visited { color: var(--on); text-underline-offset: 3px; }
.drips small { font-size: inherit; }
/* Each bar sheds two drips. Plop. Ooze. Run. */
.drips i { position: absolute; top: 100%; left: var(--l, 30%); width: var(--w, 14px); height: var(--h, 40px); margin-top: -1px; background: var(--c); border-radius: 0 0 999px 999px; animation: kg-ooze var(--d, 7s) ease-in-out var(--delay, 0s) infinite; }
.drips i::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: calc(var(--w, 14px) * 1.3); height: calc(var(--w, 14px) * 1.3); background: var(--c); border-radius: 50%; transform: translate(-50%, 0); animation: kg-plop var(--d, 7s) ease-in var(--delay, 0s) infinite; }
@keyframes kg-ooze {
  0%   { height: calc(var(--h, 40px) * .35); }
  70%  { height: var(--h, 40px); }
  76%  { height: var(--h, 40px); }
  100% { height: calc(var(--h, 40px) * .35); }
}
@keyframes kg-plop {
  0%   { transform: translate(-50%, 0) scale(.5); opacity: 1; }
  70%  { transform: translate(-50%, 0) scale(1.15); opacity: 1; }
  74%  { transform: translate(-50%, 6px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 190px) scale(.85); opacity: 0; }
}
.drips i + i { --l: 68%; --w: 9px; --h: 22px; --d: 9s; --delay: -3s; }
.drips > span:nth-child(1) i:first-child { --l: 22%; --h: 70px; --w: 18px; --d: 6.5s; }
.drips > span:nth-child(2) i:first-child { --l: 55%; --h: 96px; --w: 13px; --d: 8s; --delay: -2s; }
.drips > span:nth-child(2) i + i { --l: 18%; --h: 34px; --d: 5.5s; }
.drips > span:nth-child(3) i:first-child { --l: 38%; --h: 46px; --w: 20px; --d: 7.5s; --delay: -5s; }
.drips > span:nth-child(4) i:first-child { --l: 70%; --h: 104px; --w: 16px; --d: 9.5s; --delay: -1s; }
.drips > span:nth-child(4) i + i { --l: 25%; --h: 18px; --d: 6s; }
.drips > span:nth-child(5) i:first-child { --l: 30%; --h: 62px; --w: 12px; --d: 6s; --delay: -4s; }
.drips > span:nth-child(6) i:first-child { --l: 60%; --h: 84px; --w: 22px; --d: 10s; --delay: -6s; }
.drips > span:nth-child(6) i + i { --l: 15%; --h: 40px; --w: 11px; --d: 7s; }
.drips > span:nth-child(7) i:first-child { --l: 45%; --h: 52px; --w: 15px; --d: 8.5s; --delay: -2.5s; }
.drips > span:nth-child(8) i:first-child { --l: 25%; --h: 110px; --w: 17px; --d: 7s; --delay: -3.5s; }
.drips > span:nth-child(8) i + i { --l: 75%; --h: 30px; --d: 11s; }

/* 404 */
.notfound { padding: 64px 0; max-width: 40em; display: flex; flex-direction: column; gap: 18px; }
.notfound address { font-family: var(--mono); font-size: 13px; color: var(--muted); font-style: normal; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- 14. Small screens ---------- */
@media (max-width: 900px) {
  .tiles, .tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .tile--feature { grid-column: span 2; grid-row: auto; }
  .cols, .article { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .year { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .year__label { position: static; font-size: 44px; }
  .aside { position: static; order: -1; flex-direction: row; flex-wrap: wrap; }
  .aside .cover { width: 220px; }
  .booth { max-width: 520px; transform: none; }
  .booth ol { flex-direction: row; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  body { font-size: 18px; }
  .hero { padding: 40px 0 8px; }
  .quote__list { font-size: 16px; }
  .banner { grid-template-rows: 90px auto auto; }
  .rows a.row { grid-template-columns: 84px minmax(0, 1fr); }
  .rows .row > :last-child:not(:nth-child(2)) { display: none; }
  .table__roles { display: none; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post__date { grid-row: auto; padding-top: 0; }
  .post__title { font-size: 23px; }
  .drips { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 120px; margin-top: 64px; }
  .drips > span { height: 92px; padding: 10px; font-size: 12px; }
  .drips > span:nth-child(-n+4) i { display: none; }
  .aside .cover { display: none; }
  .aside:not(:has(.box, .booth)) { display: none; }
  .booth { max-width: none; transform: none; }
  .booth ol { flex-direction: row; gap: 6px; }
  .prose .kg-bookmark-thumbnail { display: none; }
  .linkcard { grid-template-columns: 96px minmax(0, 1fr); }
  .linkcard__desc { display: none; }
}

/* ---------- 15. Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
