/* THE ACCENT: one source for the app and landing J (the app's input.css imports this file, landing.html links it).
   --tint-from / --tint-to  the gradient pair for accent fills and gradient text (a solid fill = two equal stops);
   --tint                   the SOLID: small text, thin borders, icons, rims.
   --tint-label             text and icons on an accent fill (defaults to white in input.css).
   Set here and nowhere else: one block per theme x arm. Arm = the visitor's landing arm (app: data-tint-arm on <html>, set by
   state/show-theme!; landing J: its data-accent) = KINOGO (every visitor but the two below), teal (landing J's teal arm, weight 0)
   or D (the landing D visitor, and landing D's own page: in the dark theme the yellow of landing D's buttons). Theme = data-theme (dark by
   default; the landing's day and sunset are the light values). A surface that stays dark inside a light page carries
   data-theme="dark" itself and reads the dark values. Everything that is accent-coloured reads these three variables. */

/* KINOGO x dark */
:root,
[data-theme="dark"] {
  --kinogo-dark-from: #60C1EC;
  --kinogo-dark-to: #76EF9F;
  --tint-from: var(--kinogo-dark-from);
  --tint-to: var(--kinogo-dark-to);
  --tint: color-mix(in srgb, var(--tint-from), var(--tint-to));
}

/* KINOGO x light */
:root[data-theme="light"],
:root[data-variant="j"]:is(:not([data-theme="dark"]), [data-sunset-paint]) {
  --tint-from: #1489C4;  /* the dark pair's sky, deepened to read on white (3.89:1) */
  --tint-to: #00958B;    /* two thirds of the way along the dark pair's hue from that sky toward its mint, as readable on white (3.70:1) */
  --tint: var(--tint-from);
}

/* THE TINT TEST (ab.cljc :tint-test, data-tint-test on <html>; KINOGO visitors only: the landing D visitor and the teal arm keep
   their own values). Arm «blue» = the two KINOGO blocks above. */

/* arm «telegram» x light and sunset (owner 05.12 19:16 «на белом этот лиловый стоит наоборот чуть затемнить»):
   the same purple hue as Telegram's #8774E1, darkened to read on white; fill labels stay white. */
:root[data-tint-test="telegram"]:not([data-tint-arm="d"]):not([data-tint-arm="teal"]),
:root[data-tint-test="telegram"]:not([data-tint-arm="d"]):not([data-tint-arm="teal"]) [data-theme="dark"],
:root[data-variant="j"][data-accent="kinogo"][data-tint-test="telegram"] {
  --tint-from: var(--tint);
  --tint-to: var(--tint);
  --tint: #7963DD;
  --tint-label: #FFFFFF;
}

/* arm «telegram» x dark (owner 05.12 19:06–19:08 «может все таки середину? а там потом поэкспермиентим с градиентом»):
   one flat purple halfway between the button's sheen #A497E3 and Telegram's #8774E1, so text and fills read as bright as the main button. */
:root[data-tint-test="telegram"]:not([data-theme="light"]):not([data-sunset-paint]):not([data-tint-arm="d"]):not([data-tint-arm="teal"]),
:root[data-tint-test="telegram"]:not([data-tint-arm="d"]):not([data-tint-arm="teal"]) [data-theme="dark"],
:root[data-variant="j"][data-accent="kinogo"][data-tint-test="telegram"][data-theme="dark"]:not([data-sunset-paint]) {
  --tint-from: #9686E2;
  --tint-to: #9686E2;
  --tint: #9686E2;
}

/* AUCTION FROZEN (project CLAUDE): a frozen surface keeps today's values under every arm (input.css resets its label) */
:root[data-tint-test]:not([data-tint-test="blue"]):not([data-tint-arm="d"]):not([data-tint-arm="teal"]) [data-frozen-auction] {
  --tint-from: #60C1EC;
  --tint-to: #76EF9F;
  --tint: color-mix(in srgb, #60C1EC, #76EF9F);
}
:root[data-theme="light"][data-tint-test]:not([data-tint-test="blue"]):not([data-tint-arm="d"]):not([data-tint-arm="teal"]) [data-frozen-auction] {
  --tint-from: #1489C4;
  --tint-to: #00958B;
  --tint: #1489C4;
  --tint-label: #FFFFFF;
}

/* teal x dark */
:root[data-tint-arm="teal"],
:root[data-tint-arm="teal"] [data-theme="dark"],
:root[data-variant="j"]:not([data-accent="kinogo"]) {
  --tint-from: #34C2BA;
  --tint-to: #178F8A;
  --tint: #2BB3AC;
}

/* teal x light */
:root[data-tint-arm="teal"][data-theme="light"],
:root[data-variant="j"]:is(:not([data-theme="dark"]), [data-sunset-paint]):not([data-accent="kinogo"]) {
  --tint-from: #1FA39D;
  --tint-to: #117A76;
  --tint: #178F8A;
}

/* D's landing controls: one gold palette regardless of theme; the dark app uses the same gold. */
:root[data-variant="d"],
:root[data-tint-arm="d"] {
  --d-landing-tint-from: #f6cd78;
  --d-landing-tint: #e6b455;
  --d-landing-tint-to: #cd982f;
}

/* D x dark */
:root[data-tint-arm="d"],
:root[data-tint-arm="d"] [data-theme="dark"],
:root[data-variant="d"]:not([data-theme="light"]) {
  --tint-from: var(--d-landing-tint-from);
  --tint-to: var(--d-landing-tint-to);
  --tint: var(--d-landing-tint);
  /* the story ring (`story-ring-fill`): D's flat yellow reads as no highlight on a ring, so here the ring runs a short warm arc of
     the hue circle from D's gold to red-orange (owner 04.12 15:28–15:32: variant 12 of the ring sheet, its end halfway in OKLab
     between 12's #FF8A1F and the redder #FF3D24) */
  --ring-from: #FFC94A;
  --ring-to: #FF6922;
}

/* D's light landing keeps gold; the app uses black tint with white ink on its fills. */
:root[data-variant="d"][data-theme="light"] {
  --tint-from: var(--d-landing-tint-from);
  --tint-to: var(--d-landing-tint-to);
  --tint: var(--d-landing-tint);
  --tint-label: #000000;
}
:root[data-tint-arm="d"][data-theme="light"] {
  --tint: #000000;
  --tint-from: var(--tint);
  --tint-to: var(--tint);
  --tint-label: #FFFFFF;
}
/* AUCTION FROZEN under D x light: keep the auction's local teal and its existing label tokens. */
:root:is([data-tint-arm="d"], [data-variant="d"])[data-theme="light"] [data-frozen-auction] {
  --tint-from: #1FA39D;
  --tint-to: #117A76;
  --tint: #178F8A;
  --tint-label: #000000;
  --ring-from: #1FA39D;
  --ring-to: #117A76;
}
