/* ===========================================================================
   ClearMind Pro — UI/UX Polish Layer
   ---------------------------------------------------------------------------
   Pure CSS + tiny JS. No libraries, no DOM changes, no ID changes.

   Loaded AFTER the Tailwind CDN script. The Play CDN generates utilities at
   runtime and injects them into <head>, so rules that must win over utilities
   use !important. That is deliberate, not sloppiness.

   Sections:
     1. Tokens
     2. Overflow / safe-area guard
     3. Touch ergonomics (mobile)
     4. Bottom sheets (mobile)
     5. Micro-interactions (60fps)
     6. Skeletons & loading
     7. Glassmorphism / depth / glow
     8. KaTeX & whiteboard typography
     9. Typography contrast & scrollbars
    10. Reduced motion
   =========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --cm-bg: #050714;
  --cm-surface: #0c0e17;
  --cm-surface-2: #121527;
  --cm-line: rgba(255, 255, 255, 0.10);
  --cm-line-strong: rgba(255, 255, 255, 0.18);
  --cm-cyan: #22d3ee;
  --cm-violet: #8b5cf6;
  --cm-fuchsia: #d946ef;
  --cm-text: #e8ecf8;
  --cm-muted: #a8b3cf;

  --cm-spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  --cm-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --cm-sat: env(safe-area-inset-top, 0px);
  --cm-sab: env(safe-area-inset-bottom, 0px);
  --cm-sal: env(safe-area-inset-left, 0px);
  --cm-sar: env(safe-area-inset-right, 0px);
}

/* ---------- 2. Overflow / safe-area guard -------------------------------- */
/* `clip` (not `hidden`) prevents horizontal scroll without creating a new
   scroll container, so position:sticky/fixed children keep working. */
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
body {
  overflow-x: clip;
  background-color: var(--cm-bg);
  color: var(--cm-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}

/* Nothing may force the document wider than the viewport. */
img, svg, video, canvas, iframe, pre, code, table,
.katex, .katex-display, .katex-block {
  max-width: 100%;
}

/* Wrap content, not every glass control: wrapping buttons produced one-letter
   vertical labels when the header ran out of room. Equations scroll locally. */
#chatMessagesContainer, .chat-bubble, .bento-card, .cmd-palette-box {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
button, .global-nav-link, .canvas-tab-btn { word-break: normal; }
#chatMessagesContainer > div > div { min-width: 0; }
#chatMessagesContainer .katex { overflow-wrap: normal; word-break: normal; }
.cm-dialog-open { overflow: hidden !important; }

/* Tap delay removal — every clickable element. */
button, a, [role="button"], input, select, textarea, summary, label {
  touch-action: manipulation;
}

/* ---------- 3. Touch ergonomics ----------------------------------------- */
@media (max-width: 767px) {
  /* 48px minimum for anything a thumb is meant to hit. */
  button:not([data-tap-tight]),
  [role="button"]:not([data-tap-tight]),
  .blitz-opt-btn,
  .cmd-item,
  .blitz-config-pill,
  .tab-pill,
  a[role="button"] {
    min-height: 48px !important;
    min-width: 48px !important;
  }

  /* Give full-width controls breathing room from the rounded screen edges. */
  #chatInputBarContainer,
  #chatInputForm {
    padding-left: calc(0.5rem + var(--cm-sal));
    padding-right: calc(0.5rem + var(--cm-sar));
  }

  /* Floating stacks stay clear of the home indicator / gesture bar. */
  .fixed.bottom-4, .fixed.bottom-5, .fixed.bottom-6,
  [class*="fixed"][class*="bottom-"] {
    padding-bottom: var(--cm-sab);
  }

  /* Quiz options need real vertical padding once they are 48px tall. */
  .blitz-opt-btn {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    align-items: center;
  }

  /* Inputs must be >=16px or iOS Safari zooms the page on focus. */
  input, textarea, select {
    font-size: max(16px, 1em) !important;
  }
}

