/* grantrindal.dev
 *
 * One typeface, one accent, true black. Everything that is not the hero is
 * deliberately quiet.
 *
 * The accent is the same pigment the hero generates Mars from, so the planet
 * above and every rule below it read as one system rather than a scene with a
 * website underneath it.
 *
 * No inline styles anywhere in the markup: the CSP forbids them, including
 * style attributes, so SVG diagrams are coloured with classes and presentation
 * attributes only.
 */

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

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg: #000000;
  --fg: #ede7dd;
  --fg-dim: #9a9081;
  --accent: #ee7038;
  --accent-deep: #8a3a14;
  --hairline: #1f1c18;
  --hairline-lit: #3a342c;
  --tint: rgba(238, 112, 56, 0.07);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 0.6875rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.375rem;
  --t-xl: 1.75rem;

  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;
  --s7: 7rem;

  --measure: 64ch;
  --shell: 68rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  /* clip rather than hidden: hidden would make this a scroll container and
   * break position: sticky elsewhere. */
  overflow-x: clip;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-lit) var(--bg);
}

/* Firefox takes the two properties above. This is the same thing for the
 * WebKit and Blink side, which ignores them. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--hairline-lit);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-deep);
}

body {
  margin: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--t-base);
  line-height: 1.7;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

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

::selection {
  background: var(--accent);
  color: #000;
}

/* -------------------------------------------------------------- helpers -- */

.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--s2);
  top: -4rem;
  z-index: 30;
  padding: var(--s1) var(--s2);
  background: var(--bg);
  border: 1px solid var(--accent);
  text-decoration: none;
  transition: top 120ms var(--ease);
}

.skip:focus {
  top: var(--s2);
}

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

.label {
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ---------------------------------------------------------------- scene -- */

/* Fixed behind everything. The sections below the hero paint opaque black over
 * it, which is why the transition to the work list has no seam. */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.scene__canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Star callout: a box on the star, a leader out to a card. Drawn in the DOM
 * rather than the canvas so the text stays crisp, since the canvas renders at
 * four CSS pixels per pixel and any label on it would be unreadable.
 *
 * Positions are set from JS through the CSSOM, which CSP allows. What CSP
 * blocks is style attributes in parsed markup, not programmatic style. */
.probe {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.probe__ring {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 1px solid var(--accent);
}

/* Four corner ticks rather than a solid box, so a faint star is not swallowed
 * by its own marker. */
.probe__ring::before,
.probe__ring::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--bg);
}

.probe__ring::after {
  inset: 3px;
  border: 0;
  box-shadow: 0 0 0 1px rgba(238, 112, 56, 0.35);
}

.probe__leader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.probe__line {
  stroke: var(--accent);
  stroke-width: 1;
}

.probe__card {
  position: absolute;
  min-width: 13rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--accent);
  background: rgba(0, 0, 0, 0.86);
  font-size: var(--t-xs);
  line-height: 1.6;
}

.probe__name {
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--hairline-lit);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.probe__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  color: var(--fg);
}

.probe__key {
  color: var(--fg-dim);
  letter-spacing: 0.08em;
}

/* Always on its own row, so the destination sits in the same place on every
 * card instead of wrapping only when the repo name happens to be long.
 *
 * The break rule is not cosmetic. Gecko treats a slash as a break opportunity
 * when it measures min-content; Blink and WebKit do not, so there the whole
 * `github.com/grindlewalt/Projector-Mapping-Universe` run became the floor for
 * the column that holds it and pushed the page sideways below 340px. Letting it
 * break anywhere removes the floor. */
.entry__repo {
  flex-basis: 100%;
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  overflow-wrap: anywhere;
}

.entry:hover .entry__repo,
.entry:focus-visible .entry__repo {
  color: var(--accent);
}

/* The catalog is CC BY-SA, so attribution lives in the footer where it does not
 * depend on JS, on hover, or on the scene rendering at all. */
.footer__src {
  color: #6f675c;
}

.footer__src a {
  color: var(--fg-dim);
}

/* ----------------------------------------------------------------- page -- */

.page {
  position: relative;
  z-index: 1;
}

/* Plain viewport height. A sticky hero gave the transition more scroll distance
 * but made the page feel stuck: you scrolled, nothing moved, then the sky went.
 * Scrolling the hero away normally and fading the scene in step with it is the
 * behaviour people expect. */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  background: transparent;
}

.hero__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: var(--s6) var(--s3) var(--s3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s4);
}

