/* Motion helpers: preloader, masks, hover preview, circle links */
#pre { display: none; position: fixed; inset: 0; z-index: 200; place-items: center; overflow: hidden }
html.pre #pre { display: grid }
html.pre { overflow: hidden }
#pre .bars { position: absolute; inset: 0; display: flex }
#pre i { flex: 1; margin-right: -1px }
#pre .b i { background: var(--bg) }
#pre .a i { background: var(--acc) }
#pre .lt { display: inline-block; white-space: pre }
#pre .nmx { position: relative; z-index: 2; font: 400 64px/1 'Outfit', sans-serif; color: var(--fg); white-space: nowrap; padding: .15em 0; margin: -.15em 0 }

.mi { display: block }
.home .t .ln, .ab-t .ln { display: flow-root }
.mk { display: block; overflow: hidden; padding: .12em 0; margin: -.12em 0 }
.home.shown .mk { overflow: visible }
.ch { display: inline-block; white-space: pre }

.home .t .ph { position: relative; overflow: hidden; background: #2a2a2a }
.home .t .ph::before { content: ""; position: absolute; inset: 0; background: url('../images/hero.jpg') center / cover no-repeat; transform: scale(var(--z, 1)) }
.home .t .ast, .as { cursor: pointer; will-change: transform }

.ab-w { overflow: hidden; margin-top: calc(var(--w-h) * .85) }
.ab-w .ab-i { margin: 0 }


.more { position: relative; overflow: hidden; isolation: isolate }
.more .fx { position: absolute; z-index: 0; border-radius: 50%; background: var(--acc); pointer-events: none; transform: scale(0) }
.more .lx { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: inherit }
.more:hover .arr { color: #000 }

@media (max-width: 700px) {
  #pre .nmx { font-size: 28px }
  .ab-w { margin-top: 13px }
}

/* nav stays hidden until the home screen reveals */
html.nv #nav { opacity: 0 !important; visibility: hidden !important }

/* hero asterisk: the wrapper takes the size and place of the svg */
.home .t .aw { display: inline-block; width: .66em; height: .66em; margin: 0 .02em; vertical-align: 0; cursor: pointer; will-change: transform }
.home .t .aw .ast { display: block; width: 100%; height: 100%; margin: 0; will-change: auto }

/* Word masks: the parent hides the word until it rises into view */
.wm { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em .08em .18em; margin: -.14em -.08em -.18em }
.wi { display: inline-block }
.wm.wu { display: block; width: fit-content }

/* Row hover (Featured Work, Emerging Questions, Passing Thoughts) */
.it { isolation: isolate }
.it .hv { position: absolute; inset: 0 -14px; z-index: -1; border-radius: 10px; background: color-mix(in srgb, var(--fg) 8%, transparent); transform: scaleX(0); transform-origin: left center; pointer-events: none }
.it .n, .it .tg { transition: color .35s, background-color .35s, border-color .35s }
@media (hover: hover) and (pointer: fine) {
  .it:hover .n { color: var(--acc) }
  .it:hover .tg { background: var(--acc); border-color: var(--acc); color: #000 }
}
/* touch: the same accent pickup while a row or pill is pressed (js/hover.js adds .on) */
.it.on .n { color: var(--acc) }
.it.on .tg { background: var(--acc); border-color: var(--acc); color: #000 }
.more.on .arr { color: #000 }

#mind .im { position: relative; overflow: hidden; background-image: none }
#mind .im::before { content: ""; position: absolute; inset: 0; background: var(--img, none) center / cover no-repeat; transform: scale(var(--z, 1)) }

/* Heading letter hover: extra headroom inside the mask so a hopping letter is never clipped */
.wk-h .wm { padding-top: .3em; margin-top: -.3em }

/* phone: a bigger asterisk, sized to the cap height and centred on the letters so it sits level with them */
@media (max-width: 700px) {
  .home .t .aw { width: .84em; height: .84em; margin: 0 .02em; vertical-align: -.09em }
}


/* Light / dark switching ---------------------------------------------------- */
/* View Transitions: the old and new page are stacked and the new one is revealed by js/theme.js */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal }
::view-transition-old(root) { z-index: 1 }
::view-transition-new(root) {
  z-index: 2;
  animation: theme-reveal .65s cubic-bezier(.45, 0, .2, 1) both
}
@keyframes theme-reveal {
  from { clip-path: circle(0px at var(--tx, 50%) var(--ty, 0)) }
  to   { clip-path: circle(var(--tr, 150vmax) at var(--tx, 50%) var(--ty, 0)) }
}
/* while it runs, nothing else may fade, or the circle edge would blur */
html.vt *, html.vt *::before, html.vt *::after { transition: none !important }

/* Fallback (no View Transitions): all colours ease together instead of snapping */
html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .55s ease, color .55s ease, border-color .55s ease, fill .55s ease, stroke .55s ease, box-shadow .55s ease !important
}

/* letter-by-letter headings */
.ch { display: inline-block }