/* ---------- 4. Bottom sheets (mobile) ----------------------------------- */
.cm-sheet-handle { display: none; }
@media (max-width: 767px) {
  #profileModal:not(.hidden), #authModal.active, #onboardingModal.active,
  #cmdPaletteModal:not(.hidden), #shortcutsModal:not(.hidden) {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    background: rgba(2, 4, 12, 0.72) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  /* Explicit panels only. Never animate/style a modal backdrop as a sheet. */
  #profileModal > .cm-sheet-panel, #authModal > .cm-sheet-panel,
  #onboardingModal > .cm-sheet-panel, #cmdPaletteModal > .cm-sheet-panel,
  #shortcutsModal > .cm-sheet-panel {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(90dvh, calc(var(--cm-viewport-height, 100dvh) - 12px)) !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: 0 !important;
    padding-bottom: calc(16px + var(--cm-sab)) !important;
    overscroll-behavior: contain;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.4) !important;
    transform: none;
  }
  #authModal > .cm-sheet-panel, #profileModal > .cm-sheet-panel,
  #shortcutsModal > .cm-sheet-panel { overflow-y: auto !important; }
  #onboardingModal > .cm-sheet-panel { height: 90dvh !important; }
  #onboardingModal .modal-body-scroll, #cmdPaletteResults { min-height: 0; overscroll-behavior: contain; }
  .cm-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    touch-action: none;
    cursor: grab;
  }
  .cm-sheet-handle > span { width: 44px; height: 4px; background: #7e8aa7; border-radius: 99px; }
  .cm-sheet-handle:active { cursor: grabbing; transform: none !important; }
  #authModal.active > .cm-sheet-panel, #onboardingModal.active > .cm-sheet-panel,
  #profileModal:not(.hidden) > .cm-sheet-panel, #cmdPaletteModal:not(.hidden) > .cm-sheet-panel,
  #shortcutsModal:not(.hidden) > .cm-sheet-panel { animation: cm-sheet-in 220ms var(--cm-ease); }
}

@keyframes cm-sheet-in {
  from { transform: translateY(14%); opacity: 0.4; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ---------- 5. Micro-interactions (60fps) -------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  button, a, [role="button"],
  .glass, .glass-strong, .bento-card, .lift,
  .blitz-opt-btn, .cmd-item, .blitz-config-pill {
    transition:
      transform 0.18s var(--cm-ease),
      box-shadow 0.28s var(--cm-ease),
      background-color 0.2s var(--cm-ease),
      border-color 0.2s var(--cm-ease),
      opacity 0.2s var(--cm-ease);
    /* Avoid permanently promoting every card/control to a GPU layer. */
  }
}

/* Tactile press feedback. Excludes 3D/canvas elements whose transform is owned
   by JS — scaling those would fight the animation loop. */
@media (prefers-reduced-motion: no-preference) {
  button:active:not([data-no-tap]),
  [role="button"]:active:not([data-no-tap]),
  .blitz-opt-btn:active,
  .cmd-item:active,
  .blitz-config-pill:active,
  .lift:active {
    transform: scale(0.955);
  }
}
/* Never transform a whole glass panel or override a flashcard's flipped state.
   Their existing transforms, canvas sizing and audio animation stay owned by
   the original feature code. */

/* Focus rings: visible for keyboards, quiet for mouse/touch. */
:focus-visible {
  outline: 2px solid var(--cm-cyan);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- 6. Skeletons & loading --------------------------------------- */
@keyframes cm-shimmer {
  0%   { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}
@keyframes cm-dot {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.45; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

.cm-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.045) 25%,
    rgba(255, 255, 255, 0.11) 37%,
    rgba(255, 255, 255, 0.045) 63%
  );
  background-size: 840px 100%;
  animation: cm-shimmer 1.4s linear infinite;
}
.cm-skeleton-line { height: 12px; margin: 9px 0; }
.cm-skeleton-line:last-child { width: 62%; }

.cm-loading-host { position: relative; min-height: 180px; }
.cm-loading-overlay {
  position: absolute; inset: 0; z-index: 15; min-height: 180px;
  border: 1px solid var(--cm-line); border-radius: 20px;
  padding: 24px; background: rgba(12, 14, 23, 0.97);
  display: flex; flex-direction: column; justify-content: flex-start;
}
.cm-loading-caption { color: #dce3f4; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.cm-feature-error { border: 1px solid #9f664b; border-radius: 16px; padding: 16px; color: #ffe1c9; background: #271b20; }
.cm-feature-error button { min-height: 48px; padding: 10px 16px; border: 1px solid #ac7b67; border-radius: 12px; margin-top: 12px; }

/* Upgrade the existing Luna typing bubble into a shimmering skeleton card.
   Pure CSS — no JS change, DOM untouched. */
#lunaTypingIndicator .glass {
  min-width: 0;
  width: min(240px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-block: 0.85rem !important;
}
#lunaTypingIndicator .glass::before {
  content: "";
  display: block;
  width: 132px;
  height: 8px;
  margin-bottom: 7px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(167, 139, 250, 0.42) 37%,
    rgba(255, 255, 255, 0.05) 63%
  );
  background-size: 420px 100%;
  animation: cm-shimmer 1.25s linear infinite;
}
#lunaTypingIndicator .glass::after {
  content: "";
  display: block;
  width: 88px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(34, 211, 238, 0.3) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 420px 100%;
  animation: cm-shimmer 1.25s linear infinite reverse;
}

