/* Trillium glass extras (shared by HRM, CRM, PMS, Accounts, Portal).
   1. "Morning light" — a soft pastel colour wash behind the glass that shifts
      gently with the time of day (chosen by the user 2026-11-14).
   2. Motion: cards rise in one after another, shimmer while loading, glass toasts.
   3. iPhone-style type: San Francisco on Apple devices, Inter ("Trillium Sans")
      elsewhere; bold, tightly spaced headings and numbers like iOS.
   Everything is screen-only and switches on only when <html> has .glass and .fx
   (fx.js adds .fx). App-specific selectors are injected by fx.js from
   window.TRILLIUM_FX. */
@font-face {
  font-family: 'Trillium Sans';
  src: url('/assets/glass/inter-latin.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@media screen {
  /* ---- 1. "Morning light" backdrop, shifting with the time of day ---- */
  html.glass.fx { --fx-a: #d9ecb0; --fx-b: #ffd8bf; --fx-c: #bfe3d4; --fx-d: #fbe6b0; --fx-1: #f4f8ec; --fx-2: #fdf3ea; --fx-3: #eef6f0; }
  html.glass.fx[data-daypart="morning"] { --fx-a: #e3efb8; --fx-b: #ffe0c2; --fx-c: #cbe9d6; --fx-d: #fdeab4; --fx-1: #f7f9ec; --fx-2: #fff5e8; --fx-3: #f1f7ee; }
  html.glass.fx[data-daypart="evening"] { --fx-a: #d4e6a6; --fx-b: #ffcfb0; --fx-c: #f6d9c4; --fx-d: #f9dc9c; --fx-1: #f6f4e6; --fx-2: #fdeee2; --fx-3: #f5efe4; }
  html.glass.fx[data-daypart="night"]   { --fx-a: #cfe2b4; --fx-b: #f2d6c8; --fx-c: #c3dfd6; --fx-d: #e9dcb6; --fx-1: #eef3ea; --fx-2: #f5efe9; --fx-3: #e9f1ee; }
  html.glass-dark.fx { --fx-a: #2c3d1c; --fx-b: #4a2f22; --fx-c: #1d3a33; --fx-d: #43391b; --fx-1: #10160d; --fx-2: #17130f; --fx-3: #0e1512; }

  html.glass.fx body::before {
    background:
      radial-gradient(55% 45% at 12% 12%, var(--fx-a) 0%, transparent 62%),
      radial-gradient(50% 42% at 92% 10%, var(--fx-b) 0%, transparent 62%),
      radial-gradient(65% 50% at 78% 92%, var(--fx-c) 0%, transparent 65%),
      radial-gradient(50% 45% at 8% 88%, var(--fx-d) 0%, transparent 62%),
      linear-gradient(160deg, var(--fx-1), var(--fx-2) 55%, var(--fx-3)) !important;
    filter: none !important;
  }

  /* ---- 2. Motion ---- */
  /* translate/scale (not transform) so an element's own transform — centring,
     hover lift — is left alone. */
  @keyframes fx-rise { from { opacity: 0; translate: 0 12px; scale: 0.985; } to { opacity: 1; translate: none; scale: none; } }
  @keyframes fx-drop { from { opacity: 0; translate: 0 -14px; scale: 0.96; } to { opacity: 1; translate: none; scale: none; } }
  @keyframes fx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
  .fx-skel {
    color: transparent !important; display: inline-block; min-width: 2.6em; min-height: 0.8em; border-radius: 8px; vertical-align: middle;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 25%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0.25) 75%) 0 0 / 200% 100%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: fx-shimmer 1.4s linear infinite;
  }
  html.glass-dark .fx-skel { background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.04) 75%) 0 0 / 200% 100%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }

  /* ---- 3. iPhone-style type ---- */
  html.glass.fx body, html.glass.fx [style*="font-family"] {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Trillium Sans", Inter, system-ui, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
  html.glass.fx :is(button, input, select, textarea) { font-family: inherit; }
  html.fx .fx-num { font-variant-numeric: tabular-nums; }
}
/* ---- Speed (2026-11-14): live blur is expensive, so it is kept only where
   one element sits over moving content — the top bar, open modals, the
   drawer menu and toasts. Buttons, chips, links, table cells, sticky
   columns and tooltips keep their glass colour but no live blur (there is
   little behind them to blur). The grain layer is dropped and the backdrop
   is given its own layer so scrolling never repaints it. ---- */
@media screen {
  html.glass.fx :is(button, a, input, select, textarea, label, th, td, [role="button"], [class*="btn"], [class*="chip"], [class*="pill"], [class*="tip"], [class*="badge"], [style*="position: sticky"], [style*="position: absolute"]) {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  html.glass.fx body::after { display: none !important; }
  html.glass.fx body::before { will-change: transform; transform: translateZ(0); }
}
@media screen and (prefers-reduced-motion: reduce) {
  html.fx * { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .fx-skel { animation: none; }
}
@media print {
  html.fx body::before, html.fx body::after { display: none !important; }
}
