/*
 * TrainexAI — Font Loading
 * Single source of truth for all typography.
 * Loaded once via <link> in every HTML page.
 *
 * Strategy:
 *   - preconnect to Google Fonts domains (speeds up DNS + TLS)
 *   - Single @import with display=swap (no FOUT, no blocking)
 *   - font-display: swap on all weights
 *   - Fallback stack covers all platforms
 */

/* ── Google Fonts — Inter + Poppins ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* ── Font stacks ─────────────────────────────────────────────────────────────── */
:root {
  --font-primary:   'Inter',   'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-secondary: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Base typography ─────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Prevent FOUT: use system font until web font loads ─────────────────────── */
/* Inter and Poppins are loaded with display=swap so text is always visible.    */
/* The @font-face below ensures font-display:swap is applied even if the        */
/* browser ignores the Google Fonts display param.                              */
@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter');
}
@font-face {
  font-family: 'Poppins';
  font-display: swap;
  src: local('Poppins');
}

/* ── Rupee symbol — ensure correct rendering on all browsers ────────────────── */
/* The ₹ symbol (U+20B9) is in Noto Sans, not always in Inter/Poppins */
.price, .price-amount, [class*="price"],
.stat-value, .order-total, #order-total-amount {
  font-family: 'Poppins', 'Noto Sans', 'Arial Unicode MS', 'Segoe UI', sans-serif;
}
