/* ── SITE PREFERENCES ──────────────────────────────────────────────────────
   Shared by the home page and the blog. Text size scales the root font size;
   every font-size on the site is in rem, so text grows while layout stays.
   The control itself is sized in px so it doesn't jump when you use it.   */

html { font-size: calc(100% * var(--ts, 1)); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.text-size { position: relative; flex-shrink: 0; }
.text-size-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border-2, var(--border));
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.text-size-btn:hover, .text-size-btn[aria-expanded="true"] { border-color: var(--amber); color: var(--amber); }
.ts-glyph { display: inline-flex; align-items: baseline; gap: 1px; font-family: var(--font-display); font-weight: 600; line-height: 1; }
.ts-sm { font-size: 11px; }
.ts-lg { font-size: 16px; }

.text-size-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  z-index: 120;
  width: max-content;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-2, var(--border));
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.text-size-menu[hidden] { display: none; }
.text-size-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 2px 10px;
}
.text-size-options { display: flex; gap: 6px; }
.text-size-options button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  width: 64px; height: 64px;
  padding: 8px 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.text-size-options button:hover { border-color: var(--amber); color: var(--text); }
.text-size-options button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: var(--amber-glow); }
.ts-opt { font-family: var(--font-display); font-weight: 600; line-height: 1; }
.ts-opt-1 { font-size: 14px; }
.ts-opt-2 { font-size: 17px; }
.ts-opt-3 { font-size: 20px; }
.ts-opt-4 { font-size: 24px; }
.ts-name { font-family: var(--font-body); font-size: 11px; line-height: 1; }

@media (max-width: 480px) {
  .text-size-menu { position: fixed; top: calc(var(--nav-h, 64px) + 8px); right: 12px; left: 12px; width: auto; }
  .text-size-options { justify-content: space-between; }
  .text-size-options button { flex: 1; width: auto; }
}
