/* kit.css: what the Signature Kit's DOM modules need from a stylesheet.
 *
 * Two rules hold throughout. Nothing here hides content: every rule is either
 * the no-JavaScript version of a part (the device frame, the native scroller)
 * or applies only to markup a module builds once it runs. And the defaults a
 * site may want to restyle sit inside :where(), which has no specificity, so
 * the site's own rules win without a fight.
 */

/* Text for screen readers only, beside pieces that are hidden from them. */
.kit-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* split-text ---------------------------------------------------------------- */

.kit-w,
.kit-c {
  display: inline-block;
}

.kit-line,
.kit-line-in {
  display: block;
}

/* The mask a rising line comes up through. A clip-path rather than overflow,
   because it can reach past the line box: up for accents, sideways for
   italics, and a little down so descenders are whole at rest even under a
   tight display line-height. */
.kit-rise .kit-line {
  clip-path: inset(-0.6em -0.35em -0.26em -0.35em);
}

.kit-rise.kit-rise-done .kit-line {
  clip-path: none;
}

/* marquee ------------------------------------------------------------------- */

/* Without JavaScript, and with reduced motion, the strip scrolls by hand. */
:where([data-kit~="marquee"]) {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

:where([data-kit~="marquee"]) > * {
  flex: none;
}

.kit-marquee {
  overflow: hidden;
  overflow: clip;
}

/* One custom property moves every item, so the loop is a single style write a
   frame and the site's own item rules (gap, child selectors) still apply. */
.kit-marquee > * {
  translate: var(--kit-marquee-x, 0px) 0;
  will-change: translate;
}

/* counters ------------------------------------------------------------------ */

/* Equal-width figures, so a rolling column never changes width. */
:where([data-kit~="counters"]) {
  font-variant-numeric: tabular-nums;
}

/* Columns are separate boxes, and a line may break between any two of them;
   the number as written has no such break. */
.kit-odo {
  white-space: nowrap;
}

.kit-odo-col {
  position: relative;
  display: inline-block;
  /* Clips the strip above and below the line; sideways it may spill, since a
     passing digit can be wider than the one it lands on. */
  clip-path: inset(0 -0.4em);
}

/* The final digit holds the column's width and baseline; the strip rolls over it. */
.kit-odo-digit {
  visibility: hidden;
}

.kit-odo-strip {
  position: absolute;
  inset: 0 0 auto 0;
  display: block;
  text-align: center;
  will-change: transform;
}

.kit-odo-strip > span {
  display: block;
}

.kit-odo-sep {
  transition: opacity 0.25s ease;
}

/* pinned-gallery ------------------------------------------------------------ */

/* The phone, reduced-motion and no-JavaScript version: a native scroller that
   snaps to each slide. */
:where([data-kit~="pinned-gallery"]) :where([data-track]) {
  display: flex;
  /* A track a site made as wide as its slides (width: max-content) would
     push the page sideways instead of scrolling by itself. */
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

:where([data-kit~="pinned-gallery"] [data-track]) > * {
  flex: none;
  scroll-snap-align: start;
}

/* A pinned section shorter than the screen would leave the page's bare
   background under it for the whole length of the pin. */
.kit-pinned {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-x: clip;
}

.kit-pinned [data-track] {
  max-width: none;
  overflow: visible;
  scroll-snap-type: none;
  will-change: transform;
}

/* The frame an image drifts inside: its own parent when that holds only the
   image, else a frame the module makes. */
.kit-clip {
  overflow: hidden;
}

.kit-drift {
  display: block;
  overflow: hidden;
}

.kit-drift > img,
.kit-clip > img {
  will-change: transform;
}

/* cursor -------------------------------------------------------------------- */

.kit-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.kit-cursor.kit-cursor-on {
  opacity: 1;
}

.kit-cursor-dot,
.kit-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.kit-cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--kit-cursor, currentColor);
}

