/* The Download for Mac button of Tessel, a made-up window tiling app. The pill is the button for GSAP (press);
   the layers inside are for CSS and for their own tweens: the skin swells, the fill bar slides, the sheen crosses.
   The window next to the label holds the laptop at rest and, while installing, the tiny disk image window with the
   app, the dashed arc and the Applications folder (back, app, front: three layers so the app slips inside). */
:root {
  --fondo: #ffffff;        /* the page */
  --inchiostro: #121116;   /* the pill */
  --testo: #f4f3f7;        /* the words on the pill */
  --accento: #8f7dff;      /* the app's colour: the fill edge, the percentage, the icon */
  --accento-2: #5b8cff;    /* the second colour of the app icon */
  --grigio: #8b8994;       /* the small line below */
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.frame {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(340px, 92vw);
  padding: 14px 0 40px;
}

/* the pill */
.c {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 60px;
  padding: 0 26px 0 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--testo);
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  max-width: 92vw;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.c:focus-visible { outline: 2px solid var(--accento); outline-offset: 4px; }

.c__skin, .c__glow, .c__fill, .c__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.c__skin {
  z-index: -4;
  background:
    radial-gradient(120% 140% at 50% -40%, rgba(255, 255, 255, 0.09), transparent 55%),
    linear-gradient(180deg, #23222a 0%, var(--inchiostro) 60%, #0b0b0e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(18, 17, 22, 0.16),
    0 6px 14px -6px rgba(18, 17, 22, 0.32),
    0 24px 44px -24px rgba(40, 30, 90, 0.55);
}
.c__glow {
  z-index: -3;
  opacity: 0;
  background: radial-gradient(130px 80px at var(--gx, 50%) var(--gy, 50%), rgba(190, 180, 255, 0.17), transparent 70%);
}
/* the fill: a bar that slides in from the left, with a lit leading edge */
.c__fill {
  z-index: -2;
  overflow: hidden;
}
.c__bar {
  position: absolute;
  inset: 0;
  /* pushed out to the left by the script (xPercent: -100): GSAP would read a CSS translate as pixels */
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(90deg, rgba(110, 92, 240, 0.22), rgba(143, 125, 255, 0.46) 86%, rgba(206, 198, 255, 0.78));
  box-shadow: inset -1px 0 0 rgba(232, 228, 255, 0.8), 12px 0 24px -6px rgba(143, 125, 255, 0.7);
}
.c__sheen {
  z-index: -1;
  overflow: hidden;
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(225, 220, 255, 0.26) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}

/* the window beside the label */
.c__win {
  position: relative;
  flex: none;
  width: 22px;
  height: 26px;
}
.w__laptop {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 24px;
  height: 24px;
  margin-left: -12px;
}
.w__laptop svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lp__base { fill: rgba(244, 243, 247, 0.12); }
.lp__notch { stroke-width: 1.2; opacity: 0.5; }
.lp__arrow { stroke: var(--accento); stroke-width: 1.6; }

.w__trail {
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke: rgba(201, 192, 255, 0.7);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 1.5 3;
  opacity: 0;
}
.w__folder {
  position: absolute;
  left: 46px;
  top: 3px;
  width: 24px;
  height: 20px;
  opacity: 0;
}
.w__folder svg { display: block; width: 24px; height: 20px; overflow: visible; }
.w__folder--back { z-index: 1; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45)); }
.w__folder--front { z-index: 3; }
.f__paper { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.8; stroke-linecap: round; }
.f__flap { transform-origin: 50% 100%; }
.f__edge { stroke: rgba(255, 255, 255, 0.75); stroke-width: 0.7; stroke-linecap: round; fill: none; }
.f__mark { fill: none; stroke: rgba(40, 72, 130, 0.65); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }

.w__app {
  position: absolute;
  z-index: 2;
  left: 5px;
  top: 7px;
  width: 16px;
  height: 16px;
  opacity: 0;
}
.w__done {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  opacity: 0;
}

/* the app icon: a squircle with three tiles, the mark of a window tiling app */
.app {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5px;
  width: 16px;
  height: 16px;
  padding: 3.5px;
  border-radius: 4.6px;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, 0.45), transparent 55%),
    linear-gradient(145deg, var(--accento), var(--accento-2));
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.45), 0 3px 6px -2px rgba(60, 40, 160, 0.6);
}
.app i {
  display: block;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.95);
}
.app i:first-child { grid-row: span 2; }
.app i:nth-child(3) { opacity: 0.7; }
.app--big {
  width: 22px;
  height: 22px;
  padding: 5px;
  gap: 2px;
  border-radius: 6.4px;
}
.app--big i { border-radius: 1.4px; }

/* the labels: measured by the script, narrowed on the wdth axis while they swap */
.c__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.c__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
}
.c__label[data-l="idle"] { opacity: 1; }
.c__pct {
  display: inline-block;
  min-width: 2.45em;
  margin-left: 0.4em;
  text-align: right;
  color: #c9c0ff;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.note {
  position: absolute;
  left: 0;
  right: 0;
  top: 90px;
  height: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 460;
  color: var(--grigio);
}
.note__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  white-space: nowrap;
}
.note__line[data-n="done"] { opacity: 0; color: #6d62c9; }

@media (max-width: 400px) {
  .c { height: 56px; font-size: 15px; padding: 0 22px 0 18px; gap: 10px; }
  .note { top: 84px; font-size: 12px; }
}
