/* ==============================================
   TYPOGRAPHY SYSTEM - READABLE & MODERN
   Optimized for eye comfort and legibility
   ============================================== */

/* Import highly readable, warm fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Lexend:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Font Families */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-accent: 'Lexend', system-ui, -apple-system, sans-serif;

  /* Font Sizes - Responsive Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px - optimal for body text */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Line Heights - Generous for readability */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;
  --leading-extra: 1.875;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
}

/* ==============================================
   GLOBAL RESETS FOR READABILITY
   ============================================== */

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
  font-weight: var(--font-regular);
}

/* ==============================================
   HEADINGS - Clear Hierarchy
   ============================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: var(--font-extrabold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  font-weight: var(--font-bold);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: var(--font-bold);
  line-height: 1.3;
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: var(--font-semibold);
  line-height: 1.4;
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: 1.4;
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  line-height: 1.4;
}

/* ==============================================
   BODY TEXT - Optimized for Reading
   ============================================== */

p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  letter-spacing: 0.01em;
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
}

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

/* Larger body text for emphasis */
p.lead,
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-extra);
  font-weight: var(--font-regular);
  color: var(--text-primary);
}

/* Small text */
small,
.text-small {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Extra small text */
.text-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

/* ==============================================
   LISTS - Readable Spacing
   ============================================== */

ul, ol {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  margin-bottom: 0.75rem;
  line-height: var(--leading-loose);
}

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

/* ==============================================
   LINKS - Clear & Readable
   ============================================== */

a {
  font-family: inherit;
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all 0.2s ease;
}

/* ==============================================
   LABELS & METADATA
   ============================================== */

label,
.label {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.meta,
.metadata {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
}

/* ==============================================
   SECTION-SPECIFIC TYPOGRAPHY
   ============================================== */

/* Section Headers */
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--font-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text-tertiary);
  margin-top: 0.75rem;
}

/* Card Titles */
.card-title,
.education-title-section h3,
.certification-title-section h3 {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: var(--font-bold);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Card Subtitles */
.card-subtitle,
.education-university,
.certification-issuer {
  font-family: var(--font-accent);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Card Body Text */
.card-description,
.education-overview p,
.certification-description,
.summary-main-card p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}

/* Meta Information */
.education-meta-item,
.certification-date {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
  letter-spacing: 0.02em;
}

/* Highlighted Text */
.education-highlight,
.text-highlight {
  font-family: var(--font-body);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* Tags & Badges */
.certification-tag,
.skill-tag,
.tag {
  font-family: var(--font-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  line-height: 1;
}

/* ==============================================
   SKILLS SECTION - Terminal Theme Override
   ============================================== */

.skills-terminal-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: var(--font-extrabold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.skills-terminal-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-relaxed);
  letter-spacing: 0.02em;
}

.terminal-tab {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: lowercase;
}

.terminal-skill-name {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  letter-spacing: 0;
}

.terminal-prompt {
  font-family: 'Courier New', monospace;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

/* ==============================================
   SUMMARY SECTION
   ============================================== */

.summary-sidebar-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: 1.3;
}

.summary-sidebar-card li {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* ==============================================
   EDUCATION SECTION
   ============================================== */

.education-overview h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.education-details li,
.education-skills li {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  letter-spacing: 0.01em;
}

.education-course-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
  text-align: center;
}

/* ==============================================
   RESPONSIVE ADJUSTMENTS
   ============================================== */

@media (max-width: 768px) {
  :root {
    --text-base: 0.9375rem; /* 15px on mobile */
  }

  body {
    font-size: var(--text-base);
    line-height: var(--leading-loose);
  }

  h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  h2 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  h3 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .card-description,
  .education-overview p,
  .certification-description {
    font-size: var(--text-base);
    line-height: 1.75;
  }
}

@media (max-width: 480px) {
  :root {
    --text-base: 0.875rem; /* 14px on small mobile */
  }

  .section-header h2 {
    font-size: 1.5rem;
  }
}

/* ==============================================
   ACCESSIBILITY - Readable Focus States
   ============================================== */

*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==============================================
   DARK MODE OPTIMIZATIONS
   ============================================== */

:root.dark {
  /* Slightly increase letter spacing in dark mode for better readability */
  --tracking-normal: 0.01em;
}

:root.dark body {
  letter-spacing: 0.01em;
}

:root.dark p {
  letter-spacing: 0.015em;
}

/* ==============================================
   PRINT STYLES - Readable on Paper
   ============================================== */

@media print {
  body {
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
  }

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

  p {
    orphans: 3;
    widows: 3;
  }
}
