/* Kepler shapes kit: the Guide's shapes behind page content. Colour values live only here. */
.ks-art {
  --gl-fog: #fffdf9; --gl-paper: #e6dece; --gl-sheet: #f6f1e6; --gl-side: #e3dccd; --gl-nav: #cfc6b3; --gl-card: #ebe4d5;
  --gl-ink: #1b1917; --gl-green: #2f9a52; --gl-warn: #e08a12; --gl-copper: #c8600c;
  --aurora-1: #ff9f2e; --aurora-2: #ff5d8f; --aurora-3: #7b5cff;
  position: relative; isolation: isolate;
}
.ks-art > .ks-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* page head art: a band at the top of a page, behind the heading. Text sits left, the shape sits right. */
.ks-head { position: absolute; left: 0; right: 0; top: 0; height: min(460px, 70vh); z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%); }
.ks-head > .ks-canvas { -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 74%); mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 74%); }
.ks-head[data-ks-shape="ribbons"] > .ks-canvas, .ks-head[data-ks-shape="pieces"] > .ks-canvas { -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.14) 0%, rgba(0,0,0,.3) 45%, #000 76%); mask-image: linear-gradient(90deg, rgba(0,0,0,.14) 0%, rgba(0,0,0,.3) 45%, #000 76%); }
.ks-head::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 82% 0%, color-mix(in srgb, var(--aurora-1) 10%, transparent), transparent 60%), radial-gradient(ellipse at 100% 60%, color-mix(in srgb, var(--aurora-3) 6%, transparent), transparent 50%); }
.ks-page { position: relative; isolation: isolate; }

/* sign-in pages: the shape lives in the brand panel, never over the form */
.ks-auth-art { height: 360px; width: min(520px, 100%); margin-top: 28px; }
.ks-auth-art > .ks-canvas { z-index: 0; }

/* small centred pages: the shape fills the page behind one card */
.ks-backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.ks-backdrop > .ks-canvas { z-index: 0; }
.ks-over { position: relative; z-index: 1; }

/* no WebGL, or more than three scenes on a page: soft bands of the same three colours */
.ks-no-gl::after { content: ""; position: absolute; inset: 8% 0 12% 30%; z-index: -1; pointer-events: none; filter: blur(26px); opacity: .55;
  background: linear-gradient(172deg, transparent 22%, rgba(123, 92, 255, .3) 30%, transparent 40%, rgba(255, 93, 143, .3) 50%, transparent 60%, rgba(255, 159, 46, .34) 70%, transparent 80%);
  background: linear-gradient(172deg, transparent 22%, color-mix(in srgb, var(--aurora-3) 30%, transparent) 30%, transparent 40%, color-mix(in srgb, var(--aurora-2) 30%, transparent) 50%, transparent 60%, color-mix(in srgb, var(--aurora-1) 34%, transparent) 70%, transparent 80%); }

/* a row of small tiles with one lit tile: the divider between sections */
.ks-tile-rule { --t: 11px; position: relative; height: 34px; display: grid; place-items: center; pointer-events: none; }
.ks-tile-rule::before { content: ""; width: min(420px, 72vw); height: var(--t); border-radius: 2px;
  background: repeating-linear-gradient(90deg, #e6dece 0 var(--t), transparent var(--t) calc(var(--t) + 5px));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.ks-tile-rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: var(--t); height: var(--t); margin: calc(var(--t) / -2) 0 0 calc(var(--t) / -2 + 8px); border-radius: 2px; background: #ff9f2e; box-shadow: 0 0 14px rgba(255, 159, 46, .55); animation: ks-step 9s steps(9) infinite; }
@keyframes ks-step { from { transform: translateX(-72px); } to { transform: translateX(72px); } }

@media (max-width: 760px) {
  /* phone: the heading fills the width, so the shape becomes a faint corner mark, never a layer under text */
  .ks-head { height: 210px; }
  .ks-head > .ks-canvas, .ks-head[data-ks-shape="ribbons"] > .ks-canvas, .ks-head[data-ks-shape="pieces"] > .ks-canvas { opacity: .26; -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 80%); mask-image: linear-gradient(90deg, transparent 20%, #000 80%); }
  .ks-backdrop > .ks-canvas { opacity: .4; }
  .ks-auth-art { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ks-tile-rule::after { animation: none; } }
@media print { .ks-head, .ks-backdrop, .ks-auth-art, .ks-canvas, .ks-tile-rule { display: none !important; } }
