/* Betty role tokens. v3, 26 Nov 2026 (design upgrade: typefaces and five soft surface colours).
   Source of truth for colour, shape and size in every Betty screen.
   Brand values come from ../Betty-design-resources/design-tokens.json and the brand guide.
   Role names follow shadcn/ui so a later move to Basecoat or shadcn is a re-skin.
   Rules of use are in COMPONENT-DECISIONS.md. Do not add hex values in a screen. */

/* ---- typefaces: bundled, served from our own server (SIL Open Font License; licences beside the files) ---- */
@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/assets/fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("/assets/fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/assets/fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }

:root {
  /* ---- brand palette ---- */
  --betty-parchment: #F5EFE4;
  --betty-paper: #FBF7EE;
  --betty-linen: #E6D9C5;
  --betty-ink: #322D28;
  --betty-forest: #3C5043;
  --betty-terracotta: #A36348;       /* fills and large text only: 4.1:1 on parchment */
  --betty-terracotta-deep: #8A4F38;  /* text-safe: 5.6:1 on parchment */
  --betty-brass: #AD935D;            /* ornament only: 2.6:1 */
  --betty-brass-deep: #7A6535;       /* captions on parchment or paper: 4.9:1 */
  --betty-sage: #9CA88C;             /* tints and geometry, never text */
  --betty-sandstone: #CBB597;
  --betty-clinical: #536D7E;         /* carer / professional context only */
  --betty-alert: #A23939;            /* real alerts and destructive actions only */

  /* ---- roles ---- */
  --background: var(--betty-parchment);
  --foreground: var(--betty-ink);
  --card: var(--betty-paper);
  --card-foreground: var(--betty-ink);
  --primary: var(--betty-forest);
  --primary-soft: #5E7366;   /* the unfilled part of a timed default (T1): a mid green that keeps white words readable */
  --primary-foreground: #FFFFFF;
  --secondary: var(--betty-linen);
  --secondary-foreground: var(--betty-ink);
  --accent: var(--betty-terracotta);
  --accent-strong: var(--betty-terracotta-deep);
  --accent-foreground: #FFFFFF;      /* on --accent-strong; on --accent use large text only */
  --muted-foreground: var(--betty-brass-deep);
  --border: var(--betty-sandstone);
  --ring: var(--betty-brass);
  --tint: var(--betty-sage);
  --clinical: var(--betty-clinical);
  --destructive: var(--betty-alert);
  --destructive-foreground: #FFFFFF;
  /* ---- added in the design upgrade (26 Nov): the only new colours ---- */
  --night: #26221E;          /* the resting face at night, nothing else */
  --clinical-tint: #DFE5E8;  /* carer surfaces */
  --tint-soft: #E3E7DA;      /* family surfaces */
  --ring-soft: #EFE6D0;      /* friend and notebook surfaces */
  --accent-soft: #F0DED3;    /* "from her" surfaces */
  /* ---- added with the two rooms (27 Nov): the place decides who can read, and its colour says which place ---- */
  --room-family: #E3E7DA;        /* Family chat: paper */
  --room-family-edge: #9CA88C;
  --room-family-strong: #5E7366; /* its sill and its door on her tablet; white words */
  --room-private: #F0DED3;       /* her and one person: paper */
  --room-private-edge: #C99B86;
  --room-private-strong: #A36348;
  --clinical-edge: #B9C6CE;      /* the edge of a visit-notes card */

  /* ---- shape ---- */
  --radius-card: 6px;
  --radius-control: 12px;
  --radius-voice: 50%;
  --space: 8px;

  /* ---- type: Libre Caslon Text for Betty's words and people's words; Atkinson Hyperlegible Next for labels
     and controls. Georgia and the system sans stand in while the files load, or if they cannot. ---- */
  --font-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-functional: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --line-height: 1.55;
}

/* ---- registers: set one class on <body> ---- */
.zen        { --body: 26px; --heading: 36px; --target: 72px; }
.editorial  { --body: 16px; --heading: 26px; --target: 44px; }
.functional { --body: 19px; --heading: 28px; --target: 56px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
