/* 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; } }

/* The first ask: a slice of toast, a lead line, three perks. */
.dl-ask1 { gap: 14px; }
.dl-toast { display: block; margin: -6px 0 -4px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)); rotate: -4deg; transition: rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.dl-toast svg { display: block; }
.dl-toast-butter { opacity: 0; transform: translateY(-7px) scale(0.6); transform-box: fill-box; transform-origin: 50% 100%;
  transition: opacity 0.2s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
.dl-toast-glad { opacity: 0; transition: opacity 0.18s ease; }
.dl-toast-sad { transition: opacity 0.18s ease; }
.dl-ask1:has(.dl-donate:hover, .dl-donate:focus-visible) .dl-toast { rotate: 3deg; }
.dl-ask1:has(.dl-donate:hover, .dl-donate:focus-visible) .dl-toast-butter { opacity: 1; transform: none; }
.dl-ask1:has(.dl-donate:hover, .dl-donate:focus-visible) .dl-toast-glad { opacity: 1; }
.dl-ask1:has(.dl-donate:hover, .dl-donate:focus-visible) .dl-toast-sad { opacity: 0; }
.dl-lead { max-width: 420px; }
.dl-perks {
  width: min(430px, 100%); margin: 2px 0 2px; padding: 4px 0; list-style: none; text-align: left;
  display: flex; flex-direction: column; border-radius: 16px;
  background: rgba(245, 242, 234, 0.045); box-shadow: inset 0 0 0 0.5px rgba(245, 242, 234, 0.12);
}
.dl-perk { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 11px 16px; }
.dl-perk + .dl-perk { border-top: 0.5px solid rgba(245, 242, 234, 0.09); }
.dl-perk-icon {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.dl-perk-icon svg { display: block; }
.dl-perk-icon.is-code { color: var(--mint); background: rgba(52, 211, 153, 0.13); }
.dl-perk-icon.is-idea { color: var(--yellow); background: rgba(255, 200, 61, 0.13); }
.dl-perk-icon.is-bowl { color: #FF8A7A; background: rgba(255, 75, 58, 0.13); }
.dl-perk-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-perk-text strong { font: 750 15px/1.25 var(--font-round); color: var(--paper); letter-spacing: -0.005em; }
.dl-perk-text span { font-size: 13.5px; line-height: 1.42; color: rgba(245, 242, 234, 0.66); text-wrap: pretty; }
.dl-ask1 .dl-row { margin-top: 4px; }

/* The second ask: same perks, and a lunch fund with feelings. */
.dl-same { margin: -6px 0 0; font: 700 13px/1.3 var(--font-round); letter-spacing: 0.01em; color: rgba(245, 242, 234, 0.6); }
.dl-meter-fill { transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease; }
.dl-meter[data-mood="up"] .dl-meter-fill { background: linear-gradient(90deg, var(--yellow-lo), var(--yellow)); box-shadow: 0 0 12px rgba(255, 200, 61, 0.6); }
.dl-meter[data-mood="down"] .dl-meter-fill { transition-duration: 0.9s; transition-timing-function: cubic-bezier(0.5, 0, 0.75, 0); opacity: 0.8; }

/* The email step: one field, the promise, and a way past it. */
.dl-envelope {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: -2px;
  color: var(--ink); 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-email .dl-h { font-size: 32px; }
.dl-email .dl-p { margin-top: -6px; font-size: 15px; color: rgba(245, 242, 234, 0.7); }
.dl-email-form { width: min(460px, 100%); margin-top: 2px; display: flex; flex-direction: column; gap: 8px; }
.dl-email-row {
  display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 34px;
  background: rgba(245, 242, 234, 0.08); border: 1px solid rgba(245, 242, 234, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dl-email-row:focus-within { border-color: rgba(255, 200, 61, 0.7); background: rgba(245, 242, 234, 0.1); }
.dl-email-input {
  flex: 1; min-width: 0; height: 46px; padding: 0 8px 0 18px; border: 0; outline: none; background: none;
  font: 500 16px/1 var(--font-body); color: var(--paper); -webkit-user-select: text; user-select: text;
}
.dl .dl-email-input:focus-visible { outline: none; }
.dl-email-input::placeholder { color: rgba(245, 242, 234, 0.42); }
.dl-email-input[aria-invalid="true"] { color: #FFB4AA; }
.dl-email-row:has([aria-invalid="true"]) { border-color: rgba(255, 75, 58, 0.7); }
.dl-email-go.dl-mid { height: 46px; padding: 0 22px; border-radius: 23px; font-size: 16.5px; }
.dl-email-go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(150, 95, 0, 0.22), 0 6px 16px -6px rgba(255, 200, 61, 0.55); }
.dl-email-go[aria-disabled="true"] { filter: saturate(0.6) brightness(0.92); }
.dl-email-err { margin: 0; min-height: 0; font-size: 13px; color: #FFB4AA; }
.dl-email-err:empty { display: none; }
.dl-promise { max-width: 480px; display: flex; flex-direction: column; gap: 6px; }
.dl-promise p { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(245, 242, 234, 0.7); text-wrap: pretty; }
.dl-promise p:first-child { color: rgba(245, 242, 234, 0.86); }
.dl-promise .dl-promise-small { font-size: 12.5px; color: rgba(245, 242, 234, 0.5); }
.dl-promise a { color: rgba(245, 242, 234, 0.78); text-decoration: underline; text-decoration-color: rgba(245, 242, 234, 0.35); text-underline-offset: 3px; }
.dl-promise a:hover { color: var(--paper); }
.dl-email .dl-skip { margin-top: -4px; }
.dl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dl-email-note {
  margin: -4px 0 0; padding: 6px 12px; border-radius: var(--r-pill);
  font: 700 13.5px/1.3 var(--font-round); color: var(--mint); background: rgba(52, 211, 153, 0.1);
  box-shadow: inset 0 0 0 0.5px rgba(52, 211, 153, 0.32);
}
.dl-email-note.is-failed { color: var(--yellow); background: rgba(255, 200, 61, 0.1); box-shadow: inset 0 0 0 0.5px rgba(255, 200, 61, 0.3); }

@media (max-width: 819.98px) {
  .dl { padding: 34px 20px 24px; min-height: 0; border-radius: 20px; }
  .dl-email .dl-h { font-size: 26px; }
  .dl-ask1 { gap: 12px; }
  .dl-toast svg { width: 46px; height: 43px; }
  .dl-perk { gap: 12px; padding: 10px 12px; grid-template-columns: 32px 1fr; }
  .dl-perk-icon { width: 32px; height: 32px; border-radius: 10px; }
  .dl-perk-text span { font-size: 13px; }
  .dl-email-row { flex-direction: column; align-items: stretch; padding: 0; gap: 10px; border: 0; background: none; box-shadow: none; }
  .dl-email-input { flex: none; width: 100%; box-sizing: border-box; height: 50px; padding: 0 16px; border-radius: 14px; background: rgba(245, 242, 234, 0.08); border: 1px solid rgba(245, 242, 234, 0.2); }
  .dl-email-input:focus { border-color: rgba(255, 200, 61, 0.7); }
  .dl-email-row:focus-within { background: none; }
  .dl-email-go.dl-mid { height: 50px; border-radius: 25px; }
  .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, .dl-toast, .dl-toast-butter, .dl-toast-glad, .dl-toast-sad, .dl-meter-fill { transition: none; }
  .dl-toast-butter { transform: 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); }
.th-mail { color: var(--paper-dim); text-decoration: underline; text-decoration-color: rgba(245, 242, 234, 0.3); text-underline-offset: 3px; }
.th-mail:hover { color: var(--yellow); }