/* ---------- 7. Glassmorphism / depth / glow ------------------------------ */
.glass, .glass-strong {
  border: 1px solid var(--cm-line) !important;
  background-image: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.018) 45%,
    rgba(255, 255, 255, 0) 100%
  ) !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
    0 10px 30px -12px rgba(0, 0, 0, 0.6) !important;
}
.glass:hover, .glass-strong:hover {
  border-color: var(--cm-line-strong) !important;
}

/* Radial mesh glow behind "active" cards — Linear/Apple-style depth. */
.bento-card {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--cm-line) !important;
}
.bento-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s var(--cm-ease);
  background:
    radial-gradient(60% 55% at 22% 0%,  rgba(139, 92, 246, 0.20), transparent 70%),
    radial-gradient(55% 60% at 88% 12%, rgba(34, 211, 238, 0.16), transparent 72%),
    radial-gradient(70% 70% at 50% 110%, rgba(217, 70, 239, 0.12), transparent 70%);
  pointer-events: none;
}
.bento-card:hover::before,
.bento-card:focus-within::before,
.bento-card[aria-selected="true"]::before {
  opacity: 1;
}

/* Status pills / badges: razor-sharp edges + subtle inner highlight. */
.shimmer-badge,
.motion-hud-badge,
#chatPersonaBadge,
.persona-badge-mentor,
.persona-badge-strict,
.persona-badge-polymath,
.persona-badge-socratic,
.persona-badge-hacker,
.persona-badge-feynman {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 2px 8px -3px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.02em;
}

/* ---------- 8. KaTeX & whiteboard typography ----------------------------- */
.katex, .katex-display, .katex-block {
  color: #f4f7ff !important;
  font-weight: 500;
  text-rendering: auto;
}
.katex-display, .katex-block {
  padding: 0.75rem 0.35rem !important;
  margin: 0.6rem 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
/* Long equations scroll instead of blowing out the card on a phone. */
.katex-display > .katex {
  white-space: nowrap;
  padding-right: 0.25rem;
}
@media (max-width: 767px) {
  .katex { font-size: 1.02em; }
  .katex-display { font-size: 0.98em; }
}

/* Tutor cue cards: distinct, high-contrast surfaces. */
#chatMessagesContainer .glass {
  border: 1px solid var(--cm-line) !important;
  line-height: 1.65;
}
#chatMessagesContainer strong { color: #ffffff; }

