/* Open-Props v1.7.10 + @radix-ui/colors (Sand / Sage) — MIT License
 * AlphaGuru v2.0 Locked Design Tokens (Section 3.10 & Section 8.1.B)
 */
@font-face {
  font-family: 'Excalifont';
  src: local('Excalifont'), local('Kalam'), local('Segoe Print'), local('Bradley Hand');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kalam';
  src: local('Kalam'), local('Excalifont'), local('Segoe Print'), local('Comic Sans MS');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Scholar's Desk Warm Cream & Chalk Palette */
  --ag-bg-canvas: #FFFAF0;
  --ag-bg-elevated: #F5EFE6;
  --ag-bg-card: #FFFFFF;
  --ag-ink-primary: #1E1B18;
  --ag-ink-secondary: #57534E;
  --ag-border-hairline: #E7E0D6;
  --ag-accent-sage: #0D9488;
  --ag-accent-indigo: #4F46E5;
  --ag-accent-amber: #D97706;
  --ag-accent-rose: #E11D48;
  --ag-grader-stage: #F5F5F5;

  /* Radix Sand & Sage Scales (MIT) */
  --sand-1: #FDFDFC;
  --sand-2: #F9F9F8;
  --sand-3: #F1F0EF;
  --sand-4: #E9E8E6;
  --sand-6: #D9D6D0;
  --sand-11: #63635E;
  --sand-12: #21201C;
  --sage-3: #E6F4F1;
  --sage-9: #0D9488;
  --sage-11: #0F766E;

  /* Open-Props Spacing, Radius & Motion Tokens (MIT) */
  --size-1: 4px;
  --size-2: 8px;
  --size-3: 12px;
  --size-4: 16px;
  --size-5: 24px;
  --radius-2: 8px;
  --radius-3: 12px;
  --radius-round: 9999px;
  --ease-3: cubic-bezier(0.25, 0, 0.3, 1);
  --ease-out-3: cubic-bezier(0, 0, 0.2, 1);
  --animation-fade-in: ag-warm-cream-dissolve 1.2s var(--ease-out-3) forwards;

  /* Typography Stack */
  --ag-font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --ag-font-serif: 'Newsreader', 'Instrument Serif', Georgia, serif;
  --ag-font-board-hand: 'Excalifont', 'Kalam', 'Segoe Print', cursive;
  --ag-font-mono: 'JetBrains Mono', monospace;

  /* Day-1 Dream Intro Aurora Gradient & Border Shimmer */
  --ag-intro-aurora: linear-gradient(135deg, #FFFAF0 0%, #E0F2FE 52%, #E6E1F9 100%);
  --ag-shimmer-border: linear-gradient(90deg, #E7E0D6 0%, #0D9488 50%, #E7E0D6 100%);
}

@keyframes ag-warm-cream-dissolve {
  0% {
    opacity: 0.92;
    background-color: #FFFAF0;
  }
  100% {
    opacity: 1;
    background-color: #FFFAF0;
  }
}

@keyframes ag-border-shimmer {
  0% {
    border-color: #E7E0D6;
  }
  50% {
    border-color: #0D9488;
  }
  100% {
    border-color: #E7E0D6;
  }
}

/* Focus signals (Section 8.5): one 1.2 s border pass and a 2 px micro-bounce, never a loop. */
@keyframes ag-shimmer-pass {
  0% {
    border-color: #E7E0D6;
  }
  50% {
    border-color: #0D9488;
  }
  100% {
    border-color: #0D9488;
  }
}

@keyframes ag-micro-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes ag-hint-pill-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* Border-Only Shimmer for newly derived formulas (No whole-page shake) */
.ag-focus-shimmer,
.ag-formula-shimmer {
  border: 1.5px solid #0D9488;
  animation: ag-shimmer-pass 1.2s ease-out 1;
  box-shadow: none;
}

.ag-hint-pill-bounce,
.ag-next-action-bounce {
  animation: ag-micro-bounce 0.9s var(--ease-3) 2;
}

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