/* Motion and plate furniture, loaded after style.css / post.css and print.css.
   - Page transitions: the pink band and the name carry over between the homepage, the CV and the posts.
   - Homepage: the name registers on load, figures draw as they scroll into view, section rules draw across,
     the slideshow dot shows its timer, a slim bar with scroll progress follows below the band.
   - Plate furniture: crop marks around figures, the Hamburg street map printed into the band and the footer.
   Entrance states only apply under html.motion, which the homepage sets when scripting and motion are both on,
   so the page is complete without either. */

/* ---------- page transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .band:not(.foot), .site-bar, .post-hero { view-transition-name: band; }
  .post-hero .site-bar { view-transition-name: none; }
  .masthead h1, .site-bar .name { view-transition-name: site-name; }
  .page h1, .post-hero h1 { view-transition-name: post-title; }
  ::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.3, 0, .1, 1); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

  /* theme switch: the new theme spreads from the button */
  .theme-wipe .band, .theme-wipe .site-bar, .theme-wipe .post-hero, .theme-wipe h1, .theme-wipe .site-bar .name { view-transition-name: none; }
  .theme-wipe::view-transition-old(root) { animation: none; }
  .theme-wipe::view-transition-new(root) { animation: theme-wipe .65s cubic-bezier(.4, 0, .2, 1) both; }
}
@keyframes theme-wipe {
  from { clip-path: circle(var(--wipe-r, 0px) at var(--wipe-x, 100%) var(--wipe-y, 0)); }
  to { clip-path: circle(150vmax at var(--wipe-x, 100%) var(--wipe-y, 0)); }
}

/* ---------- crop marks around figures ---------- */
.home .wfig, .home .plate, .home .hero-map { position: relative; }
.home .wfig::before, .home .plate::before, .home .hero-map::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; aspect-ratio: 4 / 3;
  pointer-events: none;
  border: 0 solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M0 9.5h6M9.5 0v6M30 9.5h-6M20.5 0v6M0 20.5h6M9.5 30v-6M30 20.5h-6M20.5 30v-6' stroke='%238E8B84' fill='none'/%3E%3C/svg%3E") 10 / 10px / 10px stretch;
  transition: border-image-outset .25s ease;
}
.home .hero-map::before { aspect-ratio: auto; height: 100%; }
.home a:hover .wfig::before, .home a:hover .plate::before { border-image-outset: 14px; }
.title { transition: color .2s; }
.fig { transition: background-color .2s; }

/* thumbnail read-out under the pointer */
.wfig .cross { stroke: var(--ink); stroke-width: 1; opacity: .55; }
.wfig .cross-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.wfig text.read { fill: var(--ink); }

/* ---------- the Hamburg street map, printed into the band ---------- */
.band-map {
  position: absolute;
  inset: -12% -4%;
  z-index: -1;
  pointer-events: none;
  background: var(--field-ink);
  opacity: .2;
  -webkit-mask: url(fig/hamburg-roads.svg) 70% 40% / cover no-repeat, url(fig/hamburg-water.svg) 70% 40% / cover no-repeat;
  mask: url(fig/hamburg-roads.svg) 70% 40% / cover no-repeat, url(fig/hamburg-water.svg) 70% 40% / cover no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .band-map { animation: drift 70s ease-in-out infinite alternate; }
}
@keyframes drift {
  from { transform: translate3d(-1.5%, -2%, 0) scale(1.02); }
  to { transform: translate3d(1.5%, 2%, 0) scale(1.08); }
}

:is(body.home, body.cv) .wrap { padding-bottom: clamp(72px, 10vw, 128px); }

