/* ============================================================
   TYPOGRAPHY  —  Buddy Design System
   ------------------------------------------------------------
   Every Buddy app is native SwiftUI and renders in Apple's
   system faces: SF Pro (Text/Display), SF Pro Rounded, and
   SF Mono. All four now ship as real .otf files (assets/fonts/,
   from Apple's free SF Pro / SF Mono downloads, licensed for
   Apple-platform UI design). The @font-face rules list local()
   first so an installed system face wins, then the bundled file.
   ============================================================ */

/* ============================================================
   @font-face — Apple system faces (all real .otf).
   ------------------------------------------------------------
   local() is listed first so an installed system face wins;
   otherwise the bundled .otf loads. SF Pro Text/Display are the
   optical-size members of SF Pro; Rounded and Mono are separate
   families.
   ============================================================ */

/* ---- SF Pro Text (real .otf, per weight) ---- */
@font-face {
  font-family: "SF Pro Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("SF Pro Text"), local("SFProText-Regular"),
    url("../assets/fonts/SF-Pro-Text-Regular.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: local("SF Pro Text Medium"), local("SFProText-Medium"),
    url("../assets/fonts/SF-Pro-Text-Medium.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: local("SF Pro Text Semibold"), local("SFProText-Semibold"),
    url("../assets/fonts/SF-Pro-Text-Semibold.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Text"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("SF Pro Text Bold"), local("SFProText-Bold"),
    url("../assets/fonts/SF-Pro-Text-Bold.otf") format("opentype");
}

/* ---- SF Pro Display (real .otf, per weight) ---- */
@font-face {
  font-family: "SF Pro Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("SF Pro Display"), local("SFProDisplay-Regular"),
    url("../assets/fonts/SF-Pro-Display-Regular.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Display"; font-style: normal; font-weight: 600; font-display: swap;
  src: local("SF Pro Display Semibold"), local("SFProDisplay-Semibold"),
    url("../assets/fonts/SF-Pro-Display-Semibold.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Display"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("SF Pro Display Bold"), local("SFProDisplay-Bold"),
    url("../assets/fonts/SF-Pro-Display-Bold.otf") format("opentype");
}

/* ---- SF Pro Rounded (real .otf, per weight) ---- */
@font-face {
  font-family: "SF Pro Rounded"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("SF Pro Rounded"), local("SFProRounded-Regular"),
    url("../assets/fonts/SF-Pro-Rounded-Regular.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Rounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: local("SF Pro Rounded Medium"), local("SFProRounded-Medium"),
    url("../assets/fonts/SF-Pro-Rounded-Medium.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Rounded"; font-style: normal; font-weight: 600; font-display: swap;
  src: local("SF Pro Rounded Semibold"), local("SFProRounded-Semibold"),
    url("../assets/fonts/SF-Pro-Rounded-Semibold.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Rounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("SF Pro Rounded Bold"), local("SFProRounded-Bold"),
    url("../assets/fonts/SF-Pro-Rounded-Bold.otf") format("opentype");
}
@font-face {
  font-family: "SF Pro Rounded"; font-style: normal; font-weight: 800; font-display: swap;
  src: local("SF Pro Rounded Heavy"), local("SFProRounded-Heavy"),
    url("../assets/fonts/SF-Pro-Rounded-Heavy.otf") format("opentype");
}

/* ---- SF Mono (real .otf, per weight) ---- */
@font-face {
  font-family: "SF Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("SF Mono"), local("SFMono-Regular"),
    url("../assets/fonts/SF-Mono-Regular.otf") format("opentype");
}
@font-face {
  font-family: "SF Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: local("SF Mono Medium"), local("SFMono-Medium"),
    url("../assets/fonts/SF-Mono-Medium.otf") format("opentype");
}
@font-face {
  font-family: "SF Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: local("SF Mono Semibold"), local("SFMono-Semibold"),
    url("../assets/fonts/SF-Mono-Semibold.otf") format("opentype");
}
@font-face {
  font-family: "SF Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("SF Mono Bold"), local("SFMono-Bold"),
    url("../assets/fonts/SF-Mono-Bold.otf") format("opentype");
}

:root {
  /* ---- Font families ------------------------------------ */
  /* Body & UI text — SF Pro Text on Apple, system UI elsewhere */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  /* Large titles & display — SF Pro Display */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  /* Rounded — used for friendly titles & Pointy's instrument chrome.
     Real SF Pro Rounded ships with this system. */
  --font-rounded: "SF Pro Rounded", ui-rounded, -apple-system,
    BlinkMacSystemFont, system-ui, sans-serif;

  /* Monospaced — telemetry, tabular data, entity IDs, durations */
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;

  /* ---- Weights (match Apple's named weights) ------------ */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;

  /* ---- Type scale  (maps to iOS UIFont.TextStyle) -------
     size / line-height / default weight. Dynamic Type means
     these are the *base* (Large) sizes; everything scales. */
  --type-large-title-size: 34px;   --type-large-title-line: 41px;
  --type-title1-size: 28px;        --type-title1-line: 34px;
  --type-title2-size: 22px;        --type-title2-line: 28px;
  --type-title3-size: 20px;        --type-title3-line: 25px;
  --type-headline-size: 17px;      --type-headline-line: 22px;   /* semibold body */
  --type-body-size: 17px;          --type-body-line: 22px;
  --type-callout-size: 16px;       --type-callout-line: 21px;
  --type-subheadline-size: 15px;   --type-subheadline-line: 20px;
  --type-footnote-size: 13px;      --type-footnote-line: 18px;
  --type-caption1-size: 12px;      --type-caption1-line: 16px;
  --type-caption2-size: 11px;      --type-caption2-line: 13px;

  /* Telemetry / numeric (Pointy & data-dense screens) */
  --type-telemetry-size: 13px;        --type-telemetry-line: 16px;
  --type-telemetry-large-size: 20px;  --type-telemetry-large-line: 24px;
  --type-telemetry-display-size: 22px;--type-telemetry-display-line: 26px;

  /* Letter-spacing — iOS uses optical tracking; keep near 0 */
  --tracking-tight: -0.02em;   /* large display */
  --tracking-normal: 0em;
  --tracking-label: 0.06em;    /* uppercased caption labels */
}
