/* ==========================================================================
   Base Element Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Headings - Using display font for modern look */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

/* Paragraphs */
p {
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

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

.lead {
  font-size: var(--text-lg);
  line-height: 1.7;
}

/* Links */
a {
  color: var(--accent-primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* Text link with animated underline */
.link {
  position: relative;
  display: inline-block;
}

.link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-base) ease;
}

.link:hover::after {
  width: 100%;
}

/* External link indicator */
.link-external::after {
  content: none;
}

.link-external {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.link-external svg {
  width: 0.875em;
  height: 0.875em;
  transition: transform var(--transition-fast);
}

.link-external:hover svg {
  transform: translate(2px, -2px);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--border-radius-sm);
}

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

pre code {
  background: none;
  padding: 0;
}

/* Strong and emphasis */
strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-primary);
  margin: var(--space-8) 0;
}

/* Selection */
::selection {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* Images */
img {
  border-radius: var(--border-radius-md);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
