* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--surface-bg); color: var(--text-primary); font-family: var(--font); min-height: 100vh;
  transition: background var(--duration-color) ease, color var(--duration-color) ease;
}

a { color: inherit; }

.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--ember);
  margin-bottom: 10px;
}
.eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--ember); flex: 0 0 auto; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 13px 24px;
  background: var(--surface-topbar); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-min);
  transition: background var(--duration-color) ease, border-color var(--duration-color) ease;
}
.topbar__wordmark { height: 22px; width: auto; display: block; }
.topbar__nav { display: flex; gap: 4px; flex: 1; }
.topbar__nav-item {
  padding: 7px 12px; border-radius: var(--radius-input); font-size: 13px; font-weight: 600;
  text-decoration: none; color: rgba(var(--fg-rgb), .6); border: 1px solid transparent;
}
.topbar__nav-item.is-active { background: var(--surface-fill); border-color: var(--hairline-min); color: var(--text-primary); }
.topbar__meta { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.topbar__theme-toggle {
  width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: var(--radius-input);
  border: 1px solid var(--hairline-min); background: transparent; color: var(--text-primary);
  cursor: pointer; flex: 0 0 auto; transition: transform var(--duration-lift) ease, background var(--duration-color) ease;
}
.topbar__theme-toggle:hover { background: rgba(var(--fg-rgb), .06); }

/* Page shell */
.page { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }
.page--narrow { max-width: 1000px; }

.card {
  background: var(--surface-fill); border: 1px solid var(--hairline-min); border-radius: var(--radius-card);
  transition: background var(--duration-color) ease, border-color var(--duration-color) ease;
}

.btn-primary {
  height: 40px; padding: 0 18px; border-radius: var(--radius-button); border: none;
  background: var(--ember); color: var(--ink); font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform var(--duration-lift) ease;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
  height: 40px; padding: 0 16px; border-radius: var(--radius-button); border: 1px solid var(--hairline-min);
  background: transparent; color: var(--text-primary); font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform var(--duration-lift) ease;
}
.btn-ghost:hover { transform: translateY(-1px); }

.ghost-link {
  font-size: 13px; font-weight: 600; color: var(--ember-ink); text-decoration: none; white-space: nowrap;
}
.ghost-link:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .btn-primary, .btn-ghost, .topbar__theme-toggle, body, .topbar, .card { transition: none; }
  .btn-primary:hover:not(:disabled), .btn-ghost:hover { transform: none; }
}
