/* owlgit design tokens: the faces, the type scale, colour for the light and the dark theme, spacing, shape,
   shadow and motion. Every other stylesheet reads these names and never a raw value, so a theme is only this file.
   The theme is set on <html> by js/theme.js (data-theme="light" or "dark"); light is the default.
   Breakpoints (media queries cannot read custom properties): phone below 48rem, tablet 48rem to 79.9375rem,
   desktop 80rem and up. */

/* ---------- Faces: self-hosted, no outside request (public/fonts/LICENSES.md) ---------- */
/* Bricolage Grotesque: the display face, for the headings, the titles and the figures (Bakr's pick, 2026-10-30) */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* IBM Plex Sans Arabic: one family from two files per weight, the Arabic letters from one, the Latin from the other */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+2010;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+0300-0308, U+2013-2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-arabic-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+2010;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/fonts/plex-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02DC, U+0300-0308, U+2013-2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Monaspace Krypton";
  src: url("/fonts/krypton-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monaspace Krypton";
  src: url("/fonts/krypton-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monaspace Krypton";
  src: url("/fonts/krypton-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- The dark set: named once, so the dark theme and the hero in the light theme share it. To recolour the
   site, change the light values below and these; nothing else reads a colour by its value. ---------- */
:root {
  --d-page: #101316;
  --d-surface: #1A2027;
  --d-surface-raised: #2A323B;
  --d-current-bg: #36404A;
  --d-dialog: #171B20;
  --d-hairline: #46525E;
  --d-backdrop: rgb(0 0 0 / 0.48);
  --d-text: #EEF2F5;
  --d-text-muted: #B7C2CC;
  --d-link: #E9A27A;
  --d-current-fg: #F0B592;
  --d-focus-ring: #F0B592;
  --d-accent-navy: #F8DECB;
  --d-accent-bright: #E39468;
  --d-primary: #E39468;
  --d-primary-hover: #F0B592;
  --d-primary-active: #F8DECB;
  --d-on-primary: #101316;
  --d-logo-1: #F8DECB;
  --d-logo-2: #E39468;
  --d-node-bg: #E39468;
  --d-node-fg: #101316;
  --d-rail: #E39468;
  --d-figure: #E9A27A;
  --d-status-live: #77D39A;
  --d-status-beta: #F0C36A;
  --d-status-progress: #E9A27A;
  --d-status-archived: #B7C2CC;
  --d-c-off-topics: #D2B8F7;
  --d-shadow-1: 0 0.125rem 0.5rem 0 #00000038;
  --d-shadow-2: 0 0.375rem 1.5rem 0 #00000052;
}

/* ---------- Light (the default) ---------- */
:root {
  color-scheme: light;
  --canvas: var(--page);   /* the page's own colour, readable inside a band that wears the dark set */

  /* faces */
  --font-display: "Bricolage Grotesque", "Geist", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-ui: "Geist", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Geist", system-ui, sans-serif;
  --font-code: "Monaspace Krypton", ui-monospace, monospace;

  /* type scale: size, line height, weight (Latin and Arabic), letter spacing */
  --fs-display: 3rem;       --lh-display: 3.5rem;    --fw-display: 700;  --fw-display-ar: 600;  --ls-display: -0.025em;
  --fs-h1: 2.25rem;         --lh-h1: 2.75rem;        --fw-h1: 700;       --fw-h1-ar: 600;       --ls-h1: -0.02em;
  --fs-h2: 1.75rem;         --lh-h2: 2.25rem;        --fw-h2: 650;       --fw-h2-ar: 600;       --ls-h2: -0.015em;
  --fs-h3: 1.25rem;         --lh-h3: 1.75rem;        --fw-h3: 650;       --fw-h3-ar: 600;       --ls-h3: -0.01em;
  --fs-body: 1rem;          --lh-body: 1.625rem;     --fw-body: 400;     --fw-body-ar: 400;     --ls-body: 0;
  --fs-small: 0.875rem;     --lh-small: 1.25rem;     --fw-small: 450;    --fw-small-ar: 400;    --ls-small: 0;
  --fs-caption: 0.75rem;    --lh-caption: 1rem;      --fw-caption: 550;  --fw-caption-ar: 600;  --ls-caption: 0.01em;
  --fs-code: 0.875rem;      --lh-code: 1.375rem;     --fw-code: 400;

  /* measures */
  --measure-long: min(44rem, 68ch);
  --measure-lead: min(38rem, 60ch);
  --measure-head: 52.5rem;   /* the line under a page's title: two short sentences on one row on a desktop */
  --measure-title: min(28rem, 24ch);
  --measure-line: 32rem;

  /* colour: surfaces */
  --page: #FDFDFC;
  --surface: #EEF1F3;
  --surface-raised: #FFFFFF;
  --current-bg: #E1E6EA;
  --dialog: #FFFFFF;
  --hairline: #CBD3DA;
  --backdrop: rgb(27 33 39 / 0.24);

  /* colour: ink (the slate palette, Bakr 2026-10-30; every pair measured 4.5:1 or better by the build's shooter) */
  --text: #1B2127;
  --text-muted: #55616C;
  --link: #99491C;
  --current-fg: #8D4318;
  --focus-ring: #8D4318;

  /* colour: brand and controls */
  --accent-navy: #27313A;
  --accent-bright: #B8562A;
  --primary: #27313A;
  --primary-hover: #3A4652;
  --primary-active: #1B2127;
  --on-primary: #FFFFFF;
  --logo-1: #27313A;
  --logo-2: #B8562A;
  /* the commit motif: a filled node and the rail between nodes, in the palette's copper */
  --node-bg: #B8562A;
  --node-fg: #FFFFFF;
  --rail: #99491C;
  --figure: #99491C;

  /* colour: status (text plus a 6px dot, never a coloured background) */
  --status-live: #1F6B3A;
  --status-beta: #7A4A00;
  --status-progress: #99491C;
  --status-archived: #55616C;

  /* colour: a collection's own (src/site.json collections.<id>.colour; Off-topics', Bakr, 2026-11-07, the fuller plan 2.1): a
     violet none of the palette's accents use, 4.5:1 or better as text on the page, the surfaces and the current colour in
     both themes; the build writes it as --tint on what wears it */
  --c-off-topics: #663399;

  /* spacing: a 4px scale */
  --space-0: 0rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --section-gap: var(--space-16);

  /* shape */
  --r-bar: 1rem;
  --r-card: 0.875rem;
  --r-current: 0.75rem;
  --r-button: 0.625rem;
  --r-field: 0.625rem;
  --r-image: 0.625rem;
  --r-row: 0.5rem;
  --r-chip: 0.875rem;
  --r-key: 0.25rem;
  --hairline-w: 0.0625rem;
  --line: var(--hairline-w) solid var(--hairline);

  /* shadow */
  --shadow-1: 0 0.125rem 0.5rem 0 #27313A14;
  --shadow-2: 0 0.375rem 1.5rem 0 #27313A1F;

  /* icons: Lucide at a 1.75px stroke whatever the size (stroke-width is in the 24-unit viewBox) */
  --icon-24: 1.5rem;     --stroke-24: 1.75;
  --icon-20: 1.25rem;    --stroke-20: 2.1;
  --icon-18: 1.125rem;   --stroke-18: 2.3333;
  --icon-16: 1rem;       --stroke-16: 2.625;

  /* the page grid */
  --page-max: 90rem;
  --page-pad: var(--space-8);
  --gutter: var(--space-6);
  --columns: 12;

  /* the phone's dock (the destinations fixed at the foot): the theme's own colours, fixed here so the bar's dress over
     a hero never reaches it */
  --dock-bg: var(--surface);
  --dock-text: var(--text);
  --dock-raised: var(--surface-raised);
  --dock-current-bg: var(--current-bg);
  --dock-current-fg: var(--current-fg);
  --dock-hairline: var(--hairline);

  /* the bar and the footer: bands across the whole page, their content on the page grid; the bar's height holds its
     2rem border below 80rem and up */
  --bar-h: 7rem;
  --band-pad: max(var(--page-pad), calc(50% - var(--page-max) / 2 + var(--page-pad)));
  --dock-h: 4rem;

  /* the mark in the bar: its height, and its shift from where the grid puts it (adjustable on the design picker) */
  --mark-h: 2rem; --mark-x: 0rem; --mark-y: 0rem;

  /* the watermarks: the owl mark, faint, in a band and in the footer (Bakr's choice on the design picker, 2026-10-30) */
  --wm-size: 27rem; --wm-x: 37%; --wm-y: 87%; --wm-opacity: 0.07; --wm-flip: -1;
  --fwm-size: 22rem; --fwm-x: 50%; --fwm-y: 61%; --fwm-opacity: 0.04; --fwm-flip: 1;

  /* motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-theme: 180ms;
  --dur-hover: 120ms;
  --dur-focus: 80ms;
  --dur-active: 80ms;
  --dur-bar: 160ms;
}

/* ---------- Dark: the same names, the dark set ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: var(--d-page);
  --surface: var(--d-surface);
  --surface-raised: var(--d-surface-raised);
  --current-bg: var(--d-current-bg);
  --dialog: var(--d-dialog);
  --hairline: var(--d-hairline);
  --backdrop: var(--d-backdrop);
  --text: var(--d-text);
  --text-muted: var(--d-text-muted);
  --link: var(--d-link);
  --current-fg: var(--d-current-fg);
  --focus-ring: var(--d-focus-ring);
  --accent-navy: var(--d-accent-navy);
  --accent-bright: var(--d-accent-bright);
  --primary: var(--d-primary);
  --primary-hover: var(--d-primary-hover);
  --primary-active: var(--d-primary-active);
  --on-primary: var(--d-on-primary);
  --logo-1: var(--d-logo-1);
  --logo-2: var(--d-logo-2);
  --node-bg: var(--d-node-bg);
  --node-fg: var(--d-node-fg);
  --rail: var(--d-rail);
  --figure: var(--d-figure);
  --status-live: var(--d-status-live);
  --status-beta: var(--d-status-beta);
  --status-progress: var(--d-status-progress);
  --status-archived: var(--d-status-archived);
  --c-off-topics: var(--d-c-off-topics);
  --shadow-1: var(--d-shadow-1);
  --shadow-2: var(--d-shadow-2);
}

/* ---------- The grid and the bar by size ---------- */
@media (max-width: 79.9375rem) {
  :root {
    --page-pad: var(--space-6);
    --gutter: var(--space-5);
    --columns: 8;
    --section-gap: var(--space-12);
    --bar-h: 9.5rem;
    --mark-h: 1.875rem;
  }
}
@media (max-width: 47.9375rem) {
  :root {
    --page-pad: var(--space-4);
    --gutter: var(--space-4);
    --columns: 4;
    --section-gap: var(--space-10);
    --bar-h: 3.5rem;
    --mark-h: 1.625rem;
    --wm-size: 12rem; --fwm-size: 12rem;
  }
}

/* ---------- Less motion: every state changes at once ---------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-theme: 0ms;
    --dur-hover: 0ms;
    --dur-focus: 0ms;
    --dur-active: 0ms;
    --dur-bar: 0ms;
  }
}
