/* ==========================================================================
   Typography - Font Faces & Type Scale
   ========================================================================== */

/* Inter Variable Font */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* JetBrains Mono Variable Font */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/JetBrainsMono-Variable.woff2') format('woff2');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* Base Typography */
body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-normal);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--text-primary);
    margin-top: 0;
}

h1 {
    font-size: var(--fs-4xl);
    letter-spacing: -0.025em;
    margin-bottom: var(--sp-6);
}

h2 {
    font-size: var(--fs-2xl);
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-muted);
}

h3 {
    font-size: var(--fs-xl);
    margin-bottom: var(--sp-3);
}

h4 {
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-2);
}

h5, h6 {
    font-size: var(--fs-md);
    margin-bottom: var(--sp-2);
}

/* Paragraphs */
p {
    margin-top: 0;
    margin-bottom: var(--sp-4);
}

/* Links */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: var(--sp-4);
    padding-left: var(--sp-6);
}

li {
    margin-bottom: var(--sp-2);
}

li > ul,
li > ol {
    margin-top: var(--sp-2);
    margin-bottom: 0;
}

/* Blockquote */
blockquote {
    margin: var(--sp-4) 0;
    padding: var(--sp-4) var(--sp-6);
    border-left: 4px solid var(--accent-blue);
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

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

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: var(--sp-8) 0;
}

/* Strong / Emphasis */
strong, b {
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

em, i {
    font-style: italic;
}

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

.text-xs {
    font-size: var(--fs-xs);
}

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

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

/* Monospace */
.font-mono {
    font-family: var(--font-mono);
}

/* Tables (article content) */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--sp-6);
    font-size: var(--fs-sm);
}

.article-content th,
.article-content td {
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border-default);
    text-align: left;
}

.article-content th {
    background: var(--bg-tertiary);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

.article-content tr:nth-child(even) td {
    background: var(--bg-secondary);
}

/* Selection */
::selection {
    background: var(--accent-blue);
    color: #fff;
}
