/* The dashboard loading screen with cards landing on springs: the overview of an analytics app on a near black page.
   .wrap is moved by GSAP, .win (the glass window) is styled here. Each card holds two layers: the skeleton (.sk, grey
   bones lit by one shared light) and the content (.ct). A conic light runs round the edge (.win__beam) at the end. */
:root {
  --page: #08080b;          /* the page */
  --win: #111116;           /* the window */
  --card: #17171e;          /* the cards */
  --line: rgba(255, 255, 255, 0.07); /* thin edges */
  --ink: #f2f2f5;           /* the figures */
  --muted: #8b8b98;         /* the small words */
  --bone: #1f1f28;          /* the skeleton placeholders */
  --bone-light: #34344a;    /* the light that crosses them */
  --accent: #8b7cff;        /* the chart, the progress and the edge light: violet */
  --up: #5ee6b5;            /* a figure going up: mint */
  --down: #ff8a8a;          /* a figure going down */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

/* the fine grain over the whole page */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* two soft lights behind the window, so the page is never flat */
.glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.glow__a {
  left: 50%;
  top: 46%;
  width: min(80vw, 70vh, 620px);
  height: min(44vw, 40vh, 340px);
  margin: calc(min(44vw, 40vh, 340px) / -2) 0 0 calc(min(80vw, 70vh, 620px) / -2);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
}

.glow__b {
  left: 62%;
  top: 70%;
  width: min(46vw, 40vh, 360px);
  height: min(24vw, 22vh, 180px);
  margin: calc(min(24vw, 22vh, 180px) / -2) 0 0 calc(min(46vw, 40vh, 360px) / -2);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--up) 16%, transparent), transparent);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  container-type: inline-size;
  opacity: 0;
}

.win {
  position: relative;
  border-radius: 18px;
  padding: clamp(10px, 2.6vh, 16px);
  background: linear-gradient(180deg, #16161c 0%, var(--win) 38%, #0e0e12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px var(--line),
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 24px 48px -18px rgba(0, 0, 0, 0.85),
    0 60px 110px -40px color-mix(in srgb, var(--accent) 40%, transparent);
  overflow: hidden;
}

/* the light that follows the pointer inside the glass */
.win__spot {
  --mx: 50%;
  --my: 30%;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.055), transparent 70%);
  transition: opacity 0.4s ease;
}

@media (hover: hover) {
  .win:hover .win__spot {
    opacity: 1;
  }
}

/* the light that runs once round the edge when the data is in */
.win__beam {
  --a: 0deg;
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(from var(--a), transparent 0deg, transparent 250deg, color-mix(in srgb, var(--accent) 70%, transparent) 318deg, #ffffff 348deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* the sheen that crosses the glass once */
.win__sheen {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.win__sheen-band {
  position: absolute;
  top: -20%;
  left: 0;
  width: 34%;
  height: 140%;
  opacity: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.06) 55%, transparent 100%);
}

/* the bar at the top */
.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand__mark {
  width: 18px;
  height: 18px;
  flex: none;
  fill: var(--ink);
}

.brand__mark-lo {
  fill: var(--accent);
}

.brand__name {
  font-size: 13.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 108;
}

.bar__crumb {
  font-size: 12px;
  color: var(--muted);
  padding-left: 9px;
  box-shadow: inset 1px 0 0 var(--line);
  white-space: nowrap;
}

.bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar__btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.bar__btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .bar__btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
  }
}

.bar__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bar__avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 640;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(140deg, #a99cff, #5a49d6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px var(--win), 0 0 0 3px var(--line);
}

/* the status line with its progress */
.status {
  position: relative;
  z-index: 2;
  margin: clamp(8px, 2.2vh, 14px) 2px clamp(8px, 2vh, 12px);
}

.status__line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.status__words,
.status__pct,
.status__when {
  grid-row: 1;
}

.status__words {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.status__words--done {
  color: var(--ink);
  opacity: 0;
}

.status__check {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--up);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status__pct,
.status__when {
  grid-column: 2;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.status__pct {
  color: var(--ink);
}

.status__when {
  opacity: 0;
}

.status__track {
  display: block;
  height: 2px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.status__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent) 80%, #ffffff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* the cards */
.kpis {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.6cqi, 10px);
}

.row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(6px, 1.6cqi, 10px);
  margin-top: clamp(6px, 1.6cqi, 10px);
}

