/* ryanclinton.uk. Tokens and rules from site-spec.md section 5; motion from section 8. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* Fallbacks sized to the web fonts, so the swap doesn't move the page */
@font-face { font-family: "Archivo fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 88%; descent-override: 21%; }
@font-face { font-family: "Plex fallback"; src: local("Arial"); size-adjust: 101%; ascent-override: 102%; descent-override: 27%; }

:root {
  --sky: #0b0e14;
  --sky-deep: #06080c;
  --panel: #131824;
  --panel-raised: #1a2131;
  --line: #253047;
  --text: #d9dee8;
  --text-dim: #8b95a8;
  --link: #9cc4ff;
  --accent: #4d9fff;
  --amber: #ffb547;
  --kind-observation: #7fb2ff;
  --kind-build: #f0b35c;
  --kind-mod: #8fd6a4;
  --kind-story: #d9a6e8;
  --kind-note: #7cc9c1;
  --proven: #8fd6a4;
  --partly: #ffb547;
  --not-yet: #8b95a8;

  --display: "Archivo", "Archivo fallback", system-ui, sans-serif;
  --body: "Plex Sans", "Plex fallback", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 46rem;
  --wide: 76rem;
  --gutter: 1rem;
  --radius: 12px;
  --raise: 0 10px 30px rgb(0 0 0 / .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 2rem; } }

/* Every page is the warm room from the films (references/NOTES.md, Ryan 18 Oct 2026); only the dark
   tokens above remain for the terminal and the photographs' own frames */
body.home, body.reading, body.case-study {
  --sky: #f3e9dd; --sky-deep: #eadcc9; --panel: #fbf5ee; --panel-raised: #efe3d4; --line: #dccbb6;
  --text: #2b231c; --text-dim: #6f6052; --link: #a3242c; --accent: #a3242c; --amber: #a3242c;
  --kind-observation: #24408f; --kind-build: #b8400f; --kind-mod: #0d6b51; --kind-story: #5a47b5; --kind-note: #1d6b64;
  --proven: #0d6b51; --partly: #b8400f; --not-yet: #6f6052;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--text);
  font: 400 17px/1.65 var(--body);
  font-kerning: normal;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 20; padding: .5rem 1rem; background: var(--text); color: var(--sky); border-radius: 6px; }
.skip:focus { top: .75rem; }

.wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* Type ---------------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; font-weight: 640; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); margin: .3rem 0 1.5rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin: 3rem 0 .8rem; }
h3 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
.display { font-family: var(--display); font-stretch: 125%; font-weight: 720; letter-spacing: -0.025em; line-height: .95; }
.label {
  font: 400 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 38rem; text-wrap: pretty; }
p, li { text-wrap: pretty; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .06em .35em; }
pre { font-family: var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; overflow-x: auto; font-size: .88rem; line-height: 1.55; }
pre code { border: 0; padding: 0; background: none; }

/* Buttons and links --------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 2rem 0 0; }
.button {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  padding: .55rem 1.15rem; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--text); background: rgb(77 159 255 / .12); text-decoration: none;
  font: 500 .95rem/1 var(--body);
  transition: background .15s, border-color .15s;
}
.button:hover { background: rgb(77 159 255 / .24); }
.text-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--amber); padding-bottom: 1px; min-height: 24px; display: inline-flex; align-items: center; gap: .35rem; }
.text-link:hover { color: var(--amber); }

/* Header ---------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--sky) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: background .25s, border-color .25s; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: .7rem var(--gutter); }
.wordmark { font: 700 .82rem/1 var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.nav ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.nav ul { display: flex; gap: .25rem; }
.nav a { display: block; padding: .6rem .7rem; color: var(--text-dim); text-decoration: none; font-size: .92rem; border-radius: 6px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.menu-button { display: none; }
.menu { display: none; }
body.reading .site-header { background: color-mix(in srgb, var(--sky) 90%, transparent); }

/* Over the hero the header starts clear and turns solid after scrolling (site.js) */
.home .site-header { position: fixed; inset: 0 0 auto; background: transparent; border-color: transparent; backdrop-filter: none; }
.home .site-header.solid { background: rgb(11 14 20 / .88); border-color: var(--line); backdrop-filter: blur(10px); }
.no-js .home .site-header, html:not(.js) .home .site-header { background: rgb(11 14 20 / .88); }

