/* =============================================================
   OCC apps kit: tokens
   For OCC's internal web apps (Email account requests, I'm New Here, Tool Inventory, Box Access Map, the shared
   sign-in and the apps home). Not visitonecc.com.

   1. Fonts      Urbanist (headings), Montserrat (body), Poppins (buttons). Self-hosted from fonts/, latin subset, SIL OFL.
   2. Color      Stillwater, copied exactly from palette/palette.css (round 4, final), with elevation next to it
                 because shadows change with the theme. Light on :root; dark under prefers-color-scheme unless the
                 page sets data-theme="light"; and again on [data-theme="dark"], so a dark island can sit on a
                 light page. Every color is a literal, never a var() alias. palette-check.cjs checks the colors.
   3. Scales     type, spacing, radii, motion, layout: the same in both themes.

   Rules the tokens assume (the README has them all): one filled primary per view; selection owns the edge,
   attention owns the fill; One Red only with words; a person's color only on their avatar; focus is a 3px
   --focus ring with a 2px offset.
   ============================================================= */

/* ---- 1. Fonts (paths are relative to this file, kit/) ---- */
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Urbanist-Variable-latin.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Montserrat-Variable-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/Poppins-SemiBold-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/Poppins-Bold-latin.woff2') format('woff2'); }

/* ---- 2. Color: Stillwater. Five named colors (One Red, Hearth, Stillwater, Linen, Limestone), two tints (Blush,
   Mist), the working neutrals and 8 person colors. Role names; the comments say each one's job. ---- */