/* ---------- slim bar below the band: name, sections, scroll progress ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px var(--gutter) 10px;
  background: var(--field);
  color: var(--field-ink);
  transform: translateY(-102%);
  transition: transform .35s cubic-bezier(.3, 0, .1, 1);
}
.topbar.on { transform: none; }
.topbar .name { font: 400 30px/.9 var(--display); font-feature-settings: 'ss07'; text-shadow: 1.5px 1px 0 var(--off-register); }
.topbar nav { display: flex; gap: 22px; font-size: 14px; }
.topbar nav a { position: relative; padding: 3px 0; }
.topbar nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.topbar nav a:hover::after, .topbar nav a[aria-current]::after { transform: none; }
.topbar :focus-visible { outline-color: var(--field-ink); }
.topbar .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--field-ink); transform: scaleX(var(--p, 0)); transform-origin: left; z-index: 1; }
@media (max-width: 699px) { .topbar nav { gap: 14px; font-size: 13px; } .topbar .name { display: none; } .topbar { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .topbar { transition: none; } }
@media (min-width: 960px) { .has-topbar h2.side { top: 72px; } }
@media print { .topbar { display: none; } }

/* ---------- slideshow: the current dot stretches and shows the time left ---------- */
.dots button { position: relative; overflow: hidden; transition: width .3s ease, border-color .3s; }
.dots button i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.dots button[aria-current="true"] { width: 30px; border-radius: 5px; background: none; }
.dots button[aria-current="true"] i { transform: none; }
.hero.auto .dots button[aria-current="true"] i { animation: dot-fill 8s linear both; }
.hero.auto.hold .dots button[aria-current="true"] i { animation-play-state: paused; }
@keyframes dot-fill { from { transform: scaleX(0); } to { transform: none; } }

/* ---------- entrances (homepage, html.motion only) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(.3em); } }
@keyframes rise-s { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes register { from { text-shadow: 16px 10px 0 var(--off-register); } }
@keyframes wipe { from { clip-path: inset(-5% 100% -5% -5%); } to { clip-path: inset(-5%); } }

.masthead h1 .w { display: inline-block; }
.motion .masthead h1 { animation: register 1s cubic-bezier(.2, .7, .1, 1) .1s both; }
.motion .masthead h1 .w { animation: rise .8s cubic-bezier(.2, .7, .1, 1) both; }
.motion .masthead h1 .w + .w { animation-delay: .12s; }
.motion .masthead .role, .motion .masthead .nav { animation: fade .6s ease .55s both; }
.motion .band:not(.foot) .band-map { animation: fade 1.6s ease .2s both, drift 70s ease-in-out infinite alternate; }
.motion .about > *, .motion .hero { animation: rise-s .7s cubic-bezier(.2, .7, .1, 1) .45s both; }
.motion .about > * + * { animation-delay: .58s; }
.motion .hero { animation-delay: .7s; }

/* section rule draws across, the section name rises */
.motion section.row { transition: background-size 1.1s cubic-bezier(.6, 0, .1, 1); }
.motion section.row:not(.in) { background-size: 0 1px; }
.motion h2.side { transition: opacity .6s ease .15s, transform .6s cubic-bezier(.2, .7, .1, 1) .15s; }
.motion section.row:not(.in) h2.side { opacity: 0; transform: translateY(18px); }

/* rows arrive */
.motion :is(.posts, .plates, .papers) > li, .motion .contact > * { transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .1, 1); }
.motion :is(.posts, .plates, .papers) > li:not(.in), .motion section.row:not(.in) .contact > * { opacity: 0; transform: translateY(16px); }
.motion .plates > li:nth-child(3n + 2), .motion .contact > :nth-child(2) { transition-delay: .1s; }
.motion .plates > li:nth-child(3n), .motion .contact > :nth-child(3) { transition-delay: .2s; }

/* figures draw from left to right; labels and marks land last */
.fig .plot { transition: clip-path 1.2s cubic-bezier(.6, 0, .2, 1) .15s; clip-path: inset(-5%); }
.fig .late { transition: opacity .45s ease 1.15s; }
.motion .fig:not(.in) .plot { clip-path: inset(-5% 100% -5% -5%); transition: none; }
.motion .fig:not(.in) .late { opacity: 0; transition: none; }
.motion .slide.on .plot { animation: wipe 1.3s cubic-bezier(.6, 0, .2, 1) .25s both; }
.motion .slide.on .late { animation: fade .45s ease 1.3s both; }
.hamburg span { transition: opacity 1s ease .2s; }
.hamburg .roads { transition: opacity 1.4s ease .6s; }
.motion .hamburg:not(.in) span { opacity: 0; transition: none; }

.motion .foot .sign { transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .1, 1), text-shadow 1s cubic-bezier(.2, .7, .1, 1) .1s; }
.motion .foot:not(.in) .sign { opacity: 0; transform: translateY(.25em); text-shadow: 16px 10px 0 var(--off-register); }
.motion .foot:not(.in) .c-pink { clip-path: inset(0 100% 0 0); }
.motion .foot .c-pink { transition: clip-path 1s cubic-bezier(.6, 0, .2, 1) .1s; clip-path: inset(0); }

