/* Mission control: a ship's console. Palette, type and layout follow
   design/directions-dark.html (D). The fonts are self-hosted: fonts.css. */
:root {
  --hull: #0D1322; --panel: #131B2E; --panel-hi: #18223A; --well: #070B15;
  --line: #24314D; --line-hi: #34466B;
  --ice: #8BE4F2; --ice-deep: #5CC7D9; --amber: #FFB547;
  --white: #F4F7FC; --text: #C9D3E6; --dim: #8090B0;
  --ff-head: "Oxanium", "Segoe UI", system-ui, sans-serif;
  --ff-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;
  --measure: 40rem;
}
/* ferropress's islands (comments, search) inherit this page's font and text colour and read
   --fp-* properties for the rest (ferropress docs/islands.md). Ratios are against the page (--hull):
   muted text 5.8:1; field borders 4.1:1 (3:1 needed); the button's hull label on ice 12.8:1, on
   white when hovered 17.3:1; the ice focus ring 12.8:1; errors 8.1:1. */
#fp-comments, #fp-search, [data-fp-island] {
  --fp-muted: var(--dim); --fp-border: #62769E; --fp-surface: var(--well); --fp-surface-2: var(--panel);
  --fp-accent: var(--ice); --fp-on-accent: var(--hull); --fp-accent-hover: var(--white);
  --fp-on-accent-hover: var(--hull); --fp-danger: #FF8A80; --fp-radius: 0;
}
#fp-comments h2, #fp-comments h3 { font-family: var(--ff-head); color: var(--white); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--hull); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--ff-body);
  font-size: 18px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  background: var(--hull);
  background-image: repeating-linear-gradient(0deg, rgba(139,228,242,.025) 0 1px, transparent 1px 3px);
}
a { color: var(--ice); text-underline-offset: 3px; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
::selection { background: var(--ice); color: var(--hull); }
.gauge { width: 100%; max-width: 52rem; margin: 0 auto; padding: 0 1.5rem; }
.skip { position: absolute; left: -999px; top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 1rem; top: .6rem; z-index: 60; background: var(--ice); color: var(--hull);
  padding: .5rem .8rem; font-family: var(--ff-head); font-weight: 600; }

/* Draft preview banner (signed-in preview of an unpublished entry only) */
.preview-bar { position: sticky; top: 0; z-index: 70; display: flex; flex-wrap: wrap; gap: .8rem;
  align-items: center; justify-content: center; padding: .5rem 1rem; background: var(--amber);
  color: var(--hull); font-family: var(--ff-mono); font-size: .8rem; }
.preview-bar__tag { font-weight: 500; border: 1px solid var(--hull); padding: .05rem .45rem; }

/* Header: call sign, tagline, navigation */
.console { border-bottom: 1px solid var(--line); }
.console__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; padding-top: 1.6rem; padding-bottom: 1.1rem; }
.callsign { display: inline-block; font-family: var(--ff-head); font-weight: 700; font-size: 1.3rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--white); text-decoration: none; line-height: 1.2; }
.callsign:hover { color: var(--ice); }
.callsign--logo img { display: block; max-height: 3rem; width: auto; max-width: min(100%, 18rem); }
.callsign__tag { display: block; margin-top: .15rem; font-family: var(--ff-head); font-size: .85rem;
  letter-spacing: .04em; color: var(--ice); }
.mastnav { display: flex; align-items: center; gap: 1.5rem; }
.mastnav a, .navtree__label { font-family: var(--ff-head); font-size: .95rem; color: var(--dim);
  text-decoration: none; padding: .2rem 0; }
.mastnav a:hover, .mastnav a[aria-current="page"] { color: var(--ice); }
.mastnav a[aria-current="page"] { box-shadow: 0 2px 0 var(--ice); }
.navtree { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.navtree li { position: relative; display: inline-flex; align-items: center; gap: .1rem; }
button.navtree__label { border: 0; background: none; cursor: pointer; }
/* Submenu disclosure (APG Disclosure Navigation); >=24px hit target. */
.navsub-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 24px;
  min-height: 24px; padding: 0; background: none; border: 0; color: var(--dim); cursor: pointer; }