@container (max-width: 500px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }
  .list {
    display: none;
  }
}

.card {
  --flash: 0;
  position: relative;
  border-radius: 12px;
  background: linear-gradient(180deg, #1a1a22, var(--card));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* the edge of a card lights up for an instant when its data lands */
.card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--flash);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}

/* the skeleton: grey bones; one light crosses them all at the same place (--sx is the light, --ox the bone's left) */
.sk {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: inherit;
}

.sk i {
  --ox: 0px;
  display: block;
  height: 8px;
  border-radius: 4px;
  background-color: var(--bone);
  background-image: linear-gradient(100deg, transparent 0, var(--bone-light) 50%, transparent 100%);
  background-repeat: no-repeat;
  background-size: 150px 100%;
  background-position: calc(var(--sx, -300px) - var(--ox) - 75px) 0;
}

.sk .sk__big {
  height: 15px;
  margin: 2px 0 1px;
}

.sk .sk__area {
  flex: 1;
  width: 100%;
  border-radius: 8px;
}

.ct {
  position: relative;
}

.kpi {
  padding: clamp(8px, 2.4cqi, 13px) clamp(8px, 2.4cqi, 14px);
}

.kpi .sk {
  padding: clamp(10px, 2.6cqi, 15px) clamp(8px, 2.4cqi, 14px);
  gap: clamp(6px, 1.3cqi, 8px);
}

.kpi__label {
  display: block;
  font-size: clamp(10px, 2.2cqi, 12px);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi__value {
  display: flex;
  margin: clamp(3px, 1cqi, 6px) 0 clamp(4px, 1.2cqi, 7px);
  font-size: clamp(15px, 4.4cqi, 25px);
  font-weight: 620;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* the odometer: each digit is a column of figures that rolls */
.odo {
  display: inline-block;
  height: 1.12em;
  line-height: 1.12em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}

.odo__strip {
  display: block;
}

.odo__strip span {
  display: block;
  height: 1.12em;
}

.odo--sym {
  line-height: 1.12em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 4px;
  border-radius: 999px;
  font-size: clamp(9.5px, 2cqi, 11px);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  color: var(--up);
  background: color-mix(in srgb, var(--up) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 20%, transparent);
}

.chip svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chip--down {
  color: var(--down);
  background: color-mix(in srgb, var(--down) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 20%, transparent);
}

/* the chart */
.chart {
  padding: clamp(9px, 2.4cqi, 14px) clamp(10px, 2.6cqi, 15px) clamp(8px, 2cqi, 12px);
}

.chart .sk {
  padding: clamp(11px, 2.6cqi, 16px) clamp(10px, 2.6cqi, 15px) clamp(10px, 2.4cqi, 14px);
  gap: 10px;
}

.chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.chart__title {
  font-weight: 580;
}

.chart__range {
  color: var(--muted);
  font-size: 11px;
}

.chart__plot {
  position: relative;
  height: clamp(78px, 25vh, 168px);
  margin-top: 8px;
}

.chart__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart__grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}

.chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 55%, transparent));
}

.chart__cur {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  opacity: 0;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.22) 30%, rgba(255, 255, 255, 0.22) 100%);
}

.chart__mk {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.chart__tip {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.chart__tip-in {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 9px;
  padding: 4px 7px;
  border-radius: 7px;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(30, 30, 40, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px -6px rgba(0, 0, 0, 0.8);
}

.chart__tip-in b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* the channels */
.list {
  padding: clamp(9px, 2.4cqi, 14px) clamp(10px, 2.6cqi, 15px);
}

.list .sk {
  padding: clamp(11px, 2.6cqi, 16px) clamp(10px, 2.6cqi, 15px);
  gap: 12px;
}

.list__title {
  display: block;
  font-size: 11.5px;
  font-weight: 580;
}

.list__rows {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: clamp(8px, 2.2vh, 13px);
}

.list__row {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.list__val {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex;
}

.list__bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.list__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent));
}
