/**
 * typography.css
 * -----------------------------------------------------------------------------
 * Font loading, type scale, prose styles, and text helpers.
 * ----------------------------------------------------------------------------- */

/* ===== Font imports (General Sans + Inter via Google Fonts CDN as fallback) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Body typography ===== */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
}

/* ===== Headings ===== */
h1, .h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, var(--text-6xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, var(--text-5xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h4, .h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

h5, .h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

h6, .h6 {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

/* ===== Display & lead ===== */
.display {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, var(--text-7xl));
  font-weight: var(--weight-bold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tighter);
}

.lead {
  font-size: clamp(var(--text-lg), 2.2vw, var(--text-2xl));
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ===== Inline elements ===== */
p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--weight-semibold); }

em, i { font-style: italic; }

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

mark {
  background: var(--color-accent-muted);
  color: var(--color-accent-hover);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--color-bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-accent-hover);
}

pre {
  background: var(--color-bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
  color: var(--color-text);
}

kbd {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: var(--text-sm);
  box-shadow: 0 2px 0 var(--color-border-strong);
}

/* ===== Links ===== */
a {
  color: var(--color-text);
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--color-accent-hover); }

.link-accent {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.link-accent:hover { color: var(--color-accent-hover); }

/* ===== Block elements ===== */
blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-2) var(--space-5);
  margin: var(--space-5) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
}

/* ===== Type utilities ===== */
.text-gradient {
  background: var(--gradient-aurora);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-soft {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-muted { color: var(--color-muted); }
.text-faint { color: var(--color-faint); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }
.font-mono     { font-family: var(--font-mono); }

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-wider); }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

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

/* ===== Eyebrow label (above headings) ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--color-accent);
}

/* ===== Prose (for blog content) ===== */
.prose {
  max-width: 70ch;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}
.prose h2, .prose h3, .prose h4 {
  color: var(--color-text);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.prose p { margin-bottom: var(--space-4); }
.prose ul, .prose ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}
.prose ul li { list-style: disc; margin-bottom: var(--space-2); }
.prose ol li { list-style: decimal; margin-bottom: var(--space-2); }
.prose img {
  border-radius: var(--radius-md);
  margin: var(--space-5) 0;
}
.prose blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-3) var(--space-5);
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text);
}
