/* The loading gem (components/loading/GemLoader.vue; the boot curtain in index.html inlines the same file). It is
   generated from the gem-loader sandbox (`yarn loader:build`, docs/sign-offs/2026-11-25-gem-loader) and drawn in the
   studio's own colours: every colour in it is relative to --sg-gem-body and --sg-gem-light (shared studioTheme `gem`),
   which the boot script, the published paint.css or the app's theme set on :root. Until one of them has, it is the
   mark's own violet (zero specificity, so any of them wins wherever it lands in the page). */
:where(:root) {
  --sg-gem-body: #8249ca;
  --sg-gem-light: #ae8fe1;
}

/* Keep boot, sign-in and the destination on the same desktop content width.
   Overlay scrollbars reserve no space. Paint an empty gutter in the studio's
   ground colour, including before the application stylesheet arrives. */
html {
  background-color: var(--surface-ground, var(--sg-app-background, #0f172a));
}
@media screen and (min-width: 992px) {
  html {
    scrollbar-gutter: stable;
  }
}

body {
  margin: 0;
}

.layout-preloader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background-color: var(--sg-app-background, #0f172a);
}
/* The gem's own height; the box around it is as big as its glow reaches (the file sizes itself from this). In px:
   this sheet paints before the app's 14px root does, and a rem would shrink the gem the moment the app's CSS lands. */
.sg-gem-loader {
  --sg-gem-loader-size: 64px;
  position: relative;
  display: block;
  line-height: 0;
  pointer-events: none;
}
/* The gem's own light on the page around it (glow riff round 2, Dax 2026-11-25: "around B for dark, dial back a little;
   around C on light, dial back a little"). The studio's colour, made a little more vivid, blooming round the gem; never its
   pale light step (grey fog in the dark, lost on paper). Alpha falls on an eased curve (a straight fade with a kink shows a
   ring). It breathes with the gem's glow: the build writes sg-gem-breath into the gem's file; opacity only, so the
   compositor runs it. Only on the two full-screen curtains, where the gem lights its own room: inside a page it was a
   purple haze pulsing over the content (Dax 2026-11-26), so the in-page loader is the gem and its own tight glow. */
.main-loader .sg-gem-loader::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: radial-gradient(closest-side, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.24) 0%, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.173) 20%, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.101) 40%, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.046) 60%, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.012) 80%, oklch(from var(--sg-gem-body) l calc(c * 1.3) h / 0.0) 100%);
}
.app-dark .main-loader .sg-gem-loader::before {
  inset: -130%;
  background: radial-gradient(closest-side, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.26) 0%, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.187) 20%, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.109) 40%, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.049) 60%, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.013) 80%, oklch(from var(--sg-gem-body) l calc(c * 1.15) h / 0.0) 100%);
}
/* Full screen (the boot curtain and the app's own curtain), the gem is the one thing on screen: about a quarter of a
   phone's width, and the same weight on a desk (size riff, 2026-11-25: phone C, desk D). */
.main-loader .sg-gem-loader {
  --sg-gem-loader-size: 104px;
}
@media screen and (min-width: 992px) {
  .main-loader .sg-gem-loader {
    --sg-gem-loader-size: 136px;
  }
}
/* The gem itself (.sg-gem, the generated file) carries its own layout: its layers are positioned inside it. */
