/* Halo design system: tokens. Decided 2026-10-30.
   Base: the cool night palette from Halo BEM. Identity: Halo orange.
   Orange is the accent detail (decided 2026-10-30): thin lines and small type only, never a fill.
   Warnings are red. Actions (buttons, links) are neutral. */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100,400;100,500;100,600;100,700;125,300;125,400&family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,200..800&display=swap");

:root {
  /* Night (tools, dashboards, dark slides) */
  --night-ground: #12161c;
  --night-deep: #0c0f14;
  --night-panel: #1b212a;
  --night-line: #2c3541;
  --night-line-soft: #222a34;
  --night-ink: #dce3ea;
  --night-ink-2: #8a97a5;   /* aluminium */
  --night-ink-3: #5d6976;   /* faint: labels only, never body text */
  --focus: #e08a3c;   /* a thin orange ring: an accent detail */

  /* Paper (documents, print) */
  --paper-ground: #ffffff;
  --paper-ink: #161616;
  --paper-ink-2: #4a4a4a;
  --paper-line: #d9dde2;

  /* Brand: identity surfaces only (logo, covers, title slides) */
  --halo-orange: #cc5500;
  --halo-black: #161616;
  --halo-graphite: #3f3f3f;
  --halo-white: #ffffff;
  --on-orange: #ffffff;

  /* Accent: orange as thin lines and small type. Active tab underline, selection edge, focus ring,
     section labels, a rule under a heading. Never a fill, a button or a chart series. */
  --accent-on-night: #e08a3c;  /* 6.8:1 on night ground */
  --accent-on-paper: #b34a00;  /* 5.4:1 on white */
  /* Warnings and over-limit: red */
  --warn-on-night: #e06c6c;    /* 5.6:1 on night ground */
  --warn-on-paper: #b23434;    /* 6.1:1 on white */
  --over: #e06c6c;
  /* Status, from Halo BEM (decided 2026-10-31): the licence is a red dashed line, as on Halo BEM's Data tab;
     the part of a reading over it is a red patch. OK is Halo BEM's green. */
  --ok-on-night: #8fd46a;      /* 10.2:1 */
  --ok-on-paper: #357a23;      /* 5.3:1 */
  --limit-on-night: #e06c6c;   /* dashed */
  --limit-on-paper: #b23434;   /* dashed */
  --ok: var(--ok-on-night);
  --limit: var(--limit-on-night);

  /* Series: categorical, in order. No orange: orange is the accent, not a data colour. */
  --series-1: #2f8adc;
  --series-2: #af8f15;
  --series-3: #9565c7;
  --series-4: #499537;
  --series-5: #c0558d;
  --series-6: #32a0c5;
  /* Same series on white */
  --series-1-paper: #0065b0;
  --series-2-paper: #a1830e;
  --series-3-paper: #7749a3;
  --series-4-paper: #347c22;
  --series-5-paper: #a24074;
  --series-6-paper: #1787a9;
  /* Halo BEM's four ways, an established exception (bass is amber there) */
  --way-sub: #6fa8dc; --way-bass: #e08a3c; --way-mid: #8fd46a; --way-top: #f2d06b;

  /* Type */
  /* The hybrid type (decided 2026-11-13, sketches/type-compare.html; the system before it is in archive/2026-11-13-archivo-type/; compare in sketches/type-compare.html):
     Bricolage Grotesque is the voice (headlines, headings, eyebrows, labels, leads, quotes); Archivo is for reading and
     controls; figures stay Archivo Expanded Light. Bricolage's optical size axis ("opsz") does the work of separate cuts. */
  --font-display: "Bricolage Grotesque", "Archivo", sans-serif;   /* headlines and headings; a capital per word, never all capitals */
  --font-display-stretch: 100%;              /* Bricolage stops at 100 %: room comes from the optical size */
  --font-display-weight: 400;                /* headlines; headings 450 */
  --opsz-display: "opsz" 48;                 /* headlines (option 6, sketches/heading-spacing.html) */
  --opsz-head: "opsz" 28;                    /* section and card headings */
  --font-label: "Bricolage Grotesque", "Archivo", sans-serif;     /* eyebrows (400) and small capital labels (600), opsz 12 */
  --opsz-label: "opsz" 12;
  --track-label: .07em;                      /* labels; eyebrows .09em */
  --font-lead: "Bricolage Grotesque", "Archivo", sans-serif;      /* the lead paragraph: Light, opsz 24 */
  --opsz-lead: "opsz" 24;
  --font-body: "Archivo", system-ui, sans-serif;            /* normal width: text, buttons, controls */
  /* Numbers (decided 2026-10-31): IBM Plex Mono is retired. Small numbers and labels are Archivo with tabular figures;
     big figures (tiles, slides) are Archivo Expanded Light (.halo-figure). --font-mono keeps its name so old rules still work. */
  --font-mono: "Archivo", system-ui, sans-serif;
  --font-figure: "Archivo", sans-serif;      /* with font-stretch 125% and weight 300 */

  /* Type scale (decided 2026-10-31, option 4 in sketches/type-scale.html): fluid. Every step is a range that runs in a
     straight line from a 375 px screen to a 1440 px screen: about 1.2 between steps on a phone, 1.333 on a desktop.
     Text barely moves, headlines move a lot. Use the names, never a pixel size. Print (pt) and slides (cqi) keep their own units. */
  --t-label: 11px;                                              /* capitals: tabs, nav, tags, stamps, table heads, ticks */
  --t-eyebrow: 14px;                                            /* the section eyebrow, kept at its decided size */
  --t-small: clamp(12.5px, 12.32px + .047vw, 13px);            /* controls, readouts, tables, captions, notes, help */
  --t-body: clamp(15px, 14.65px + .094vw, 16px);               /* running text, inputs, dialog and empty-state titles */
  --t-lead: clamp(17px, 15.59px + .376vw, 21px);               /* the paragraph under a head; a hero's lede */
  --t-subhead: clamp(17px, 15.59px + .376vw, 21px);            /* bold, Archivo 600 */
  --t-head: clamp(25px, 18.66px + 1.69vw, 43px);               /* section heads (.halo-head), card heads */
  --t-title: clamp(30px, 20.49px + 2.535vw, 57px);             /* page heads and website heroes */
  --t-display: clamp(36px, 13.11px + 6.103vw, 101px);          /* covers, title slides, the 404 */
  --t-figure: clamp(28px, 24.48px + .939vw, 38px);             /* big figures: stat tiles */
  --t-figure-s: clamp(22px, 19.89px + .563vw, 28px);           /* smaller figures: readouts in a tool */

  /* Motion (decided 2026-10-31: none). Nothing travels, grows, turns, spins or drifts. A part that appears or
     disappears fades over --fade; hover and state changes may fade colour over the same time. Data never animates. */
  --fade: 120ms linear;
  /* Bloom (decided 2026-11-03, option 8 in sketches/enquire-hover-2.html): the hover of the solid white button (Enquire,
     buttons on the glow). Amber and cream bloom out round the pill and it rises 2 px. The one hover that moves. */
  --bloom-night: 0 0 0 1px #f2ddb0, 0 0 18px 2px rgba(242,180,90,.55), 0 0 44px 10px rgba(224,138,60,.28), 0 12px 20px -10px rgba(0,0,0,.6);
  --bloom-paper: 0 0 0 1px #e08a3c, 0 0 18px 2px rgba(224,138,60,.45), 0 0 44px 10px rgba(204,85,0,.2);
  --bloom-rise: translateY(-2px);
  --bloom-time: box-shadow .35s ease, transform .25s ease, background-color var(--fade);

  /* Spacing (decided 2026-10-31): one 4-point scale underneath, four settings by medium on top.
     Use the role variables (--gap-xs, --gap-s, --gap-m, --gap-l, --pad, --margin), not the raw steps. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-7: 32px; --sp-8: 40px; --sp-9: 48px; --sp-10: 64px; --sp-11: 96px;
  /* Default: page (comfortable) */
  --gap-xs: var(--sp-2); --gap-s: var(--sp-4); --gap-m: var(--sp-7); --gap-l: var(--sp-10);
  --pad: var(--sp-6); --margin: clamp(16px, 6.7vw, 96px);

  /* Shape */
  /* Label spacing (decided 2026-11-03, from the accordion): a small label or eyebrow never touches the line it labels.
     --gap-label between a small label and its text, value or field, and between a small title and the text under it;
     --gap-eyebrow between an eyebrow and a display headline. Titles at 1.35 line height, small text under them at 1.5–1.6. */
  --gap-label: 6px;
  --gap-eyebrow: 10px;

  --radius: 0px;    /* square frames (2026-11-03, sketches/square-and-pill.html option A): every frame is square; controls are pills */
  --radius-sm: 0px;
  --gap: 16px;
}