/* --------------------------------------------------------------- header -- */

.wordmark {
  margin: 0;
  font-weight: 400;
}

/* The block glyph is exactly 0.6em wide and 1.32em tall, so rows at
 * line-height 1 overlap and never gap. Columns are the problem: at a
 * fractional advance width the rasteriser leaves a hairline seam between
 * neighbouring blocks. A small negative tracking overlaps them just enough to
 * close it, and applies evenly so the grid stays square. Measured at -0.012em
 * seams were still visible, -0.025em was clean. */
/* The padding is what keeps the last row whole. At line-height 1 the block
 * glyphs paint a couple of pixels past the em box they are allotted, so the
 * min-height below lands exactly on the ink and overflow: hidden shaves the
 * bottom of the final row. Measured at 3px in Blink and Gecko; visible in all
 * three engines. A quarter em is enough at every size the clamp produces, and
 * costs nothing else since the box is sized by min-height anyway. */
.wordmark__art {
  font-family: var(--mono);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
  white-space: pre;
  overflow: hidden;
  padding-bottom: 0.25em;
}

/* 45 and 29 columns. Half block letterforms are seven rows instead of eleven,
 * so the type can be larger and still leave the scene room to breathe. */
.wordmark__art--wide {
  font-size: clamp(0.5rem, 1.62vw, 1.15rem);
  min-height: 13em;
}

.wordmark__art--narrow {
  display: none;
  font-size: clamp(0.6rem, 5.2vw, 1.25rem);
  min-height: 7em;
}

/* Rows print in sequence, then the summary reveals word by word.
 *
 * Done in CSS rather than JS on purpose: there is no frame where the finished
 * text exists but is hidden, it costs nothing in the JS budget, and it still
 * works with scripting disabled. Words are revealed, never inserted, so the
 * paragraph occupies its final box from the first paint and nothing reflows. */
.wordmark__art > span {
  display: block;
  opacity: 0;
  animation: reveal 1ms linear forwards;
}

.hero__summary {
  max-width: 52ch;
  font-size: var(--t-md);
  line-height: 1.65;
  color: var(--fg);
}

.hero__summary .w {
  opacity: 0;
  animation: reveal 1ms linear forwards;
}

@keyframes reveal {
  to { opacity: 1; }
}

.wordmark__art > span:nth-child(1) { animation-delay: 26ms; }
.wordmark__art > span:nth-child(2) { animation-delay: 52ms; }
.wordmark__art > span:nth-child(3) { animation-delay: 78ms; }
.wordmark__art > span:nth-child(4) { animation-delay: 104ms; }
.wordmark__art > span:nth-child(5) { animation-delay: 130ms; }
.wordmark__art > span:nth-child(6) { animation-delay: 156ms; }
.wordmark__art > span:nth-child(7) { animation-delay: 182ms; }
.wordmark__art > span:nth-child(8) { animation-delay: 208ms; }
.wordmark__art > span:nth-child(9) { animation-delay: 234ms; }
.wordmark__art > span:nth-child(10) { animation-delay: 260ms; }
.wordmark__art > span:nth-child(11) { animation-delay: 286ms; }
.wordmark__art > span:nth-child(12) { animation-delay: 312ms; }
.wordmark__art > span:nth-child(13) { animation-delay: 338ms; }