/* ---------- 9. Typography contrast & scrollbars --------------------------- */
h1, h2, h3, h4 {
  color: #f6f8ff;
  letter-spacing: -0.015em;
}
/* Lift the faintest greys to meet contrast on a near-black background. */
.text-slate-500 { color: #94a3b8 !important; }
.text-slate-400 { color: #a9b4cc !important; }
.text-gray-400  { color: #a5b0c8 !important; }
.text-slate-300 { color: #c3cbdd !important; }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }

::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

/* ---------- 10. Modern Obsidian Cockpit & Classroom Polish --------------- */
#globalNavbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(7, 9, 20, 0.88) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
}

/* Left Mini-Sidebar Dock floating capsule */
aside.hidden.sm\:flex {
  background: rgba(10, 13, 29, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

/* Left Chat Section modern glass container */
#leftChatSection {
  background: rgba(10, 13, 30, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}

#chatStreamHeader {
  background: rgba(13, 17, 38, 0.6) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

/* Right Canvas Section modern glass container */
#rightCanvasSection {
  background: rgba(10, 13, 30, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}

/* Canvas top tab bar */
.canvas-tab-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%) !important;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Quick Action Cards in Canvas */
#pageClassroom .grid > div {
  background: rgba(14, 18, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(16px) !important;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

#pageClassroom .grid > div:hover {
  background: rgba(18, 23, 54, 0.75) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(139, 92, 246, 0.2) !important;
}

/* Chat Input Bar floating appearance */
#chatInputForm {
  background: rgba(14, 18, 40, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s ease !important;
}

#chatInputForm:focus-within {
  border-color: rgba(139, 92, 246, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), 0 12px 36px rgba(0, 0, 0, 0.5) !important;
}

/* Speech bubbles modern polish */
.chat-bubble, #chatMessagesContainer .glass {
  background: rgba(14, 18, 40, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  padding: 1.1rem 1.25rem !important;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4) !important;
}

/* ---------- 11. Measured viewport and touch corrections ------------------- */
#globalNavbar > div, #topWorkspaceNav, #pageClassroom > main,
#leftChatSection, #rightCanvasSection, #chatMessageInput { min-width: 0; }
#topWorkspaceNav { flex-shrink: 1; max-width: 100%; }
#chatInputForm { gap: 6px; }
#chatMessageInput { width: 0; min-width: 0; line-height: 1.5; }
#chatStreamHeader { gap: 12px; }
#chatStreamHeader > div:first-child { flex: 1; min-width: 0; }
#chatStreamHeader > div:first-child > div:last-child { min-width: 0; }
#chatStreamHeader > div:first-child > div:last-child > div:first-child { flex-wrap: wrap; }
#chatStreamHeader > div:last-child { flex-shrink: 0; }
#chatStreamHeader h2 { min-width: 0; flex-wrap: wrap; }
#chatActiveTopic { overflow-wrap: anywhere; }
#teachingModeBtn, #chatPersonaBadge { white-space: nowrap; }
@media (min-width: 1024px) and (max-width: 1535px) {
  #globalNavbar > div { flex-wrap: wrap; }
  #topWorkspaceNav { order: 3; width: 100%; justify-content: center; }
  #globalNavbar > div > div:last-child { margin-left: auto; }
}
@media (min-width: 1024px) {
  #leftChatSection, #rightCanvasSection {
    height: calc(100dvh - var(--cm-navbar-height, 74px) - 32px);
    min-height: 420px;
  }
  #pageClassroom { min-height: 0; }
  #chatStreamHeader { flex-wrap: wrap; }
}
@media (max-width: 1023px) {
  body.cm-app { height: var(--cm-viewport-height, 100dvh) !important; min-height: 0 !important; max-height: var(--cm-viewport-height, 100dvh) !important; }
  body.cm-app #workspacePages { height: auto !important; padding: 0 !important; }
  body.cm-app #pageClassroom { padding: 4px 8px 0 !important; }
  #pageClassroom > aside { display: none !important; }
  #chatStreamHeader { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  #chatStreamHeader > div:last-child { margin-left: auto; }
  #chatStreamHeader > div:first-child { flex-basis: 100%; }
  #chatStreamHeader h2 { font-size: 13px; }
  #chatStreamHeader h2 #chatActiveTopic { font-family: inherit; font-style: normal; font-size: 13px; }
  #chatStreamHeader > div:first-child > div:last-child > div:first-child > span { white-space: nowrap; }
  #chatStreamHeader > div:first-child > div:last-child > div:last-child p { font-size: 11px; }
  #leftChatSection #chatMessagesContainer > div { max-width: 100% !important; }
  #chatMessagesContainer .glass { padding: 12px !important; font-size: 14px; }
  #chatMessageInput { font-size: 16px !important; min-height: 48px; padding-block: 12px; }
  #chatSendBtn, #chatMicBtn, label[for="chatPhotoInput"] {
    min-width: 48px !important; min-height: 48px !important;
    display: flex; align-items: center; justify-content: center;
  }
  #chatInputBarContainer { padding: 6px 6px max(8px, env(safe-area-inset-bottom)) !important; }
  #chatInputForm { padding: 4px !important; }
  #suggestedChipsDock { padding: 4px 8px; }
  #suggestedChipsDock button { white-space: nowrap; }
  #mobileWorkspaceSegment { order: 2; margin: 4px 0 0 !important; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  #pageClassroom > main { order: 1; }
  .cm-keyboard-open #suggestedChipsDock, .cm-keyboard-open #mobileWorkspaceSegment { display: none !important; }
  .cm-keyboard-open #chatStreamHeader { display: none; }
  #chatStreamHeader, #leftChatSection, #rightCanvasSection { backdrop-filter: none !important; }
}
@media (max-width: 767px) {
  #globalNavbar > div > div:first-child { gap: 8px; min-width: 0; }
  #globalNavbar > div > div:first-child > a { gap: 6px; min-width: 0; flex: 1; }
  #globalNavbar > div > div:first-child > a > div:last-child > div > span:last-child { display: none; }
  #globalNavbar > div > div:first-child > div { gap: 4px; }
  #globalNavbar [title="Daily Streak"], #globalNavbar [title="Total XP"] { display: none; }
  #languageSelectMobile { max-width: 108px; min-height: 48px; font-size: 14px !important; }
  #headerProfileBtnMobile { justify-content: center; }
  #topWorkspaceNav a { display: inline-flex; min-width: 48px; min-height: 48px; align-items: center; }
  #topWorkspaceNav button { white-space: nowrap; }
  a.btn-primary, a.btn-secondary, #authModal input, #profileModal input, #profileModal select { min-height: 48px; }
  #closeAuthModalBtn { z-index: 2; top: 12px; right: 12px; }
  #authModal .cm-sheet-handle { width: calc(100% - 48px); }
}
@media print {
  .cm-sheet-handle, .cm-loading-overlay { display: none !important; }
  .katex, .katex-display, .katex-block { color: #111827 !important; overflow: visible !important; }
}

/* Footer links wrap instead of disappearing outside narrow landing pages. */
footer > div > div { min-width: 0; flex-wrap: wrap; justify-content: center; }
@media (max-width: 1023px), (pointer: coarse) {
  button:not([data-tap-tight]), [role="button"]:not([data-tap-tight]),
  #topWorkspaceNav a, #chatSendBtn, #chatMicBtn, label[for="chatPhotoInput"] {
    min-width: 48px !important; min-height: 48px !important;
  }
  footer a { min-height: 48px; display: inline-flex; align-items: center; }
}

/* ---------- 12. Reduced motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