/* ---------- the orb: a circle on the edge of the band that shows the page in the other theme.
   Its upper part deepens (or, on the dark page, brightens) the pink of the band; its lower part inverts the paper
   and whatever is printed on it. The theme switch grows out of it. ---------- */
.orb-row { --d: clamp(160px, 22.6vw, 290px); --up: calc(40px + var(--d) / 2); position: relative; z-index: 5; height: 0; pointer-events: none; }
.orb-clip { position: absolute; left: 0; right: 0; top: calc(-1 * var(--up)); height: var(--d); overflow: hidden; }
.orb {
  --orb-band: brightness(.8);
  position: absolute;
  top: 0;
  right: calc(max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter)) + 19px - var(--d) / 2);
  width: var(--d); height: var(--d);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}
.orb i { position: absolute; left: 0; right: 0; }
.orb i:first-child { top: 0; height: var(--up); -webkit-backdrop-filter: var(--orb-band); backdrop-filter: var(--orb-band); }
.orb i:last-child { top: var(--up); bottom: 0; -webkit-backdrop-filter: invert(1) hue-rotate(180deg); backdrop-filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .orb { --orb-band: brightness(1.22) saturate(1.2); } }
:root[data-theme="dark"] .orb { --orb-band: brightness(1.22) saturate(1.2); }
@supports not ((backdrop-filter: invert(1)) or (-webkit-backdrop-filter: invert(1))) { .orb { display: none; } }
@keyframes orb-in { from { transform: scale(0); } }
.motion .orb { animation: orb-in .9s cubic-bezier(.2, .8, .2, 1) .5s both; }
@media print { .orb-row { display: none; } }

/* ---------- collage: the street map as ink linework on plate grey, a pink block printed over it, a card of real
   counts, and a block that inverts whatever it covers. Used by the homepage header, the footer, the article
   headers and the article endings. ---------- */
:root { --blend: multiply; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --blend: screen; } }
:root[data-theme="dark"] { --blend: screen; }

.collage, .band.collage { --strip: 64px; position: relative; isolation: isolate; overflow: hidden; background: var(--plate); color: var(--ink); }
.collage::before, .collage::after { display: none; }
.collage :focus-visible { outline-color: var(--ink); }
.collage .band-map {
  background: var(--ink); opacity: .85; inset: 0 0 var(--strip) 0; animation: none !important;
  -webkit-mask-position: var(--mx, 70%) var(--my, 40%), var(--mx, 70%) var(--my, 40%);
  mask-position: var(--mx, 70%) var(--my, 40%), var(--mx, 70%) var(--my, 40%);
}
.collage ~ .orb-row .orb { --orb-band: invert(1) hue-rotate(180deg) !important; }
.collage .masthead { position: relative; min-height: clamp(360px, 36vw, 470px); align-content: space-between; }
.collage .masthead h1 { color: var(--field-ink); }
.c-pink, .c-dark, .c-card { position: absolute; z-index: -1; pointer-events: none; }
.c-pink { left: 0; top: 0; bottom: var(--strip); width: 67%; background: var(--field); mix-blend-mode: var(--blend); }
.c-card {
  right: 5%; top: 9%; width: 33%; height: 62%;
  background: var(--accent-soft); mix-blend-mode: var(--blend);
  overflow: hidden; border: 1px solid var(--ink);
}
.c-card pre { margin: 0; padding: 14px 44px 14px 16px; font: 400 15px/1.9 var(--serif); letter-spacing: .12em; color: var(--ink); white-space: pre; }
.c-card pre b { font-weight: 400; background: var(--ink); color: var(--accent-soft); border-radius: 40%; }
.c-fig { position: absolute; right: 8px; bottom: 10px; writing-mode: vertical-rl; transform: rotate(180deg); font: 400 22px/1 var(--serif); letter-spacing: .08em; color: var(--ink); }
.c-dark { left: 55%; top: 24%; width: 22%; bottom: var(--strip); -webkit-backdrop-filter: invert(1) hue-rotate(180deg); backdrop-filter: invert(1) hue-rotate(180deg); }
@media (max-width: 699px) {
  .band.collage { --strip: 120px; }
  .c-pink { width: 100%; }
  .c-card { width: 54%; top: auto; bottom: calc(var(--strip) + 10px); height: 30%; right: 4%; }
  .c-dark { left: 38%; width: 28%; top: 54%; }
  .collage .masthead { min-height: 440px; align-content: stretch; grid-template-rows: auto 1fr auto; }
  .collage .masthead .role { align-self: end; margin-bottom: 14px; }
}

