/* ==========================================================================
   ubKids design tokens
   Гэрэл өнгөтэй, цэвэрхэн, хүүхдэд ээлтэй өнгөний систем
   ========================================================================== */

:root {
  /* Brand */
  --brand-50:  #eef3ff;
  --brand-100: #dbe6ff;
  --brand-200: #bdd0ff;
  --brand-300: #91b0ff;
  --brand-400: #5f86ff;
  --brand-500: #2f6bff;
  --brand-600: #1f51e0;
  --brand-700: #1a3fb4;
  --brand-800: #1b378d;

  /* Accents per category */
  --coral:   #ff7a59;
  --coral-s: #fff1ec;
  --mint:    #16b981;
  --mint-s:  #e8f9f2;
  --amber:   #f5a524;
  --amber-s: #fff6e6;
  --violet:  #8b5cf6;
  --violet-s:#f3eeff;
  --sky:     #0ea5e9;
  --sky-s:   #e7f6fe;
  --rose:    #f43f5e;
  --rose-s:  #ffecef;
  --lime:    #65a30d;
  --lime-s:  #f2f9e5;

  /* Neutrals */
  --ink:      #0e1526;
  --ink-2:    #33405c;
  --muted:    #6b7791;
  --muted-2:  #98a2b6;
  --line:     #e7eaf1;
  --line-2:   #f0f2f7;
  --surface:  #ffffff;
  --surface-2:#f8f9fc;
  --surface-3:#f2f4f9;
  --canvas:   #fbfcfe;

  /* Status */
  --ok:    #16b981;
  --warn:  #f5a524;
  --dang:  #ef4444;
  --info:  #2f6bff;

  /* Elevation */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --sh-md: 0 8px 24px rgba(16, 24, 40, .08);
  --sh-lg: 0 20px 48px rgba(16, 24, 40, .12);
  --sh-brand: 0 10px 28px rgba(47, 107, 255, .22);

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 999px;

  /* Motion */
  --ease: cubic-bezier(.22, .68, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .16s;
  --t: .28s;
  --t-slow: .55s;

  /* Layout */
  --shell: 1220px;
  --nav-h: 68px;
  --side-w: 260px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.62;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04";
}

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: -.024em;
  font-weight: 700;
  color: var(--ink);
}
h1 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.034em; }
h2 { font-size: clamp(23px, 2.8vw, 33px); letter-spacing: -.03em; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-600); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--brand-700); }

img, svg, canvas { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

table { border-collapse: collapse; width: 100%; }

hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

::selection { background: var(--brand-200); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: #d6dbe6 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d6dbe6; border-radius: 99px; border: 3px solid var(--canvas); }
*::-webkit-scrollbar-thumb:hover { background: #bfc6d4; }

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 9999;
  background: var(--brand-600); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Utility ---------- */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 24px; }
.shell-wide { max-width: 1440px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.small { font-size: 13.5px; }
.lead { font-size: 17px; line-height: 1.66; color: var(--ink-2); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hide { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Boot splash ---------- */
.boot {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px;
}
.boot__mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-500), var(--violet));
  animation: bootPulse 1.1s var(--ease) infinite;
}
.boot__text { color: var(--muted); font-size: 14px; margin: 0; }
@keyframes bootPulse {
  0%, 100% { transform: scale(.86) rotate(0deg); opacity: .55; }
  50% { transform: scale(1) rotate(8deg); opacity: 1; }
}

/* ---------- Motion primitives ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-13deg); } 40% { transform: rotate(11deg); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .62s var(--ease-out), transform .62s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

.page-enter { animation: fadeUp .42s var(--ease-out) both; }

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

/* Сервер талын шинэчлэлтээр дахин зурах үед анимэйшн давтагдахгүй */
.is-repainting *, .is-repainting *::before, .is-repainting *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}
