/*
 * FondPas typography system
 * --------------------------
 * The only typographic authority loaded after the visual system.
 * It intentionally changes no color, spacing, sizing of surfaces, or layout.
 */

@font-face {
    font-family: "Inter";
    src: url("./fonts/InterVariable.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --fp-font: "Inter", sans-serif;

    --fp-weight-regular: 400;
    --fp-weight-medium: 500;
    --fp-weight-heading: 680;
    --fp-weight-ui-strong: 760;
    --fp-weight-display: 780;
    --fp-weight-label: 800;

    --fp-type-display-xl: clamp(3.5rem, 6vw, 7.4rem);
    --fp-type-display: clamp(2.3rem, 4vw, 4.3rem);
    --fp-type-project-title: clamp(2.15rem, 3.2vw, 3.85rem);
    --fp-type-h2: clamp(1.7rem, 2.5vw, 2.25rem);
    --fp-type-h3: 1.25rem;
    --fp-type-lead: clamp(1.02rem, 1.3vw, 1.25rem);
    --fp-type-body: 1rem;
    --fp-type-small: 0.9rem;
    --fp-type-caption: 0.78rem;
    --fp-type-label: 0.72rem;

    --fp-leading-display: 0.98;
    --fp-leading-heading: 1.12;
    --fp-leading-body: 1.6;
    --fp-leading-ui: 1.35;
    --fp-leading-label: 1.25;

    --fp-tracking-display: -0.055em;
    --fp-tracking-heading: -0.035em;
    --fp-tracking-body: 0;
    --fp-tracking-label: 0.18em;

    /* Compatibility aliases used by existing FondPas styles. */
    --ui-font: var(--fp-font);
    --ui-font-display: var(--fp-font);
    --ui-font-body: var(--fp-font);
    --ui-font-sans: var(--fp-font);
}

html {
    font-family: var(--fp-font);
    font-size: 16px;
    font-synthesis: none;
}

body,
button,
input,
select,
textarea,
table,
code,
pre,
kbd,
samp {
    font-family: var(--fp-font) !important;
    font-synthesis: none;
}

body {
    font-size: var(--fp-type-body);
    font-weight: var(--fp-weight-regular);
    line-height: var(--fp-leading-body);
    letter-spacing: var(--fp-tracking-body);
}

button,
input,
select,
textarea {
    font-size: var(--fp-type-small);
    line-height: var(--fp-leading-ui);
    letter-spacing: var(--fp-tracking-body);
}

code,
pre,
kbd,
samp,
.ui-metric strong,
.ui-metric-card strong,
.ui-stage-stat strong,
.step-stage-stat strong,
.application-command-value,
.application-truth-strip strong,
.application-score-summary strong,
.start-intelligence-metrics strong,
.call-intake-profile-stats strong,
.account-metrics strong {
    font-variant-numeric: tabular-nums;
}

p,
li,
dd,
blockquote,
.ui-rich,
.rich-content,
.section-content {
    line-height: var(--fp-leading-body);
    letter-spacing: var(--fp-tracking-body);
}

strong,
b {
    font-weight: var(--fp-weight-heading);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--fp-font) !important;
    font-weight: var(--fp-weight-heading);
    text-wrap: balance;
}

h1 {
    font-size: var(--fp-type-display);
    line-height: var(--fp-leading-display);
    letter-spacing: var(--fp-tracking-display);
}

h2 {
    font-size: var(--fp-type-h2);
    line-height: var(--fp-leading-heading);
    letter-spacing: var(--fp-tracking-heading);
}

h3 {
    font-size: var(--fp-type-h3);
    line-height: var(--fp-leading-heading);
    letter-spacing: var(--fp-tracking-heading);
}

h4,
h5,
h6 {
    line-height: var(--fp-leading-heading);
    letter-spacing: var(--fp-tracking-heading);
}

/* Short brand statements may retain the expressive FondPas display scale. */
.ui-auth-brand h1,
.start-workspace-copy > h1 {
    font-size: var(--fp-type-display-xl) !important;
    font-weight: var(--fp-weight-display) !important;
    line-height: 0.94 !important;
    letter-spacing: var(--fp-tracking-display) !important;
}

/* Page and public-flow titles. */
.ui-stage-title,
.call-intake-copy h1,
.brief-review-stage-copy h1,
.legal-document h1,
.account-console-head h1,
.start-workspace-head h1,
.workspace-title-row > h1 {
    font-size: var(--fp-type-display) !important;
    font-weight: var(--fp-weight-display) !important;
    line-height: var(--fp-leading-display) !important;
    letter-spacing: var(--fp-tracking-display) !important;
}

/*
 * Dynamic titles can contain long official ITMS names. They must never inherit
 * the marketing display scale or ultra-tight headline rhythm.
 */