.kit-cursor-ring {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border: 1.5px solid var(--kit-cursor, currentColor);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.kit-cursor-label {
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--kit-cursor-ink, #fff);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.kit-cursor-label-on .kit-cursor-ring {
  background: var(--kit-cursor, currentColor);
}

.kit-cursor-label-on .kit-cursor-label {
  opacity: 1;
  transition-delay: 0.08s;
}

html.kit-cursor-none,
html.kit-cursor-none * {
  cursor: none !important;
}

html.kit-cursor-none :is(input, textarea, select, [contenteditable]) {
  cursor: auto !important;
}

/* device-frame -------------------------------------------------------------- */

/* The device is drawn around the screenshot in CSS, so it is there before and
   without any JavaScript. Sizes are container units of the figure (1cqw is
   1% of its width), so the bezel scales with the device, not the page. The
   screen keeps a device's proportions (--kit-screen; set your own on the
   figure) and a taller screenshot is cropped from the top, ready to scroll. */
:where(.kit-device) {
  display: block;
  width: 100%;
  margin: 0;
}

.kit-device {
  container-type: inline-size;
  position: relative;
  box-sizing: border-box;
  --kit-screen: 16 / 10;
}

.kit-device > img {
  display: block;
  box-sizing: content-box;
  max-width: none;
  height: auto;
  aspect-ratio: var(--kit-screen);
  object-fit: cover;
  object-position: 50% 0;
}

.kit-device::before,
.kit-device::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

/* Laptop (also a .kit-device with no data-device) */
.kit-device:is([data-device="laptop"], :not([data-device])) > img {
  width: 81cqw;
  margin: 0 auto 2.4cqw;
  border: solid #0d0d10;
  border-width: 1.5cqw 1.5cqw 2.2cqw;
  border-radius: 2.4cqw 2.4cqw 0.5cqw 0.5cqw;
  box-shadow:
    0 0 0 0.22cqw #2c2c31,
    0 3cqw 6cqw -2cqw rgba(10, 10, 20, 0.45);
}

.kit-device:is([data-device="laptop"], :not([data-device]))::before {
  top: 0.55cqw;
  left: 50%;
  width: 0.55cqw;
  height: 0.55cqw;
  margin-left: -0.275cqw;
  border-radius: 50%;
  background: #24242a;
  box-shadow: inset 0 0 0 0.12cqw #3a3a44;
}

.kit-device:is([data-device="laptop"], :not([data-device]))::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5cqw;
  border-radius: 0.3cqw 0.3cqw 50% 50% / 0.3cqw 0.3cqw 100% 100%;
  background:
    linear-gradient(#9b9ba3, #c3c3c9) 50% 0 / 15cqw 0.75cqw no-repeat,
    linear-gradient(#f2f2f4, #d4d4d9 35%, #a9a9b0 80%, #8b8b93);
  box-shadow: 0 1.6cqw 3cqw -1.2cqw rgba(10, 10, 20, 0.5);
}

/* Browser window */
.kit-device[data-device="browser"] > img {
  width: 99.5cqw;
  border: 0.25cqw solid #d5d5db;
  border-top: 4.2cqw solid #ececf0;
  border-radius: 1.4cqw;
  box-shadow: 0 2.4cqw 6cqw -2cqw rgba(10, 10, 30, 0.35);
}

.kit-device[data-device="browser"]::before {
  top: 1.7cqw;
  left: 2cqw;
  width: 1.05cqw;
  height: 1.05cqw;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 1.75cqw 0 0 #febc2e, 3.5cqw 0 0 #28c840;
}

.kit-device[data-device="browser"]::after {
  top: 1.05cqw;
  left: 50%;
  width: 38cqw;
  height: 2.35cqw;
  margin-left: -19cqw;
  border-radius: 0.8cqw;
  background: #fff;
  box-shadow: inset 0 0 0 0.12cqw #dadade;
}

/* Phone */
:where(.kit-device[data-device="phone"]) {
  max-width: 340px;
  margin-inline: auto;
}

.kit-device[data-device="phone"] {
  --kit-screen: 9 / 19.5;
}

.kit-device[data-device="phone"] > img {
  width: 90.8cqw;
  margin: 0 auto;
  border: 3.6cqw solid #0a0a0c;
  border-radius: 15cqw;
  box-shadow:
    0 0 0 0.7cqw #3b3b41,
    0 0 0 1cqw #1c1c20,
    0 5cqw 9cqw -3cqw rgba(10, 10, 20, 0.5);
}

.kit-device[data-device="phone"]::before {
  top: 6.4cqw;
  left: 50%;
  width: 27cqw;
  height: 7.8cqw;
  margin-left: -13.5cqw;
  border-radius: 4cqw;
  background: #040405;
}

/* Tablet */
:where(.kit-device[data-device="tablet"]) {
  max-width: 820px;
  margin-inline: auto;
}

.kit-device[data-device="tablet"] {
  --kit-screen: 4 / 3;
}

.kit-device[data-device="tablet"] > img {
  width: 93.6cqw;
  margin: 0 auto;
  border: 2.6cqw solid #0e0e11;
  border-radius: 4.4cqw;
  box-shadow:
    0 0 0 0.45cqw #3a3a40,
    0 3.5cqw 7cqw -2.5cqw rgba(10, 10, 20, 0.45);
}

.kit-device[data-device="tablet"]::before {
  top: 1.05cqw;
  left: 50%;
  width: 0.8cqw;
  height: 0.8cqw;
  margin-left: -0.4cqw;
  border-radius: 50%;
  background: #26262c;
}
