/*
 * MAN OF GLASS
 *
 * The one stylesheet for the site. Motion pieces add motion.css on top.
 *
 *   1. Tokens        colours (Flexoki), type
 *   2. Base          elements
 *   3. Layout        column, page
 *   4. Chrome        skip link, nav pill, footer, loading bar
 *   5. Lists         home and category pages, pagination, categories
 *   6. Post          title, meta, content, embeds, footer links
 *   7. Transitions   view transitions between pages and themes
 *   8. Preferences   reduced motion, print
 */

/* ============================================================ 1. Tokens */

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-mono-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*
 * Flexoki: an inky colour scheme for prose and code.
 * https://stephango.com/flexoki
 */
:root {
  --flexoki-black: #100F0F;
  --flexoki-paper: #FFFCF0;

  --flexoki-950: #1C1B1A;
  --flexoki-900: #282726;
  --flexoki-850: #343331;
  --flexoki-800: #403E3C;
  --flexoki-700: #575653;
  --flexoki-600: #6F6E69;
  --flexoki-500: #878580;
  --flexoki-300: #B7B5AC;
  --flexoki-200: #CECDC3;
  --flexoki-150: #DAD8CE;
  --flexoki-100: #E6E4D9;
  --flexoki-50: #F2F0E5;

  /* Accents for the dark theme (400) */
  --flexoki-red-dark: #D14D41;
  --flexoki-orange-dark: #DA702C;
  --flexoki-yellow-dark: #D0A215;
  --flexoki-green-dark: #879A39;
  --flexoki-cyan-dark: #3AA99F;
  --flexoki-blue-dark: #4385BE;
  --flexoki-purple-dark: #8B7EC8;
  --flexoki-magenta-dark: #CE5D97;

  /* Accents for the light theme (600) */
  --flexoki-red-light: #AF3029;
  --flexoki-orange-light: #BC5215;
  --flexoki-yellow-light: #AD8301;
  --flexoki-green-light: #66800B;
  --flexoki-cyan-light: #24837B;
  --flexoki-blue-light: #205EA6;
  --flexoki-purple-light: #5E409D;
  --flexoki-magenta-light: #A02F6F;

  /* Dark theme, the default */
  color-scheme: dark;
  --bg: var(--flexoki-black);
  --bg-2: var(--flexoki-950);
  --ui: var(--flexoki-900);
  --ui-2: var(--flexoki-850);
  --ui-3: var(--flexoki-800);
  --tx: var(--flexoki-paper);
  --tx-2: var(--flexoki-200);
  --tx-3: var(--flexoki-500);
  --accent: var(--flexoki-orange-dark);
  /* Hairlines: rules, the ring on a rule, the dot between name and date. */
  --rule: var(--flexoki-900);
  /* The accent where it colours words: light (or deep) enough to read on --bg, --bg-2 and --ui. */
  --accent-tx: #DF7733;

  --font: "Roboto Mono", ui-monospace, Menlo, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  --line-height: 1.6;
  --heading-size: 1.75rem;
}

/* Light theme: dark ink on warm cream. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #E6E4D9;
  --bg-2: #DAD8CE;
  --ui: #E6E4D9;
  --ui-2: #CECDC3;
  --ui-3: #B7B5AC;
  --tx: #100F0F;
  --tx-2: #343331;
  --tx-3: #575653;
  --accent: #BC5215;
  --accent-tx: #8F3D0E;
  --rule: #CECDC3;
}

/* Without JavaScript nothing sets data-theme, so follow the system setting. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #E6E4D9;
    --bg-2: #DAD8CE;
    --ui: #E6E4D9;
    --ui-2: #CECDC3;
    --ui-3: #B7B5AC;
    --tx: #100F0F;
    --tx-2: #343331;
    --tx-3: #575653;
    --accent: #BC5215;
    --accent-tx: #8F3D0E;
    --rule: #CECDC3;
  }
}

/* ============================================================== 2. Base */

html {
  /* The page colour lives on html so view transitions capture it cleanly. */
  background-color: var(--bg);
  position: relative;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: transparent;
  color: var(--tx-2);
  font-family: var(--font);
  font-weight: 400;
  line-height: var(--line-height);
}

/*
 * Type is sized in rem, and so are the line-heights that are not the body's
 * 1.6: everything then follows the reader's own text size, and at the default
 * size each one is a whole number of pixels (1.875rem is 30px).
 */
h1,
.h1 {
  font-size: var(--heading-size);
  font-weight: 400;
  color: var(--tx);
}

h1 {
  margin: 0.67em 0;
}

