/* ═══════════════════════════════════════════════════════════════
   Site chrome: wordmark, section rail, welcome cue
   ═══════════════════════════════════════════════════════════════ */

/* Both appear as the welcome word crumbles: --welcome-progress is 0 on the
   first screen and 1 everywhere below it, so they are invisible over the
   opening and fade in with the first scroll without any script. */
.wordmark {
  position: fixed;
  top: calc(var(--topbar-top) + 11px);
  left: max(28px, env(safe-area-inset-left, 0px));
  z-index: var(--z-chrome);
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--primary-text);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.32em;
  text-decoration: none;
  opacity: calc(var(--welcome-progress, 0) * 1.6);
  transition: color 260ms ease, opacity 200ms ease;
}

.wordmark:hover,
.wordmark:focus-visible {
  color: var(--text);
}

.section-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: var(--z-chrome);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-50%);
  opacity: calc(var(--welcome-progress, 0) * 1.6);
  transition: opacity 200ms ease;
}

html.intro-active .wordmark,
html.intro-active .section-rail {
  opacity: 0;
}

.section-rail a {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  text-decoration: none;
}

.section-rail a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
  transform: translate(-50%, -50%);
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.section-rail a:hover::before,
.section-rail a:focus-visible::before,
.section-rail a.is-active::before {
  border-color: var(--primary-text);
  background: var(--primary-text);
}

.section-rail a.is-active::before {
  transform: translate(-50%, -50%) scale(1.3);
}

.rail-label {
  position: absolute;
  right: 30px;
  top: 50%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--text);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(6px, -50%);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.section-rail a:hover .rail-label,
.section-rail a:focus-visible .rail-label {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .section-rail {
    display: none;
  }
}

@media (max-width: 680px) {
  /* The two round buttons already anchor the top on a phone; a third pill on
     the left sat on top of whatever scrolled under it. */
  .wordmark {
    display: none;
  }

}