:root, [data-theme="light"] {
  color-scheme: light;
  /* Grounds */
  --canvas: #F6F1EC;          /* Limestone. The page behind everything. */
  --surface: #FFFCF9;         /* Linen. Cards, lists, fields, the rail. */
  --sunk: #EFE7E0;            /* One step down from Linen: row hover, success and info notes, kbd. */
  --line: #E6DCD3;            /* Hairline, 1.32:1. Decorative only, never the only boundary. */
  --field: #8A7D75;           /* Field and secondary-button border, 3.90:1 on Linen (Ember's #CDBFB3 was 1.76). */
  /* Text */
  --fg: #231B17;              /* Hearth. Body text and headings, 15.08:1 on the canvas. */
  --muted: #6B5D54;           /* Secondary text, 5.18:1 or better on every ground. */
  /* Header: a Linen bar with the full-color logo (occ-logo.png, 40px tall) */
  --header-bg: #FFFCF9;       /* Linen. Never black in light mode. */
  --header-fg: #231B17;       /* App name. */
  --header-muted: #6B5D54;    /* "OCC apps" and the tabs that aren't current. */
  --header-line: #E6DCD3;     /* The 1px hairline under the bar. It replaces the 4px red rule. */
  /* The action: Stillwater */
  --primary: #195A73;         /* The one primary button per view. 7.47:1 on Linen. */
  --primary-fg: #FFFFFF;      /* Its label, 7.63:1. */
  --primary-hover: #08465D;   /* Hover and pressed, label 10.27:1. */
  --link: #195A73;            /* Links, always underlined: only 2.22:1 against body text. */
  --link-hover: #08465D;      /* Link hover. */
  /* You are here: Stillwater */
  --select-bg: #E5F3FA;       /* Mist. The selected row and the current rail item. */
  --select-line: #195A73;     /* The 2px edge of a selected row, the 3px bar under the current tab, the sort arrow. */
  --select-fg: #195A73;       /* Text and icon of the current tab and rail item, 6.74:1 on Mist. */
  /* Keyboard focus: Hearth */
  --focus: #231B17;           /* 3px ring, 2px offset, 16.56:1 on Linen. */
  /* Needs you: One Red, always with words */
  --needs-bg: #F8E6E3;        /* Blush. The one item that needs you. */
  --needs-line: #EBC4BF;      /* Its 2px border. Decorative: the dot and the words carry the meaning. */
  --needs-glow: 0 10px 30px rgba(191, 30, 46, 0.12);  /* Its one soft glow. One per view. */
  --attn: #A61A28;            /* The words "Needs you" and other attention text, 6.22:1 on Blush. */
  --attn-mark: #BF1E2E;       /* One Red: the dot, the ring around a person who needs you, the count badge. */
  --attn-fg: #FFFFFF;         /* The number on the count badge, 6.10:1. */
  --error: #A61A28;           /* Error message with its alert icon, saying what to do. */
  --error-line: #BF1E2E;      /* The 2px border of a field with an error, 5.97:1 on Linen. */
  /* Disabled (WCAG-exempt, kept readable in glare; a nearby line says why it's off) */
  --disabled-bg: #EFE7E0;     /* Fill of a disabled button. */
  --disabled-fg: #8F8278;     /* Its label, 3.05:1. */
  /* People: initials avatars only. Tint behind, ink for the initials; slot = FNV-1a(id) % 8 (people.css). */
  --person-0-tint: #EDCC91; --person-0-ink: #6B4D01;  /* ochre */
  --person-1-tint: #D2D79E; --person-1-ink: #54570F;  /* olive */
  --person-2-tint: #B8DCBE; --person-2-ink: #365D3F;  /* sage */
  --person-3-tint: #A7DDDC; --person-3-ink: #155B5B;  /* teal */
  --person-4-tint: #C5D0F3; --person-4-ink: #465077;  /* iris: was slate blue, whose ink was 2.9 from Stillwater */
  --person-5-tint: #DDC7EC; --person-5-ink: #5F486D;  /* plum */
  --person-6-tint: #D9D0BB; --person-6-ink: #5B523C;  /* sand */
  --person-7-tint: #D5B39D; --person-7-ink: #5E3C24;  /* umber */
  /* Elevation: offset shadows in warm Hearth, rare and quiet. Literals, like the colors, so a [data-theme] island is right. */
  --shadow-1: 0 1px 2px rgba(35, 27, 23, 0.06), 0 1px 3px rgba(35, 27, 23, 0.05);    /* Raised: the current step, a lifted card. */
  --shadow-2: 0 2px 4px rgba(35, 27, 23, 0.05), 0 10px 24px rgba(35, 27, 23, 0.10);  /* Floating: the people picker, menus, toasts. */
  --shadow-3: 0 2px 6px rgba(35, 27, 23, 0.06), 0 24px 64px rgba(35, 27, 23, 0.20);  /* Overlays: dialogs, sheets, side panels, the Ctrl K palette. */
  --scrim: rgba(35, 27, 23, 0.45);                                                   /* Behind an overlay. */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* Grounds */
    --canvas: #231B17;          /* Hearth. The night canvas: the same dark as the day's text. */
    --surface: #2C231E;         /* Linen at night, one step above the canvas. Header, rail, cards, fields. */
    --sunk: #352C27;            /* One step up from the surface: row hover, notes, kbd. */
    --line: #42362F;            /* Hairline, 1.32:1. Decorative only. */
    --field: #8C7D73;           /* Field and secondary-button border, 3.88:1 on the surface. */
    /* Text */
    --fg: #F6F1EC;              /* Limestone. The night text, 15.08:1 on the canvas. */
    --muted: #B9A99D;           /* Secondary text, 5.73:1 or better on every ground. */
    /* Header: the white logo (occ-logo-white.png) */
    --header-bg: #2C231E;       /* One step above the canvas. */
    --header-fg: #F6F1EC;       /* App name. */
    --header-muted: #B9A99D;    /* "OCC apps" and the other tabs. */
    --header-line: #42362F;     /* The 1px hairline under the bar. */
    /* The action: Stillwater at night */
    --primary: #97BED1;         /* Sea-mist fill with a Hearth label: calmer than a sky blue on warm dark. */
    --primary-fg: #231B17;      /* Its label, 8.55:1. */
    --primary-hover: #ADD1E2;   /* Hover and pressed, label 10.47:1. */
    --link: #97BED1;            /* Links, underlined, 7.76:1 on the surface. */
    --link-hover: #ADD1E2;      /* Link hover. */
    /* You are here */
    --select-bg: #1C343E;       /* Mist at night. */
    --select-line: #97BED1;     /* The 2px edge, the 3px tab bar, the sort arrow. */
    --select-fg: #97BED1;       /* Current tab and rail item, 6.58:1 on Mist at night. */
    /* Keyboard focus */
    --focus: #F6F1EC;           /* Limestone ring, 3px, 2px offset. */
    /* Needs you */
    --needs-bg: #40201F;        /* Blush at night. */
    --needs-line: #7A3434;      /* Its 2px border, decorative. */
    --needs-glow: 0 12px 40px rgba(234, 100, 112, 0.18);  /* The one soft glow. */
    --attn: #F0777A;            /* Attention words, 5.28:1 on Blush at night and 10+ from Stillwater in every vision type. */
    --attn-mark: #EA6470;       /* The dot, the ring, the count badge. */
    --attn-fg: #231B17;         /* The number on the badge, 5.28:1. */
    --error: #F0777A;           /* Error message text, 5.58:1 on the surface. */
    --error-line: #EA6470;      /* Error field border. */
    /* Disabled */
    --disabled-bg: #352C27;
    --disabled-fg: #84776E;     /* 3.14:1. */
    /* People at night */
    --person-0-tint: #5C430B; --person-0-ink: #DFCFB2;
    --person-1-tint: #494B1C; --person-1-ink: #D1D4B8;
    --person-2-tint: #344F39; --person-2-ink: #C5D6C8;
    --person-3-tint: #235050; --person-3-ink: #BDD7D6;
    --person-4-tint: #3E4663; --person-4-ink: #CAD0E5;  /* iris */
    --person-5-tint: #51405B; --person-5-ink: #D7CCDE;
    --person-6-tint: #4E4737; --person-6-ink: #D5D1C6;
    --person-7-tint: #5B4130; --person-7-ink: #DFCDC2;
    /* Elevation at night: deeper and darker, because the surfaces are already one step up. */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.30), 0 12px 28px rgba(0, 0, 0, 0.40);
    --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.35), 0 28px 72px rgba(0, 0, 0, 0.55);
    --scrim: rgba(12, 9, 7, 0.62);
  }
}