h1 * {
  color: var(--tx);
}

h2 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--tx);
}

h3,
.h3 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--tx);
}

p {
  color: var(--tx-2);
  margin-bottom: 20px;
  letter-spacing: 0.4px;
}

@media only screen and (max-width: 400px) {
  p {
    letter-spacing: 0.2px;
  }
}

a {
  background-color: transparent;
  color: var(--tx);
  text-decoration: none;
  padding-bottom: 2px;
}

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

ul,
ol {
  color: var(--tx-2);
}

figure {
  display: block;
  margin: 1em 40px;
}

figure,
img,
iframe {
  max-width: 100%;
}

img {
  height: auto;
  border-style: none;
  border-radius: 4px;
}

iframe {
  border: 0;
}

svg:not(:root) {
  overflow: hidden;
}

blockquote {
  padding-left: 15px;
  border-left: 3px solid var(--ui-2);
}

@media screen and (max-width: 567px) {
  blockquote {
    margin-right: 0;
    margin-left: 0;
  }
}

blockquote cite {
  display: block;
  margin-top: 1em;
  font-style: normal;
  color: var(--tx-3);
}

blockquote cite a {
  color: var(--tx-3);
}

blockquote cite a:hover {
  color: var(--accent-tx);
}

/* Drawn with a border, not a fill, so it survives a forced-colours mode. */
hr {
  box-sizing: content-box;
  width: 100%;
  height: 0;
  margin: 40px auto;
  border: 0;
  border-top: 1px solid var(--ui-2);
}

button {
  font: inherit;
  margin: 0;
  overflow: visible;
  text-transform: none;
  -webkit-appearance: button;
  appearance: button;
}

/* One focus ring everywhere, shown for keyboard use only. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* main takes focus after an in-page navigation; that needs no ring. */
main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.has-text-align-center {
  text-align: center;
}

.animated {
  animation: fade-in-down 0.6s 0.3s both;
}

@keyframes fade-in-down {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================ 3. Layout */

/* On narrow screens the pill floats over the column: anything scrolled into
   view (a focused link, the skip link's target) stops short of it. */
@media screen and (max-width: 800px) {
  html {
    scroll-padding: 84px 0 24px;
  }
}

.wrapper-normal {
  width: 96%;
  max-width: 560px;
  margin: 0 auto;
}

@media only screen and (max-width: 1050px) {
  .wrapper-normal {
    width: 88%;
  }
}

.page {
  margin-top: 225px;
}

@media screen and (max-width: 567px) {
  .page {
    margin-top: 140px;
  }
}

.page h1.single-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--tx);
}

.not-found {
  text-align: center;
}

/* ============================================================ 4. Chrome */

/* Skip link: off screen until it has keyboard focus. */
.skip-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 2px solid var(--ui-2);
  border-radius: 22px;
  color: var(--tx);
  font-size: 0.875rem;
  line-height: 1.25rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Nav pill: back button and theme toggle in one control. */
