/* P0-12A — Lityura Typography Font Baseline V1.0
 *
 * Font binaries are intentionally not bundled in this package.
 * Inter may be self-hosted later as a Latin-focused subset.
 */

:root {
  /* UI: consistent Latin/digit rhythm, native CJK fallback */
  --font-ui:
    "Inter Variable",
    "Inter",
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Noto Sans SC",
    system-ui,
    sans-serif;

  /* Reading: CJK-first; do not rely on system-ui alone for long paragraphs */
  --font-reading:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Noto Sans SC",
    sans-serif;

  /* Code / path / aligned numeric metadata */
  --font-mono:
    ui-monospace,
    "SFMono-Regular",
    Menlo,
    Monaco,
    Consolas,
    "Noto Sans Mono",
    "Liberation Mono",
    monospace;
}

/* P0-12A only freezes family roles.
 * Font size / line-height / tracking tokens are finalized in P0-12B.
 */

html,
body {
  font-family: var(--font-ui);
}

.typography-reading {
  font-family: var(--font-reading);
}

code,
pre,
kbd,
samp,
.typography-mono {
  font-family: var(--font-mono);
}


/* P0-12B — Lityura Typography Scale & Tokens V1.0 */

:root {
  /* Raw size scale */
  --type-12: 0.75rem;
  --type-13: 0.8125rem;
  --type-14: 0.875rem;
  --type-16: 1rem;
  --type-17: 1.0625rem;
  --type-18: 1.125rem;
  --type-20: 1.25rem;
  --type-22: 1.375rem;
  --type-24: 1.5rem;
  --type-26: 1.625rem;
  --type-28: 1.75rem;
  --type-30: 1.875rem;
  --type-32: 2rem;
  --type-36: 2.25rem;

  /* Font weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Line-height tokens */
  --leading-display: 1.18;
  --leading-heading-1: 1.25;
  --leading-heading-2: 1.32;
  --leading-heading-3: 1.40;
  --leading-body: 1.70;
  --leading-reading: 1.80;
  --leading-ui: 1.45;
  --leading-caption: 1.40;
  --leading-system: 1.35;
  --leading-code: 1.65;

  /* Tracking */
  --tracking-normal: 0;
  --tracking-meta: 0.01em;
  --tracking-system: 0.08em;

  /* Semantic type roles — Desktop baseline */
  --text-display-size: var(--type-36);
  --text-h1-size: var(--type-28);
  --text-h2-size: var(--type-22);
  --text-h3-size: var(--type-18);
  --text-body-lg-size: var(--type-17);
  --text-body-size: var(--type-16);
  --text-reading-size: var(--type-16);
  --text-ui-size: var(--type-14);
  --text-ui-sm-size: var(--type-13);
  --text-caption-size: var(--type-12);
  --text-system-size: var(--type-12);
  --text-code-size: var(--type-14);

  /* Reading measure */
  --reading-measure: 44rem;      /* ~704px at 16px root */
  --reading-measure-wide: 47.5rem; /* 760px */
}

/* Compact: 768–1279 */
@media (max-width: 79.9375rem) {
  :root {
    --text-display-size: var(--type-32);
    --text-h1-size: var(--type-26);
    --text-h2-size: 1.3125rem; /* 21px */
  }
}

/* Mobile: <768 */
@media (max-width: 47.9375rem) {
  :root {
    --text-display-size: var(--type-30);
    --text-h1-size: var(--type-24);
    --text-h2-size: var(--type-20);
  }
}

/* Semantic utilities / baseline roles */
.type-display {
  font-family: var(--font-ui);
  font-size: var(--text-display-size);
  line-height: var(--leading-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-normal);
}

.type-h1 {
  font-family: var(--font-ui);
  font-size: var(--text-h1-size);
  line-height: var(--leading-heading-1);
  font-weight: var(--weight-semibold);
}

.type-h2 {
  font-family: var(--font-ui);
  font-size: var(--text-h2-size);
  line-height: var(--leading-heading-2);
  font-weight: var(--weight-semibold);
}

.type-h3 {
  font-family: var(--font-ui);
  font-size: var(--text-h3-size);
  line-height: var(--leading-heading-3);
  font-weight: var(--weight-semibold);
}

.type-body-lg {
  font-family: var(--font-reading);
  font-size: var(--text-body-lg-size);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

.type-body {
  font-family: var(--font-ui);
  font-size: var(--text-body-size);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

.type-reading {
  font-family: var(--font-reading);
  font-size: var(--text-reading-size);
  line-height: var(--leading-reading);
  font-weight: var(--weight-regular);
  max-width: var(--reading-measure);
}

.type-ui {
  font-family: var(--font-ui);
  font-size: var(--text-ui-size);
  line-height: var(--leading-ui);
  font-weight: var(--weight-medium);
}

.type-ui-sm {
  font-family: var(--font-ui);
  font-size: var(--text-ui-sm-size);
  line-height: var(--leading-ui);
  font-weight: var(--weight-regular);
}

.type-caption {
  font-family: var(--font-ui);
  font-size: var(--text-caption-size);
  line-height: var(--leading-caption);
  font-weight: var(--weight-regular);
}

.type-system {
  font-family: var(--font-ui);
  font-size: var(--text-system-size);
  line-height: var(--leading-system);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-system);
  text-transform: uppercase;
}

.type-code {
  font-family: var(--font-mono);
  font-size: var(--text-code-size);
  line-height: var(--leading-code);
  font-weight: var(--weight-regular);
}

/*
 * Weight fallback policy:
 * Do not set `font-synthesis: none` globally in P0.
 * If a CJK platform family has no exact 500/600 face, allow the browser/platform
 * to map, interpolate, or synthesize the nearest usable weight.
 * P0-12C validates whether any platform-specific correction is necessary.
 */