.hero__summary .w:nth-child(1) { animation-delay: 373ms; }
.hero__summary .w:nth-child(2) { animation-delay: 386ms; }
.hero__summary .w:nth-child(3) { animation-delay: 399ms; }
.hero__summary .w:nth-child(4) { animation-delay: 412ms; }
.hero__summary .w:nth-child(5) { animation-delay: 425ms; }
.hero__summary .w:nth-child(6) { animation-delay: 438ms; }
.hero__summary .w:nth-child(7) { animation-delay: 451ms; }
.hero__summary .w:nth-child(8) { animation-delay: 464ms; }
.hero__summary .w:nth-child(9) { animation-delay: 477ms; }
.hero__summary .w:nth-child(10) { animation-delay: 490ms; }
.hero__summary .w:nth-child(11) { animation-delay: 503ms; }
.hero__summary .w:nth-child(12) { animation-delay: 516ms; }
.hero__summary .w:nth-child(13) { animation-delay: 529ms; }
.hero__summary .w:nth-child(14) { animation-delay: 542ms; }
.hero__summary .w:nth-child(15) { animation-delay: 555ms; }
.hero__summary .w:nth-child(16) { animation-delay: 568ms; }
.hero__summary .w:nth-child(17) { animation-delay: 581ms; }
.hero__summary .w:nth-child(18) { animation-delay: 594ms; }
.hero__summary .w:nth-child(19) { animation-delay: 607ms; }
.hero__summary .w:nth-child(20) { animation-delay: 620ms; }
.hero__summary .w:nth-child(21) { animation-delay: 633ms; }
.hero__summary .w:nth-child(22) { animation-delay: 646ms; }
.hero__summary .w:nth-child(23) { animation-delay: 659ms; }
.hero__summary .w:nth-child(24) { animation-delay: 672ms; }
.hero__summary .w:nth-child(25) { animation-delay: 685ms; }
.hero__summary .w:nth-child(26) { animation-delay: 698ms; }
.hero__summary .w:nth-child(27) { animation-delay: 711ms; }
.hero__summary .w:nth-child(28) { animation-delay: 724ms; }
.hero__summary .w:nth-child(29) { animation-delay: 737ms; }
.hero__summary .w:nth-child(30) { animation-delay: 750ms; }
.hero__summary .w:nth-child(31) { animation-delay: 763ms; }
.hero__summary .w:nth-child(32) { animation-delay: 776ms; }
.hero__summary .w:nth-child(33) { animation-delay: 789ms; }
.hero__summary .w:nth-child(34) { animation-delay: 802ms; }
.hero__summary .w:nth-child(35) { animation-delay: 815ms; }
.hero__summary .w:nth-child(n + 36) { animation-delay: 815ms; }

/* ------------------------------------------------------------- contacts -- */

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* The email item holds the address and its copy control as one pair. */
.contact li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

/* Keycap mechanic: it sits on a 2px ledge, lifts when hovered, presses flat
 * when clicked. */
/* The [hidden] rule has to be here rather than left to the UA sheet. An author
 * display declaration outranks it, so without this the email keycap and its
 * copy button paint anyway when scripting is off, as an empty button and a
 * control that cannot do anything, right next to the noscript address. */
.contact__link[hidden] {
  display: none;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--hairline-lit);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 2px 0 var(--hairline-lit);
  color: var(--fg);
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease),
    border-color 120ms var(--ease), background-color 120ms var(--ease);
}

.contact__link:hover,
.contact__link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--tint);
  box-shadow: 0 4px 0 var(--accent-deep);
}

.contact__link:active {
  transform: translateY(0);
  box-shadow: 0 0 0 var(--accent-deep);
}

.contact__link .glyph {
  color: var(--accent);
}

.contact__copy {
  font: inherit;
  cursor: pointer;
}

.contact__note {
  font-size: var(--t-xs);
  color: var(--fg-dim);
}

.hero__cue {
  padding: 0 var(--s3) var(--s4);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-align: center;
}

.hero__cue span {
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--accent);
  animation: nudge 2.6s var(--ease) infinite;
}

@keyframes nudge {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(3px); }
}

/* ----------------------------------------------------------- below fold -- */

/* Opaque, so the scene is covered no matter what the canvas is doing. */
.slab {
  position: relative;
  z-index: 1;
  background: var(--bg);
}

.section {
  padding-block: var(--s7) var(--s6);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s4);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--hairline);
}

.section__title {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__count {
  font-size: var(--t-xs);
  color: var(--fg-dim);
  letter-spacing: 0.16em;
}

/* -------------------------------------------------------------- entries -- */

.entries {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

/* minmax(0, 1fr) rather than 1fr: a grid item's automatic minimum size is its
 * min-content, so a plain 1fr track cannot shrink below the widest thing in it.
 * The repo URL made that floor wider than the screen on narrow phones. */
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0 var(--s2);
  padding: var(--s3);
  border: 1px solid var(--hairline);
  text-decoration: none;
  transition: transform 120ms var(--ease), border-color 120ms var(--ease),
    background-color 120ms var(--ease);
}

/* The rail. Absolutely placed so thickening it costs no layout. */
.entry::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 140ms var(--ease);
}

.entry:hover,
.entry:focus-visible {
  transform: translateX(6px);
  border-color: var(--hairline-lit);
  background: var(--tint);
}

.entry:hover::before,
.entry:focus-visible::before {
  transform: scaleX(1);
}

.entry:active {
  transform: translateX(4px);
}

.entry__index {
  grid-row: 1 / span 3;
  font-size: var(--t-sm);
  color: var(--fg-dim);
  letter-spacing: 0.08em;
}

