/* ============================================================
   Portal redesign layer — applies the homepage's award-winning
   pass (grain, magnetic CTA, considered entrances) to the parent
   and teacher-facing pages, without touching portal.css itself.
   Loaded after portal.css on every portal/legal page.
============================================================ */

/* Replace portal.css's blanket fade-up keyframes: the JS layer now
   drives a single orchestrated entrance + a reveal-on-render for
   anything the app injects later, so switch these off to avoid a
   double-animation flash. */
@media (prefers-reduced-motion: no-preference) {
  .bar,
  .wrap > .page-head, .wrap > .panel, .wrap > .section, .wrap > h1, .wrap > p.lede,
  .login > h1, .login > p.lede, .login > p.home,
  .panel, .list li, .entry {
    animation: none !important;
  }
}

/* Elements the redesign JS animates in start hidden via inline
   opacity/transform set at runtime, not CSS, so content still shows
   if JS fails to load (progressive, never a blank page). */

/* Word-split spans used by the page heading's blur-in entrance */
.wrap h1 .sp, .login h1 .sp { will-change: transform, opacity, filter; display: inline-block; }

/* Magnetic-hover wrapper for the primary action on each page
   (Sign in, Save, etc.) — keeps the button's own size/markup intact. */
.magnet { display: inline-block; }
.magnet > .btn { display: inline-block; will-change: transform; }

/* A touch more depth on the surfaces parents actually read from,
   so the dashboard feels considered rather than purely functional. */
.panel {
  box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.06);
  transition: box-shadow .3s ease;
}
html[data-theme="dark"] .panel {
  box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 10px 30px rgba(0,0,0,.3);
}
.list li, .stat-tile, .kind-card {
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.list li:hover { border-color: var(--border-strong); }
.stat-tile:hover, .kind-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }

/* A calmer, more deliberate loading state than three plain bouncing
   dots — a soft shimmer line under them hints that real content is
   on its way, matching the brand's gold rather than a generic grey. */
.loading { position: relative; }
.loading::after {
  content: ''; position: absolute; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  width: 72px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  background-size: 200% 100%;
  animation: loadingShimmer 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .loading::after { animation: none; opacity: .4; } }
@keyframes loadingShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Subtle sitewide grain, matching the homepage's pass — just enough
   to lift the flat card colours off the screen. */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 998; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
