/**
 * Typography System
 * Fonts: Heebo (headers) & DM Sans (body)
 *
 * This file sets up all text styles for the portfolio.
 * Import this after tokens.css
 */

/* ==================== FONT IMPORTS ==================== */
/* Import from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Kalam:wght@300;400;700&display=swap');

/* ==================== TYPOGRAPHY TOKENS ==================== */

:root {
  /* Font Families */
  --font-heading: 'Fraunces', serif;
  --font-body: 'Roboto', sans-serif;
  --font-label: 'Roboto', sans-serif;

  /* Font Style: body-md (default body copy) */
  --font-body-md-family: var(--font-body);
  --font-body-md-size: var(--text-base);
  --font-body-md-weight: var(--weight-regular);
  --font-body-md-line-height: var(--leading-relaxed);

  /* Font Style: microcopy (contextual labels above/below images) */
  --font-microcopy-family: var(--font-body);
  --font-microcopy-size: 1rem;
  --font-microcopy-weight: var(--weight-regular);
  --font-microcopy-line-height: var(--leading-normal);

  /* Font Style: body-lrg (large body copy, section labels) */
  --font-body-lrg-family: var(--font-body);
  --font-body-lrg-size: var(--text-xl);
  --font-body-lrg-weight: var(--weight-semibold);
  --font-body-lrg-line-height: var(--leading-relaxed);

  /* Font Style: heading-xl (H1 - 60px) */
  --font-heading-xl-family: var(--font-heading);
  --font-heading-xl-size: var(--text-6xl);
  --font-heading-xl-weight: var(--weight-bold);
  --font-heading-xl-line-height: var(--leading-tight);

  /* Font Style: H2 Large (60px) */
  --font-h2-lrg-size: var(--text-6xl);

  /* Font Style: H2 Regular (48px) */
  --font-h2-reg-size: var(--text-5xl);

  /* Font Style: H2 Small (36px) */
  --font-h2-sm-size: var(--text-4xl);

  /* Font Style: heading-lrg (H2 default - 48px) */
  --font-heading-lrg-family: var(--font-heading);
  --font-heading-lrg-size: var(--font-h2-reg-size);
  --font-heading-lrg-weight: var(--weight-bold);
  --font-heading-lrg-line-height: var(--leading-tight);

  /* Font Style: heading-md (H3 - 36px) */
  --font-heading-md-family: var(--font-heading);
  --font-heading-md-size: var(--text-4xl);
  --font-heading-md-weight: var(--weight-bold);
  --font-heading-md-line-height: var(--leading-tight);

  /* Font Style: heading-sm (H4 - 30px) */
  --font-heading-sm-family: var(--font-heading);
  --font-heading-sm-size: var(--text-3xl);
  --font-heading-sm-weight: var(--weight-bold);
  --font-heading-sm-line-height: var(--leading-tight);

  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px - captions, labels */
  --text-sm: 0.875rem;   /* 14px - small body */
  --text-base: 1rem;     /* 16px - base body */
  --text-lg: 1.125rem;   /* 18px - large body */
  --text-xl: 1.25rem;    /* 20px - lead text */
  --text-2xl: 1.5rem;    /* 24px - H5 */
  --text-3xl: 1.875rem;  /* 30px - H4 */
  --text-4xl: 2.25rem;   /* 36px - H3 */
  --text-5xl: 3rem;      /* 48px - H2 */
  --text-6xl: 3.75rem;   /* 60px - H1 */
  --text-7xl: 4rem;      /* 64px - Display (hero) */

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* 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;
}

/* ==================== BASE STYLES ==================== */

