/* ==========================================================================
   Free resources (/r, templates/resource.html): the paste box, the loader and
   the follow card. The cards keep the original's hard offset shadow, drawn in
   bone on the night page.
   ========================================================================== */
.rx, .rx-ov, .rx-body { --rx-edge: var(--bone); --rx-err: #FF9466; }
.rx-i { width: 14px; height: 14px; flex: none; }
.rx-open { display: none; }

/* ---------- head: the paste box, or the resource unlocked ---------- */
.rx { position: relative; padding: calc(var(--hdr) + clamp(40px, 8vh, 104px)) 0 clamp(56px, 9vh, 104px); }
.rx-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.rx-main { max-width: 780px; }
.rx-kicker { margin: 0 0 22px; }
.rx-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 24px; }
.rx-state__t { font-weight: 650; font-size: 16px; }
.rx-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 2px;
  font-stretch: 62%; font-weight: 650; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
}
.rx-chip--ok { background: var(--bone); border-color: var(--bone); color: var(--night); }
.rx-h { font-size: clamp(38px, 5.4vw, 88px); max-width: 15ch; }
.rx-h em { font-style: normal; color: var(--ash-2); }
.rx-lede { margin-top: clamp(16px, 2.4vh, 26px); }

.rx-form {
  display: flex; gap: 10px; max-width: 680px; margin-top: clamp(28px, 4vh, 40px); padding: 10px;
  background: var(--night); border: 1.5px solid var(--rx-edge); border-radius: 4px; box-shadow: 6px 6px 0 var(--rx-edge);
}
.rx-form input {
  flex: 1; min-width: 0; height: 56px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 2px; background: rgba(236, 233, 226, .07);
  color: var(--bone); font: inherit; font-size: 16px; outline: none;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.rx-form input::placeholder { color: var(--ash-2); opacity: 1; }
.rx-form input:focus { background: transparent; border-color: var(--line-2); }
.rx-go { flex: none; min-height: 56px; }
.rx-hint { margin: 18px 0 0; font-size: 14.5px; color: var(--ash); }
.rx-hint b { font-weight: 650; color: var(--bone); }
.rx-err { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; font-size: 15px; line-height: 1.45; color: var(--rx-err); }
.rx-err::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: currentColor; }
.rx-err[hidden] { display: none; }

.rx-media { position: relative; display: flex; flex-direction: column; align-items: center; margin: 0; }
.rx-media::before {
  content: ""; position: absolute; inset: 12% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(236, 233, 226, .13), transparent); filter: blur(28px);
}
.rx-media img { display: block; width: auto; max-width: 100%; height: min(68vh, 620px); object-fit: contain; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55)); }
.rx-media figcaption { margin-top: 18px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--ash); }
.rx-media figcaption b { display: block; font-weight: 650; font-size: 16px; color: var(--bone); }

/* ---------- how it works ---------- */
.rx-how { padding: clamp(48px, 8vh, 96px) 0 clamp(80px, 12vh, 140px); border-top: 1px solid var(--line); }
.rx-label { margin: 0 0 24px; }
.rx-how__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); margin: 0; padding: 0; list-style: none; }
.rx-how__steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: start; }
.rx-how__steps .rx-n { grid-row: span 2; }
.rx-how__steps b { font-weight: 650; font-size: 18px; line-height: 1.35; }
.rx-how__steps li > span:last-child { font-size: 15.5px; line-height: 1.5; color: var(--ash); }
.rx-more { margin: 44px 0 0; color: var(--ash); }
.rx-more a { color: var(--bone); text-underline-offset: 4px; }
.rx-n {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px;
  border: 1px solid var(--line-2); border-radius: 50%;
  font-stretch: 62%; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--bone);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

/* ---------- the overlay: loader and follow card ---------- */
.rx-ov {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(14, 14, 17, .6); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  animation: rxFade .25s ease both; transition: opacity .3s ease;
}
.rx-ov[hidden] { display: none; }
.rx-ov.is-leaving { opacity: 0; }
.rx-card {
  position: relative; width: 100%; max-width: 388px; padding: 30px 28px 28px;
  background: var(--night); border: 1.5px solid var(--rx-edge); border-radius: 4px; box-shadow: 6px 6px 0 var(--rx-edge);
  animation: rxIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
.rx-card[hidden] { display: none; }
.rx-card.is-done { animation: rxPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.rx-card.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); transition: opacity .3s ease, transform .3s ease; animation: none; }
.rx-card__t {
  margin: 24px 0 0; text-align: center; text-wrap: balance;
  font-stretch: 112%; font-weight: 800; font-size: 25px; line-height: 1.05; letter-spacing: -.01em; text-transform: uppercase;
}
.rx-card__t em { font-style: normal; color: var(--ash-2); }
.rx-when-done, .is-done .rx-when-busy { display: none; }
.is-done .rx-when-done { display: inline; }
.rx-dots i { font-style: normal; animation: rxDot 1.2s infinite both; }
.rx-dots i:nth-child(2) { animation-delay: .2s; }
.rx-dots i:nth-child(3) { animation-delay: .4s; }

