/* Engineer C: the download flow and Thanks. */

/* ------------------------------------------------------------ the panel */
.dl {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 20;
  width: min(620px, calc(100% - 32px)); min-height: 380px; box-sizing: border-box; padding: 40px 44px 34px;
  display: flex; flex-direction: column; justify-content: center;
  border-radius: 22px; color: var(--paper); text-align: center; outline: none;
  background: rgba(22, 22, 25, 0.76);
  -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(245, 242, 234, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 36px 80px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.3);
  font-family: var(--font-body); -webkit-user-select: none; user-select: none;
}
/* Off the stage (the plain page, a phone) it floats over paper, so the veil is a little thicker. */
.dl.dl-fixed {
  position: fixed; z-index: 1000; max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow: auto;
  background: rgba(22, 22, 25, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 90px rgba(20, 20, 22, 0.45), 0 10px 24px rgba(20, 20, 22, 0.3);
}
.dl::before {
  /* A low warm light inside the glass, like the wallpaper's. */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(70% 55% at 50% 118%, rgba(255, 200, 61, 0.12), rgba(255, 200, 61, 0) 70%);
}
.dl :focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.dl-x {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: rgba(245, 242, 234, 0.6);
  background: rgba(245, 242, 234, 0.06); box-shadow: inset 0 0 0 0.5px rgba(245, 242, 234, 0.12);
  transition: background 0.15s ease, color 0.15s ease;
}
.dl-x:hover { background: rgba(245, 242, 234, 0.14); color: var(--paper); }
.dl-x svg { display: block; }

.dl-body { position: relative; }
.dl-step { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.dl-h { margin: 0; font: 800 34px/1.1 var(--font-round); letter-spacing: -0.012em; text-wrap: balance; }
.dl-h-big { font-size: 44px; letter-spacing: -0.02em; }
.dl-p { margin: 0; max-width: 440px; font-size: 16px; line-height: 1.5; color: rgba(245, 242, 234, 0.84); text-wrap: pretty; }
.dl-ask2 .dl-p { font-size: 17px; color: rgba(245, 242, 234, 0.86); }

/* Buttons */
.dl-donate, .dl-free, .dl-ghost, .dl-skip { appearance: none; font: inherit; text-decoration: none; cursor: pointer; }
.dl-donate {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; border: 0;
  color: var(--ink); font-family: var(--font-round); font-weight: 800; white-space: nowrap;
  background: linear-gradient(180deg, var(--yellow-hi) 0%, var(--yellow) 55%, var(--yellow-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(150, 95, 0, 0.22), 0 0 0 8px rgba(255, 200, 61, 0.14), 0 10px 26px -6px rgba(255, 200, 61, 0.5);
  transition: translate 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease;
}
.dl-donate:hover { color: var(--ink); translate: 0 -1px; filter: brightness(1.04); }
.dl-donate:active { translate: 0 1px; filter: brightness(0.96); }
.dl-big { height: 60px; padding: 0 34px; border-radius: 30px; font-size: 21px; }
.dl-mid { height: 56px; padding: 0 30px; border-radius: 28px; font-size: 19px; }
.dl-ask2 .dl-donate { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(150, 95, 0, 0.22), 0 10px 26px -6px rgba(255, 200, 61, 0.5); }
.dl-free {
  box-sizing: border-box; padding: 0 26px; border: 1px solid rgba(245, 242, 234, 0.3); color: var(--paper);
  background: rgba(245, 242, 234, 0.06); font-family: var(--font-round); font-weight: 700; white-space: nowrap;
  transition: background 0.15s ease;
}
.dl-free:hover { background: rgba(245, 242, 234, 0.12); }

/* Row with Donate in the middle and the small free button that runs away. */
.dl-row { position: relative; width: 100%; height: 64px; margin-top: 8px; display: flex; align-items: center; justify-content: center; }
.dl-ghost {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 140px; height: 40px; padding: 0; border: 1px solid rgba(245, 242, 234, 0.3); border-radius: 20px;
  color: var(--paper); background: rgba(245, 242, 234, 0.08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transform: translate(calc(-50% + 187px), -50%);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), background 0.15s ease, border-color 0.15s ease;
}
.dl-ghost:hover { background: rgba(245, 242, 234, 0.14); }
.dl-ghost.is-settled { border-color: rgba(255, 200, 61, 0.55); color: var(--yellow); }
/* Calm (keyboard, touch, Reduce Motion): it simply sits beside Donate. */
.dl.is-calm .dl-row { height: auto; flex-wrap: wrap; gap: 14px; }
.dl.is-calm .dl-ghost { position: static; transform: none; transition: none; }

.dl-soon { margin: -6px 0 0; font-size: 12.5px; letter-spacing: 0.01em; color: rgba(245, 242, 234, 0.62); }
.dl-ask1 .dl-soon { margin-top: 2px; }
.dl-skip {
  min-height: 44px; padding: 0 16px; border: 0; background: none; color: rgba(245, 242, 234, 0.82);
  font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(245, 242, 234, 0.35); text-underline-offset: 4px;
}
.dl-skip:hover { color: var(--paper); text-decoration-color: currentColor; }
.dl-ask1 .dl-skip { margin-top: -6px; }

/* The lunch meter */
.dl-meter { width: min(380px, 100%); display: flex; flex-direction: column; gap: 7px; }
.dl-meter-top { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(245, 242, 234, 0.76); }
.dl-meter-top span:last-child { font-family: var(--font-mono); font-weight: 600; }
.dl-meter-track { height: 8px; border-radius: 4px; background: rgba(245, 242, 234, 0.14); overflow: hidden; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.25); }
.dl-meter-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #E63A2A, var(--red)); box-shadow: 0 0 10px rgba(255, 75, 58, 0.6); }
.dl-pair { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }

/* The end */
.dl-badge {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: -2px;
  color: var(--ink); background: var(--mint); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.14), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.dl-done.is-waiting .dl-badge { background: var(--yellow); box-shadow: 0 0 0 6px rgba(255, 200, 61, 0.14), 0 8px 18px rgba(0, 0, 0, 0.35); }
.dl-done .dl-h { font-size: 32px; }
.dl-note {
  margin: -4px 0 0; padding: 6px 12px; border-radius: var(--r-pill);
  font: 700 13.5px/1.3 var(--font-round); color: var(--yellow); background: rgba(255, 200, 61, 0.1);
  box-shadow: inset 0 0 0 0.5px rgba(255, 200, 61, 0.3);
}
.dl-file {
  width: min(420px, 100%); box-sizing: border-box; padding: 14px 16px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: var(--paper);
  background: rgba(245, 242, 234, 0.07); border: 1px solid rgba(245, 242, 234, 0.12);
}
a.dl-file:hover { background: rgba(245, 242, 234, 0.1); }
.dl-file-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.dl-file-name { font-family: var(--font-mono); }
.dl-file-size { color: rgba(245, 242, 234, 0.76); }
.dl-file-track { height: 6px; border-radius: 3px; background: rgba(245, 242, 234, 0.14); overflow: hidden; }
.dl-file-fill { height: 100%; border-radius: 3px; background: var(--mint); transform-origin: left; animation: dl-fill 1.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes dl-fill { from { scale: 0 1; } }
/* Not ready: an amber bar that waits, with stripes walking slowly. Nothing to click. */
.dl-file.is-pending .dl-file-size { color: var(--yellow); font-weight: 600; }
.dl-file.is-pending .dl-file-fill {
  width: 86%; animation: dl-walk 1.6s linear infinite;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, #E9A920 6px 12px);
  background-size: 17px 100%;
}
@keyframes dl-walk { to { background-position: 17px 0; } }

@media (max-width: 819.98px) {
  .dl { padding: 34px 20px 24px; min-height: 0; border-radius: 20px; }
  .dl-h { font-size: 28px; }
  .dl-h-big { font-size: 38px; }
  .dl-p { font-size: 15.5px; }
  .dl-big { height: 56px; padding: 0 28px; font-size: 19px; }
  .dl-mid { padding: 0 22px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-ghost, .dl-donate { transition: none; }
  .dl-file-fill, .dl-file.is-pending .dl-file-fill { animation: none; }
}

/* ----------------------------------------------------------------- Thanks */
.th { padding: 4px 26px 22px; display: flex; flex-direction: column; min-height: 100%; box-sizing: border-box; }
.th-head { display: flex; align-items: center; gap: 15px; padding-bottom: 18px; }
.th-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--tile-mint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.th-h { margin: 0; font: 800 23px/1.1 var(--font-round); letter-spacing: -0.012em; color: var(--paper); }
.th-sub { margin: 5px 0 0; font-size: 13px; line-height: 1.42; color: var(--paper-dim); }
.th-list { margin: 0; padding: 0; list-style: none; border-top: 0.5px solid rgba(255, 255, 255, 0.08); }
.th-item { display: grid; grid-template-columns: 30px 1fr; gap: 4px; padding: 13px 0; border-bottom: 0.5px solid rgba(255, 255, 255, 0.08); }
.th-n { padding-top: 3px; font: 600 11px/1 var(--font-mono); color: rgba(245, 242, 234, 0.4); }
.th-text { display: flex; flex-direction: column; gap: 4px; }
.th-name {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font: 750 15.5px/1.2 var(--font-round); color: var(--paper); text-decoration: none; border-radius: 4px;
}
.th-name:hover { color: var(--yellow); }
.th-out { color: rgba(245, 242, 234, 0.45); display: inline-flex; transition: translate 0.15s ease, color 0.15s ease; }
.th-name:hover .th-out { color: var(--yellow); translate: 1px -1px; }
.th-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.th-what { margin: 0; font-size: 13px; line-height: 1.45; color: var(--paper-dim); }
.th-foot { margin: auto 0 0; padding-top: 16px; font-size: 12px; color: var(--paper-faint); }
