/**
 * Wazzaf Neo - Self-Hosted Fonts
 * Optimized for performance, GDPR compliance, and offline support
 *
 * SETUP INSTRUCTIONS:
 * 1. Download Inter Tight from Google Fonts (https://fonts.google.com/specimen/Inter+Tight)
 * 2. Convert to WOFF2 format if not already (use https://everythingfonts.com/ttf-to-woff2)
 * 3. Place font files in /frontend/fonts/ directory
 * 4. Update paths below if needed
 *
 * Font Subsetting Recommendation:
 * - Include Latin character set only (reduces file size by ~70%)
 * - Use tools like glyphhanger or fonttools pyftsubset
 * - Command: pyftsubset Inter-Tight.woff2 --output-file=Inter-Tight-subset.woff2 --unicodes=U+0020-007F,U+00A0-00FF
 */

/* ==========================================================================
   Inter Tight - Primary Heading Font
   Sharp, modern sans-serif for headings and UI elements
   ========================================================================== */

/* Inter Tight Regular (400) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400;
  font-display: swap; /* FOUT prevention - shows fallback immediately, swaps when loaded */
  src: url('/fonts/InterTight-Regular.woff2') format('woff2');
  /* Fallback for older browsers */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Tight Medium (500) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/InterTight-Medium.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Tight SemiBold (600) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/InterTight-SemiBold.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Tight Bold (700) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/InterTight-Bold.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Tight ExtraBold (800) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/InterTight-ExtraBold.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Tight Black (900) */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/InterTight-Black.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Inter - Body Text Font (Fallback for Söhne)
   Clean, readable sans-serif for body text and UI
   ========================================================================== */

/* Inter Regular (400) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Medium (500) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter SemiBold (600) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Bold (700) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Preload Critical Fonts
   Preload the most important fonts to avoid layout shift
   Add these <link> tags to your HTML <head>:

   <link rel="preload" href="/fonts/InterTight-Bold.woff2" as="font" type="font/woff2" crossorigin>
   <link rel="preload" href="/fonts/Inter-Regular.woff2" as="font" type="font/woff2" crossorigin>

   Or use JavaScript to inject them dynamically (better for SPAs)
   ========================================================================== */

/**
 * PERFORMANCE METRICS TARGETS:
 *
 * With self-hosted fonts + subsetting:
 * - Total font payload: ~180KB (down from ~300KB via Google Fonts)
 * - First contentful paint (FCP): <1.8s
 * - Largest contentful paint (LCP): <2.5s
 * - Cumulative layout shift (CLS): <0.1
 *
 * GDPR COMPLIANCE:
 * - No external requests to Google Fonts
 * - No IP addresses shared with third parties
 * - Full control over font delivery
 * - Meets EU data protection requirements
 */

/**
 * FALLBACK STRATEGY:
 *
 * If font files are not available, the CSS will gracefully fall back to:
 * 1. System fonts (-apple-system, BlinkMacSystemFont, 'Segoe UI')
 * 2. No console errors or broken layouts
 * 3. Maintain consistent spacing with font-size-adjust (future enhancement)
 */
