:root {
  --paper: #f5f2ec;        /* the warm white page */
  --card: #fffdf9;         /* the loader card */
  --ink: #1b1a18;          /* titles, finished ramps */
  --muted: #8d877c;        /* small print, ramps still to come */
  --line: #e4ded3;         /* hairlines, ramps still to come */
  --accent: #3f57d6;       /* the single accent: the marble and the ramp it runs on */
  --marble-light: #b7c4ff; /* the marble's lit side */
  --marble-deep: #1d2a86;  /* the marble's shade */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

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

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 2vh 14px;
}

.loader {
  width: min(480px, 92vw);
  background: var(--card);
  border: 1px solid #ebe5da;
  border-radius: min(24px, 4.4vh);
  padding: min(20px, 3.4vh) min(22px, 5vw) min(16px, 2.8vh);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(40, 30, 10, .05), 0 24px 50px -24px rgba(40, 30, 10, .28);
  display: flex;
  flex-direction: column;
  gap: min(10px, 1.8vh);
}

.loader__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 560;
  color: var(--muted);
  letter-spacing: .01em;
}

h1 {
  font-size: clamp(17px, min(4.8vw, 3.4vh), 22px);
  font-weight: 650;
  font-variation-settings: "wdth" 92;
  letter-spacing: -.02em;
  margin-top: 2px;
}

.file {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.file span { margin-left: 6px; font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: 11.5px; }

.pct {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(24px, min(7vw, 5.4vh), 34px);
  font-weight: 520;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  text-align: right;
  min-width: 3.4ch;
}

.pct i { font-style: normal; color: var(--muted); font-size: .52em; margin-left: 1px; }

.track {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  overflow: visible;
}

.ramp__line {
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke .35s;
}

.ramp__stop {
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke .35s;
}

.ramp__label {
  font-size: 11px;
  font-weight: 560;
  fill: var(--muted);
  letter-spacing: .005em;
  transition: fill .35s;
}

.ramp.is-active .ramp__line,
.ramp.is-active .ramp__stop { stroke: var(--accent); }
.ramp.is-active .ramp__label { fill: var(--accent); }

.ramp.is-done .ramp__line,
.ramp.is-done .ramp__stop { stroke: var(--ink); }
.ramp.is-done .ramp__label { fill: var(--ink); }

.cup__line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .35s;
}

.cup.is-done .cup__line { stroke: var(--ink); }

.marble__mark {
  fill: none;
  stroke: rgba(255, 255, 255, .78);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.marble__dot { fill: rgba(255, 255, 255, .62); }
.marble__shine { fill: rgba(255, 255, 255, .5); }

.loader__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 26px;
  border-top: 1px solid var(--line);
  padding-top: min(12px, 2vh);
}

.foot {
  grid-area: 1 / 1;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foot--done {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 560;
  opacity: 0;
}

.tick {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
}

.tick svg { width: 20px; height: 20px; display: block; }

.tick path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