.rx-orb { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.rx-orb__ball {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; color: var(--night);
  background: linear-gradient(180deg, #fff, #ECE9E2 47%, #CDC8BE 53%, #E2DED6);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .25), 0 14px 28px -12px rgba(0, 0, 0, .9);
}
.rx-orb__ball > * { grid-area: 1 / 1; }
.rx-orb__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--night); animation: rxPulse 1s ease-in-out infinite; }
.rx-orb__ok { display: none; width: 28px; height: 28px; }
.is-done .rx-orb__dot, .is-done .rx-orb__ring { display: none; }
.is-done .rx-orb__ok { display: block; animation: rxCheck .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.rx-orb__ring { position: absolute; inset: -11px; animation: rxSpin 1.1s linear infinite; }
.rx-orb__ring i { position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--bone); }

.rx-steps { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.rx-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ash-2); transition: color .25s var(--ease); }
.rx-steps li.is-active, .rx-steps li.is-done { color: var(--bone); }
.rx-tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 50%; color: var(--night); }
.rx-tick > *, .rx-tick::after { grid-area: 1 / 1; }
.rx-tick .rx-i { width: 12px; height: 12px; opacity: 0; }
.rx-steps li.is-active .rx-tick { border: 2px solid var(--bone); }
.rx-steps li.is-active .rx-tick::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bone); animation: rxPing 1s cubic-bezier(0, 0, .2, 1) infinite; }
.rx-steps li.is-done .rx-tick { background: var(--bone); border-color: var(--bone); animation: rxCheck .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.rx-steps li.is-done .rx-tick .rx-i { opacity: 1; }
.rx-bar { height: 6px; margin-top: 26px; overflow: hidden; border-radius: 3px; background: rgba(236, 233, 226, .1); }
.rx-bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--bone); }
.rx-load.is-running .rx-bar i { animation: rxProgress 2.3s cubic-bezier(.3, .1, .2, 1) forwards; }
.rx-load.is-done .rx-bar i { width: 100%; animation: none; }