body {
  font-family: var(--font-body-md-family);
  font-size: var(--font-body-md-size);
  font-weight: var(--font-body-md-weight);
  line-height: var(--font-body-md-line-height);
  color: var(--role-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== HEADINGS ==================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: 0;
  color: var(--role-text-primary);
  margin-top: 0;
  margin-bottom: 0.75em;
}

h1 {
  font-family: var(--font-heading-xl-family);
  font-size: var(--font-heading-xl-size);
  font-weight: var(--font-heading-xl-weight);
  line-height: var(--font-heading-xl-line-height);
  letter-spacing: 0;
}

h2 {
  font-family: var(--font-heading-lrg-family);
  font-size: var(--font-heading-lrg-size);
  font-weight: var(--font-heading-lrg-weight);
  line-height: var(--font-heading-lrg-line-height);
}

h2.h2-lrg { font-size: var(--font-h2-lrg-size); }
h2.h2-sm { font-size: var(--font-h2-sm-size); }

h3 {
  font-family: var(--font-heading-md-family);
  font-size: var(--font-heading-md-size);
  font-weight: var(--font-heading-md-weight);
  line-height: var(--font-heading-md-line-height);
}

h4 {
  font-family: var(--font-heading-sm-family);
  font-size: var(--font-heading-sm-size);
  font-weight: var(--font-heading-sm-weight);
  line-height: var(--font-heading-sm-line-height);
}

h5 {
  font-size: var(--text-2xl);  /* 24px */
}

h6 {
  font-size: var(--text-xl);   /* 20px */
  font-weight: var(--weight-semibold);
}

/* ==================== DISPLAY TEXT ==================== */

.text-display {
  font-family: var(--font-heading);
  font-size: var(--text-7xl);  /* 64px - matches your Header 2 */
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--role-text-primary);
}

/* ==================== BODY TEXT ==================== */

p {
  margin-top: 0;
  margin-bottom: 1em;
  line-height: var(--font-body-md-line-height);
}

.text-sm {
  font-size: var(--text-sm);    /* 14px */
}

.text-base {
  font-size: var(--text-base);  /* 16px */
}

.text-lg {
  font-size: var(--text-lg);    /* 18px */
}

.text-xl {
  font-size: var(--text-xl);    /* 20px */
}

/* Lead paragraph (intro text) */
.text-lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--role-text-primary);
}

/* ==================== FONT WEIGHTS ==================== */

.font-light {
  font-weight: var(--weight-light);
}

.font-regular {
  font-weight: var(--weight-regular);
}

.font-medium {
  font-weight: var(--weight-medium);
}

.font-semibold {
  font-weight: var(--weight-semibold);
}

.font-bold {
  font-weight: var(--weight-bold);
}

.font-extrabold {
  font-weight: var(--weight-extrabold);
}

/* ==================== TEXT COLORS ==================== */

.text-primary {
  color: var(--role-text-primary);
}

.text-secondary {
  color: var(--role-text-secondary);
}

.text-muted {
  color: var(--role-text-muted);
}

/* ==================== SPECIAL ELEMENTS ==================== */

/* Caption text */
.caption {
  font-size: var(--text-xs);
  color: var(--role-text-muted);
  line-height: var(--leading-normal);
}

/* Microcopy (contextual text above/below images) */
.microcopy {
  font-family: var(--font-microcopy-family);
  font-size: var(--font-microcopy-size);
  font-weight: var(--font-microcopy-weight);
  line-height: var(--font-microcopy-line-height);
  color: var(--role-text-secondary);
  margin: 2.5rem 0 0 0;
}

/* Label text */
.label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--role-text-secondary);
}

/* Links */
a {
  color: var(--role-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--role-brand-primary);
  text-decoration: underline;
}

/* Strong/Bold */
strong, b {
  font-weight: var(--weight-semibold);
}

/* Emphasis/Italic */
em, i {
  font-style: italic;
}

/* Small text */
small {
  font-size: var(--text-sm);
}

/* ==================== RESPONSIVE TYPOGRAPHY ==================== */

/* Tablet and below */
@media (max-width: 1024px) {
  :root {
    --text-6xl: 3rem;     /* 48px */
    --text-7xl: 3rem;     /* 48px */
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --text-4xl: 1.875rem; /* 30px */
    --text-5xl: 2.25rem;  /* 36px */
    --text-6xl: 2.5rem;   /* 40px */
    --text-7xl: 2.5rem;   /* 40px */
    --font-microcopy-size: var(--text-sm); /* 14px on mobile */
  }

  body {
    font-size: var(--text-sm); /* Slightly smaller base on mobile */
  }
}