.application-workspace-title h1,
.ui-stage-title--application,
.ui-stage-title--call,
.ui-stage-title--portfolio,
.ui-stage-title--workflow,
.brief-review-call strong {
    font-size: var(--fp-type-project-title) !important;
    font-weight: var(--fp-weight-heading) !important;
    line-height: 1.04 !important;
    letter-spacing: var(--fp-tracking-heading) !important;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* Section hierarchy shared by project, assessment, admin, and legal surfaces. */
.ui-section-title,
.section-heading h1,
.section-heading h2,
.workspace-step-main > .section-heading:first-of-type h2,
.step-context-bar h2,
.step-stage-copy h2,
.application-overview h2,
.application-overview-attention h2,
.final-gate h2,
.final-attention h2,
.final-human-input h2,
.itms-copy-workspace h2,
.itms-transfer-head h2,
.ai-review-head h2,
.brief-review-head h2,
.collaboration-summary h2,
.work-register h2,
.work-register-head h2,
.start-intelligence-main h2,
.start-path h2,
.start-workspace-panel-main h2,
.account-danger-zone h2,
.legal-document-grid h2 {
    font-size: var(--fp-type-h2) !important;
    font-weight: var(--fp-weight-heading) !important;
    line-height: var(--fp-leading-heading) !important;
    letter-spacing: var(--fp-tracking-heading) !important;
}

.section-heading h3,
.workspace-title-row h2,
.workspace-title-row h3,
.application-overview-grid h3,
.final-next-action h3,
.review-card-header h3,
.ai-claim-list h3,
.work-case h3,
.ui-profile-name-line h3,
.ui-callout-title,
.ui-case-title,
.discovery-planned .ui-case-title,
.discovery-results .ui-case-title,
.draft-status-side-body .ui-case-title {
    font-size: var(--fp-type-h3) !important;
    font-weight: var(--fp-weight-heading) !important;
    line-height: var(--fp-leading-heading) !important;
    letter-spacing: var(--fp-tracking-heading) !important;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* Introductory and explanatory copy. */
.ui-stage-body,
.ui-section-copy,
.page-header-copy,
.workspace-header-copy,
.legal-lead,
.ui-auth-brand > p:last-child,
.ui-auth-card-head > p:last-child,
.call-intake-copy > p:not(.ui-kicker),
.brief-review-stage-copy > p:not(.ui-kicker),
.start-workspace-copy > p:not(.ui-kicker),
.start-workspace-head > div > p:last-child,
.start-workspace-panel-main > p:not(.ui-kicker),
.start-intelligence-main > p:not(.ui-kicker) {
    font-size: var(--fp-type-lead) !important;
    font-weight: var(--fp-weight-regular) !important;
    line-height: var(--fp-leading-body) !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

/* Uppercase overlines and compact semantic labels. */
.ui-kicker,
.eyebrow,
.ui-label,
.application-workspace-overline,
.application-step-navigation-label,
.ai-processing-eyebrow,
.admin-ai-fill-label,
.account-table-actions-label,
.work-case-id,
.workspace-command-meta dt,
.meta-list dt,
.eligibility-mismatch dt,
.ui-assessment-trace-metrics dt,
.expert-trace-evidence dt,
.field > span:first-child,
.ui-field > span:first-child,
.call-intake-form label > span,
.account-table-head,
.expert-ai-table-head,
.expert-trace-state,
.collaboration-list-head > span,
.itms-human-boundary > span,
.itms-readiness-gate > span,
.final-attention-list article > span,
.final-clear > span,
.ui-profile-switcher-label,
.account-locked-role span,
.account-last-login span,
.account-metrics span,
.application-truth-strip small,
.priority-side-grid .summary-label,
.application-expert-toggle > span,
.expert-trace-index,
.expert-trace-evidence article > header > span,
.start-intelligence-metrics span {
    font-size: var(--fp-type-label) !important;
    font-weight: var(--fp-weight-label) !important;
    line-height: var(--fp-leading-label) !important;
    letter-spacing: var(--fp-tracking-label) !important;
}

/* Metadata and captions share one readable floor. */
small,
.muted,
.ui-note-small,
.ui-case-meta,
.ui-profile-meta,
.field-meta,
.application-command-value-meta,
.application-card-meta .muted,
.application-workspace-title > p,
.application-workspace-source a,
.application-workspace-source details,
.account-last-login strong,
.account-shared-note,
.account-field-error,
.account-you,
.admin-ai-test-source,
.admin-ai-test-banner-mark,
.ai-processing-time,
.ai-processing-phase,
.expert-trace-progress small,
.expert-ai-register header p,
.expert-trace-evidence article header p,
.ui-site-footer p,
.ui-site-footer-links a,
.ui-site-footer-signature span,
.work-register-count,
.brief-review-badge,
.brief-review-field small,
.brief-review-confirm small,
.ui-assessment-source-list small,
.ui-assessment-trace > summary small,
.discovery-data-details > summary small,
.final-evidence-details > summary small,
.itms-copy-sections details > summary small {
    font-size: var(--fp-type-caption) !important;
    font-weight: var(--fp-weight-medium) !important;
    line-height: 1.45 !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

/* Navigation, buttons, chips, and form controls use one compact UI rhythm. */
.ui-nav-link,
.ui-button,
.ui-button-ghost,
.ui-button-secondary,
.ui-button-danger,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.text-link,
.ui-stage-link,
.ui-pagination a,
.ui-step-pill,
.ui-chip,
.ui-chip-primary,
.ui-chip-light,
.ui-chip-success,
.ui-chip-warning,
.ui-chip-danger,
.pill,
.application-step-navigation > div a,
.application-step-review-link,
.application-expert-toggle,
.brief-review-actions a,
.brief-review-actions button,
.call-intake-back,
.call-intake-control button,
.account-row-actions .ui-button-ghost,
.account-text-action,
.collaboration-summary-action,
.ui-profile-menu-item span,
.ui-profile-manage-link,
.start-profile-summary > a,
.account-delete-confirm > summary,
.ai-review-section > summary > span:last-child,
.final-evidence-details > summary > span:last-child,
.application-output-register > summary > span:last-child,
.discovery-data-details > summary > span:last-child,
.itms-copy-sections details > summary > span:last-child {
    font-size: var(--fp-type-small) !important;
    font-weight: var(--fp-weight-ui-strong) !important;
    line-height: var(--fp-leading-ui) !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

.admin-ai-test-banner-mark,
.expert-trace-index,
.expert-trace-evidence article > header > span,
.expert-ai-register article > span,
.ai-processing-title {
    font-size: var(--fp-type-label) !important;
    font-weight: var(--fp-weight-label) !important;
    line-height: var(--fp-leading-label) !important;
}

.account-avatar {
    font-size: var(--fp-type-body) !important;
    font-weight: var(--fp-weight-display) !important;
    line-height: 1 !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

.start-path-number {
    font-weight: var(--fp-weight-display) !important;
}

.account-status {
    font-size: var(--fp-type-caption) !important;
    font-weight: var(--fp-weight-ui-strong) !important;
    line-height: var(--fp-leading-ui) !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

input,
select,
textarea,
.ui-textarea,
.brief-review-field input,
.brief-review-field textarea,
.field textarea {
    font-size: var(--fp-type-body) !important;
    font-weight: var(--fp-weight-regular) !important;
    line-height: 1.5 !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

/* Strong operational values and compact status text. */
.ui-metric strong,
.ui-metric-card strong,
.ui-stage-stat strong,
.step-stage-stat strong,
.application-command-value,
.application-hero-mini strong,
.application-score-summary strong,
.application-truth-strip strong,
.final-truths strong,
.itms-transfer-summary strong,
.start-intelligence-metrics strong,
.call-intake-profile-stats strong,
.account-metrics strong,
.work-register-counts strong {
    font-weight: var(--fp-weight-display) !important;
    line-height: 1 !important;
    letter-spacing: var(--fp-tracking-heading) !important;
}

.application-draft-status p,
.application-decision-strip p,
.application-overview header p,
.application-overview-attention header p,
.final-gate-head p,
.final-attention header p,
.final-human-input header p,
.final-next-action p,
.itms-copy-workspace header p,
.itms-transfer-head p,
.ai-review-head p,
.collaboration-summary p:not(.ui-kicker),
.work-register-head p,
.legal-document-grid p {
    font-size: var(--fp-type-small) !important;
    font-weight: var(--fp-weight-regular) !important;
    line-height: var(--fp-leading-body) !important;
    letter-spacing: var(--fp-tracking-body) !important;
}

@media (max-width: 720px) {
    :root {
        --fp-type-display-xl: clamp(3.2rem, 16vw, 5.25rem);
        --fp-type-display: clamp(2.4rem, 12vw, 3.8rem);
        --fp-type-project-title: clamp(2rem, 9vw, 3rem);
        --fp-type-h2: clamp(1.6rem, 7vw, 2.15rem);
    }

    .ui-auth-brand h1,
    .start-workspace-copy > h1 {
        line-height: 0.96 !important;
    }

    .application-workspace-title h1,
    .ui-stage-title--application,
    .ui-stage-title--call,
    .ui-stage-title--portfolio,
    .ui-stage-title--workflow {
        line-height: 1.06 !important;
    }
}