.rx-close {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: none; color: var(--ash); cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.rx-close:hover { color: var(--bone); background: rgba(236, 233, 226, .08); }
.rx-ava { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.rx-ava img { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }
.rx-ava__b {
  position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--bone); color: var(--night); box-shadow: 0 0 0 3px var(--night);
}
.rx-ava__b > * { grid-area: 1 / 1; }
.rx-ava__x { width: 12px; height: 12px; }
.rx-ava__ok { display: none; width: 14px; height: 14px; }
.is-done .rx-ava__x, .is-done .rx-close, .is-done .rx-gate__d, .is-done .rx-gate__steps, .is-done .rx-gate__err { display: none; }
.is-done .rx-ava__ok { display: block; animation: rxCheck .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.rx-gate__d { margin: 12px 0 0; text-align: center; font-size: 15px; line-height: 1.5; color: var(--ash); text-wrap: balance; }
.rx-gate__d b { font-weight: 650; color: var(--bone); white-space: nowrap; }
.rx-gate__steps { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.rx-gate__steps li { display: flex; align-items: center; gap: 12px; }
.rx-gate__steps li.is-on .rx-n { background: var(--bone); border-color: var(--bone); color: var(--night); }
.rx-btn {
  position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 0; min-height: 50px; padding: 0 16px; overflow: hidden; border-radius: 2px;
  font: inherit; font-stretch: 62%; font-weight: 650; font-size: 13.5px; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.rx-btn--x { border: 1px solid var(--bone); background: var(--bone); color: var(--night); transition: background-color .2s var(--ease); }
.rx-btn--x:hover { background: #fff; border-color: #fff; }
/* "I already follow": see-through until it arms, then it fills and turns solid over 3 s */
.rx-already {
  border: 1.5px solid var(--line-2); background: transparent; color: var(--bone); opacity: .28; cursor: not-allowed;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.rx-already.is-filling { opacity: 1; transition: opacity 3s linear, border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.rx-already__fill { position: absolute; inset: 0; background: rgba(236, 233, 226, .12); transform: scaleX(0); transform-origin: left; }
.rx-already.is-filling .rx-already__fill { animation: rxFill 3s linear forwards; }
.rx-already__l { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.rx-already.is-ready { border-color: var(--bone); box-shadow: 3px 3px 0 var(--bone); cursor: pointer; }
.rx-already.is-ready .rx-already__fill { display: none; }
.rx-already.is-ready .rx-shut { display: none; }
.rx-already.is-ready .rx-open { display: inline; }
.rx-already.is-ready:hover { background: var(--bone); color: var(--night); }
.rx-already.is-ready:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--bone); }
.rx-already.is-shake { animation: rxShake .4s ease; }
.rx-gate__err { margin-top: 16px; font-size: 14px; }

/* ---------- unlocked ---------- */
.rx--open { padding-bottom: clamp(48px, 7vh, 80px); }
.rx-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: 14.5px; color: var(--ash); text-decoration: none; transition: color .2s var(--ease); }
.rx-back:hover { color: var(--bone); }
.rx--open .rx-h { max-width: none; font-size: clamp(30px, 8.2vw, 104px); overflow-wrap: anywhere; }
.rx-intro { margin-top: 18px; max-width: 56ch; }
.rx--open .mx-actions .rx-i { width: 16px; height: 16px; }
.rx-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.rx-facts li {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 2px; color: var(--ash);
  font-stretch: 62%; font-weight: 600; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
}
.rx-body { padding: clamp(56px, 9vh, 112px) 0; border-top: 1px solid var(--line); }
.rx-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 104px); }
.rx-body code {
  padding: 1px 6px; border-radius: 3px; background: rgba(236, 233, 226, .08); color: var(--bone);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; overflow-wrap: anywhere;
}
.rx-inside li > span:last-child, .rx-howto li > span:last-child { min-width: 0; }
.rx-inside { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rx-inside li { display: flex; align-items: flex-start; gap: 12px; font-size: 16.5px; line-height: 1.5; color: var(--bone-2); }
.rx-inside .rx-tick { margin-top: 1px; background: var(--bone); border-color: var(--bone); }
.rx-inside .rx-tick .rx-i { opacity: 1; }
.rx-strip { margin: 40px 0 0; }
.rx-strip img { display: block; width: 100%; max-width: 560px; height: auto; }
.rx-howto { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.rx-howto li { display: flex; align-items: flex-start; gap: 14px; font-size: 16.5px; line-height: 1.5; color: var(--bone-2); }
.rx-howto .rx-n { margin-top: -1px; }
.rx-code { margin-top: 28px; overflow: hidden; background: var(--night); border: 1.5px solid var(--rx-edge); border-radius: 4px; box-shadow: 6px 6px 0 var(--rx-edge); }
.rx-code + .rx-code { margin-top: 30px; }
.rx-code__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px 9px 16px;
  border-bottom: 1px solid var(--line-2); color: var(--ash); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
}
.rx-copy {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--bone); border-radius: 2px; background: var(--bone); color: var(--night);
  font: inherit; font-family: "Archivo", ui-sans-serif, system-ui, sans-serif; font-stretch: 62%; font-weight: 650; font-size: 12.5px;
  letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.rx-copy.is-copied { background: transparent; color: var(--bone); }
.rx-code pre {
  margin: 0; padding: 16px; overflow: auto; background: rgba(236, 233, 226, .03); color: var(--bone-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; line-height: 1.7; white-space: pre;
}
.rx-next { padding: clamp(64px, 10vh, 128px) 0; border-top: 1px solid var(--line); }
.rx-next__in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; max-width: 1000px; }
.rx-next__in img { width: 72px; height: 72px; border-radius: 16px; }
.rx-next__h { font-size: clamp(30px, 3.6vw, 58px); }
.rx-next .mx-text { margin-top: 18px; }

@media (max-width: 900px) {
  .rx-grid, .rx-cols { grid-template-columns: minmax(0, 1fr); }
  .rx-media img { height: min(54vh, 440px); }
  .rx-how__steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .rx-form { flex-direction: column; box-shadow: 4px 4px 0 var(--rx-edge); }
  .rx-form input { flex: none; }
  .rx-go { width: 100%; }
  .rx-card { padding: 28px 20px 22px; box-shadow: 4px 4px 0 var(--rx-edge); }
  .rx-btn { padding: 0 12px; font-size: 12.5px; letter-spacing: .12em; }
  .rx-next__in { grid-template-columns: 1fr; }
}

@keyframes rxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rxIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rxPop { 0% { transform: scale(1); } 45% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes rxCheck { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes rxSpin { to { transform: rotate(1turn); } }
@keyframes rxPulse { 50% { opacity: .4; } }
@keyframes rxPing { 75%, 100% { opacity: 0; transform: scale(2); } }
@keyframes rxProgress { 0% { width: 0; } 60% { width: 72%; } 100% { width: 100%; } }
@keyframes rxDot { 0%, 20% { opacity: 0; } 40%, 100% { opacity: 1; } }
@keyframes rxFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rxShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

@media (prefers-reduced-motion: reduce) {
  .rx-ov, .rx-card, .rx-card.is-done, .rx-tick, .rx-orb__ok, .rx-ava__ok, .rx-orb__dot, .rx-dots i, .rx-already.is-shake { animation: none; }
  .rx-orb__ring { display: none; }
}