/* Spacing by medium. Put one of these on the page or the region. */
.halo-tool {   /* tools and dashboards: fixed, compact */
  --gap-xs: var(--sp-1); --gap-s: var(--sp-2); --gap-m: var(--sp-4); --gap-l: var(--sp-6); --pad: var(--sp-4); --margin: var(--sp-4);
}
.halo-page {   /* web pages and page heads: comfortable, margin grows from a phone to a wide screen */
  --gap-xs: var(--sp-2); --gap-s: var(--sp-4); --gap-m: var(--sp-7); --gap-l: var(--sp-10); --pad: var(--sp-6); --margin: clamp(16px, 6.7vw, 96px);
}
.halo-doc {    /* documents: comfortable steps, print margins */
  --gap-xs: var(--sp-2); --gap-s: var(--sp-4); --gap-m: var(--sp-7); --gap-l: var(--sp-9); --pad: var(--sp-6); --margin: 20mm;
}
.halo-slide {  /* slides and covers: shares of the frame, so they hold at any size */
  container-type: inline-size;
  --gap-xs: 1cqi; --gap-s: 2cqi; --gap-m: 3.5cqi; --gap-l: 6cqi; --pad: 6cqi; --margin: 7cqi;
}

/* Contextual roles: write components against these, not the raw tokens. */
.halo-night, :root[data-halo="night"] {
  --bg: var(--night-ground); --bg-sunk: var(--night-deep); --panel: var(--night-panel);
  --line: var(--night-line); --line-soft: var(--night-line-soft); --ink: var(--night-ink); --ink-2: var(--night-ink-2); --ink-3: var(--night-ink-3);
  --warn: var(--warn-on-night); --accent: var(--accent-on-night);
  /* Main button (decided 2026-10-31): top-lit glow, light falling top to bottom, no edge lines */
  /* The action (decided 2026-10-31, glass family with group colour): the group's series colour as a tint and a ring */
  --action-bg: color-mix(in srgb, var(--g, var(--s1)) 22%, transparent);
  --action-ink: var(--ink); --action-shadow: none;
  --action-ring: inset 0 0 0 1px color-mix(in srgb, var(--g, var(--s1)) 80%, transparent);
  /* Depth (decided 2026-10-31): lit from above. A fine highlight on the top edge, a crisp dark line beneath.
     1 resting (tiles, cards, chips), 2 floating (panels over a view), 3 on top (menus, popovers). */
  --elev-1: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 0 rgba(0, 0, 0, .4);
  --lift: 0%;    /* night lift (2026-10-31) withdrawn 2026-11-03 with square frames: frames sit flat. Was 55 %. */
  --elev-2: inset 0 1px 0 rgba(255, 255, 255, .10), 0 1px 0 rgba(0, 0, 0, .5), 0 8px 18px -6px rgba(0, 0, 0, .55);
  --elev-3: inset 0 1px 0 rgba(255, 255, 255, .10), 0 10px 24px -8px rgba(0, 0, 0, .6);
  --select-ink: var(--night-ink); --select-line: var(--accent-on-night);  /* selected: ink text, orange underline or edge */
  --s1: var(--series-1); --s2: var(--series-2); --s3: var(--series-3); --s4: var(--series-4); --s5: var(--series-5); --s6: #f2ddb0;
  color-scheme: dark; color: var(--ink); font-variant-numeric: tabular-nums;
}
.halo-paper, :root[data-halo="paper"] {
  --bg: var(--paper-ground); --bg-sunk: #f4f5f7; --panel: #ffffff;
  --line: var(--paper-line); --line-soft: #eceef1; --ink: var(--paper-ink); --ink-2: var(--paper-ink-2); --ink-3: #6b6b6b;
  --warn: var(--warn-on-paper); --accent: var(--accent-on-paper);
  --ok: var(--ok-on-paper); --limit: var(--limit-on-paper);
  --action-bg: color-mix(in srgb, var(--g, var(--s1)) 14%, transparent);
  --action-ink: var(--ink); --action-shadow: none;
  --action-ring: inset 0 0 0 1px color-mix(in srgb, var(--g, var(--s1)) 85%, transparent);
  --elev-1: inset 0 1px 0 #ffffff, 0 1px 0 rgba(22, 22, 22, .10), 0 3px 6px -3px rgba(22, 22, 22, .12);
  --lift: 0%;    /* paper keeps its shadow; no glow */
  --elev-2: inset 0 1px 0 #ffffff, 0 1px 0 rgba(22, 22, 22, .12), 0 10px 22px -8px rgba(22, 22, 22, .18);
  --elev-3: 0 1px 0 rgba(22, 22, 22, .12), 0 14px 30px -10px rgba(22, 22, 22, .25);
  --select-ink: var(--paper-ink); --select-line: var(--accent-on-paper);
  --s1: var(--series-1-paper); --s2: var(--series-2-paper); --s3: var(--series-3-paper); --s4: var(--series-4-paper); --s5: var(--series-5-paper); --s6: #8a6d3b;
  color-scheme: light; color: var(--ink); font-variant-numeric: tabular-nums;
}