/* footer: the same plate, closing the page */
.foot-c { margin-top: 0; }
.foot-c .stage { --strip: 0px; min-height: clamp(300px, 30vw, 400px); display: flex; flex-direction: column; justify-content: flex-end; }
.foot-c .sign {
  position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(18px, 2.4vw, 30px);
  font: 400 clamp(64px, 11vw, 150px)/.8 var(--display); font-feature-settings: 'ss07'; color: var(--field-ink);
  text-shadow: 2px 1.5px 0 var(--off-register);
}
.foot-c .sign span { margin-left: -.03em; display: block; }
.foot-c .band-map { --mx: 15%; --my: 82%; }
.foot-c .c-card { top: 12%; height: 58%; }
@media (max-width: 699px) { .foot-c .c-dark { top: 10%; bottom: auto; height: 24%; left: 8%; width: 26%; } }
.foot-c .strip { background: var(--plate); color: var(--ink); }
.foot-c .strip-in { max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter) 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 40px; }
.foot-c .credit { margin: 0; font-size: 13px; line-height: 1.55; }
.foot-c .top { grid-column: 2; }
.foot-c .top { position: relative; padding: 4px 0; font-size: 15px; white-space: nowrap; }
.foot-c .top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.foot-c .top:hover::after { transform: none; }
@media (max-width: 699px) { .foot-c .strip-in { grid-template-columns: minmax(0, 1fr); } .foot-c .top { grid-column: 1; } .foot-c .stage { min-height: 340px; } }

/* ---------- homepage: the same vocabulary, in smaller amounts ---------- */
/* section names are overprinted with a bar of pink */
:is(.home, .cv) h2.side { isolation: isolate; justify-self: start; }
:is(.home, .cv) h2.side::before { content: ""; position: absolute; z-index: -1; left: -.12em; right: -.12em; bottom: .02em; height: .4em; background: var(--field); opacity: .9; }
.motion section.row h2.side::before { transition: clip-path .8s cubic-bezier(.6, 0, .2, 1) .35s; }
.motion section.row:not(.in) h2.side::before { clip-path: inset(0 100% 0 0); }

/* thumbnails and plates: an ink frame, and a dither veil of pink (drawn by home.js) that dissolves when the row is pointed at */
.home .wfig .fig, .home .plate .fig { outline: 1px solid var(--ink); }
.veil { position: absolute; top: 0; left: 0; pointer-events: none; }

/* paper kinds are small punched tags; links in the contact section fill with pink */
.papers .kind { justify-self: end; align-self: start; border: 1px solid var(--ink); padding: 6px 10px; text-align: left; background: color-mix(in srgb, var(--accent-soft) 70%, transparent); transition: background-color .2s, color .2s; }
.papers li:hover .kind { background: var(--ink); color: var(--paper); }
.links a { background: linear-gradient(var(--field), var(--field)) 0 100% / 0 100% no-repeat; transition: background-size .3s cubic-bezier(.6, 0, .2, 1), color .3s; padding: 0 .08em; }
.links a:hover { background-size: 100% 100%; color: var(--field-ink); }

/* ---------- articles ---------- */
.post-hero, .post-end {
  --plate: var(--surface-map); --ink: var(--text); --paper: var(--surface);
  --accent-soft: color-mix(in srgb, var(--accent) 36%, var(--surface));
  --gutter: clamp(16px, 4vw, 56px); --max: 1320px;
}
.post-hero { --strip: 52px; display: flex; flex-direction: column; min-height: clamp(400px, 38vw, 520px); }
.post-hero-in { position: relative; flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-direction: column; }
.post-hero .site-bar { background: none; color: inherit; padding: 22px 0 0; overflow: visible; }
.post-hero .site-bar::before, .post-hero .site-bar::after { display: none; }
.post-hero .site-bar .name { color: var(--field-ink) !important; font-size: clamp(30px, 3vw, 40px); text-shadow: 1.5px 1px 0 var(--off-register); }
.post-hero .site-bar nav a, .post-hero .site-bar nav button { color: var(--ink) !important; }
.post-hero h1 {
  margin: clamp(22px, 3.4vw, 44px) 0 0; max-width: 60%;
  font: 400 clamp(42px, 6.6vw, 98px)/.86 var(--display); font-feature-settings: 'ss07'; letter-spacing: 0;
  color: var(--field-ink); text-shadow: 2px 1.5px 0 var(--off-register); text-wrap: balance; overflow-wrap: anywhere;
}
.post-hero .c-card { top: 84px; height: auto; bottom: calc(var(--strip) + 40px); }
.post-hero .strip { margin: auto 0 0; min-height: var(--strip); display: flex; align-items: center; font: 400 13px/1.35 var(--serif); color: var(--ink); }
.top + .page { margin-top: var(--space-5); }
@media (max-width: 699px) {
  .post-hero { --strip: 72px; min-height: 420px; }
  .post-hero h1 { max-width: 100%; }
  .post-hero .c-card { top: auto; height: 30%; bottom: calc(var(--strip) + 10px); }
}