.entry__name {
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.entry:hover .entry__name,
.entry:focus-visible .entry__name {
  color: var(--accent);
}

.entry__summary {
  grid-column: 2;
  max-width: 58ch;
  margin-top: 0.35rem;
  color: var(--fg-dim);
  font-size: var(--t-sm);
  line-height: 1.65;
}

.entry__foot {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  margin-top: var(--s2);
}

.entry__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--t-xs);
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}

.entry__tech li {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--hairline);
  color: var(--fg-dim);
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

/* The one place the single-accent rule is broken on purpose.
 *
 * At rest every tag is the same dim grey, so the list reads as one quiet block
 * and the page still has exactly one accent. The colours only exist on hover,
 * where they are doing a job: telling four otherwise identical rows apart at a
 * glance, and letting someone scanning for "Java" or "React" find it by shape
 * rather than by reading. Values are muted versions of each technology's own
 * mark, and every one clears 6.4:1 on black.
 *
 * The fallback is set on .entries, not on the tag: a single class selector like
 * .t-python loses to `.entry__tech li`, so putting the default there beat every
 * colour and the tags stayed grey. */
.entry:hover .entry__tech li,
.entry:focus-visible .entry__tech li {
  color: var(--tech);
  border-color: var(--hairline-lit);
}

.entries { --tech: var(--fg-dim); }

