/* oxihome.org design tokens. DESIGN.md explains the choices.
   Colour, shape and motion are the product's own (crates/oxihome-ui/style/tokens.css
   and src/motion.rs in the OxiHome repository): one identity for the hub and its site.
   Dark is the first theme. */

:root {
  color-scheme: dark;

  /* Type. One family for prose, display and numbers; one mono for code. */
  --font: "Geologica", system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --w-text: 330;      /* running text */
  --w-strong: 560;    /* names, labels, buttons */
  --w-display: 680;   /* headings */

  --t-caption: 0.8125rem;                              /* 13 px */
  --t-small: 0.9375rem;                                /* 15 px */
  --t-body: 1.0625rem;                                 /* 17 px */
  --t-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem); /* 18 → 21 px */
  --t-h3: clamp(1.3125rem, 1.2rem + 0.5vw, 1.5rem);    /* 21 → 24 px */
  --t-h2: clamp(1.875rem, 1.3rem + 2.3vw, 3rem);       /* 30 → 48 px */
  --t-h1: clamp(2.5rem, 1.5rem + 3.4vw, 4rem);         /* 40 → 64 px */
  --t-figure: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);    /* a measured number */

  /* Space: a 4 px grid. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s24: 96px;
  --s32: 128px;

  --gutter: 20px;
  --header-h: 60px;
  --page: 1200px;
  --measure: 34rem;

  /* Shape. */
  --r-small: 8px;
  --r-control: 14px;
  --r-tile: 22px;
  --r-card: 24px;
  --r-sheet: 34px;
  --r-pill: 999px;

  /* Motion: the product's four springs, sampled once per 60 Hz frame
     (tools/springs.mjs), and plain fades. */
  --spring-quick: linear(0, 0.083, 0.2466, 0.4178, 0.5674, 0.6872, 0.7783, 0.8453, 0.8933, 0.9271, 0.9507, 0.9668, 0.9778, 0.9852, 0.9902, 0.9935, 0.9958, 0.9972, 0.9982, 0.9988, 1);
  --dur-quick: 333ms;
  --spring-smooth: linear(0, 0.0387, 0.1272, 0.2363, 0.3489, 0.4555, 0.5513, 0.6346, 0.7052, 0.7641, 0.8125, 0.8518, 0.8834, 0.9087, 0.9288, 0.9446, 0.9571, 0.9668, 0.9744, 0.9803, 0.9849, 0.9884, 0.9911, 0.9932, 0.9948, 0.9961, 0.997, 0.9977, 0.9983, 0.9987, 1);
  --dur-smooth: 500ms;
  --spring-bouncy: linear(0, 0.0298, 0.1034, 0.2017, 0.3109, 0.421, 0.5257, 0.621, 0.7048, 0.7763, 0.8358, 0.8841, 0.9223, 0.9518, 0.9738, 0.9898, 1.0009, 1.0081, 1.0124, 1.0146, 1.0152, 1.0147, 1.0136, 1.0121, 1.0105, 1.0088, 1.0072, 1.0057, 1.0045, 1.0034, 1.0025, 1.0018, 1.0012, 1);
  --dur-bouncy: 550ms;
  --spring-gentle: linear(0, 0.0223, 0.077, 0.1499, 0.2314, 0.315, 0.3963, 0.473, 0.5434, 0.6071, 0.6637, 0.7136, 0.7571, 0.7947, 0.8271, 0.8548, 0.8784, 0.8984, 0.9153, 0.9296, 0.9415, 0.9515, 0.9599, 0.9668, 0.9726, 0.9774, 0.9814, 0.9847, 0.9874, 0.9897, 0.9915, 0.9931, 0.9943, 0.9954, 0.9962, 0.9969, 0.9975, 0.9979, 0.9983, 0.9986, 0.9989, 1);
  --dur-gentle: 683ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fade: 200ms;
  --dur-fade-fast: 120ms;

  /* Colour, dark: a graphite with a breath of green, so the verdigris sits in it. */
  --canvas: #0c0e0f;
  --surface: #15181a;
  --surface-raised: #1c2022;
  --control: #272c2f;
  --control-strong: #3a4145;
  --line: rgb(255 255 255 / 0.06);
  --line-strong: rgb(255 255 255 / 0.12);
  --text: #eef1ef;
  --text-2: #a2aaa7;
  --text-3: #6d7572;
  --inverse: #eef1ef;
  --inverse-ink: #0c0e0f;
  --accent: #5fd4bb;
  --accent-ink: #052a22;
  --danger: #ff7a70;
  --glass: rgb(12 14 15 / 0.72);
  --shadow-tile: 0 0 0 0 transparent;
  --shadow-pop: 0 20px 64px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.3);

  /* The sides of a drawn plate: one step darker than its face. */
  --edge: #07090a;
  --edge-line: rgb(255 255 255 / 0.1);
  --side-a: #0d0f10;             /* the two visible sides of a drawn part */
  --side-b: #111415;

  /* Tints: what the house is doing. "r g b", mixed into surfaces. */
  --tint-accent: 95 212 187;
  --tint-warm: 255 190 110;      /* warm white light, about 2700 K */
  --tint-violet: 168 124 255;    /* a coloured light */
  --tint-attention: 255 142 108;
  --tint-heat: 255 128 66;
  --tint-cool: 102 176 255;
  --tint-ink: #14110a;
  --mix-rest: 14%;
  --mix-fill-a: 28%;
  --mix-fill-b: 40%;
  --glow: 0.2;                   /* how much a lit tile lights the page around it */
}

/* Light: a paper with the same breath of green. */
:root[data-theme="light"] {
  color-scheme: light;

  --w-text: 360;

  --canvas: #f3f4f1;
  --surface: #ffffff;
  --surface-raised: #f6f7f5;
  --control: #e9ebe8;
  --control-strong: #ffffff;
  --line: rgb(18 26 22 / 0.07);
  --line-strong: rgb(18 26 22 / 0.14);
  --text: #141917;
  --text-2: #5b6461;
  --text-3: #8a928f;
  --inverse: #141917;
  --inverse-ink: #ffffff;
  --accent: #0f7f6a;
  --accent-ink: #ffffff;
  --danger: #c5362c;
  --glass: rgb(243 244 241 / 0.76);
  --shadow-tile: 0 1px 2px rgb(22 30 26 / 0.04), 0 6px 18px rgb(22 30 26 / 0.045);
  --shadow-pop: 0 24px 70px rgb(22 30 26 / 0.2), 0 2px 10px rgb(22 30 26 / 0.08);

  --edge: #d9dcd7;
  --edge-line: rgb(18 26 22 / 0.12);
  --side-a: #dde0db;
  --side-b: #e8eae6;

  --tint-accent: 52 190 163;
  --tint-warm: 247 170 72;
  --tint-violet: 140 96 240;
  --tint-attention: 250 124 86;
  --tint-heat: 247 112 48;
  --tint-cool: 64 150 246;
  --mix-rest: 22%;
  --mix-fill-a: 42%;
  --mix-fill-b: 58%;
  --glow: 0.1;
}

@media (min-width: 760px) {
  :root { --gutter: 32px; --header-h: 68px; }
}

@media (min-width: 1100px) {
  :root { --gutter: 48px; }
}
