/* Public footer ("Footer A · Wordmark"). Markup: views/partials/footer.ejs. Kit parts: logo, segmented, wordmark, button. */
.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: 6rem;
  overflow: hidden;
  /* Fades in so the page's ambient glows are not cut by a hard edge */
  background: linear-gradient(to bottom, transparent, var(--bg) 15rem);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.sf-glow {
  position: absolute;
  bottom: -420px;
  left: 50%;
  width: 1000px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(217, 70, 239, 0.12), rgba(129, 140, 248, 0.06) 55%, rgba(129, 140, 248, 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.sf-inner {
  position: relative;
  padding-top: 4rem;
}

/* Gradient hairline, as wide as the content */
.sf-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--ui-gutter);
  right: var(--ui-gutter);
  height: 1px;
  background: var(--ui-gradient-hairline);
}

.sf-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 2.5rem;
}

.sf-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.125rem;
  padding-right: 2.5rem;
}

.sf-tagline {
  max-width: 340px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.sf-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Desktop: the four columns sit on the same grid as the brand block */
.sf-cols { display: contents; }

.sf-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.sf-col-title {
  margin: 0 0 0.25rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.sf-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.sf-link:hover,
.sf-dev:hover { color: var(--text-primary); }

.sf-link:focus-visible,
.sf-dev:focus-visible {
  outline: 2px solid var(--ui-focus-border);
  outline-offset: 3px;
  border-radius: 4px;
}

.sf-new { margin-left: 0.375rem; }

.sf-wordmark { margin-top: 0; }

.sf-bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-bottom: 2rem;
  color: var(--text-secondary);
}

.sf-dev {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--ui-line-strong);
  text-underline-offset: 5px;
  transition: color 0.2s;
}

.sf-dev-arrow { display: inline-flex; }

/* ---------- Developer hover card ---------- */
.sf-dev-wrap {
  position: relative;
  display: inline-flex;
}

.sf-dev-card {
  position: absolute;
  bottom: calc(100% + 14px);
  left: -12px;
  z-index: 30;
  width: 340px;
  padding: 1.125rem;
  border-radius: var(--ui-radius-card, 20px);
  background: var(--ui-surface-solid);
  border: 1px solid var(--ui-line-strong);
  box-shadow: var(--ui-shadow-float);
  color: var(--text-primary);
  text-align: left;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: 24px 100%;
  transition: opacity 0.16s ease 0.12s, transform 0.2s ease 0.12s, visibility 0s linear 0.32s;
}

/* Keeps the hover alive while the pointer crosses the gap to the card */
.sf-dev-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

@media (hover: hover) {
  .sf-dev-wrap:hover .sf-dev-card {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease 0.15s, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.15s, visibility 0s linear 0.15s;
  }
}

.sf-dev-wrap:has(:focus-visible) .sf-dev-card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0s;
}

.sf-dev-wrap.is-dismissed .sf-dev-card {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.sf-dev-card-line {
  position: absolute;
  top: -1px;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 171, 252, 0), rgba(240, 171, 252, 0.7), rgba(129, 140, 248, 0.7), rgba(129, 140, 248, 0));
}

.sf-dev-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sf-dev-card-avatar {
  --ui-avatar-gap-color: var(--ui-surface-solid);
  flex-shrink: 0;
}

.sf-dev-card-id { min-width: 0; }

.sf-dev-card-name {
  margin: 0;
  font-family: var(--ui-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.sf-dev-card-role {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.sf-dev-card-bio {
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.sf-dev-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--ui-line);
}

.sf-dev-card-site {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 36px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.sf-dev-card-site:hover { color: var(--ui-accent-text); }

.sf-dev-card-social {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sf-dev-card-team {
  margin-left: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.sf-dev-card-team:hover { color: var(--text-primary); }

.sf-dev-card-site:focus-visible,
.sf-dev-card-team:focus-visible {
  outline: 2px solid var(--ui-focus-border);
  outline-offset: 3px;
  border-radius: 6px;
}

.sf-donate {
  padding: 0 0.875rem;
  font-size: inherit;
}

.sf-donate svg { fill: currentColor; }

/* The fixed clip button would cover the copyright: it steps aside while the bottom row is on screen */
.clip-fab.sf-fab-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

[data-theme="light"] .sf-glow {
  background: radial-gradient(closest-side, rgba(217, 70, 239, 0.10), rgba(129, 140, 248, 0.05) 55%, rgba(129, 140, 248, 0));
}

@media (max-width: 1100px) {
  .sf-top { grid-template-columns: minmax(0, 1fr); }
  .sf-brand { padding-right: 0; }

  .sf-cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .site-footer { margin-top: 4rem; }

  .sf-glow {
    bottom: -260px;
    width: 600px;
    height: 440px;
    background: radial-gradient(closest-side, rgba(217, 70, 239, 0.14), rgba(217, 70, 239, 0));
  }

  .sf-inner { padding-top: 3rem; }
  .sf-top { gap: 2.25rem; }

  .sf-brand {
    align-items: stretch;
    gap: 1rem;
  }

  .sf-logo { align-self: flex-start; }
  .sf-logo { --ui-logo-name-mobile: 1.25rem; }
  .sf-logo .ui-logo-name { letter-spacing: 0; }

  .sf-tagline {
    max-width: none;
    line-height: 1.55;
  }

  .sf-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1rem;
  }

  /* 36px rows: the artboard's 32px link + 4px gap, as one tappable height */
  .sf-col { gap: 0; }
  .sf-col-title { margin-bottom: 0.375rem; }
  .sf-link { min-height: 36px; }
  .sf-link.ui-hide-mobile,
  .sf-new { display: none; }

  .sf-wordmark { margin-top: 2rem; }

  .sf-bottom {
    margin-top: 4.5rem;
    font-size: 0.8125rem;
    flex-wrap: wrap;
  }

  .sf-dev-wrap {
    order: -1;
    flex-basis: 100%;
  }

  .sf-dev { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-link,
  .sf-dev { transition: none; }

  .sf-dev-card,
  .sf-dev-wrap:hover .sf-dev-card,
  .sf-dev-wrap:has(:focus-visible) .sf-dev-card { transform: none; transition: none; }
}