.t-python   { --tech: #6ea8dc; }
.t-fastapi  { --tech: #4db6a4; }
.t-sqlite   { --tech: #7fb3c8; }
.t-react    { --tech: #61c7e0; }
.t-kvm      { --tech: #b48ead; }
.t-electron { --tech: #6d9dc5; }
.t-webgl    { --tech: #c47f7f; }
.t-js       { --tech: #d4c060; }
.t-java     { --tech: #d08a5a; }
.t-wpilib   { --tech: #8b9dd6; }
.t-choreo   { --tech: #a88ad6; }
.t-git      { --tech: #d0765e; }
.t-flipper  { --tech: #d99a5e; }
.t-ducky    { --tech: #b0a35e; }
.t-hid      { --tech: #7fa8d6; }

.entry__arrow {
  grid-column: 3;
  grid-row: 1;
  color: var(--fg-dim);
  transition: transform 140ms var(--ease), color 140ms var(--ease);
}

.entry:hover .entry__arrow,
.entry:focus-visible .entry__arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* Status is carried by a fill level rather than a second colour, because the
 * design has exactly one accent and traffic lights would break that. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.status__fill {
  color: var(--accent);
  letter-spacing: -0.1em;
}

/* --------------------------------------------------------------- stack -- */

.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.stack__cell {
  padding: var(--s3);
  background: var(--bg);
}

.stack__key {
  margin-bottom: 0.4rem;
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.stack__val {
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--fg-dim);
}

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

.footer {
  position: relative;
  z-index: 1;
  padding-block: var(--s4) var(--s5);
  border-top: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--fg-dim);
  font-size: var(--t-sm);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
}

/* -------------------------------------------------------- project pages -- */

.topbar {
  position: relative;
  z-index: 1;
  padding-block: var(--s3);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--t-sm);
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 120ms var(--ease);
}

.backlink .glyph {
  transition: transform 140ms var(--ease);
}

.backlink:hover,
.backlink:focus-visible {
  color: var(--accent);
}

.backlink:hover .glyph {
  transform: translateX(-4px);
}

.doc {
  padding-block: var(--s6) var(--s7);
}

.doc__head {
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--hairline);
}

.doc__title {
  margin-bottom: var(--s2);
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  align-items: center;
}

.doc__section {
  padding-top: var(--s5);
}

.doc__h {
  margin-bottom: var(--s3);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc__h::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin-bottom: var(--s2);
  background: var(--accent);
}

.prose {
  max-width: var(--measure);
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: var(--s3);
  line-height: 1.75;
}

.prose p {
  color: var(--fg);
}

.prose li {
  position: relative;
  margin-bottom: 0.6rem;
  padding-left: 1.4rem;
  color: var(--fg);
}

.prose li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.prose strong {
  font-weight: 700;
  color: var(--fg);
}

.prose code {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9em;
  color: var(--accent);
}

.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* The gap callout. Deliberately loud, because naming the unfixed thing is the
 * point of these pages. */
.callout {
  max-width: var(--measure);
  margin-bottom: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--accent-deep);
  border-left: 2px solid var(--accent);
  background: var(--tint);
}

.callout__key {
  margin-bottom: 0.5rem;
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.callout p {
  margin: 0;
  font-size: var(--t-sm);
  line-height: 1.7;
}

.figure {
  max-width: 100%;
  margin-bottom: var(--s3);
  border: 1px solid var(--hairline);
}

.figure__frame {
  overflow-x: auto;
  padding: var(--s3);
}

.figure svg {
  display: block;
  min-width: 30rem;
  height: auto;
}

.figure figcaption {
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-xs);
  line-height: 1.65;
  color: var(--fg-dim);
}

/* Diagram palette, applied by class because CSP blocks style attributes. */
.d-line { stroke: var(--hairline-lit); fill: none; stroke-width: 1; }
.d-line-a { stroke: var(--accent); fill: none; stroke-width: 1.5; }
.d-dash { stroke: var(--accent-deep); fill: none; stroke-width: 1; stroke-dasharray: 4 4; }
.d-box { fill: #0a0908; stroke: var(--hairline-lit); stroke-width: 1; }
.d-box-a { fill: rgba(238, 112, 56, 0.08); stroke: var(--accent); stroke-width: 1; }
.d-zone { fill: rgba(255, 255, 255, 0.02); stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 3 3; }
.d-t { fill: var(--fg); font-family: var(--mono); font-size: 11px; }
.d-t-dim { fill: var(--fg-dim); font-family: var(--mono); font-size: 10px; }
.d-t-a { fill: var(--accent); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.d-fill-a { fill: var(--accent); }
.d-fill-dim { fill: var(--fg-dim); }

/* Same URL, same floor: inline-flex will not shrink below the run inside it. */
.repo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--s2);
  padding: 0.6rem 1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--hairline-lit);
  box-shadow: 0 2px 0 var(--hairline-lit);
  font-size: var(--t-sm);
  text-decoration: none;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease),
    border-color 120ms var(--ease), background-color 120ms var(--ease);
}

.repo:hover,
.repo:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--tint);
  box-shadow: 0 4px 0 var(--accent-deep);
}

.repo:active {
  transform: translateY(0);
  box-shadow: 0 0 0 var(--accent-deep);
}

/* --------------------------------------------------------------- toggle -- */

.motion {
  position: fixed;
  right: var(--s2);
  bottom: var(--s2);
  z-index: 20;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--hairline-lit);
  background: rgba(0, 0, 0, 0.8);
  color: var(--fg-dim);
  font: inherit;
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}

.motion:hover,
.motion:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 46rem) {
  :root {
    --s6: 3rem;
    --s7: 4rem;
  }

  .wordmark__art--wide { display: none; }
  .wordmark__art--narrow { display: block; }

  .hero__inner { gap: var(--s3); }
  .hero__summary { font-size: var(--t-base); }

  .entry {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    padding: var(--s2);
  }

  .entry__arrow { display: none; }

  /* The star callout is a hover affordance and touch has no hover. */
  .probe { display: none; }
}

@media (max-width: 30rem) {
  .shell { padding-inline: var(--s2); }
  .hero__inner { padding-inline: var(--s2); }
  .contact { gap: var(--s1); }
  .contact__link { padding: 0.5rem 0.7rem; }
}

/* Short viewports: the wordmark is the first thing to give, not the copy. */
@media (max-height: 44rem) {
  .wordmark__art--wide { font-size: clamp(0.45rem, 1.2vw, 0.8rem); }
  .hero__inner { gap: var(--s3); padding-top: var(--s5); }
  .hero__cue { display: none; }
}

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

/* Finished state immediately, never a degraded animation. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    /* Zeroing the delay too, otherwise the staggered reveal would still hold
     * the text invisible for a second before snapping in. */
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .wordmark__art > span,
  .hero__summary .w {
    opacity: 1;
    animation: none;
  }

  .entry:hover,
  .entry:focus-visible,
  .entry:active { transform: none; }

  .contact__link:hover,
  .contact__link:focus-visible,
  .repo:hover,
  .repo:focus-visible { transform: none; }

  .hero__cue span { animation: none; }
}

/* Same, but driven by the in-page toggle rather than the OS setting. */
.still .wordmark__art > span,
.still .hero__summary .w {
  opacity: 1;
  animation: none;
}

.still .entry:hover,
.still .entry:focus-visible,
.still .entry:active,
.still .contact__link:hover,
.still .contact__link:focus-visible,
.still .repo:hover,
.still .repo:focus-visible {
  transform: none;
}

.still .hero__cue span {
  animation: none;
}