@media (max-width: 767px) {
  .nav { display: none; }
  .menu-button {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    font: 500 .9rem var(--body); color: var(--text); background: none;
    border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  }
  .menu:popover-open {
    display: flex; flex-direction: column; justify-content: space-between;
    position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
    margin: 0; padding: 5rem var(--gutter) 2rem; border: 0;
    background: var(--sky-deep); color: var(--text);
  }
  .menu a { display: block; padding: .6rem 0; font: 640 clamp(1.8rem, 9vw, 2.6rem)/1.15 var(--display); font-stretch: 118%; color: var(--text); text-decoration: none; }
  .menu a[aria-current] { color: var(--amber); }
  .menu-close { align-self: flex-start; min-height: 44px; padding: 0 1.2rem; font: 500 1rem var(--body); color: var(--text); background: none; border: 1px solid var(--line); border-radius: 999px; }
}

/* Hero ------------------------------------------------------------------------ */
.hero {
  --mx: 72%;
  --my: 46%;
  --photo: clamp(260px, 34vw, 540px);
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at var(--mx) var(--my), #101726 0%, var(--sky-deep) 70%);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.hero-sky svg {
  position: absolute; z-index: -2;
  left: var(--mx); top: var(--my);
  width: max(165vw, 120svh); max-width: none; aspect-ratio: 1;
  translate: calc(-50% + var(--px, 0px)) calc(-50% + var(--py, 0px));
  transition: translate .6s var(--ease);
}
.sky .grid polyline { fill: none; stroke: #9cc4ff; stroke-opacity: .07; stroke-width: .6; vector-effect: non-scaling-stroke; }
.sky .lines polyline { fill: none; stroke: #9cc4ff; stroke-opacity: .28; stroke-width: 1; vector-effect: non-scaling-stroke; animation: fade-in 2.4s .5s var(--ease) both; }
.sky .labels text { font: 400 7px var(--mono); letter-spacing: .25em; fill: #8b95a8; fill-opacity: .7; text-anchor: middle; }
.sky .tw { animation: twinkle 5s ease-in-out infinite; animation-delay: var(--d); }
.hero.paused .sky .tw, .lite .sky .tw { animation-play-state: paused; }
@keyframes twinkle { 50% { opacity: .35; } }
@keyframes fade-in { from { opacity: 0; } }

.hero-photo {
  position: absolute; z-index: -1;
  left: var(--mx); top: var(--my);
  width: var(--photo); aspect-ratio: 1;
  translate: calc(-50% + var(--px, 0px) * .5) calc(-50% + var(--py, 0px) * .5);
  transition: translate .6s var(--ease);
  border-radius: 50%;
  overflow: hidden;
  mask-image: radial-gradient(circle closest-side, #000 72%, transparent 100%);
}
.hero-photo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(156 196 255 / .25); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { scale: 1.06; } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(6 8 12 / .92) 0%, rgb(6 8 12 / .55) 38%, transparent 62%),
    linear-gradient(0deg, var(--sky) 0%, transparent 28%);
}
.hero-text { width: 100%; padding-top: 8rem; padding-bottom: clamp(4rem, 12vh, 8rem); }
.hero .display { font-size: clamp(3rem, 9vw, 8.5rem); margin: .6rem 0 1.4rem; max-width: 12ch; }
.hero .label { color: var(--amber); }
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 1.25rem; margin: 0; max-width: 24rem;
  font: 400 .72rem/1.5 var(--mono); letter-spacing: .03em; text-align: right;
}
.hero-caption a { color: var(--text-dim); text-decoration: none; }
.hero-caption a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 767px) {
  .hero { --mx: 50%; --my: 30%; --photo: min(66vw, 300px); align-items: flex-end; }
  .hero::after { background: linear-gradient(0deg, var(--sky) 0%, rgb(6 8 12 / .9) 42%, transparent 66%); }
  .hero-text { padding-bottom: 4.5rem; }
  .hero-caption { left: var(--gutter); text-align: left; bottom: 1rem; }
}