.navsub-toggle:hover { color: var(--ice); }
.navsub-toggle svg { transition: transform .15s; }
.navsub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.mastnav .navtree .navtree { position: absolute; top: 100%; right: 0; z-index: 50; display: none;
  flex-direction: column; align-items: flex-start; gap: .6rem; min-width: 11rem; margin-top: .5rem;
  padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line-hi); }
html:not(.fp-js) .mastnav .navtree li:hover > .navtree,
html:not(.fp-js) .mastnav .navtree li:focus-within > .navtree { display: flex; }
.mastnav .navtree li > .navsub-toggle[aria-expanded="true"] + .navtree { display: flex; }
#fp-search:not(:empty) { display: inline-flex; }

/* Readout under the header: the latest entry's date (the feed link is in the footer) */
.readout { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: -1.2rem 0 2.2rem;
  font-family: var(--ff-mono); font-size: .8rem; color: var(--dim); }
.readout b { color: var(--amber); font-weight: 500; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: .5rem; vertical-align: 1px;
  border-radius: 50%; background: var(--ice); box-shadow: 0 0 8px var(--ice); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

main { padding: 0 0 3rem; }
main > .gauge { padding-top: 2.4rem; }

/* Panels: a framed console block with corner brackets */
.panel { position: relative; background: var(--panel); padding: 1.3rem 1.6rem; }
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px;
  border: 0 solid var(--ice); pointer-events: none; }
.panel::before { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.panel::after { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

/* Stamp: date (amber) and categories, in mono */
.stamp { margin: 0; font-family: var(--ff-mono); font-size: .8rem; color: var(--dim); }
.stamp b { color: var(--amber); font-weight: 500; }
.stamp a { color: var(--dim); text-decoration: none; }
.stamp a:hover { color: var(--ice); }
.stamp__sep { color: var(--line-hi); margin: 0 .5rem; }

/* Tags */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 0; padding: 0; }
.chip { display: inline-block; font-family: var(--ff-mono); font-size: .75rem; color: var(--ice-deep);
  text-decoration: none; padding: .1rem .55rem; border: 1px solid var(--line-hi); }
.chip:hover { color: var(--hull); background: var(--ice); border-color: var(--ice); }

/* The log: entries on the home page and on category/tag archives */
.archive-head { margin: 0 0 2rem; }
.archive-head__count { margin: 0 0 .3rem; font-family: var(--ff-mono); font-size: .8rem; color: var(--dim); }
.archive-head__title { margin: 0; font-family: var(--ff-head); font-weight: 700; font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15; color: var(--white); }
.archive-head__desc { margin: .6rem 0 0; max-width: var(--measure); color: var(--text); }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.entry--figure { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: 1.4rem; align-items: start; }
.entry__title { margin: .3rem 0 .4rem; font-family: var(--ff-head); font-weight: 600; font-size: 1.45rem; line-height: 1.25; }
.entry__title a { color: var(--white); text-decoration: none; }
.entry__title a:hover { color: var(--ice); }
.entry__excerpt { margin: 0; font-size: 1.02rem; }
.entry__thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line-hi); }
.entry__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.entry--full { padding: 1.8rem 2rem; }
.entry--full .entry__title { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; margin: .4rem 0 1.1rem; }
.entry--full .figure { margin-bottom: 1.4rem; }
.entry--full .body { max-width: var(--measure); }
.entry--full .chips { margin-top: 1.2rem; }
.entry__more { display: inline-block; margin-top: 1rem; font-family: var(--ff-head); font-weight: 600;
  font-size: .95rem; color: var(--ice); text-decoration: none; }
.entry__more:hover { color: var(--white); }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line); font-family: var(--ff-head); font-size: .95rem; }
.pager a { color: var(--ice); text-decoration: none; }
.pager a:hover { color: var(--white); }
.pager .spent { color: var(--dim); }
.empty { padding: 2.5rem 1.6rem; font-family: var(--ff-mono); font-size: .9rem; color: var(--dim); }

/* A single entry */
.article { max-width: var(--measure); }
.article--wide { max-width: none; }
.article__head { margin-bottom: 2rem; }
.article__title { margin: .5rem 0 0; font-family: var(--ff-head); font-weight: 700; font-size: clamp(2rem, 5.5vw, 2.7rem);
  line-height: 1.12; color: var(--white); }