.halo-display {   /* headlines: Bricolage at optical size 48, a capital per word, wrapping to the column (no <br>) */
  font-family: var(--font-display); font-weight: var(--font-display-weight); font-stretch: var(--font-display-stretch);
  font-variation-settings: var(--opsz-display); text-transform: capitalize; letter-spacing: 0; line-height: 1.1; text-wrap: balance; font-synthesis: none;
}
/* Section head (decided 2026-10-31, after Apple's pattern): an orange eyebrow in the text font,
   then the headline in the display face. Optional bold subhead, then body. */
.halo-eyebrow { display: block; font: 400 var(--t-eyebrow)/1.2 var(--font-label); font-variation-settings: var(--opsz-label); letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 var(--gap-eyebrow); }
.halo-eyebrow::before { content: "//// "; letter-spacing: .02em; }   /* four slashes open every eyebrow (2026-11-13, after folk.app's brackets) */
.halo-head { font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: 450; font-variation-settings: var(--opsz-head);
  text-transform: capitalize; letter-spacing: 0; font-size: var(--t-head); line-height: 1.14; margin: 0 0 28px; text-wrap: balance; font-synthesis: none; }
.halo-subhead { font: 600 var(--t-subhead)/1.35 var(--font-body); margin: 12px 0 0; }
.halo-lead { font: 300 var(--t-lead)/1.6 var(--font-lead); font-variation-settings: var(--opsz-lead); color: var(--ink-2); }   /* the paragraph under a head (2026-11-13) */
.halo-quoted {   /* a quotation as a headline (2026-11-13): SemiBold upright, sentence case, the opening mark hung in the margin */
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "opsz" 72; font-style: normal; font-synthesis: none;
  text-transform: none; letter-spacing: -.03em; line-height: 1.06; text-wrap: balance; text-indent: -.42em; padding-left: .42em; }