/* section heads in articles: the same bar of pink under the name; plates get an ink frame and a misregistered echo */
.shead h2 { position: relative; isolation: isolate; }
.shead h2::before { content: ""; position: absolute; z-index: -1; left: -.15em; right: -.15em; bottom: .06em; height: .4em; background: var(--field); opacity: .9; }
body:not(.home) .plate { outline: 1px solid var(--text); }
body:not(.home) .plate::after { content: ""; position: absolute; inset: 0; transform: translate(8px, 8px); background: var(--field); mix-blend-mode: var(--blend); z-index: -1; pointer-events: none; }

/* the ending: more writing */
.post-end { --strip: 0px; min-height: clamp(220px, 22vw, 300px); display: flex; align-items: flex-end; margin-top: var(--space-6); }
.post-end .band-map { --mx: 22%; --my: 72%; }
.post-end .c-dark { left: 60%; top: 30%; width: 20%; }
.end-link { position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(18px, 2.6vw, 34px); font: 400 clamp(46px, 7vw, 100px)/.84 var(--display); font-feature-settings: 'ss07'; color: var(--field-ink); text-shadow: 2px 1.5px 0 var(--off-register); text-decoration: none; }
.end-link i { font-style: normal; display: inline-block; transition: transform .3s cubic-bezier(.2, .7, .1, 1); }
.end-link:hover i { transform: translateX(.18em); }
.post-end :focus-visible, .post-hero :focus-visible { outline-color: var(--ink); }

/* articles and the footer arrive by printing in: the blocks wipe across */
@keyframes block-x { from { clip-path: inset(0 100% 0 0); } }
@keyframes block-y { from { clip-path: inset(0 0 100% 0); } }
@keyframes block-u { from { clip-path: inset(100% 0 0 0); } }
@media (prefers-reduced-motion: no-preference) {
  .post-hero .c-pink, .post-end .c-pink { animation: block-x .9s cubic-bezier(.6, 0, .2, 1) .1s both; }
  .post-hero .c-card { animation: block-y .8s cubic-bezier(.6, 0, .2, 1) .45s both; }
  .post-hero .c-dark, .post-end .c-dark { animation: block-u .7s cubic-bezier(.6, 0, .2, 1) .6s both; }
  .post-hero h1 { animation: rise .8s cubic-bezier(.2, .7, .1, 1) .3s both; }
  .post-hero .strip { animation: fade .6s ease .8s both; }
}
@media print { .post-end { display: none; } }

/* ---------- CV page ---------- */
.cv-title { position: relative; isolation: isolate; width: fit-content; }
.cv-title::before { content: ""; position: absolute; z-index: -1; left: -.06em; right: -.06em; bottom: .02em; height: .36em; background: var(--field); opacity: .9; }
.cv-end .contact .links { margin-bottom: 0; }

/* the collage headers print in on load, on every page that has one */
@media (prefers-reduced-motion: no-preference) {
  .band.collage .c-pink { animation: block-x .9s cubic-bezier(.6, 0, .2, 1) .1s both; }
  .band.collage .c-card { animation: block-y .8s cubic-bezier(.6, 0, .2, 1) .45s both; }
  .band.collage .c-dark { animation: block-u .7s cubic-bezier(.6, 0, .2, 1) .6s both; }
}

/* ---------- branched menu (assets/branched-menu.js), ported from React Bits ----------
   Section heads on a rail; the open section's items hang off a trunk on curved branches and a pink line draws to the
   active one. It docks on the left from 1100px wide. Where the text leaves no room beside it, it folds to its rail and
   opens over the page, on paper, on hover or focus. */
