/* Typography System */

/* Base typography */
body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
}

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

h1 {
    font-size: var(--font-size-5xl);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--font-size-4xl);
    letter-spacing: -0.025em;
}

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

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

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

/* Responsive headings */
@media (max-width: 768px) {
    h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2 {
        font-size: var(--font-size-3xl);
    }
    
    h3 {
        font-size: var(--font-size-2xl);
    }
}

/* Paragraph and text */
p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

.text-large {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

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

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

/* Text colors */
.text-primary {
    color: var(--color-text-primary);
}

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

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

/* Font weights */
.font-normal {
    font-weight: var(--font-weight-normal);
}

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

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

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

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

.font-heading {
    font-family: var(--font-family-heading);
}

/* Lists */
ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: var(--spacing-xs);
}

/* Remove list styles when needed */
.list-none {
    list-style: none;
    padding-left: 0;
}

/* Links */
a {
    color: var(--color-text-primary);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    transition: color var(--duration-base) var(--ease-out);
}

a:hover {
    color: var(--color-text-secondary);
}

.link-plain {
    text-decoration: none;
}

.link-plain:hover {
    text-decoration: underline;
}

/* Blockquotes */
blockquote {
    border-left: var(--border-width-thick) solid var(--color-border);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

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

/* Code */
code {
    font-family: var(--font-family-mono);
    font-size: 0.875em;
    background-color: var(--color-bg-secondary);
    padding: 0.125em 0.25em;
    border-radius: var(--radius-sm);
    border: var(--border-width) solid var(--color-border-light);
}

pre {
    font-family: var(--font-family-mono);
    background-color: var(--color-bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-base);
    border: var(--border-width) solid var(--color-border-light);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Text utilities */
.text-uppercase {
    text-transform: uppercase;
}

.text-lowercase {
    text-transform: lowercase;
}

.text-capitalize {
    text-transform: capitalize;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Line height utilities */
.leading-tight {
    line-height: var(--line-height-tight);
}

.leading-snug {
    line-height: var(--line-height-snug);
}

.leading-normal {
    line-height: var(--line-height-normal);
}

.leading-relaxed {
    line-height: var(--line-height-relaxed);
}

.leading-loose {
    line-height: var(--line-height-loose);
}

/* Letter spacing */
.tracking-tight {
    letter-spacing: -0.025em;
}

.tracking-normal {
    letter-spacing: 0;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

/* Section titles */
.section__title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: var(--spacing-3xl);
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .section__title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--spacing-2xl);
    }
}

/* Hero typography */
.hero__title {
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.025em;
}

.hero__subtitle {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-2xl);
}

@media (max-width: 768px) {
    .hero__title {
        font-size: var(--font-size-4xl);
    }
    
    .hero__subtitle {
        font-size: var(--font-size-lg);
    }
}