/* DroidCTRL Font Definitions */

/* Inter Font Family - Primary Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* JetBrains Mono - Code/Technical Text */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* Space Grotesk - Alternative Display Font */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Custom Font Stack Definitions */
:root {
  /* Primary font stack */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Code/monospace font stack */
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', 'Source Code Pro', monospace;

  /* Display/heading font stack */
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* System font stack (fallback) */
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Font Weight Variables */
:root {
  --font-weight-thin: 100;
  --font-weight-extralight: 200;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;
}

/* Typography Scale */
:root {
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */
  --font-size-6xl: 3.75rem;    /* 60px */
  --font-size-7xl: 4.5rem;     /* 72px */
  --font-size-8xl: 6rem;       /* 96px */
  --font-size-9xl: 8rem;       /* 128px */
}

/* Line Height Scale */
:root {
  --line-height-none: 1;
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
}

/* Letter Spacing */
:root {
  --letter-spacing-tighter: -0.05em;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0em;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;
}

/* Font Feature Settings */
:root {
  --font-feature-numeric: 'tnum' 1, 'lnum' 1;
  --font-feature-small-caps: 'smcp' 1;
  --font-feature-stylistic: 'ss01' 1;
}

/* Base Font Styles */
body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
  font-feature-settings: var(--font-feature-numeric);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Heading Styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-black);
}

h2 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
}

h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

h4 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

h5 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

/* Code and Technical Text */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-feature-settings: 'liga' 0, 'calt' 0;
}

code {
  font-size: 0.875em;
  font-weight: var(--font-weight-medium);
}

pre {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

/* Utility Classes */
.font-primary {
  font-family: var(--font-primary);
}

.font-mono {
  font-family: var(--font-mono);
}

.font-display {
  font-family: var(--font-display);
}

.font-system {
  font-family: var(--font-system);
}

/* Font Weight Utilities */
.font-thin { font-weight: var(--font-weight-thin); }
.font-extralight { font-weight: var(--font-weight-extralight); }
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }
.font-black { font-weight: var(--font-weight-black); }

/* Font Size Utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }
.text-7xl { font-size: var(--font-size-7xl); }
.text-8xl { font-size: var(--font-size-8xl); }
.text-9xl { font-size: var(--font-size-9xl); }

/* Line Height Utilities */
.leading-none { line-height: var(--line-height-none); }
.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* Letter Spacing Utilities */
.tracking-tighter { letter-spacing: var(--letter-spacing-tighter); }
.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

/* Special Typography */
.gradient-text {
  background: linear-gradient(135deg, #00d4ff 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Font Loading Optimization */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('inter-regular.woff2') format('woff2'),
       url('inter-regular.woff') format('woff');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('inter-semibold.woff2') format('woff2'),
       url('inter-semibold.woff') format('woff');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('inter-bold.woff2') format('woff2'),
       url('inter-bold.woff') format('woff');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('inter-black.woff2') format('woff2'),
       url('inter-black.woff') format('woff');
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  h4 { font-size: var(--font-size-xl); }
  h5 { font-size: var(--font-size-lg); }
  h6 { font-size: var(--font-size-base); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-xl); }
}

/* Print Styles */
@media print {
  * {
    font-family: 'Times New Roman', serif !important;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  .gradient-text {
    -webkit-text-fill-color: initial;
    background: none;
    color: black;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .gradient-text {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--primary-color);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .gradient-text {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--text-primary);
  }

  .text-shadow,
  .text-shadow-lg {
    text-shadow: none;
  }
}

/* Font Loading Animation */
.font-loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fonts-loaded .font-loading {
  opacity: 1;
}

/* Performance Optimizations */
.text-optimize {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: subpixel-antialiased;
}

.text-quality {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}