.bm-dock { display: none; }
@media (min-width: 1100px) {
  .bm-dock {
    --bm-ink: var(--ink, var(--text));
    --bm-accent: var(--accent);
    --bm-line: var(--rule, var(--line));
    --bm-bg: var(--paper, var(--surface));
    --bm-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --bm-muted: color-mix(in srgb, var(--bm-ink) 55%, transparent);
    display: block; position: fixed; z-index: 30; left: 18px; top: 50%;
    max-height: calc(100vh - 140px); overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
    transform: translate(-10px, -50%); opacity: 0; pointer-events: none;
    transition: opacity .35s ease, transform .5s cubic-bezier(.2, .7, .1, 1);
  }
  .bm-dock.on { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
  /* folded (no room beside the text): the rail stays, with a tick per section and the pink marker on the current one;
     pointing at it or focusing it opens the whole menu over the page, on paper */
  .bm-dock:not(.docked) .branched-menu { width: 40px; max-width: 40px; overflow: hidden; padding: 6px 0 6px 14px; transition: max-width .3s var(--bm-ease-out), width .3s var(--bm-ease-out), background-color .2s, box-shadow .2s; }
  .bm-dock:not(.docked) .branched-menu::before { background: linear-gradient(to bottom, var(--bm-ink) 0%, var(--bm-ink) 70%, transparent 100%); opacity: .55; }
  .bm-dock:not(.docked):not(:hover):not(:focus-within) .branched-menu__head { position: relative; color: transparent; padding: 5px 0; font-size: 14px; }
  .bm-dock:not(.docked):not(:hover):not(:focus-within) .branched-menu__head::before { content: ''; position: absolute; left: 0; top: 50%; width: 12px; height: 2px; background: var(--bm-ink); opacity: .55; }
  .bm-dock:not(.docked):not(:hover):not(:focus-within) .branched-menu__section[data-open] .branched-menu__head::before,
  .bm-dock:not(.docked):not(:hover):not(:focus-within) .branched-menu__head[data-active]::before { background: var(--bm-accent); opacity: 1; width: 18px; }
  .bm-dock:not(.docked):not(:hover):not(:focus-within) .branched-menu__body { display: none; }
  .bm-dock:not(.docked):is(:hover, :focus-within) .branched-menu { width: 260px; max-width: 260px; background: var(--bm-bg); box-shadow: 0 0 0 1px var(--bm-ink); padding-right: 16px; }
}
.branched-menu {
  --bm-row: 30px; --bm-indent: 30px; --bm-line-w: 1.25;
  position: relative; display: flex; flex-direction: column; width: var(--bm-width, 230px); max-width: var(--bm-width, 230px);
  padding: 0 0 0 14px; color: var(--bm-ink); font: 400 12.5px/1.2 var(--serif); box-sizing: border-box;
}
.branched-menu::before {
  content: ''; position: absolute; top: 8px; bottom: 0; left: 0; width: 2px; border-radius: 1px;
  background: linear-gradient(to bottom, var(--bm-line) 0%, var(--bm-line) 55%, transparent 100%);
}
.branched-menu__marker {
  position: absolute; top: -1px; left: 0; z-index: 1; width: 2px; height: 16px; border-radius: 1px;
  background: var(--bm-accent); opacity: 0; transition: top 220ms var(--bm-ease-out), opacity 150ms ease;
}
.branched-menu__marker[data-on] { opacity: 1; }
.branched-menu__section { display: flex; flex-direction: column; }
.branched-menu__head {
  display: block; margin: 0; padding: 7px 0; border: 0; background: none; color: var(--bm-muted);
  font: 400 23px/.95 var(--display); font-feature-settings: 'ss07'; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  -webkit-tap-highlight-color: transparent; transition: color 200ms ease;
}
.branched-menu__section[data-open] .branched-menu__head, .branched-menu__head[data-active] { color: var(--bm-ink); }
@media (hover: hover) and (pointer: fine) { .branched-menu__head:hover { color: var(--bm-ink); } }
.branched-menu__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 300ms var(--bm-ease-out); }
.branched-menu__section[data-open] .branched-menu__body { grid-template-rows: 1fr; }
.branched-menu__fold { min-height: 0; overflow: hidden; }
.branched-menu__tree { position: relative; padding: 6px 0; box-sizing: border-box; }
.branched-menu__lines { position: absolute; top: 0; left: 0; overflow: visible; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.branched-menu__section[data-open] .branched-menu__lines { opacity: 1; transition: opacity 250ms ease 100ms; }
.branched-menu__base, .branched-menu__reach { fill: none; stroke-width: var(--bm-line-w); stroke-linecap: round; stroke-linejoin: round; }
.branched-menu__base { stroke: var(--bm-line); }
.branched-menu__reach { stroke: var(--bm-accent); transition: stroke-dashoffset 400ms var(--bm-ease-out); }
.branched-menu__item {
  display: flex; align-items: center; width: 100%; height: var(--bm-row); margin: 0; padding: 0 0 0 var(--bm-indent);
  border: 0; background: none; color: var(--bm-muted); font: inherit; text-align: left; cursor: pointer; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; transition: color 200ms ease;
}
@media (hover: hover) and (pointer: fine) { .branched-menu__item:hover { color: var(--bm-ink); } }
.branched-menu__item[data-active] { color: var(--bm-ink); }
.branched-menu__item[data-active] .branched-menu__label { background: linear-gradient(transparent 58%, var(--accent-soft, color-mix(in srgb, var(--accent) 36%, transparent)) 58%); }
.branched-menu__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branched-menu :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .bm-dock, .bm-dock .branched-menu, .branched-menu__marker, .branched-menu__body, .branched-menu__reach { transition: none !important; }
}
@media print { .bm-dock { display: none; } }