:root[data-theme="dark"], [data-theme="dark"] {
  color-scheme: dark;
  /* Grounds */
  --canvas: #231B17;          /* Hearth. The night canvas: the same dark as the day's text. */
  --surface: #2C231E;         /* Linen at night, one step above the canvas. Header, rail, cards, fields. */
  --sunk: #352C27;            /* One step up from the surface: row hover, notes, kbd. */
  --line: #42362F;            /* Hairline, 1.32:1. Decorative only. */
  --field: #8C7D73;           /* Field and secondary-button border, 3.88:1 on the surface. */
  /* Text */
  --fg: #F6F1EC;              /* Limestone. The night text, 15.08:1 on the canvas. */
  --muted: #B9A99D;           /* Secondary text, 5.73:1 or better on every ground. */
  /* Header: the white logo (occ-logo-white.png) */
  --header-bg: #2C231E;       /* One step above the canvas. */
  --header-fg: #F6F1EC;       /* App name. */
  --header-muted: #B9A99D;    /* "OCC apps" and the other tabs. */
  --header-line: #42362F;     /* The 1px hairline under the bar. */
  /* The action: Stillwater at night */
  --primary: #97BED1;         /* Sea-mist fill with a Hearth label: calmer than a sky blue on warm dark. */
  --primary-fg: #231B17;      /* Its label, 8.55:1. */
  --primary-hover: #ADD1E2;   /* Hover and pressed, label 10.47:1. */
  --link: #97BED1;            /* Links, underlined, 7.76:1 on the surface. */
  --link-hover: #ADD1E2;      /* Link hover. */
  /* You are here */
  --select-bg: #1C343E;       /* Mist at night. */
  --select-line: #97BED1;     /* The 2px edge, the 3px tab bar, the sort arrow. */
  --select-fg: #97BED1;       /* Current tab and rail item, 6.58:1 on Mist at night. */
  /* Keyboard focus */
  --focus: #F6F1EC;           /* Limestone ring, 3px, 2px offset. */
  /* Needs you */
  --needs-bg: #40201F;        /* Blush at night. */
  --needs-line: #7A3434;      /* Its 2px border, decorative. */
  --needs-glow: 0 12px 40px rgba(234, 100, 112, 0.18);  /* The one soft glow. */
  --attn: #F0777A;            /* Attention words, 5.28:1 on Blush at night and 10+ from Stillwater in every vision type. */
  --attn-mark: #EA6470;       /* The dot, the ring, the count badge. */
  --attn-fg: #231B17;         /* The number on the badge, 5.28:1. */
  --error: #F0777A;           /* Error message text, 5.58:1 on the surface. */
  --error-line: #EA6470;      /* Error field border. */
  /* Disabled */
  --disabled-bg: #352C27;
  --disabled-fg: #84776E;     /* 3.14:1. */
  /* People at night */
  --person-0-tint: #5C430B; --person-0-ink: #DFCFB2;
  --person-1-tint: #494B1C; --person-1-ink: #D1D4B8;
  --person-2-tint: #344F39; --person-2-ink: #C5D6C8;
  --person-3-tint: #235050; --person-3-ink: #BDD7D6;
  --person-4-tint: #3E4663; --person-4-ink: #CAD0E5;  /* iris */
  --person-5-tint: #51405B; --person-5-ink: #D7CCDE;
  --person-6-tint: #4E4737; --person-6-ink: #D5D1C6;
  --person-7-tint: #5B4130; --person-7-ink: #DFCDC2;
  /* Elevation at night: deeper and darker, because the surfaces are already one step up. */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.30), 0 12px 28px rgba(0, 0, 0, 0.40);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.35), 0 28px 72px rgba(0, 0, 0, 0.55);
  --scrim: rgba(12, 9, 7, 0.62);
}

