/* Walker.OS — shared refinements.
   Loaded after each page's own <style>, so it only tunes spacing, motion and
   states. Every color comes from that page's existing tokens (--accent, --text). */

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .38s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
@supports not (view-transition-name: none) {
  body { animation: pg-in .45s cubic-bezier(.16, 1, .3, 1) both; }
}
@keyframes pg-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pg-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- type + global states ---------- */
html { -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; }
body { font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 22%, transparent) transparent; }

/* ---------- desktop (index) ---------- */
.w.o:not(.mx) { animation: pw-open .3s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes pw-open {
  from { opacity: 0; transform: scale(.95) translateY(12px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
.w-tb .d .dt { transition: transform .15s ease, filter .15s ease; }
.w-tb .d .dt:hover { transform: scale(1.12); }
.w-bd h2 { letter-spacing: -.01em; margin-bottom: 5px; }
.w-bd .st { letter-spacing: .8px; }
.w-bd p { line-height: 1.78; max-width: 70ch; }

.tb { backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); }
.tb-app, .tb-start { transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease; }
.tb-app img { transition: transform .28s cubic-bezier(.16, 1, .3, 1); }
.tb-app:hover img { transform: translateY(-2px) scale(1.18); }
.tb-app:active, .tb-start:active { transform: scale(.94); }

.wc { transition: border-color .2s ease, background .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease; }
.wc:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.btn { transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease; }
.btn:active { transform: scale(.96); }
.gi { transition: border-color .2s ease, transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease; }
.gi:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .4); }
.gi img { transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.lc { transition: background .2s ease, border-color .2s ease, transform .25s cubic-bezier(.16, 1, .3, 1); }
.lc:active { transform: scale(.98); }
.cf .fl input:focus, .cf .fl textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.mp-card { transition: transform .35s cubic-bezier(.16, 1, .3, 1), border-color .2s ease, background .2s ease, box-shadow .35s ease; }
.mp-card:active { transform: translateY(-3px) scale(.98); }
.ms-btn { transition: opacity .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1); }
.ms-btn:hover { transform: scale(1.06); }

/* ---------- gallery ---------- */
.header { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.home-btn { transition: background .2s ease, border-color .2s ease, transform .15s ease; }
.home-btn:active { transform: scale(.96); }
.content .desc { max-width: 70ch; line-height: 1.75; }
.cat { animation: pg-rise .6s cubic-bezier(.16, 1, .3, 1) both; }
.cat:nth-of-type(2) { animation-delay: .06s; }
.cat:nth-of-type(3) { animation-delay: .12s; }
.cat:nth-of-type(n+4) { animation-delay: .18s; }
.cat h2 { letter-spacing: 1.5px; }
.card { transition: border-color .25s ease, transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease; }
.card:hover { transform: translateY(-3px); }
.card img { transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.lb.show .lb-inner { animation: lb-in .35s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-nav, .lb .lb-close { transition: color .2s ease, transform .15s ease; }
.lb-nav:active { transform: translateY(-50%) scale(.92); }

/* ---------- links + media, all pages ---------- */
.w-bd a:not(.btn):not(.lc), .footer a, .content .desc a {
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.w-bd img, .card img, .about-photo img { image-rendering: auto; }
.w-tb { transition: background .2s ease; }
.tb-start:hover { transform: translateY(-1px); }
.mp-card:focus-visible, .lc:focus-visible, .btn:focus-visible, .tb-app:focus-visible { outline-offset: 3px; }

/* ---------- law library ---------- */
.term > summary, .cls > summary, .ch summary { transition: background .2s ease, color .2s ease; }
.brief { transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1); }
.brief:hover { transform: translateX(2px); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