/* Sections -------------------------------------------------------------------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }

.now { margin-top: 2rem; margin-bottom: clamp(5rem, 10vw, 8rem); }
.now dl { display: grid; gap: 1.5rem 2.5rem; margin: 0; }
.now div { border-top: 1px solid var(--line); padding-top: 1rem; }
.now dd { margin: .5rem 0 0; color: var(--text); }
@media (min-width: 768px) { .now dl { grid-template-columns: repeat(3, 1fr); } }

.work { margin-bottom: clamp(5rem, 10vw, 8rem); }

/* The flagship: media beside the words, full width */
.flagship { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-bottom: 1.5rem; padding: clamp(1rem, 2.5vw, 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.flagship-body { container-type: inline-size; }
.flagship .display { font-size: clamp(2rem, 11cqi, 4.2rem); margin: .8rem 0 1rem; }   /* the name always fits its column */
.flagship .display a { color: var(--text); text-decoration: none; }
.flagship .display a:hover { color: var(--amber); }
.flagship-body > .label { color: var(--amber); }
.flagship-body p:last-child { margin-bottom: 0; }
@media (min-width: 1100px) { .flagship { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; } }

.figures { display: grid; gap: 1rem; margin: 1.5rem 0; }
.figures div { border-left: 2px solid var(--amber); padding-left: 1rem; }
.figures dt { font: 500 clamp(1.35rem, 2.2vw, 1.75rem)/1.15 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.figures dd { margin: .3rem 0 0; color: var(--text-dim); font-size: .92rem; line-height: 1.45; }
.case .figures { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 2.5rem 0 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 1.25rem 0; padding: 0; }
.chips li { font: 400 .74rem/1 var(--mono); letter-spacing: .04em; color: var(--text-dim); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; }

/* Bento: three tiles in mixed sizes */
.bento { display: grid; gap: 1.5rem; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: translate .25s var(--ease), box-shadow .25s var(--ease), background .25s; }
.tile:hover, .tile:focus-within { translate: 0 -4px; box-shadow: var(--raise); background: var(--panel-raised); }
.tile-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.tile h3 { margin: .5rem 0 .3rem; font-size: clamp(1.35rem, 2vw, 1.7rem); }
.tile h3 a { color: var(--text); text-decoration: none; }
.tile h3 a::after { content: ""; position: absolute; inset: 0; }   /* the whole tile is the link */
.tile h3 a:focus-visible { outline: none; }
.tile:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile .summary { color: var(--text-dim); margin: 0; }
.tile-media { overflow: hidden; background: var(--sky-deep); }
.tile-media img { width: 100%; transition: scale .5s var(--ease); }
.tile:hover .tile-media img { scale: 1.03; }
.tile-image .tile-media img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.terminal-frame { padding: 1rem 1rem 0; }
.terminal-frame img { border-radius: 8px 8px 0 0; }
.tile:hover .terminal-frame img { scale: 1; }
.big-figure { margin: 1.4rem 0 0; color: var(--text-dim); font-size: .95rem; }
.big-figure .number { display: block; font: 600 clamp(3.5rem, 7vw, 5.5rem)/.9 var(--display); font-stretch: 125%; color: var(--amber); letter-spacing: -0.03em; margin-bottom: .4rem; }
.small-figure { margin: .4rem 0 0; font: 400 .78rem/1.5 var(--mono); color: var(--text-dim); }
.tile-text .chips { margin-top: auto; padding-top: 1.25rem; margin-bottom: 0; }
@media (min-width: 768px) { .bento { grid-template-columns: 1fr 1fr; } .tile-text { grid-row: span 2; } }
@media (min-width: 1100px) {
  .bento { grid-template-columns: 5fr 4fr 4fr; }
  .tile-text { grid-row: auto; }
}

/* Video with a play button; site.js plays it on hover and focus */
.video { position: relative; margin: 0; border-radius: 8px; overflow: hidden; background: var(--sky-deep); }
.video video { width: 100%; }
.play {
  position: absolute; left: 1rem; bottom: 1rem; width: 48px; height: 48px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgb(6 8 12 / .75); color: #f3e9dd; border: 1px solid rgb(217 222 232 / .35);
  font-size: .95rem; cursor: pointer; transition: opacity .2s;
}
.video.playing .play { opacity: 0; }
.video.playing:hover .play, .video.playing .play:focus-visible { opacity: 1; }

/* Evidence: a real terminal session */
.evidence { background: var(--sky-deep); border-block: 1px solid var(--line); padding-block: clamp(3.5rem, 8vw, 6rem); margin-bottom: clamp(5rem, 10vw, 8rem); }
.evidence h2 { margin: 0 0 1.5rem; }
.terminal { margin: 0; }
.terminal pre { background: #0d1117; border-color: #1f2735; font-size: clamp(.74rem, 1.45vw, .95rem); padding: 1.4rem 1.5rem; margin: 0; }
.terminal code { color: #d4d4d4; }
.terminal figcaption { margin-top: .8rem; font: 400 .78rem/1.5 var(--mono); color: var(--text-dim); }

.from-diary { margin-bottom: clamp(5rem, 10vw, 8rem); }
.photo-row { display: grid; gap: 1.5rem; }
.tile-photo .tile-media img { aspect-ratio: 4 / 3; object-fit: cover; }
.tile-photo h3 { font-size: 1.15rem; }
@media (min-width: 768px) { .photo-row { grid-template-columns: repeat(3, 1fr); } }

section.story { padding-bottom: clamp(5rem, 12vw, 9rem); }     /* section: the diary's kind labels are also .story */
section.story > div { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vw, 4rem); }
.story .display { font-size: clamp(2.6rem, 7vw, 6rem); margin: 0 0 1.5rem; max-width: 14ch; }
.story .lede { color: var(--text-dim); max-width: 42rem; }

/* The home page: a warm room, not a night sky. David Heckhoff's clay scene beside a big name,
   then Area's row of folders (references/NOTES.md). Colours are taken from the film's room. */
.home .site-header, .home .site-header.solid, html:not(.js) .home .site-header { position: sticky; background: color-mix(in srgb, var(--sky) 92%, transparent); border-color: transparent; }
.home .site-header.solid { border-color: var(--line); }
.desk { display: grid; gap: 1.5rem; align-items: center; padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem); }
.desk .display { font-size: clamp(3.4rem, 9vw, 7.5rem); font-weight: 800; margin: 0; max-width: 8ch; }
.sticker {
  display: inline-block; margin: 1rem 0 1.6rem; padding: .35rem .8rem .3rem; transform: rotate(-4deg);
  background: #24408f; color: #fff; font: 700 1.05rem/1.2 var(--display); font-stretch: 112%;
  box-shadow: 3px 3px 0 #16285e;
}
.desk .lede { color: var(--text-dim); max-width: 26rem; margin: 0; }
.desk-film .film { margin: 0; max-width: 768px; }
.desk-film video { border-radius: 0; background: transparent;
  --fade-x: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  --fade-y: linear-gradient(180deg, transparent, #000 9%, #000 88%, transparent);
  -webkit-mask-image: var(--fade-x), var(--fade-y); -webkit-mask-composite: source-in;
          mask-image: var(--fade-x), var(--fade-y); mask-composite: intersect; }
@media (min-width: 64rem) { .desk { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; } }
.diary-desk .display { font-size: clamp(1.9rem, 8.2vw, 3.3rem); font-stretch: 100%; max-width: none; white-space: nowrap; }
.diary-desk .lede { margin-top: 1.2rem; }
@media (min-width: 64rem) { .diary-desk .display { font-size: min(3.3rem, calc(3vw + .6rem)); } }

.folders { padding-block: clamp(2rem, 6vw, 4.5rem); }
.folders ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 1.5rem; }
.folders a { display: flex; flex-direction: column; align-items: center; gap: .7rem; width: 9.5rem; color: var(--text); text-decoration: none; font: 500 .95rem/1.3 var(--body); text-align: center; }
.folders svg { width: 120px; filter: drop-shadow(0 6px 10px rgb(80 50 20 / .16)); }
.folders span::after { content: "▲"; display: block; font-size: .6rem; margin-top: .3rem; visibility: hidden; }
.folders a:hover span::after, .folders a:focus-visible span::after { visibility: visible; }
@media (max-width: 599px) {
  .folders ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem .5rem; }
  .folders a { width: auto; font-size: .85rem; }
  .folders svg { width: 88px; }
}
/* On the workbench: the screen is a print laid on the desk, tilted the other way from the sticker */
.bench { padding-block: clamp(2rem, 6vw, 4rem) clamp(4rem, 9vw, 7rem); }
.bench > .display { font-size: clamp(2.4rem, 6vw, 4.8rem); margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); }
.bench-main { display: grid; gap: 1.75rem 3rem; align-items: center; }
.bench-shot { display: block; transform: rotate(1.5deg); }
.bench-shot img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 14px 30px rgb(80 50 20 / .2); }
.bench-text h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .8rem; }
.bench-text .lede { margin: 0 0 1rem; }
.bench-also { list-style: none; margin: clamp(2.5rem, 6vw, 4rem) 0 0; padding: 0; display: grid; gap: 1.5rem 2.5rem; }
.bench-also li { border-top: 1px solid var(--line); padding-top: 1rem; }
.bench-also h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
.bench-also h3 a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--amber); }
.bench-also h3 a:hover { color: var(--amber); }
.bench-also p { margin: 0; color: var(--text-dim); max-width: 36rem; }
@media (min-width: 768px) { .bench-also { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .bench-main { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.home section.story { padding-bottom: clamp(4rem, 10vw, 7rem); }
.home .story .display { font-size: clamp(2.4rem, 6vw, 4.8rem); }
.home .story .lede + .lede { margin-top: 1.2rem; }

/* A claymation film: plays once when scrolled to (site.js), never upscaled */
.film { margin: 2rem 0 0; max-width: 768px; }
.film-frame { position: relative; }
@media (min-width: 64rem) { .film { margin-top: 0; } }
.film video { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--sky-deep); }
.film.playing .play { opacity: 0; }
.film.playing:hover .play, .film.playing .play:focus-visible { opacity: 1; }

/* Case study ------------------------------------------------------------------ */
.case-head { padding-top: clamp(3rem, 8vw, 6rem); }
.case-head .label { color: var(--amber); }
.case-head .display { font-size: clamp(2.1rem, 9.5vw, 7.5rem); margin: 1rem 0 1.5rem; }
.case-media { margin-top: 2.5rem; }
.prose {
  display: grid;
  grid-template-columns: [full-start] minmax(var(--gutter), 1fr) [wide-start] minmax(0, 15rem) [content-start] min(var(--measure), 100% - 2 * var(--gutter)) [content-end] minmax(0, 15rem) [wide-end] minmax(var(--gutter), 1fr) [full-end];
  padding-bottom: 6rem;
}
.prose > * { grid-column: content; min-width: 0; }
.prose > .breakout { grid-column: wide; }
.prose h2 { border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: 4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--amber); }
.prose .terminal, .prose .photo, .prose .screens, .prose .table-wrap { margin: 2rem 0; }
.photo { margin: 0; }
.photo img { border-radius: 8px; }
.photo figcaption, .screens figcaption { margin-top: .7rem; font-size: .9rem; color: var(--text-dim); }
.screens { display: grid; gap: 2rem 1.5rem; }
.screens figure { margin: 0; }
.screens img { border-radius: 8px; border: 1px solid var(--line); }
.screens figcaption strong { color: var(--text); font-weight: 600; }
@media (min-width: 768px) { .screens { grid-template-columns: 1fr 1fr; } }
.note { font: 400 .78rem/1.5 var(--mono); color: var(--text-dim); margin-top: -1rem; }

.table-wrap { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--text-dim); font: 400 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
tbody th { font-weight: 600; }
.status td:last-child { color: var(--text-dim); }
.state { display: inline-block; white-space: nowrap; font: 400 .74rem/1 var(--mono); letter-spacing: .04em; padding: .35rem .55rem; border: 1px solid currentColor; border-radius: 6px; }
.state.proven { color: var(--proven); }
.state.partly { color: var(--partly); }
.state.not-yet { color: var(--not-yet); }
@media (max-width: 767px) {
  .status thead { display: none; }
  .status tr { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .status th, .status td { border: 0; padding: 0; }
  .status td:last-child { grid-column: 1 / -1; }
}

/* The diary: a calm reading surface (unchanged in content) --------------------- */
.reading main { padding-top: 2.5rem; padding-bottom: 4rem; }
.entry-page h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.entry-page picture img, .entry-page p > img { border-radius: 8px; margin: 1.5rem 0 .4rem; }
.entry-page em:only-child { color: var(--text-dim); font-size: .92rem; }
blockquote { margin: 1.2rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--line); font-family: var(--mono); font-size: .9rem; }
blockquote p { margin: .4rem 0; }

.meta { margin: 0; font: 400 .8rem/1.5 var(--mono); color: var(--text-dim); }
.kind { display: inline-block; margin-right: .5rem; font-size: .85rem; font-weight: 600; }
.kind.observation { color: var(--kind-observation); }
.kind.build { color: var(--kind-build); }
.kind.mod { color: var(--kind-mod); }
.kind.story { color: var(--kind-story); }
.kind.note { color: var(--kind-note); }

.about h1 { margin-bottom: .8rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 1rem; }
.filters button { font: 400 .85rem var(--body); color: var(--text-dim); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; min-height: 36px; cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--sky); background: var(--text); border-color: var(--text); }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.entry a { display: block; padding: 1.1rem 1.2rem 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s; }
.entry a:hover { border-color: var(--text-dim); }
.entry img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin-bottom: 1rem; border-radius: 8px; }
.entry h2 { margin: .4rem 0 .3rem; font-size: 1.35rem; }
.entry p:last-child { margin: 0; color: var(--text-dim); }
.turn { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .95rem; }
.turn .newer { margin-left: auto; text-align: right; }

