/* BiteSized motion, the stylesheet half (motion.js is the other). One curve, --ease-out, for everything
   that moves; what arrives takes about 400 ms, what leaves about 150 ms; nothing bounces. Loaded last in
   the head so it settles what the older rules left in several dialects. */

/* ── dialogs: the veil fades, the sheet rises into place from a touch smaller; leaving is quieter ── */
@keyframes mfade { to { opacity: 1; } }
@keyframes mpop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes mfadeout { to { opacity: 0; } }
@keyframes mpopout { to { opacity: 0; transform: translateY(6px) scale(.985); } }
.modal-backdrop { animation: mfade .2s linear forwards; }
.modal-panel { animation: mpop .45s var(--ease-out) forwards; }
.modal-closing .modal-backdrop { animation: mfadeout .15s ease-out forwards; }
.modal-closing .modal-panel { animation: mpopout .15s ease-out forwards; }
/* what a dialog holds lands a beat after the sheet, head first */
/* (on the translate property and released when done, so a child's own transform is never touched) */
@keyframes bs-part { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.modal-root:not(.modal-closing) .modal-panel > :where(*) { animation: bs-part .4s var(--ease-out) backwards; }
.modal-root:not(.modal-closing) .modal-panel > :where(:nth-child(1)) { animation-delay: .05s; }
.modal-root:not(.modal-closing) .modal-panel > :where(:nth-child(2)) { animation-delay: .09s; }
.modal-root:not(.modal-closing) .modal-panel > :where(:nth-child(3)) { animation-delay: .13s; }
.modal-root:not(.modal-closing) .modal-panel > :where(:nth-child(n+4)) { animation-delay: .17s; }

/* ── the entrance classes older code still uses ── */
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* a card that replaces its skeleton is there from the first frame and only settles into place: started from
   nothing, a busy first second left the feed blank between the skeleton and the cards */
@keyframes bs-card-in { from { transform: translateY(10px); } to { transform: none; } }
.card-enter { opacity: 1; animation: bs-card-in .42s var(--ease-out) both; }
.pop { animation: pop-in .22s var(--ease-out) forwards; }

/* ── words of a headline that arrive one after another ── */
.bs-w { display: inline-block; will-change: transform, opacity, filter; }

/* ── the sidebar's selection: one pill that glides between the places ── */
.nav-glide { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 8px; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, color-mix(in srgb, var(--color-brand) 12%, transparent) 0%, color-mix(in srgb, var(--color-brand) 4%, transparent) 40%, color-mix(in srgb, var(--color-foreground) 3%, transparent) 100%);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,.08), 0 1px 3px rgba(0,0,0,.08);
  transition: transform .42s var(--ease-out), width .42s var(--ease-out), height .42s var(--ease-out), opacity .2s linear; }
.nav-glide::before { content: ''; position: absolute; left: 0; top: 50%; width: 2px; height: 16px; margin-top: -8px; border-radius: 0 999px 999px 0; background: var(--color-brand); box-shadow: 0 0 6px color-mix(in srgb, var(--color-brand) 80%, transparent); }
html[data-nav="collapsed"] .nav-glide::before { display: none; }
html.has-nav-glide #appSidebar nav .nav-link { z-index: 1; }
html.has-nav-glide #appSidebar nav .nav-link.active { background: none; box-shadow: none; }
html.has-nav-glide #appSidebar nav .nav-link.active .nav-bar { opacity: 0; }

/* ── notices ── */
/* Where a notice sits and how it moves; its look (one pill, the mark and the words on one line) is in clean-first.css,
   section 8. 17 November 2026, the owner: the pill at the foot looked broken and lay over the edge of the page's frame.
   On a wide screen it sits inside the page's frame, 16px from its corner; on a phone it is centred above the bottom bar
   (10px of air over it), and where the bar steps away (a post's page) near the foot. It arrives with a fade and a small
   rise, and leaves with a fade. */
.bs-toast { position: fixed; z-index: 1000; right: calc(var(--fam-right, 12px) + 16px); bottom: calc(var(--frame, 12px) + 16px); max-width: min(440px, calc(100vw - 48px)); cursor: default;
  animation: bs-toast-in .32s var(--ease-out) both; transition: translate .35s var(--ease-out), opacity .2s ease-out; }
