/* Snuug's themed gradient: a soft colour field with fine grain, after Qoves's pages (the founder, 19 Nov 2026: "a
   themed gradient we can use throughout the website"). Every web app screen sits on it.
   One field since 19 Nov 2026, 16:48: Mist, the front page's deep Qoves blue-grey (the founder: "just lock this in for
   all surfaces and just use this"). It is applied as Qoves applies its own:
     light Mist  :root: the dashboard and the flows. The same blue-grey made light enough for ink words, so the glass
                 cards float on it and the whole app reads as one family with the front page
     deep Mist   --g-hero, and the Night values (data-theme="night"): the entry and full-bleed screens (sign-in, the
                 upgrade page's picture side, "Signing you in", welcome, You're in, the taste test, style), with white words
     G4          .g4: the front page's own field (slate; apps/web/assets/css/front.css paints Mist on it). The
                 front page is snuug.app's home since 20 Nov 2026: the site's build copies this file as its
                 assets/css/field.css (apps/web/tools/routes.mjs FROM_REPO), so the field has one source
   The other fields (G1 cool grey, G2 warm grey, G3 sun, G3 walnut, Blobs) and their switch went the same day.
   .g-drift (opt-in, on a .g-surface): the field's light eases into place as it appears, then ebbs very slowly in whole
   steps, one a second (BUG-1190). Pause it
   with .g-paused on the element or an ancestor (a page adds that when the field is off screen); Reduce Motion stops it.
   Use: paint an element with .g-surface, or read the tokens:
     --g-base      the flat colour under the layers (and the colour to use where a gradient cannot go)
     --g-image     the colour layers (background-image)
     --g-grain     the grain, a 180 px tile of SVG noise. Paint it on its own layer (.g-surface's ::after does),
                   never in one background list with --g-image (BUG-934)
     --g-ink, --g-muted, --g-soft      words: 4.5 : 1 or more on every part of the field (soft is for large words only, 3 : 1)
     --g-rule      thin rules
     --g-solid, --g-on-solid           the main button and its words
     --g-tint      the second button
     --g-deep      a dark tone of the same hue, as "r g b" for rgb(var(--g-deep) / a): shadows and scrims
     --g-light     the colour of .g-drift's moving light
     --g-dark, --g-dark-solid          the dark accent: the promo card (an image) and small filled marks (a colour).
                   Mist's deepest slate (the front page's word side), never black or brown
     --g-hero      the deep Mist for one large picture or an entry screen (sign-in, the upgrade page's preview)
     --g-blob-warm, --g-blob-cool      "Signing you in"'s two blurred blobs (a light and a deep Mist)
   White words (#fff) read 4.5 : 1 or more on --g-dark, --g-dark-solid and --g-hero (measured on the rendered pages,
   docs/web-app/redesign.md, "Mist").
   Dark: the app's Night theme (data-theme="night" on <html>, src/ui/theme.js), or the system's dark setting when no
   theme is set. */

