/* ============================================
   Base Styles — Typography, Links, Elements
   ============================================
   Dual font system: Poppins (headings) + Open Sans (body)
   Base size: 1.125rem (18px) for readability
   Line height: 1.5–1.6 per accessibility spec
   ============================================ */

html {
    font-size: 100%;
    /* 16px default, scaled by user prefs */
}

body {
    font-family: var(--font-body);
    font-size: var(--text-md);
    /* 18px (1.125rem) base for readability */
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
    background-color: var(--color-beige-light);
}

/* ── Headings ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
}

/* Responsive heading scale */
@media (max-width: 48em) {

    /* 768px */
    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    h4 {
        font-size: var(--text-lg);
    }
}

/* ── Paragraphs ── */
p {
    margin-bottom: var(--space-4);
    line-height: var(--line-height-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: var(--text-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

@media (max-width: 48em) {
    .lead {
        font-size: var(--text-md);
    }
}

/* ── Links ── */
a {
    color: var(--color-indigo);
    text-decoration: underline;
    text-decoration-thickness: 0.0625em;
    text-underline-offset: 0.15em;
    transition: color var(--transition-fast),
        text-decoration-color var(--transition-fast);
}

a:hover {
    color: var(--color-terracotta);
    text-decoration-color: var(--color-terracotta);
}

a:focus-visible {
    outline: 0.1875rem solid var(--color-saffron);
    outline-offset: 0.125rem;
    border-radius: var(--radius-sm);
}

/* ── Lists ── */
.content-list {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.content-list li {
    margin-bottom: var(--space-2);
    line-height: var(--line-height-relaxed);
    list-style-type: disc;
}

/* ── Text Utilities ── */
.text-sage {
    color: var(--color-sage);
}

.text-terracotta {
    color: var(--color-terracotta);
}

.text-indigo {
    color: var(--color-indigo);
}

.text-saffron {
    color: var(--color-saffron-dark);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-inverse {
    color: var(--color-text-inverse);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-heading {
    font-family: var(--font-heading);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Selection ── */
::selection {
    background-color: var(--color-sage-lighter);
    color: var(--color-sage-darker);
}

/* ── Horizontal Rule ── */
hr {
    border: none;
    height: 0.0625rem;
    background: var(--color-gray-200);
    margin: var(--space-8) 0;
}

/* ── Focus styles (global, accessible) ── */
:focus-visible {
    outline: 0.1875rem solid var(--color-saffron);
    outline-offset: 0.125rem;
}

/* ── Skip Link (accessibility) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--color-indigo);
    color: var(--color-text-inverse);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-base);
    z-index: var(--z-toast);
    transition: top var(--transition-fast);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-4);
    outline: 0.1875rem solid var(--color-saffron);
}

/* ── Visually Hidden (screen reader only) ── */
.sr-only {
    position: absolute;
    width: 0.0625rem;
    height: 0.0625rem;
    padding: 0;
    margin: -0.0625rem;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}