/* The Messier checklist */
.messier-link { margin: 1.5rem 0 0; }
.messier .lede { max-width: 46rem; }
.messier > p:not(.lede):not(.meta):not(.filters) { color: var(--text-dim); max-width: 46rem; }
.m-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.m-card { padding: .9rem 1rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.m-card.todo { background: transparent; }
.m-card.todo h2, .m-card.todo .m-number { color: var(--text-dim); }
.m-number { margin: 0; font: 600 1.6rem/1 var(--display); font-stretch: 112%; }
.m-card.photographed .m-number { color: var(--amber); }
.m-card.in-frame .m-number { color: var(--kind-observation); }
.m-card h2 { margin: .4rem 0 .25rem; font-size: 1.05rem; line-height: 1.25; }
.m-detail { margin: 0; color: var(--text-dim); font-size: .85rem; line-height: 1.45; }
.m-thumb { margin-top: .75rem; }
.m-thumb img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.m-status { margin: .6rem 0 0; font-size: .85rem; }
.m-card.todo .m-status { color: var(--text-dim); font: 400 .75rem/1.4 var(--mono); }
.credit { margin-top: 2.5rem; font-size: .8rem; color: var(--text-dim); }

/* Footer ---------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; color: var(--text-dim); font-size: .9rem; }
.site-footer .wrap-wide { display: grid; gap: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-footer a { color: var(--text); display: inline-flex; min-height: 24px; align-items: center; }
.sign { margin: 0; font: 700 .78rem/1 var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
@media (min-width: 768px) { .site-footer .wrap-wide { grid-template-columns: auto 1fr auto; align-items: center; } .site-footer ul { justify-content: center; } }

/* The diary (diary-spec.md) --------------------------------------------------- */
.standfirst { font-size: 1.15rem; color: var(--text-dim); margin: -.6rem 0 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.5rem; }
.tags a, .chip-row a { font-size: .82rem; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.tags a:hover, .chip-row a:hover { color: var(--text); border-color: var(--text-dim); }
.chip-row a[aria-current] { color: var(--sky); background: var(--text); border-color: var(--text); }
.zoom { display: block; cursor: zoom-in; }
.zoom img { border-radius: 8px; }

/* Session cards: logged values in mono with a label; noted values plain (4.2) */
.cards { display: grid; gap: 1rem; margin: 1.5rem 0 2.5rem; }
.session-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem 1rem; }
.card-title { font-size: 1.15rem; margin: 0 0 .8rem; }
.session-card dl { display: grid; gap: .55rem 1.5rem; margin: 0; }
.session-card dl > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.session-card dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.session-card dt { color: var(--text-dim); font-size: .88rem; }
.session-card dd { margin: 0; font-size: .95rem; overflow-wrap: anywhere; }
.logged { font-family: var(--mono); font-size: .88rem; }
.logged::after, .noted-label { content: "logged"; margin-left: .45rem; font: 400 .66rem/1 var(--mono); letter-spacing: .05em; color: var(--text-dim); border: 1px solid var(--line); border-radius: 4px; padding: .1rem .3rem; vertical-align: .1em; white-space: nowrap; }
.why { display: block; color: var(--text-dim); font-size: .82rem; margin-top: .2rem; }
.session-card details { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.session-card summary { cursor: pointer; color: var(--link); font-size: .9rem; min-height: 24px; }
.sources p, .sources li { font-size: .85rem; color: var(--text-dim); }
.sources ul { padding-left: 1.1rem; }
.hash { font-family: var(--mono); font-size: .75rem; }
.chart-wrap { overflow-x: auto; margin: .8rem 0; }
.night { min-width: 36rem; width: 100%; font: 400 10px var(--mono); }
.night text { fill: var(--text-dim); }
.night .grid { stroke: var(--line); }
.night polyline { fill: none; stroke-width: 1.4; }
.night .fwhm { stroke: var(--kind-observation); }
.night .bg { stroke: var(--text-dim); stroke-dasharray: 3 3; }
.night .kept { stroke: var(--kind-observation); }
.night .lost { stroke: var(--text-dim); opacity: .7; }
.night-table { font-size: .82rem; }
.night-table caption { text-align: left; color: var(--text-dim); font-size: .82rem; }
.change-card { margin: 1.5rem 0 2.5rem; }
@media (max-width: 479px) { .session-card dl > div { grid-template-columns: 1fr; gap: .15rem; } }

.related { margin-top: 3.5rem; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.3rem; margin-top: 1.5rem; }
.related ul, .plain { list-style: none; padding: 0; margin: 0; }
.related li, .plain li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.rel-why { display: block; font-size: .8rem; color: var(--text-dim); }
.rel-date { font-size: .82rem; color: var(--text-dim); }
.compare { margin: 2rem 0; }
.compare .pair { display: grid; gap: 1rem; }
.compare .pair figure { margin: 0; }
.compare figcaption { font-size: .88rem; color: var(--text-dim); margin-top: .5rem; }
@media (min-width: 768px) { .compare .pair { grid-template-columns: 1fr 1fr; } }
.compare.sliding .pair { grid-template-columns: 1fr; position: relative; }
.compare.sliding .pair > figure:last-child { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare.sliding input[type=range] { width: 100%; }

/* The diary's index (10) */
.diary-home main { padding-top: 0; }
.diary-title { font-size: clamp(1.1rem, 2vw, 1.35rem); font-stretch: 112%; margin: 0 0 .3rem; }
.diary-intro { margin: 0 0 1.5rem; color: var(--text-dim); max-width: 40rem; }
/* The latest session: an entry at the page's width, photo beside its words (the film is the page's header) */
.featured { display: grid; gap: 1.25rem 2.5rem; align-items: center; margin-block: 1rem 3rem; }
@media (min-width: 64rem) { .featured { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.featured-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; }
.featured-text .label { font: 600 .9rem/1.4 var(--body); letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.featured-text .display { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-stretch: 112%; line-height: 1.05; margin: .4rem 0 .9rem; }
.featured-text .display a { color: var(--text); text-decoration: none; }
.featured-text .lede { color: var(--text-dim); margin: 0 0 .6rem; }
.logged-line { font: 400 .85rem/1.5 var(--mono); color: var(--text-dim); margin: .3rem 0; }
.ways ul { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; gap: .75rem; }
.ways a { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.ways a:hover { border-color: var(--text-dim); }
.ways span { color: var(--text-dim); font-size: .88rem; }
.search-way { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 768px) { .ways ul { grid-template-columns: repeat(4, 1fr); } .search-way { grid-column: 1 / -1; } }
.search-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--text); background: var(--sky); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; min-height: 44px; }
.search-row button { font: inherit; font-size: .95rem; color: var(--sky); background: var(--text); border: 0; border-radius: 8px; padding: .5rem 1rem; min-height: 44px; cursor: pointer; }
.archive h2#archive-h { margin-top: 0; }
.archive .filters { display: block; margin: 1rem 0 1.5rem; }
.archive .kinds, .gallery-page .kinds { display: none; }
.js .archive .kinds, .js .gallery-page .kinds { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .9rem; }
.kinds button { font: 400 .85rem var(--body); color: var(--text-dim); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; min-height: 36px; cursor: pointer; }
.kinds button[aria-pressed="true"] { color: var(--sky); background: var(--text); border-color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0; }
.more-filters summary { cursor: pointer; font-size: .9rem; color: var(--text-dim); min-height: 32px; display: inline-flex; align-items: center; }
.more-filters summary:hover { color: var(--text); }
.more-filters[open] summary { margin-bottom: .3rem; }
.chip-label { font: 400 .75rem var(--mono); color: var(--text-dim); margin-right: .3rem; }
.filter-status { font-size: .85rem; color: var(--text-dim); min-height: 1.4em; margin: .6rem 0 0; }
.month-h { font: 400 .85rem/1.4 var(--mono); color: var(--text-dim); margin: 2rem 0 .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.archive .entries { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 768px) { .archive .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); } .archive .photo-card { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .archive .photo-card { grid-column: auto; } }
.entry .card-body { display: flex; flex-direction: column; gap: .2rem; }
.entry h3 { margin: .4rem 0 .3rem; font-size: 1.3rem; }
.entry h3 + p, .text-card p { color: var(--text-dim); margin: 0; }
.photo-card img { aspect-ratio: 3 / 2; }
.text-card a { border-left: 3px solid var(--kind-build); height: 100%; }
.text-card.mod a { border-left-color: var(--kind-mod); }
.text-card.story a { border-left-color: var(--kind-story); }
.change-line { font-size: .85rem; margin-top: .5rem !important; }
.note-card a { display: flex; gap: 1rem; align-items: center; }
.note-card img { width: 6rem; aspect-ratio: 1; margin: 0; }
.targets-strip, .kit { margin-top: 4rem; }
.target-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.target-tile a { display: block; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; }
.target-tile a:hover { border-color: var(--text-dim); }
.target-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.target-tile .card-body { padding: .8rem 1rem 1rem; }
.target-tile h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.stat { margin: .3rem 0 0; font: 400 .8rem var(--mono); color: var(--text-dim); }
.kit-line { font-size: 1.05rem; }

/* Target, topic, gallery and equipment pages (6, 7, 8, 5) */
.target-hero { margin: 1rem 0 2rem; }
.ids { font: 400 .85rem/1.5 var(--mono); color: var(--text-dim); margin: -.8rem 0 0; }
.progress td, .progress th { white-space: nowrap; }
.strip { list-style: none; padding: 0 0 .5rem; margin: 1rem 0; display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 22rem); gap: 1rem; overflow-x: auto; position: relative; }   /* relative: hidden labels inside stay inside */
.strip p { font-size: .85rem; color: var(--text-dim); margin: .4rem 0 0; }
.topic-list { list-style: none; padding: 0; counter-reset: none; }
.topic-list li { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.topic-list h2 { font-size: 1.3rem; margin: .4rem 0; }
.topic-list p { margin: .2rem 0; }
.topic-noted { font-size: .95rem; }
.justified { list-style: none; padding: 0; margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.justified > li { flex: calc(var(--r) * 100) 1 calc(var(--r) * 17.5rem); min-width: 0; }
.justified::after { content: ""; flex-grow: 1000000; }   /* a short last row keeps its height instead of stretching */
.justified img { width: 100%; height: auto; }
.justified .caption { font-size: .82rem; color: var(--text-dim); margin: .4rem 0 0; }
@media (max-width: 767px) { .justified > li { flex: 1 1 calc(50% - .5rem); } }
@media (max-width: 479px) { .justified > li { flex-basis: 100%; } }
.rig { display: grid; gap: 1rem; margin: 1rem 0 2rem; }
.component { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.component dt { color: var(--text-dim); font-size: .9rem; }
.component dd { margin: 0; }
.component ul { margin: .4rem 0; padding-left: 1.1rem; }
.loan, .source { font-size: .82rem; color: var(--text-dim); }
.source { margin: .2rem 0 0; }
@media (max-width: 479px) { .component { grid-template-columns: 1fr; gap: .2rem; } }
.history { list-style: none; padding: 0 0 0 1.2rem; border-left: 2px solid var(--line); }
.history li { position: relative; padding: 0 0 1.4rem; }
.history li::before { content: ""; position: absolute; left: calc(-1.2rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--kind-build); }
.history li.software::before { background: var(--kind-mod); }
.history time { font: 400 .8rem var(--mono); color: var(--text-dim); }
.history p { margin: .2rem 0; }
.history .what { font-weight: 600; }

/* Search (11) */
.search-page .search-form { margin: 1rem 0; }
.js-search .no-js-search { display: none; }
.search-scope { font-size: .9rem; color: var(--text-dim); }
.result-count { color: var(--text-dim); font-size: .9rem; }
.results { list-style: none; padding: 0; }
.results li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.results a { font-weight: 600; }
.results p { margin: .3rem 0 0; font-size: .92rem; color: var(--text-dim); overflow-wrap: anywhere; }
.results mark { background: none; color: var(--text); font-weight: 600; }
.inline { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.inline li { border: 0; padding: .2rem 0; }

/* Lightbox (8.2) */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(6 8 12 / .97); color: #e8ecf3; }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox::backdrop { background: rgb(0 0 0 / .8); }
.lb-stage { overflow: hidden; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.lightbox.zoomed .lb-stage { overflow: auto; place-items: start; cursor: grab; touch-action: auto; }
.lightbox.zoomed .lb-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-bar { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: space-between; align-items: center; padding: .75rem var(--gutter) 1rem; border-top: 1px solid #253047; }
.lb-caption { margin: 0; font-size: .9rem; }
.lb-entry { color: #9cc4ff; font-size: .88rem; }
.lb-buttons { display: flex; gap: .4rem; }
.lb-buttons button { font: inherit; font-size: .88rem; color: #e8ecf3; background: none; border: 1px solid #3a465e; border-radius: 8px; padding: .4rem .8rem; min-height: 40px; cursor: pointer; }
.lb-buttons button[aria-pressed="true"] { background: #e8ecf3; color: #06080c; }

/* Motion (8.2): reveals only once site.js has run, so nothing is ever stuck hidden */
.js .reveal { opacity: 0; translate: 0 12px; transition: opacity .4s var(--ease), translate .4s var(--ease); transition-delay: var(--stagger, 0ms); }
.js .reveal.seen { opacity: 1; translate: 0 0; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; translate: none; }
  .hero-sky svg, .hero-photo { translate: -50% -50% !important; }
  @view-transition { navigation: none; }
}