/* ---------- grain gradient: the pink at the top of each page drifts slowly between deeper and lighter inks,
   under a riso grain ---------- */
@property --g1x { syntax: '<percentage>'; inherits: false; initial-value: 18%; }
@property --g1y { syntax: '<percentage>'; inherits: false; initial-value: 24%; }
@property --g2x { syntax: '<percentage>'; inherits: false; initial-value: 82%; }
@property --g2y { syntax: '<percentage>'; inherits: false; initial-value: 78%; }
@property --g3x { syntax: '<percentage>'; inherits: false; initial-value: 55%; }
@property --g3y { syntax: '<percentage>'; inherits: false; initial-value: 40%; }
.band.collage .c-pink, .post-hero .c-pink, .topbar {
  background:
    radial-gradient(55% 75% at var(--g1x) var(--g1y), color-mix(in srgb, var(--r4) 85%, transparent), transparent 70%),
    radial-gradient(45% 65% at var(--g2x) var(--g2y), color-mix(in srgb, var(--r5) 45%, transparent), transparent 70%),
    radial-gradient(40% 55% at var(--g3x) var(--g3y), color-mix(in srgb, #fff 14%, transparent), transparent 70%),
    var(--field);
}
.band.collage .c-pink::after, .post-hero .c-pink::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--grain) 0 0 / 180px 180px; opacity: .55; mix-blend-mode: overlay;
}
@keyframes grainient {
  0% { --g1x: 18%; --g1y: 24%; --g2x: 82%; --g2y: 78%; --g3x: 55%; --g3y: 40%; }
  33% { --g1x: 62%; --g1y: 70%; --g2x: 30%; --g2y: 20%; --g3x: 12%; --g3y: 80%; }
  66% { --g1x: 88%; --g1y: 18%; --g2x: 14%; --g2y: 72%; --g3x: 70%; --g3y: 85%; }
  100% { --g1x: 35%; --g1y: 82%; --g2x: 68%; --g2y: 30%; --g3x: 40%; --g3y: 15%; }
}
@media (prefers-reduced-motion: no-preference) {
  .band.collage .c-pink, .post-hero .c-pink, .topbar { animation: grainient 24s ease-in-out infinite alternate; }
  /* the print-in wipe on load still runs first */
  .band.collage .c-pink, .post-hero .c-pink { animation: block-x .9s cubic-bezier(.6, 0, .2, 1) .1s both, grainient 24s ease-in-out 1s infinite alternate; }
}

/* Grainient (assets/grainient.js) draws the pink block when WebGL2 is there; the CSS gradient above is the fallback */
.grainient-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.c-pink.gl { background: var(--field); }
.c-pink.gl::after { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .band.collage .c-pink.gl, .post-hero .c-pink.gl { animation: block-x .9s cubic-bezier(.6, 0, .2, 1) .1s both; }
}

/* ScrambledText (assets/scramble.js): each letter keeps its width while it scrambles */
.scr-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.scr-w { white-space: nowrap; }
.scr-c { position: relative; display: inline-block; }
.scr-s { visibility: hidden; }
.scr-g { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: pre; }
