/* A · Ledger design tokens — Condo's visual language, intended for the
   dealaria.pt tools. Values are copied from the artboards in design/ (Main,
   A-Quotas, A-Palette), the dark ones as the owner approved them on the
   canvas's dark boards (#47);
   docs/design-language.md says where each one is used, records the one
   value changed for contrast and lists the open points (#9).
   Tokens only: component styles are written on top of these. */
@layer tokens {
  /* IBM Plex, Latin1 subsets, vendored by `just vendor-fonts` (SIL OFL 1.1,
     ../fonts/LICENSE): the weights the artboards load (↑ ↓ ⌘ ↵ fall back). */
  @font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); }
  @font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2"); }
  @font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); }
  @font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); }
  @font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexMono-Medium-Latin1.woff2") format("woff2"); }

  :root {
    /* Light, or dark when the system prefers it: the @media rule below (#47). */
    color-scheme: light dark;

    /* Type */
    --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --font-figures: tabular-nums;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --text-caption: 11px;
    --text-meta: 12px;
    --text-body: 13px;
    --text-option: 14px;
    --text-query: 15px;
    --text-title: 20px;
    --text-figure: 22px;
    --text-display: 28px;
    --text-lead: 14px;
    --leading-body: 1.45;
    --leading-pair: 1.3;
    --leading-heading: 28px;
    --leading-display: 36px;
    --leading-stack: 16px;
    --leading-note: 14px;
    --tracking-title: -0.01em;
    --tracking-label: 0.06em;

    /* Colour */
    --color-surface: #FFFFFF;
    --color-surface-alt: #F5F6F7;
    --color-surface-hover: var(--color-surface-alt);
    --color-surface-alt-hover: #ECEEF0;
    --color-line: #E3E6EA;
    --color-line-strong: #CBD0D6;
    --color-ink: #15191E;
    --color-ink-muted: #4A5360;
    /* Artboards: #6B7480, 4.38:1 on surface-alt; darkened (same hue) to 4.50:1. */
    --color-ink-subtle: #69727E;
    /* Petróleo accent, owner 2026-12-05 (CON-336; condo-web follows). */
    --color-accent: #0E5560;
    --color-accent-hover: #0A4049;
    --color-accent-soft: #E8F2F3;
    --color-success: #1F6B45;
    --color-success-soft: #E9F4EE;
    --color-warning: #8A5A00;
    --color-warning-soft: #FBF3DD;
    --color-danger: #A32A2A;
    --color-danger-soft: #FBEDEC;
    --color-neutral: var(--color-ink-muted);
    --color-neutral-soft: #EEF0F2;
    --color-highlight: var(--color-warning-soft);
    --color-backdrop: rgba(21,25,30,0.38);
    --shadow-overlay: 0 24px 64px rgba(21,25,30,0.22), 0 2px 8px rgba(21,25,30,0.10);
    /* The landing page and /privacidade only (#170; the app keeps the one
       accent): a warm terracotta beside the accent, its tint band, and the
       cool band, the accent's own tint. */
    --color-landing-warm: #A3441C;
    --color-landing-warm-soft: #FBF1E9;
    --color-landing-cool-soft: var(--color-accent-soft);

    /* Space */
    --space-1: 2px;
    --space-2: 4px;
    --space-3: 6px;
    --space-4: 8px;
    --space-5: 10px;
    --space-6: 12px;
    --space-7: 16px;
    --space-8: 20px;
    --space-9: 24px;
    --space-10: 32px;
    --pad-control: var(--space-5);
    --pad-cell: var(--space-6);
    --pad-cell-dense: var(--space-5);
    --pad-badge: var(--space-3);
    --pad-kbd: 1px 5px;
    --pad-page: var(--space-10);
    --pad-band: 56px;

    /* Radius */
    --radius-mark: 2px;
    --radius-tag: 3px;
    --radius-control: 4px;
    --radius-dialog: 6px;
    --radius-pill: 8px;
    --radius-round: 50%;

    /* Lines and focus */
    --border-hairline: 1px solid var(--color-line);
    --focus-ring: 2px solid var(--color-accent);
    --focus-offset: 2px;
    --focus-field: 0 0 0 1px var(--color-accent);
    --ring-live: 0 0 0 3px var(--color-success-soft);

    /* Sizes */
    --size-sidebar: 248px;
    --size-form: 320px;
    --size-content: 960px;
    --size-feature: 240px;
    --size-measure: 640px;
    --size-rule: 24px;
    --size-rule-weight: 3px;
    --size-header: 56px;
    --size-viewport: 100dvh;
    --size-switcher: 52px;
    --size-control: 40px;
    --size-button: 32px;
    --size-row: 32px;
    --size-row-tall: 40px;
    --size-row-total: 36px;
    --size-badge: 20px;
    --size-icon: 16px;
    --size-icon-small: 14px;
    --size-avatar: 28px;
    --icon-stroke: 2.25;
  }

  /* Dark (#47): the --color-* tokens and --shadow-overlay. The aliases (--color-surface-hover,
     --color-neutral, --color-highlight) and the tokens built from colours
     (--border-hairline, --focus-ring, --focus-field, --ring-live) follow
     through var(). */
  @media (prefers-color-scheme: dark) {
    :root {
      --color-surface: #101316;
      --color-surface-alt: #171A1E;
      --color-surface-alt-hover: #202328;
      --color-line: #2A2E34;
      --color-line-strong: #737982;
      --color-ink: #E3E7EC;
      --color-ink-muted: #A8B0BB;
      --color-ink-subtle: #8E97A2;
      /* Petróleo accent, owner 2026-12-05 (CON-336; condo-web follows). */
      --color-accent: #6FBFC9;
      --color-accent-hover: #8ACFD7;
      --color-accent-soft: #1C3236;
      --color-success: #6DC190;
      --color-success-soft: #172D22;
      --color-warning: #E4AE60;
      --color-warning-soft: #362913;
      --color-danger: #E7827B;
      --color-danger-soft: #3B1E1E;
      --color-neutral-soft: #26292D;
      --color-backdrop: rgba(6,8,10,0.60);
      --shadow-overlay: 0 24px 64px rgba(6,8,10,0.60), 0 2px 8px rgba(6,8,10,0.40);
      --color-landing-warm: #EE9A70;
      --color-landing-warm-soft: #291E16;
    }
  }
}
