/* ==========================================================================
   Follow on X
   Shared by every page that links to x.com/p_d_y, except the homepage,
   which styles its own panel in home.css. Pages load this last in <head>,
   so these rules win over page CSS of equal specificity. Colours are set
   here rather than inherited so the pieces look the same on every theme.
   Served immutable: bump ?v= on every <link> when this file changes.
   ========================================================================== */

.x-logo {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

/* Footer pill ------------------------------------------------------------ */

a.x-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0.25em 0.2em;
  padding: 0.45em 0.95em 0.45em 0.8em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  vertical-align: middle;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

a.x-footer-link:hover,
a.x-footer-link:focus-visible {
  border-color: rgba(94, 234, 212, 0.7);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.16), 0 10px 26px rgba(94, 234, 212, 0.22);
  transform: translateY(-1px);
}

/* End-of-article card ---------------------------------------------------- */

@property --x-follow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.x-follow {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin: 52px 0 8px;
  padding: 26px 28px;
  border: 0;
  border-radius: 14px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(94, 234, 212, 0.16), transparent 55%),
    radial-gradient(120% 160% at 100% 100%, rgba(139, 92, 246, 0.24), transparent 55%),
    #0a0f1f;
  box-shadow: 0 22px 60px rgba(76, 29, 149, 0.28);
  color: #f5f7fb;
  text-align: left;
}

/* A 1px gradient ring that slowly turns. */
.x-follow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--x-follow-angle), #5eead4, #3b82f6, #a855f7, #ec4899, #5eead4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: x-follow-spin 7s linear infinite;
  pointer-events: none;
}

@keyframes x-follow-spin {
  to { --x-follow-angle: 360deg; }
}

.x-follow .x-follow-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: #000;
  color: #fff;
  font-size: 26px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03), 0 12px 30px rgba(0, 0, 0, 0.45);
}

.x-follow .x-follow-kicker,
.x-follow .x-follow-title,
.x-follow .x-follow-sub {
  margin: 0;
  padding: 0;
}

.x-follow .x-follow-kicker {
  color: #5eead4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.x-follow .x-follow-title {
  margin-top: 4px;
  color: #fff;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.x-follow .x-follow-sub {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.98rem;
  line-height: 1.5;
}

.x-follow .x-follow-sub strong {
  color: #fff;
}

.x-follow a.x-follow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.x-follow a.x-follow-button:hover,
.x-follow a.x-follow-button:focus-visible {
  color: #000;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.22), 0 14px 34px rgba(94, 234, 212, 0.28);
}

@media screen and (max-width: 640px) {
  .x-follow {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 22px;
  }

  .x-follow .x-follow-mark {
    width: 48px;
    height: 48px;
    font-size: 22px;
    border-radius: 14px;
  }

  .x-follow a.x-follow-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .x-follow::before { animation: none; }
  a.x-footer-link,
  .x-follow a.x-follow-button { transition: none; }
}