.halo-label {   /* section label: small Bricolage SemiBold capitals in the accent */
  font: 600 var(--t-label) var(--font-label); font-variation-settings: var(--opsz-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--g, var(--accent));  /* a control group's colour, else the accent */
}
.halo-rule { height: 2px; width: 40px; background: var(--accent); border: 0; margin: 10px 0 0; }  /* rule under a heading */
.halo-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.halo-figure {   /* a big figure: the title face, light and wide, digits aligned */
  font-family: var(--font-figure); font-stretch: 125%; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.01em; font-synthesis: none;
}
.halo-logo {   /* recolourable mark: set color to change it */
  display: inline-block; aspect-ratio: 1; background: currentColor;
  -webkit-mask: url(logos/logo-mark-alpha.png) center / cover; mask: url(logos/logo-mark-alpha.png) center / cover;
}

/* The overhead glow (decided 2026-10-30, option B): the level scale as light from above,
   bright under the array, falling to night. It is what Halo does: loud under it, quiet elsewhere.
   Identity surfaces and page heads only: covers, title slides, a tool's top bar, a document's head.
   Never inside a chart area or beside a legend, where it would read as data. */
:root {
  --glow-stops: #faefd0 0%, #f2ddb0 10%, #c49158 24%, #6a828d 42%, #354f71 58%, #243a57 72%, #151c25 88%, #0c0f14 100%;
}
.halo-glow {        /* covers, title slides, hero blocks */
  background: radial-gradient(120% 95% at 50% -18%, var(--glow-stops)); color: var(--halo-white);
}
.halo-glow-bar {    /* a tool's top bar: a thin slice of the same light */
  background: radial-gradient(60% 300% at 50% -150%, #f2ddb0 0%, #c49158 25%, #6a828d 50%, #354f71 70%, var(--night-deep) 100%);
}
.halo-glow-paper {  /* a document's head on white, "sunlit" (7c): the dark glow's exact shape, yellow and orange into white.
                      Give it a 16:9 head, as the covers have, so the shape matches. */
  background: radial-gradient(120% 95% at 50% -18%, #fffbe8 0%, #faefd0 10%, #f2d06b 24%, #f2b45a 42%, #f6cf8f 58%, #fae6c4 72%, #fdf5e8 88%, #ffffff 100%);
}
