/* FLKR — shared motion layer. Loaded on every page, after the page's own CSS.
   One idea throughout: things are built from the ground up, along a datum.
   Everything here is progressive: browsers without support show the page
   exactly as before, and prefers-reduced-motion switches all of it off. */

/* ── page transitions (cross-document View Transitions) ──────────── */
@view-transition{ navigation:auto }

@keyframes flkr-old-out{ to{ opacity:0; transform:translateY(-14px) } }
@keyframes flkr-new-in{
  from{ clip-path:inset(100% 0 0 0) }   /* rises from the ground line */
  to{   clip-path:inset(0 0 0 0) }
}
::view-transition-old(root){ animation:flkr-old-out .42s cubic-bezier(.6,0,.8,.4) both }
::view-transition-new(root){ animation:flkr-new-in .72s cubic-bezier(.2,.7,.2,1) .08s both }

/* a project or journal image that exists on both pages travels between them */
::view-transition-group(*){ animation-duration:.62s; animation-timing-function:cubic-bezier(.2,.7,.2,1) }
.nav{ view-transition-name:flkr-nav }
::view-transition-old(flkr-nav), ::view-transition-new(flkr-nav){ animation:none }

/* ── reading datum: a brass hairline under the nav tracks scroll ───── */
.nav::after{
  content:''; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background:var(--brass-lift, #D9B37A); transform-origin:0 50%; transform:scaleX(0);
  pointer-events:none;
}
@supports (animation-timeline: scroll()){
  @keyframes flkr-datum{ to{ transform:scaleX(1) } }
  .nav::after{ animation:flkr-datum linear both; animation-timeline:scroll(root) }
}

/* ── image wipe: images rise into place as they enter the view ─────── */
@supports (animation-timeline: view()){
  @keyframes flkr-wipe{
    from{ clip-path:inset(18% 0 0 0); transform:scale(1.06) }
    to{   clip-path:inset(0 0 0 0);   transform:none }
  }
  .wipe img, img.wipe{ animation:flkr-wipe linear both; animation-timeline:view(); animation-range:entry 0% entry 70% }
}

/* ── journal teaser cards (homepage and journal index) ─────────────── */
.jr-grid{ display:grid; gap:clamp(18px,2.4vw,28px); grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:clamp(28px,4vw,48px) }
.jr{ display:grid; gap:14px; align-content:start; color:inherit; text-decoration:none }
.jr-img{ display:block; aspect-ratio:4/3; overflow:hidden; border-radius:var(--r,2px); background:var(--ink-deep,#081011) }
.jr-img img{ width:100%; height:100%; object-fit:cover; display:block; transition:transform .9s cubic-bezier(.2,.7,.2,1) }
.jr:hover .jr-img img, .jr:focus-visible .jr-img img{ transform:scale(1.035) }
.jr-k{ display:flex; align-items:center; gap:10px; font-family:var(--mono); font-size:10.5px; letter-spacing:.22em;
  text-transform:uppercase; color:var(--bone-3) }
.jr-k i{ width:7px; height:7px; border-radius:1px; flex:none }
.jr-t{ font-size:clamp(19px,1.7vw,23px); line-height:1.22; letter-spacing:-0.015em; font-weight:400; color:var(--bone) ; margin:0 }
.jr:hover .jr-t{ color:var(--brass-lift,#D9B37A) }
.jr-d{ font-size:14.5px; line-height:1.6; color:var(--bone-2); margin:0 }
.jr-more{ margin-top:clamp(26px,3.5vw,40px); display:flex; justify-content:flex-start }
@media (max-width:900px){ .jr-grid{ grid-template-columns:repeat(2,minmax(0,1fr)) } }
@media (max-width:600px){ .jr-grid{ grid-template-columns:1fr } }

/* ── reduced motion: everything above becomes static ──────────────── */
@media (prefers-reduced-motion:reduce){
  @view-transition{ navigation:none }
  .nav::after{ animation:none; transform:scaleX(0) }
  .wipe img, img.wipe{ animation:none !important; clip-path:none; transform:none }
  .jr-img img{ transition:none }
}