.nav-pill {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  width: 44px;
  border-radius: 22px;
  border: 2px solid var(--ui-2);
  background: var(--bg-2);
  padding: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects are for pointers that hover; on a touch screen they would stick after a tap. */
@media (hover: hover) {
  .nav-pill:hover {
    border-color: var(--accent);
  }
}

.nav-pill.has-back {
  width: 88px;
}

/* On narrow screens the pill steps aside while the reader scrolls down. */
.nav-pill.is-away {
  transform: translateY(-84px);
}

.nav-pill:focus-within {
  transform: none;
}

.nav-pill-back,
.nav-pill-theme {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

/* The ring sits inside the pill, which clips anything outside it. */
.nav-pill-back:focus-visible,
.nav-pill-theme:focus-visible {
  outline-offset: -5px;
  border-radius: 22px;
}

.nav-pill-back {
  width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  text-decoration: none;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0s 0.3s;
}

.nav-pill.has-back .nav-pill-back {
  width: 44px;
  opacity: 1;
  visibility: visible;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.nav-pill-back.hiding {
  opacity: 0;
}

.nav-pill-back svg {
  width: 22px;
  height: 22px;
  fill: var(--tx);
  transition: fill 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .nav-pill-back:hover svg {
    fill: var(--accent);
    transform: translateX(-2px);
  }
}

.nav-pill-theme {
  width: 44px;
}

.nav-pill.has-back .nav-pill-theme {
  border-left: 1px solid var(--ui-2);
}

.nav-pill-theme svg {
  width: 20px;
  height: 20px;
  fill: var(--tx);
  transition: transform 0.3s ease, fill 0.2s;
}

@media (hover: hover) {
  .nav-pill-theme:hover svg {
    fill: var(--accent);
    transform: rotate(15deg);
  }
}

.nav-pill-theme:active svg {
  transform: rotate(15deg) scale(0.95);
}

.nav-pill-theme .sun-icon,
[data-theme="light"] .nav-pill-theme .moon-icon {
  display: none;
}

.nav-pill-theme .moon-icon,
[data-theme="light"] .nav-pill-theme .sun-icon {
  display: block;
}

/* Footer */
.footer-main {
  position: relative;
  margin: 50px 0 0;
  padding: 45px 0;
  border-top: 1px solid var(--rule);
  color: var(--tx-3);
  font-size: 0.85em;
  line-height: 1rem;
  text-align: center;
}

/* The small ring that sits on a rule. */
.footer-main::before,
.blog > .list::before {
  content: " ";
  display: block;
  position: absolute;
  top: -5px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -5px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  box-shadow: var(--bg) 0 0 0 5px;
}

.navigation--footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin: -6px 0 10px;
  padding: 0;
  list-style: none;
}

.navigation--footer li {
  margin: 0 0.25rem 1rem;
}

/* Padding makes the links comfortable to tap without moving them. */
.navigation--footer a {
  display: inline-block;
  padding: 14px 0.6rem;
  text-transform: uppercase;
}

@media only screen and (max-width: 780px) {
  .navigation--footer li {
    width: 100%;
    margin-bottom: 0;
  }
}

/* A hairline at the top of the window while the next page is still loading. */
html.is-loading::after {
  content: "";
  position: fixed;
  z-index: 1002;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  animation: page-loading 8s cubic-bezier(0.1, 0.6, 0.2, 1) both;
}

@keyframes page-loading {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(0.92);
  }
}

/* ============================================================= 5. Lists */

.header-home {
  display: block;
  position: relative;
  z-index: 99;
  margin: 0 auto;
  /* Keeps the rule below where it has always been. */
  padding-bottom: 43.6px;
  text-align: center;
}

.header-home > .title-link {
  text-decoration: none;
}

.header-home > .title-link > .title {
  line-height: 1.875rem;
  margin: 0 0 30px;
}

.header-home > .description {
  width: 70%;
  margin: 0 auto 30px;
  line-height: 1.4;
}

.blog > .list {
  position: relative;
  margin: 30px 0 0;
  padding: 40px 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.blog > .list > .item {
  display: block;
  width: 95%;
  margin: 0 auto;
}

.blog > .list > .item > .url {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  width: 100%;
  padding: 20px 0;
  text-decoration: none;
}

.blog > .list > .item > .url > .title {
  width: 75%;
  margin: 0;
  line-height: 1.75rem;
  color: var(--tx);
  transition: color ease-in-out 0.2s;
}

.blog > .list > .item:hover > .url > .title {
  color: var(--accent-tx);
}

.blog > .list .date {
  position: relative;
  top: 2px;
  width: 25%;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--tx-3);
  text-align: right;
  white-space: nowrap;
}

/* On a phone the date stays on one line and the title takes the rest. */
@media screen and (max-width: 567px) {
  .blog > .list > .item > .url > .title {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .blog > .list .date {
    flex: none;
    width: auto;
    padding-left: 1rem;
  }
}

.pagination {
  width: 95%;
  margin: 3rem auto 0;
  text-align: center;
}

/* Each page number is a full-size tap target. */
.pagination .nav-links > .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 44px;
  padding: 0 6px;
  box-sizing: border-box;
  font-size: 0.93em;
  line-height: 1.3125rem;
  color: var(--tx);
  vertical-align: middle;
}

.pagination .nav-links > .page-numbers:hover {
  color: var(--accent-tx);
}

.pagination .nav-links > .current,
.pagination .nav-links > .current:hover {
  color: var(--tx-3);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* Categories page */
hr.is-style-dots {
  height: auto;
  border: 0;
  line-height: 1;
  text-align: center;
}

hr.is-style-dots::before {
  content: "···";
  padding-left: 1em;
  color: var(--tx-3);
  font-size: 1.5em;
  letter-spacing: 1em;
}

.is-layout-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.is-layout-flex > li > a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--ui-2);
  border-radius: 5px;
  color: var(--tx);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.is-layout-flex > li > a:hover {
  background: var(--ui);
  border-color: var(--accent);
  color: var(--accent-tx);
}

/* ============================================================== 6. Post */

.post {
  margin-top: 225px;
}

@media screen and (max-width: 567px) {
  .post {
    margin-top: 140px;
  }
}

.post > .title {
  margin: 0 0 20px;
  line-height: 1.875rem;
  text-align: center;
}

.post > .meta {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 50px;
}

@media screen and (max-width: 567px) {
  .post > .meta {
    flex-direction: column;
  }
}

.post > .meta > .author-name {
  font-size: 0.9rem;
  /* The row keeps the 32px it had when a portrait sat beside the name, so the text below has not moved. */
  line-height: 2rem;
  color: var(--tx-3);
}

.post > .meta > .date {
  line-height: 1.3125rem;
  color: var(--tx-3);
}

.separator {
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.separator.spacer {
  margin: 0 30px;
}

@media screen and (max-width: 567px) {
  .separator.spacer {
    margin: 7px 0;
  }
}

.post .post-thumbnail {
  width: 100%;
  margin-bottom: 30px;
}

/* Links in running text are underlined so they do not rely on colour alone. */
.single-content-area p a,
.single-content-area li a,
.single-content-area cite a,
.post-nav-filed a {
  text-decoration: underline;
  text-decoration-color: var(--tx-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.single-content-area p a:hover,
.single-content-area li a:hover,
.single-content-area cite a:hover,
.post-nav-filed a:hover {
  text-decoration-color: currentColor;
}

.single-content-area ul * {
  line-height: 2rem;
}

/* A link to something elsewhere, set as a card. */
.link-card {
  display: block;
  max-width: 500px;
  margin: 1.5em auto;
  padding: 1.25em;
  background: var(--bg-2);
  border: 1px solid var(--ui-2);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--ui);
}

.link-card-source {
  margin-bottom: 0.5em;
  color: var(--tx-3);
  font-size: 0.75em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.link-card-title {
  margin: 0;
  color: var(--tx);
  font-size: 1.1em;
  line-height: 1.4;
}

.link-card:hover .link-card-title {
  color: var(--accent-tx);
}

.link-card:hover .link-card-source {
  color: var(--tx-2);
}

/* A photo in a circle. */
.is-style-rounded figure {
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 1em auto;
  overflow: hidden;
  border-radius: 50%;
}

.is-style-rounded figure img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  object-position: 50% 62%;
}

/* Players from elsewhere (a video, a track). Each is first shown as a still
   that links to the original; pressing it loads the real player in its place
   (navigation.js). Until then nothing is requested from the other site. */
.embed-poster {
  position: relative;
  display: block;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  background: var(--bg-2);
  text-decoration: none;
}

.embed-poster img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

/* A framed page keeps its see-through background only when the frame's colour
   scheme matches its own; without this the dark theme paints white behind it. */
.embed iframe {
  display: block;
  color-scheme: light;
}

.embed--video iframe {
  background: var(--bg-2);
}

.embed--video .embed-poster,
.embed--video iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* The play mark: a ring, like the ones the figures are drawn with. */
.embed-play {
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(16, 15, 15, 0.5);
  border: 1px solid rgba(255, 252, 240, 0.85);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.embed-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -5px;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent var(--flexoki-paper);
}

/* Two rules rather than one list: a browser that does not know :focus-visible
   would throw the whole list away and lose the hover state with it. */
.embed-poster:hover .embed-play {
  background: rgba(16, 15, 15, 0.7);
  border-color: var(--flexoki-orange-dark);
  transform: scale(1.06);
}

.embed-poster:focus-visible .embed-play {
  background: rgba(16, 15, 15, 0.7);
  border-color: var(--flexoki-orange-dark);
  transform: scale(1.06);
}

/* What will play, and where from: along the top, where the player itself
   puts its title, so a channel's mark in the corner of a still stays clear.
   The band behind the words is solid enough to read over any still. */
.embed-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  gap: 1.5em;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.9em 1.1em 2.6em;
  background: linear-gradient(to bottom, rgba(16, 15, 15, 0.86) 0, rgba(16, 15, 15, 0.86) 52%, rgba(16, 15, 15, 0) 100%);
  color: var(--flexoki-paper);
  font-size: 0.75em;
  line-height: 1.4;
  text-align: left;
}

.embed-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embed-source {
  flex: none;
  color: rgba(255, 252, 240, 0.72);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* A track: the cover, with its name underneath, in the shape of the player that replaces it. */
.embed--spotify {
  text-align: center;
}

.embed--spotify .embed-poster,
.embed--spotify iframe {
  width: 300px;
  max-width: 100%;
  height: 380px;
  margin: 0 auto;
}

/* Cover and play mark share one cell, so the mark is centred on the cover at any width. */
.embed--spotify .embed-poster {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 12px;
}

.embed--spotify .embed-poster img {
  grid-area: 1 / 1;
  height: auto;
  aspect-ratio: 1;
}

.embed--spotify .embed-play {
  position: relative;
  top: auto;
  left: auto;
  grid-area: 1 / 1;
  place-self: center;
  margin: 0;
}

.embed--spotify .embed-label {
  position: static;
  flex-direction: column;
  gap: 0.15em;
  align-items: flex-start;
  justify-content: center;
  padding: 0 1.4em;
  background: none;
  color: var(--tx);
  font-size: 0.85em;
}

.embed--spotify .embed-title {
  max-width: 100%;
}

.embed--spotify .embed-source {
  color: var(--tx-3);
  font-size: 0.85em;
}

@media screen and (max-width: 567px) {
  .embed {
    margin-left: 0;
    margin-right: 0;
  }
}

/* The foot of a post: where it is filed, and its neighbours. */
.post-nav {
  margin-top: 70px;
  font-size: 0.85em;
}

.post-nav-filed {
  margin: 0 0 18px;
  color: var(--tx-3);
}

.post-nav-filed a {
  color: var(--tx-3);
}

.post-nav-filed a:hover {
  color: var(--accent-tx);
}

.post-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-nav-links li {
  flex: 0 1 46%;
  min-width: 0;
}

.post-nav-newer {
  margin-left: auto;
  text-align: right;
}

/* On the narrowest phones two columns leave a few letters a line: stack them. */
@media screen and (max-width: 350px) {
  .post-nav-links {
    flex-direction: column;
    gap: 0;
  }

  .post-nav-newer {
    margin-left: 0;
    text-align: left;
  }
}

.post-nav-links a {
  display: block;
  padding: 8px 0;
  line-height: 1.5;
}

.post-nav-label {
  display: block;
  color: var(--tx-3);
}

.post-nav-title {
  color: var(--tx-2);
  transition: color ease-in-out 0.2s;
}

.post-nav-links a:hover .post-nav-title {
  color: var(--accent-tx);
}

/* ======================================================= 7. Transitions */

/* Pages and themes change with a circle reveal driven from navigation.js;
   the default cross-fade is switched off. */
::view-transition {
  position: fixed;
  inset: 0;
}

::view-transition-old(root),
::view-transition-new(root) {
  position: fixed;
  inset: 0;
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 0;
}

::view-transition-new(root) {
  z-index: 1;
}

/* Nothing else may animate while a snapshot is being revealed. */
html.view-transitioning *,
html.view-transitioning *::before,
html.view-transitioning *::after {
  transition: none !important;
}

html.view-transitioning .nav-pill-theme svg,
html.view-transitioning .nav-pill-theme:hover svg {
  fill: var(--tx);
  transform: none;
}

html.view-transitioning .nav-pill {
  border-color: var(--ui-2);
}

/* ======================================================= 8. Preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root,
  [data-theme] {
    --bg: #fff;
    --bg-2: #fff;
    --ui: #bbb;
    --ui-2: #bbb;
    --tx: #000;
    --tx-2: #111;
    --tx-3: #444;
    --accent: #000;
    --accent-tx: #000;
    --rule: #bbb;
  }

  .skip-link,
  .nav-pill,
  .mg-fig,
  .embed-poster img,
  .embed-play,
  .embed iframe,
  .pagination,
  .post-nav,
  .footer-main {
    display: none !important;
  }

  /* A player prints as its name and address. */
  .embed-poster,
  .embed-label,
  .embed--spotify .embed-label {
    position: static;
    display: block;
    width: auto !important;
    height: auto !important;
    aspect-ratio: auto !important;
    padding: 0;
    background: none;
    color: #000;
    font-size: 1em;
    text-align: left;
  }

  .embed-title {
    white-space: normal;
  }

  .embed-source {
    color: #444 !important;
  }

  .page,
  .post {
    margin-top: 0;
  }

  .single-content-area a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }
}

/* Forced colours (Windows High Contrast): the system picks the palette, so
   anything drawn with a fill or a transparent border is restated in its terms. */
@media (forced-colors: active) {
  .nav-pill-back svg,
  .nav-pill-theme svg {
    fill: CanvasText;
  }

  .embed-play {
    background: Canvas;
    border-color: CanvasText;
  }

  .embed-play::before {
    forced-color-adjust: none;
    border-color: transparent transparent transparent CanvasText;
  }
}
