/* ==========================================
   Self-hosted Typography System (Editorial Minimalism)
   ==========================================
   Voices:
   - Display / Hero / Preloader: Kumiko — the loud voice for headline moments.
   - Body + UI: Neue Haas Grotesk Text — clean, modern, grounded.
   - Editorial serif: Tiempos (Text + Headline Light Italic) — the quiet voice:
     ledes, pull quotes, testimonials, captions, descriptors.
   Loading strategy (web.dev font best practices):
   - WOFF2 subsets in fonts/web/ (latin + punctuation, ~6KB each; Kumiko 23KB).
   - Display face: font-display: fallback (protects LCP/CLS; brief block, no late swap).
   - Body/UI/serif: font-display: swap (text visible immediately).
   - Kumiko + Haas 400 are preloaded in <head> on every page.
*/

@font-face {
    font-family: "Rido Kumiko";
    src: url("../fonts/web/kumiko-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: fallback;
}

@font-face {
    font-family: "Rido Neue Haas Text";
    src: url("../fonts/web/haas-text-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Rido Neue Haas Text";
    src: url("../fonts/web/haas-text-550.woff2") format("woff2");
    font-style: normal;
    font-weight: 550;
    font-display: swap;
}

@font-face {
    font-family: "Rido Neue Haas Text";
    src: url("../fonts/web/haas-text-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Rido Tiempos Text";
    src: url("../fonts/web/tiempos-text-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Rido Tiempos Text";
    src: url("../fonts/web/tiempos-text-400i.woff2") format("woff2");
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Rido Tiempos Headline";
    src: url("../fonts/web/tiempos-headline-300i.woff2") format("woff2");
    font-style: italic;
    font-weight: 300;
    font-display: swap;
}

:root {
    /* Display = Neue Haas Bold: one grotesque family, weights do the work (Swiss).
       Kumiko (marker hand) is reserved for the "hand" motif: preloader HELLO,
       figure annotations, doodle-adjacent moments. Never for headings. */
    --font-display: "Rido Neue Haas Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-hand: "Rido Kumiko", "Comic Sans MS", cursive;
    --font-body: "Rido Neue Haas Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-ui: "Rido Neue Haas Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-serif: "Rido Tiempos Text", Georgia, "Times New Roman", serif;
    --font-serif-display: "Rido Tiempos Headline", "Rido Tiempos Text", Georgia, serif;
    --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

    --font-display-weight: 700;
    --font-body-weight: 400;
    --font-ui-weight: 700;

    /* Map into existing theme tokens so the base template follows the new system */
    --title-font: var(--font-ui);
    --body-font: var(--font-body);
    --title-font-weight: 700;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

body {
    font-family: var(--font-body);
    font-weight: var(--font-body-weight);
    letter-spacing: -0.005em;
}

p,
figcaption,
blockquote,
.lead,
.rido-principles__copy,
.rido-case-desc,
.rido-topic-divider__desc,
.rido-capability-grid__title {
    font-family: var(--font-body);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.55;
}

/* The quiet editorial voice — serif italic for human moments */
.serif-voice,
.lede,
.pull-quote,
blockquote.editorial,
figcaption.editorial {
    font-family: var(--font-serif);
    font-style: italic;
    letter-spacing: 0;
}

.pull-quote {
    font-family: var(--font-serif-display);
    font-weight: 300;
    line-height: 1.22;
}

/* UI / labels / controls */
button,
input,
select,
textarea,
.btn-line,
.d-menu-1 li a,
.subtitle,
.preloader-meta__label,
.rido-editorial-kicker,
.rido-editorial-eyebrow,
.rido-principles__index,
.rido-capability-grid__index,
.rido-case-brand,
.rido-topic-divider__kicker {
    font-family: var(--font-ui);
    font-weight: var(--font-ui-weight);
    font-variant-numeric: lining-nums tabular-nums;
}

/* Editorial display roles — grotesque bold, tight tracking */
h1:not(.text-fit):not(.hero-wordmark),
h2,
.hero-title,
.rido-editorial-title,
.rido-topic-divider__title {
    font-family: var(--font-display), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-weight: var(--font-display-weight);
    font-optical-sizing: auto;
    letter-spacing: -0.02em;
    font-kerning: normal;
}

/* The hand motif — Kumiko, used sparingly and deliberately */
.preloader-title,
.hand-note,
.hero-caption .hand,
figcaption .hand {
    font-family: var(--font-hand), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-weight: 400;
    letter-spacing: 0;
}

/* Keep the iconic brand masthead / wordmark sans and bold */
.text-fit,
.hero-wordmark,
.preloader-meta__label {
    font-family: var(--font-ui), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.text-fit,
.hero-wordmark {
    font-weight: 700;
}

/* Preloader keeps the hand voice; hero is the grotesque statement */
.preloader-title {
    font-weight: 400;
    line-height: 1;
}

.hero-title {
    font-weight: var(--font-display-weight);
    line-height: 1;
}

.hero-title .hero-title-rocket {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.preloader__headline,
.preloader__loading {
    font-family: var(--font-ui);
}

/* Numbers */
.timer,
.de_count h3,
.de_count .fs-48,
.rido-principles__index,
.rido-capability-grid__index {
    font-family: var(--font-ui);
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Buttons + nav feel crisp, minimal, typographic */
.d-menu-1 li a,
.btn-line {
    letter-spacing: -0.01em;
}

.subtitle,
.rido-editorial-kicker,
.rido-editorial-eyebrow,
.preloader-meta__label {
    letter-spacing: 0.08em;
}

/* Preserve emoji glyph rendering in preloader */
.preloader-word.is-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
}

/* audit: style.css declares --title-font/--body-font on the universal selector (*),
   so every element owns a Plus Jakarta Sans copy of the token and the :root remap
   above never reaches descendants (h3-h6, .btn-line, hub featured links, vibe card
   titles all computed Jakarta). Re-map at the same universal scope; fonts.css loads
   after style.css on every page, so this wins the cascade. */
* {
    --title-font: var(--font-ui);
    --body-font: var(--font-body);
}
