/* ============================================================
   TYPE

   Three families, three jobs:
     display  Instrument Serif  — the loud moments only
     ui       Inter             — everything functional
     mono     JetBrains Mono    — the instrument voice: labels,
                                  values, units, technical data

   The serif/mono pairing is the whole personality of the site.
   Inter is the connective tissue between them.
   ============================================================ */

.display-1, .display-2 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
}
.display-1 { font-size: var(--text-display-1); }
.display-2 { font-size: var(--text-display-2); }

.display-1 em, .display-2 em,
.display-1 .em, .display-2 .em {
    font-style: italic;
    color: var(--accent);
}

h1, .h1 {
    font-size: var(--text-h1);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}
h2, .h2 {
    font-size: var(--text-h2);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}
h3, .h3 { font-size: var(--text-h3); letter-spacing: var(--tracking-tight); }

/* Serif headings — used for section openers and case-study titles. */
.h-serif {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: var(--tracking-display);
    line-height: var(--leading-tight);
}

.lead {
    font-size: var(--text-lg);
    line-height: var(--leading-body);
    color: var(--fg-muted);
    max-width: 60ch;
    text-wrap: pretty;
}

.muted   { color: var(--fg-muted); }
.subtle  { color: var(--fg-subtle); }
.faint   { color: var(--fg-faint); }

/* ---------- The mono "instrument" voice ---------- */
.mono {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-mono);
    font-variant-numeric: tabular-nums;
}

/* Section eyebrow: // LIKE THIS */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--accent);
}
.eyebrow::before {
    content: '';
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: .5;
}
.eyebrow-center { justify-content: center; }

/* Numeric readouts — tabular so columns of figures line up. */
.figure {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: var(--tracking-display);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--fg-subtle);
}

/* ============================================================
   PROSE — long-form article body
   ============================================================ */

.prose {
    max-width: var(--measure);
    font-size: var(--text-lg);
    line-height: var(--leading-body);
    color: var(--fg-muted);
    text-wrap: pretty;
}

.prose > * + * { margin-top: var(--s-6); }

.prose h2 {
    margin-top: var(--s-16);
    margin-bottom: var(--s-4);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    letter-spacing: var(--tracking-display);
    color: var(--fg);
    scroll-margin-top: 7rem;
}
.prose h3 {
    margin-top: var(--s-12);
    margin-bottom: var(--s-3);
    font-size: var(--text-h3);
    font-weight: 600;
    color: var(--fg);
    scroll-margin-top: 7rem;
}
.prose h4 {
    margin-top: var(--s-8);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--fg);
}

.prose p { margin-top: var(--s-6); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
    transition: text-decoration-color var(--dur-fast), color var(--dur-fast);
}
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.prose ul, .prose ol { padding-left: 1.35em; margin-top: var(--s-6); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: var(--s-2); padding-left: .25em; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
    margin: var(--s-10) 0;
    padding-left: var(--s-6);
    border-left: 2px solid var(--accent);
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    line-height: 1.4;
    color: var(--fg);
}

.prose code {
    font-family: var(--font-mono);
    font-size: .875em;
    padding: .15em .4em;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--accent);
    word-break: break-word;
}

.prose pre {
    margin-top: var(--s-6);
    padding: var(--s-5, 1.25rem);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: var(--text-sm);
    line-height: 1.6;
}
.prose pre code {
    padding: 0; background: none; border: none; color: var(--fg-muted);
    font-size: inherit;
}

.prose img {
    border-radius: var(--radius);
    margin: var(--s-10) 0;
    box-shadow: var(--lift-2);
}

.prose hr { margin: var(--s-16) 0; }

.prose table {
    margin-top: var(--s-8);
    font-size: var(--text-sm);
}
.prose th, .prose td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.prose th {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--fg-subtle);
    font-weight: 500;
}

/* Anchor link that appears on heading hover in articles. */
.heading-anchor {
    margin-left: .4em;
    opacity: 0;
    color: var(--accent);
    font-size: .7em;
    transition: opacity var(--dur-fast);
}
h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
