/* Lightkeeper brand tokens. Version 1.1, 24 November 2026.
   The single source for colour, type, space, shape, and motion.
   v1.0 names (--lk-bg, --lk-ink, --lk-ink-soft, --lk-accent, --lk-accent-text,
   --lk-radius, --lk-space) still work. */

:root {
  /* ---- Brand colour ---- */
  --lk-lens-white: #F4F1EA;   /* light ground */
  --lk-graphite: #22252A;     /* ink, and the Night Watch ground */
  --lk-signal-red: #DA1E32;   /* lamp, buttons, accents; works on both grounds */
  --lk-deep-red: #B3162A;     /* small red text on Lens White; button hover */
  --lk-stone: #6B655B;        /* secondary text on Lens White (5.1:1) */
  --lk-mist: #B9B3A8;         /* secondary text on Graphite (7.4:1) */

  /* ---- Interface neutrals (never in the logo) ---- */
  --lk-paper: #FBF9F5;        /* raised surface on Lens White */
  --lk-sand: #D8D2C6;         /* hairlines and dividers on Lens White */
  --lk-driftwood: #8C8579;    /* control borders on Lens White (3.2:1) */
  --lk-deck: #2B2F35;         /* raised surface on Graphite */
  --lk-rail: #3A3E45;         /* hairlines and dividers on Graphite */
  --lk-slate: #6E7179;        /* control borders on Graphite (3.2:1) */
  --lk-white: #FFFFFF;        /* text on Signal Red buttons (5.0:1) */

  /* ---- Theme: Lens White (default) ---- */
  --lk-bg: var(--lk-lens-white);
  --lk-surface: var(--lk-paper);
  --lk-ink: var(--lk-graphite);
  --lk-ink-soft: var(--lk-stone);
  --lk-line: var(--lk-sand);
  --lk-control: var(--lk-driftwood);
  --lk-accent: var(--lk-signal-red);
  --lk-accent-text: var(--lk-deep-red);
  --lk-on-accent: var(--lk-white);
  --lk-accent-hover: var(--lk-deep-red);
  --lk-lamp: var(--lk-signal-red);
  --lk-focus: var(--lk-signal-red);
  color-scheme: light;

  /* ---- Type ---- */
  --lk-font-display: "Acre", "Jost", "Futura", sans-serif;  /* Acre Medium, display only */
  --lk-font-text: "Jost", "Futura", "Avenir Next", sans-serif;
  --lk-weight-regular: 400;
  --lk-weight-medium: 500;
  --lk-weight-semibold: 600;
  --lk-tracking-label: 0.22em;     /* small capitals for labels */
  --lk-tracking-wordmark: 0.14em;
  --lk-tracking-title: 0.08em;     /* Acre capitals on a title card */
  --lk-measure: 34em;              /* about 66 characters of Jost */

  /* Scale: Bringhurst's classic steps, 13 15 18 21 24 36 60 88, fluid at the top */
  --lk-text-fine: 0.8125rem;                               /* 13 */
  --lk-text-small: 0.9375rem;                              /* 15 */
  --lk-text-body: 1.125rem;                                /* 18 */
  --lk-text-lead: 1.3125rem;                               /* 21 */
  --lk-text-h3: 1.5rem;                                    /* 24 */
  --lk-text-h2: clamp(1.75rem, 1.45rem + 1.1vw, 2.25rem);  /* 28 to 36 */
  --lk-text-h1: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);   /* 36 to 60 */
  --lk-text-display: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem); /* 44 to 88 */
  --lk-text-title: clamp(2rem, 1.25rem + 3vw, 4rem);       /* title card capitals, 32 to 64 */

  --lk-leading-tight: 1.04;
  --lk-leading-heading: 1.18;
  --lk-leading-body: 1.6;

  /* ---- Space: 4 px steps ---- */
  --lk-space: 8px;
  --lk-space-1: 4px;
  --lk-space-2: 8px;
  --lk-space-3: 12px;
  --lk-space-4: 16px;
  --lk-space-6: 24px;
  --lk-space-8: 32px;
  --lk-space-12: 48px;
  --lk-space-16: 64px;
  --lk-space-24: 96px;
  --lk-space-32: 128px;
  --lk-section: clamp(64px, 9vw, 128px);  /* block padding of a page section */
  --lk-gutter: clamp(20px, 4vw, 48px);    /* inline padding of the page */

  /* ---- Layout ---- */
  --lk-width-wide: 1200px;
  --lk-width-content: 760px;
  --lk-width-narrow: 560px;

  /* ---- Shape ---- */
  --lk-radius-sm: 6px;      /* tags, small chips */
  --lk-radius-md: 10px;     /* inputs */
  --lk-radius: 16px;        /* cards and panels */
  --lk-radius-lg: 24px;     /* title cards and large frames */
  --lk-radius-pill: 999px;  /* buttons */
  --lk-rule: 1px;           /* hairline */
  --lk-frame-gap: 6px;      /* space between the two rules of a frame */

  /* ---- Motion ---- */
  --lk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --lk-fast: 120ms;
  --lk-base: 200ms;
  --lk-slow: 320ms;
  --lk-characteristic: 6s;  /* Fl(2) 6s: two flashes every six seconds */
}

/* ---- Theme: Night Watch ----
   On a section, a page, or the whole site. .lk-day forces Lens White inside Night Watch. */
.lk-night,
[data-theme="night"] {
  --lk-bg: var(--lk-graphite);
  --lk-surface: var(--lk-deck);
  --lk-ink: var(--lk-lens-white);
  --lk-ink-soft: var(--lk-mist);
  --lk-line: var(--lk-rail);
  --lk-control: var(--lk-slate);
  --lk-accent-text: var(--lk-lens-white);  /* Signal Red text fails on Graphite */
  --lk-focus: var(--lk-lens-white);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lk-bg: var(--lk-graphite);
    --lk-surface: var(--lk-deck);
    --lk-ink: var(--lk-lens-white);
    --lk-ink-soft: var(--lk-mist);
    --lk-line: var(--lk-rail);
    --lk-control: var(--lk-slate);
    --lk-accent-text: var(--lk-lens-white);
    --lk-focus: var(--lk-lens-white);
    color-scheme: dark;
  }
}

.lk-day,
[data-theme="light"] {
  --lk-bg: var(--lk-lens-white);
  --lk-surface: var(--lk-paper);
  --lk-ink: var(--lk-graphite);
  --lk-ink-soft: var(--lk-stone);
  --lk-line: var(--lk-sand);
  --lk-control: var(--lk-driftwood);
  --lk-accent-text: var(--lk-deep-red);
  --lk-focus: var(--lk-signal-red);
  color-scheme: light;
}
