/* ==========================================================================
   Site-wide typography and motion. Loaded last on every page (includes/head.php).
   Motion script: assets/js/site-motion.js
   ========================================================================== */

/* ---------- one font everywhere (DM Sans). Icon fonts are left alone. ---------- */
:root { --twk-font: 'DM Sans', -apple-system, 'Segoe UI', sans-serif; --tp-ff-body: var(--twk-font); --tp-ff-heading: var(--twk-font); --tp-ff-p: var(--twk-font); }
html body,
html body :is(h1, h2, h3, h4, h5, h6, p, a, li, div, section, article, header, footer, nav, button, input, select, textarea, option, label, legend, summary, table, th, td, strong, b, em, small, blockquote, figcaption, address, dt, dd),
html body span:not([class*="fa-"], [class*="flaticon"], .fa, .fas, .fab, .far, .fal, .fad, .bi) { font-family: var(--twk-font) !important; }

/* ---------- comfortable base text ---------- */
html body { font-size: 17px; line-height: 1.7; }
html body main p:not([class]) { font-size: max(17px, 1em); }
html body :is(input, select, textarea) { font-size: max(16px, 1em); }   /* 16px+ also stops iPhones zooming into form fields */

/* ---------- motion ---------- */
.sm-progress { position: fixed; left: 0; top: 0; z-index: 100001; width: 100%; height: 3px; background: linear-gradient(90deg, #169ef5, #ffd749); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.sm-wait { opacity: 0 !important; }

@media (prefers-reduced-motion: no-preference) {
  /* page headline eases in */
  html body main h1 { animation: smRise .9s cubic-bezier(.16, 1, .3, 1) both; }
  /* menu links: underline grows from the left */
  .twiki-primary-nav > a { background: linear-gradient(#169ef5, #169ef5) left bottom / 0 2px no-repeat; transition: background-size .35s ease, color .25s ease; }
  .twiki-primary-nav > a:hover, .twiki-primary-nav > a:focus-visible { background-size: 100% 2px; }
  /* footer links nudge, social icons lift */
  .twiki-footer-col li a { display: inline-block; transition: translate .25s ease, color .25s ease; }
  .twiki-footer-col li a:hover { translate: 5px 0; }
  .twiki-footer-social a { transition: translate .3s cubic-bezier(.2, .8, .2, 1), background-color .25s ease; }
  .twiki-footer-social a:hover { translate: 0 -5px; }
}
@keyframes smRise { from { opacity: 0; translate: 0 26px; } }
@media (prefers-reduced-motion: reduce) { .sm-progress { display: none; } .sm-wait { opacity: 1 !important; } }
@media print { .sm-progress { display: none; } .sm-wait { opacity: 1 !important; } }