@keyframes bs-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bs-toast.is-leaving { opacity: 0; pointer-events: none; }
@media (max-width: 1023.98px) { .bs-toast { left: 16px; right: 16px; width: max-content; max-width: calc(100vw - 32px); margin: 0 auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
  html.is-post-open .bs-toast:not(.bs-toast--top) { bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* while a dialog is open its buttons are at the foot: the notice comes in at the top (motion.js, sheetOpen) */
  .bs-toast.bs-toast--top { top: calc(12px + env(safe-area-inset-top)); bottom: auto; animation-name: bs-toast-down; } }
@keyframes bs-toast-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── every control answers the pointer ──
   The hover tints were one step too quiet to read on a dark screen (measured by scripts/check/hover-audit.mjs);
   a few controls had a hover rule that a more specific one silenced, and the cards' glow was written but never
   shown (their inline shadow won). Movement is on the translate property, so it never fights a script's transform. */
html:root { --oryn-surface-hover: rgba(255,255,255,.07); --oryn-border-hover: rgba(255,255,255,.2); }
html.light:root { --oryn-surface-hover: rgba(0,0,0,.05); --oryn-border-hover: rgba(0,0,0,.22); }
.feed-card, .consult-card, .np-card { transition: border-color var(--mo-base) var(--ease-out), box-shadow var(--mo-base) var(--ease-out), background-color var(--mo-base) var(--ease-out), translate var(--mo-base) var(--ease-out), scale .15s var(--ease-out); }   /* no transform here: a script moves the cards */
@media (hover: hover) {
  /* the feed card's hover is one quiet border change, written in views/feed.css: no lift and no glow here */
  .feed-card:hover { translate: none; }
  .consult-card:hover, .np-card:hover { translate: 0 -1px; border-color: color-mix(in srgb, var(--color-brand) 45%, var(--color-border)); }
  [role="tablist"] [role="tab"][aria-selected="false"]:hover { color: var(--color-foreground); }
  .cfilter-tab[aria-selected="false"]:hover { background: var(--oryn-surface-hover); }
  summary:hover { color: var(--color-foreground); }
  .sw:hover { filter: brightness(1.18); }
  .user-menu__logout-desktop:hover { background: color-mix(in srgb, var(--color-danger) 14%, transparent); }
  .set-photo:hover { border-color: var(--oryn-border-hover); background: var(--oryn-surface-hover); }
}
:where(img.rounded-full, .avatar, [data-id-avatar] img) { outline: 1px solid rgb(255 255 255 / .1); outline-offset: -1px; }
html.light :where(img.rounded-full, .avatar, [data-id-avatar] img) { outline-color: rgb(0 0 0 / .1); }
:where(h1, h2, h3, .t-h1, .t-h2, .t-title) { text-wrap: balance; }
.tabular-nums, .slot, [data-count] { font-variant-numeric: tabular-nums; }

/* ── a card grows into its page, and the page returns into its card (motion.js, morph) ──
   The old screen stays put and the new one fades in over it, so the bars never dip; the sheet travels and
   resizes on the one curve while what it holds cross-fades from the top. */
@keyframes bs-vt-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bs-vt-out { from { opacity: 1; } to { opacity: 0; } }
html.vt-sheet::view-transition-old(root) { animation: none; }
html.vt-sheet::view-transition-new(root) { animation: bs-vt-in .3s ease-out both; }
html.vt-sheet::view-transition-group(bs-sheet) { animation-duration: .5s; animation-timing-function: var(--ease-out); overflow: clip; border-radius: 12px; }
html.vt-sheet::view-transition-old(bs-sheet), html.vt-sheet::view-transition-new(bs-sheet) { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
html.vt-sheet::view-transition-old(bs-sheet) { animation: bs-vt-out .12s ease-out both; }
html.vt-sheet::view-transition-new(bs-sheet) { animation: bs-vt-in .3s ease-out .08s both; }
/* on the way back (closePostView adds vt-back) the page behind stays while the article travels into its card, and the feed arrives as it lands */
html.vt-sheet.vt-back::view-transition-old(root) { animation: bs-vt-out .22s ease-out .3s both; }
html.vt-sheet.vt-back::view-transition-new(root) { animation: bs-vt-in .26s ease-out .3s both; }
html.vt-sheet.vt-back::view-transition-old(bs-sheet) { animation: bs-vt-out .2s ease-out .3s both; }
html.vt-sheet.vt-back::view-transition-new(bs-sheet) { animation: bs-vt-in .22s ease-out .32s both; }
html.vt-sheet::view-transition-group(bs-bar), html.vt-sheet::view-transition-group(bs-dock) { animation: none; z-index: 2; }
html.vt-sheet::view-transition-old(bs-bar), html.vt-sheet::view-transition-old(bs-dock) { display: none; }
html.vt-sheet::view-transition-new(bs-bar), html.vt-sheet::view-transition-new(bs-dock) { animation: none; }

/* ── reduce motion: everything above stands still ── */
@media (prefers-reduced-motion: reduce) {
  .modal-panel, .modal-backdrop, .modal-root .modal-panel > *, .bs-toast, .pop, .card-enter { animation-duration: .001ms !important; animation-delay: 0s !important; }
  .nav-glide, .bs-toast { transition: none; }
}
