/**
 * Typography System - Complete typography in one place
 * All font declarations, sizes, weights, and component styles
 */

/* ============================================
   FONT DECLARATIONS
   ============================================ */

@font-face {
  font-family: 'Inter-Variable';
  src: url('/fonts/Inter-Variable.woff2') format('woff2-variations');
  font-weight: 400 785;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PressStart2P';
  src: url('/fonts/PressStart2P-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   TYPOGRAPHY VARIABLES
   ============================================ */

:root {
  /* Font Families */
  --font-main: 'Inter-Variable', system-ui, -apple-system, sans-serif;
  --font-accent: 'PressStart2P', 'Courier New', monospace;
  --font-code: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  
  /* Font Sizes - Responsive with clamp() */
  --text-base: clamp(16px, 2vw + 14px, 18px);
  --text-sm: clamp(12px, 1.5vw + 10px, 14px);
  --text-lg: clamp(18px, 2.5vw + 16px, 20px);
  --text-xl: clamp(20px, 3vw + 18px, 24px);
  --text-2xl: clamp(24px, 4vw + 20px, 32px);
  --text-3xl: clamp(32px, 5vw + 24px, 48px);
  --text-4xl: clamp(40px, 6vw + 32px, 64px);
  
  /* Component-specific sizes */
  --menu-size: clamp(14px, 2vw + 12px, 28px);
  --title-size: clamp(32px, 4vw + 20px, 64px);
  --subtitle-size: clamp(14px, 1.2vw + 10px, 23px);
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  
  /* Letter Spacing */
  --tracking-normal: 0;
  --tracking-wide: 0.05ch;
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */

body {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  line-height: var(--leading-tight);
  margin: 0;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0 0 1rem 0;
  line-height: var(--leading-relaxed);
}

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

/* Links */
a {
  text-decoration: underline;
  transition: color 0.2s ease;
}

/* Lists */
ul, ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
  line-height: var(--leading-relaxed);
}

/* Code */
code {
  font-family: var(--font-code);
  font-size: 0.9em;
}

/* ============================================
   COMPONENT TYPOGRAPHY
   ============================================ */

/* Navigation */
nav a,
.nav-link {
  font-family: var(--font-main);
  font-size: var(--menu-size);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
}

/* Retro Header */
.retro-header {
  font-family: var(--font-accent);
  line-height: 1;
  text-transform: uppercase;
}

.header__title {
  font-size: var(--title-size);
}

.header__subtitle {
  font-size: var(--subtitle-size);
}

/* Footer */
footer p {
  font-size: var(--text-sm);
}

/* Skip Link */
.skip-link {
  font-size: var(--text-sm);
}

/* Post Meta */
.post-meta {
  font-size: var(--text-sm);
}

.post-tag {
  font-size: 0.8rem;
}

/* Post Article */
.post-article {
  line-height: var(--leading-relaxed);
}

.post-article h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

.post-article h2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
}

.post-article h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.post-article code {
  background: var(--color-bg-secondary, #f5f5f5);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-code);
  font-size: 0.9em;
}

.post-article pre {
  background: var(--color-bg-secondary, #f5f5f5);
  padding: 1.5rem;
  border-radius: 8px;
}

.post-article pre code {
  background: none;
  padding: 0;
}

.post-article blockquote {
  font-style: italic;
}

/* Cards */
.card__title {
  font-family: var(--font-main);
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
}

.card__text {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* Buttons */
.button,
button {
  font-family: var(--font-main);
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
}

/* Accent Text */
.accent-text,
.text-accent {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.leading-tight { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