/* ---- 3. Scales: the same in both themes ---- */
:root {
  /* Type. Below headings, interfaces use only three sizes: body, small, micro. Buttons are Poppins 600 in uppercase
     from CSS, so write "Create account" in the source. Numbers that line up use tabular figures. */
  --font-heading: 'Urbanist', 'Montserrat', Helvetica, Arial, sans-serif;
  --font-body: 'Montserrat', Helvetica, Arial, sans-serif;
  --font-ui: 'Poppins', 'Montserrat', Helvetica, Arial, sans-serif;
  --fs-h1: clamp(2.2rem, 1.47vw + 1.61rem, 2.75rem);    /* 35.2 to 44px, Urbanist 800: the view's one headline. */
  --fs-h2: clamp(1.75rem, 0.93vw + 1.375rem, 2.1rem);   /* 28 to 33.6px, Urbanist 800. */
  --fs-h3: 1.375rem;                                    /* 22px, Urbanist 700: a detail's name, the question, dialog titles. */
  --fs-h4: 1.1rem;                                      /* 17.6px, Urbanist 700: group headings, card titles. */
  --fs-body: 1rem;                                      /* 16px, Montserrat 400. */
  --fs-small: 0.875rem;                                 /* 14px: labels, hints, notices, secondary lines, table cells. */
  --fs-micro: 0.8rem;                                   /* 12.8px: dates, captions, rail labels, badges, buttons. */
  --fs-button: 0.8rem;                                  /* Poppins 600, uppercase, 0.08em. */
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.5;
  --tracking-heading: -0.015em;
  --tracking-button: 0.08em;

  /* Spacing: 4px steps. Tight inside a group, generous between sections. */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  /* Radii by role: Ember's rounder corners for cards and panels, pills for buttons, a small radius for fields. */
  --radius-field: 4px;     /* Text fields, selects, the code input, kbd. */
  --radius-item: 10px;     /* A row inside a list, choice cards, notices, menu rows. */
  --radius-card: 14px;     /* Cards, lists, tables, the detail panel. */
  --radius-sheet: 20px;    /* Dialogs, bottom sheets, the Ctrl K palette, the phone's "now" card. */
  --radius-pill: 999px;    /* Buttons, chips, counts. */

  /* Motion: short and quiet. One deliberate moment per view at most; nothing moves under reduced motion. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 150ms;       /* Hovers, presses. */
  --dur-base: 250ms;       /* Panels, an item leaving the queue. */

  /* Layout */
  --tap: 44px;             /* Minimum touch target. */
  --header-h: 60px;        /* The Linen header; the logo is 40px tall inside it. */
  --rail-w: 84px;          /* The app rail on desktop. Phones use bottom tabs instead. */
  --detail-w: 480px;       /* The detail column beside a queue. */
  --gutter: 16px;          /* Side gutter on a phone. */
  --measure: 68ch;         /* Longest comfortable line. */
  --focus-width: 3px;
  --focus-offset: 2px;
  --z-sticky: 10;
  --z-overlay: 40;
  --z-toast: 50;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; }
}