/* ---------- Mist, light: the dashboard and the flows (ink words) */
:root {
  --g-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --g-light: rgb(240 246 250 / 0.24);
  --g-on-dark: #FFFFFF; --g-on-dark-2: rgb(255 255 255 / 0.72);
  --g-base: #B6C9D7;
  --g-image: radial-gradient(70% 70% at 70% 38%, rgb(226 236 244 / 0.85), rgb(226 236 244 / 0) 70%),
    radial-gradient(55% 60% at 4% 92%, rgb(64 86 104 / 0.12), rgb(64 86 104 / 0) 70%),
    linear-gradient(100deg, #A6BCCC 0%, #B6C9D7 45%, #C8D7E2 100%);
  --g-ink: #151514; --g-muted: #2C3D4A; --g-soft: #44586A; --g-rule: rgb(21 21 20 / 0.16);
  --g-solid: #151514; --g-on-solid: #F4F7F9; --g-tint: rgb(21 21 20 / 0.08); --g-deep: 40 56 70;
  /* The dark accent: the front page's slate word side. */
  --g-dark: radial-gradient(120% 90% at 0% 0%, rgb(147 179 203 / 0.16), rgb(147 179 203 / 0) 60%), linear-gradient(135deg, #3A5266, #283846 72%);
  --g-dark-solid: #2E4252;
  /* The deep Mist, as the front page: slate under the words (low left), the light Mist glowing behind the picture. */
  --g-hero: radial-gradient(60% 55% at 64% 40%, rgb(147 179 203 / 0.34), rgb(147 179 203 / 0) 72%),
    linear-gradient(rgb(22 32 41 / 0) 50%, rgb(22 32 41 / 0.55)),
    linear-gradient(100deg, #34495A 0%, #43607A 50%, #5C7D96 100%);
  --g-blob-warm: #7E9BB1; --g-blob-cool: #22323E;
}

/* ---------- Mist, deep: Night (the taste test, style, welcome, You're in) and the system's dark setting. The same
   values twice: a media query cannot share a rule with an attribute selector. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --g-base: #354B5C;
    --g-image: radial-gradient(60% 60% at 70% 36%, rgb(120 150 172 / 0.22), rgb(120 150 172 / 0) 72%),
      linear-gradient(rgb(16 24 31 / 0) 55%, rgb(16 24 31 / 0.35)), linear-gradient(100deg, #2C4152 0%, #385166 45%, #46657C 100%);
    --g-ink: #F2F5F7; --g-muted: #D0DAE2; --g-soft: #A9B9C5; --g-rule: rgb(242 245 247 / 0.16);
    --g-solid: #F2F5F7; --g-on-solid: #151514; --g-tint: rgb(242 245 247 / 0.12); --g-deep: 12 18 23;
    --g-light: rgb(150 180 200 / 0.12);
    --g-dark: radial-gradient(120% 90% at 0% 0%, rgb(170 198 218 / 0.18), rgb(170 198 218 / 0) 60%), linear-gradient(135deg, #43596C, #2F4253 72%);
    --g-dark-solid: #3A5062; }
}
:root[data-theme="night"] { --g-base: #354B5C;
  --g-image: radial-gradient(60% 60% at 70% 36%, rgb(120 150 172 / 0.22), rgb(120 150 172 / 0) 72%),
    linear-gradient(rgb(16 24 31 / 0) 55%, rgb(16 24 31 / 0.35)), linear-gradient(100deg, #2C4152 0%, #385166 45%, #46657C 100%);
  --g-ink: #F2F5F7; --g-muted: #D0DAE2; --g-soft: #A9B9C5; --g-rule: rgb(242 245 247 / 0.16);
  --g-solid: #F2F5F7; --g-on-solid: #151514; --g-tint: rgb(242 245 247 / 0.12); --g-deep: 12 18 23;
  --g-light: rgb(150 180 200 / 0.12);
  /* BUG-1410: the promo card a step lighter than the deep field, so it reads as a card, not a hole (white words 4.5 : 1 or more). */
  --g-dark: radial-gradient(120% 90% at 0% 0%, rgb(170 198 218 / 0.18), rgb(170 198 218 / 0) 60%), linear-gradient(135deg, #43596C, #2F4253 72%);
  --g-dark-solid: #3A5062; }

/* ---------- G4, slate (deep blue-grey, white words; the same in light and dark) */
.g4, :root[data-theme="night"] .g4 {
  --g-base: #242D32;
  --g-image: radial-gradient(55% 65% at 70% 46%, rgb(104 126 138 / 0.42), rgb(104 126 138 / 0) 72%),
    linear-gradient(rgb(8 11 13 / 0) 55%, rgb(8 11 13 / 0.32)),
    linear-gradient(100deg, #161C1F 0%, #1F282D 36%, #2C373D 70%, #35434B 100%);
  --g-ink: #F5F7F8; --g-muted: rgb(245 247 248 / 0.8); --g-soft: rgb(245 247 248 / 0.6); --g-rule: rgb(245 247 248 / 0.18);
  --g-solid: #F5F7F8; --g-on-solid: #151514; --g-tint: rgb(245 247 248 / 0.14); --g-deep: 14 18 21;
  --g-light: rgb(150 176 190 / 0.16);
}

/* The field itself: the colour layers over the base, and the grain on a layer of its own, under the content. */
/* BUG-934: the grain is its own layer; in one background list its size landed on the wrong layer. */
/* ::after holds the grain; ::before is .g-drift's light, painted under it. */
:where(.g-surface) { position: relative; }
.g-surface { isolation: isolate; background-color: var(--g-base); background-image: var(--g-image); color: var(--g-ink); }
.g-surface::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--g-grain); }

/* The drift: one soft light, larger than the field, moving on the compositor (transform only, so no repaint). */
.g-drift { overflow: clip; }
.g-drift::before { content: ""; position: absolute; inset: -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(32% 36% at 62% 44%, var(--g-light), transparent 70%), radial-gradient(26% 30% at 30% 70%, var(--g-light), transparent 70%);
  animation: g-arrive 1.6s var(--ease-out) both, g-ebb 120s steps(30) 1.6s infinite; }
/* BUG-1190: the light eases into place once, then ebbs in whole steps, one a second (as base.css body::before): a smooth
   endless drift drew the window at every refresh. `translate`, not `transform`, so the two stay on the compositor. */
@keyframes g-arrive { from { transform: translate(-4%, 3%) scale(1.04); } }
@keyframes g-ebb { 0%, 100% { translate: 0 0; } 25% { translate: 3% -2%; } 50% { translate: 4% 1%; } 75% { translate: 1.5% 2.5%; } }
.g-drift.g-paused::before, .g-paused .g-drift::before { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .g-drift::before { animation: none; } }