.figure { margin: 0 0 2rem; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line-hi); }
.article__foot { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }

/* Post body, as ferropress renders it */
.body > :first-child { margin-top: 0; }
.body h2, .body h3, .body h4 { font-family: var(--ff-head); color: var(--white); line-height: 1.25; }
.body h2 { font-size: 1.55rem; font-weight: 600; margin: 2.4rem 0 .7rem; }
.body h3 { font-size: 1.25rem; font-weight: 600; margin: 1.9rem 0 .5rem; }
.body h4 { font-size: 1.05rem; font-weight: 600; margin: 1.6rem 0 .4rem; }
.body p { margin: 0 0 1.15rem; }
.body strong { color: var(--white); }
.body ul, .body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.body li { margin-bottom: .35rem; }
.body li > p { margin: 0; }
.body li::marker { color: var(--ice); }
.body blockquote { margin: 1.8rem 0; padding: .9rem 1.3rem; background: var(--panel); border-left: 2px solid var(--amber);
  color: var(--white); font-style: italic; }
.body blockquote p:last-child { margin-bottom: 0; }
/* Code shows the characters as typed: JetBrains Mono's ligatures would merge "==", "--", "->"
   and the like into single glyphs, which misleads anyone copying code and breaks ASCII art. */
.body code { font-family: var(--ff-mono); font-size: .86em; color: var(--ice); background: var(--well);
  border: 1px solid var(--line); padding: .05em .35em; font-variant-ligatures: none; }
.body pre { margin: 0 0 1.4rem; padding: 1rem 1.2rem; overflow: auto; background: var(--well);
  border: 1px solid var(--line); font-size: .86rem; line-height: 1.6; }
.body pre code { padding: 0; border: 0; background: none; color: var(--ice); }
/* ASCII art: a code block whose language is "ascii-art" (ferropress renders it as
   class="language-ascii-art"). Rows touch (line-height 1) so a picture keeps its shape, and the
   type shrinks so up to 100 columns fit wherever the block sits (a page, a full entry in a
   listing, a phone): 100 columns of a 0.6em-wide mono glyph are 60em, so the size is the block's
   own content width (100cqi, the pre being the size container) over 60, and at most .62rem.
   Render art for a cell 0.6 wide by 1 tall. */
.body pre:has(> code.language-ascii-art) { container-type: inline-size; }
.body pre code.language-ascii-art { display: block; line-height: 1;
  font-size: min(.62rem, calc(100cqi / 60)); }
.body img { max-width: 100%; height: auto; }
.body figure { margin: 1.8rem 0; }
.body figure img { display: block; border: 1px solid var(--line-hi); }
.body figcaption { margin-top: .5rem; font-family: var(--ff-mono); font-size: .78rem; color: var(--dim); }
.body hr { border: 0; height: 1px; margin: 2.4rem 0; background: var(--line); }
.body table { width: 100%; margin: 0 0 1.4rem; border-collapse: collapse; font-size: .95rem; }
.body th, .body td { padding: .5rem .7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.body th { font-family: var(--ff-head); font-weight: 600; color: var(--white); background: var(--panel); }
.body .fp-embed { margin: 1.8rem 0; }
.body .fp-embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 1px solid var(--line-hi); }

/* Footer */
.colophon { margin-top: 2rem; border-top: 1px solid var(--line); }
.colophon__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; padding-top: 1.5rem; padding-bottom: 2.5rem; font-family: var(--ff-mono); font-size: .8rem; color: var(--dim); }
.colophon a { color: var(--dim); text-decoration: none; }
.colophon a:hover { color: var(--ice); }
/* The footer menu, if any, then the feed link, which is always there */
.colophon__links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.3rem; }
.colophon .navtree { gap: 1.3rem; }
.colophon .navtree .navtree { gap: .6rem; }
.colophon .navtree__label { font-family: var(--ff-mono); font-size: .8rem; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .panel, .entry--full { padding: 1.1rem 1.15rem; }
  .entry--figure { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .entry__thumb { order: -1; }
  .mastnav, .navtree { gap: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  * { transition: none !important; }
}
