/* Hua's Classroom — base layout */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  line-height: 1.55;
  background: var(--paper);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

a { color: var(--teal-deep); }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.topbar .logo {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-actions a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.topbar-actions a:hover { color: var(--ink); }

.topbar .btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
}

.topbar .btn-sm:hover { background: #243044; }

.topbar.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

footer.page-foot {
  border-top: 1px solid var(--line);
  padding: 28px 20px 40px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
  background: #fff;
}

footer.page-foot a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

footer.page-foot a:hover { color: var(--ink); }

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

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes spin-slow {
  from { transform: rotate(18deg); }
  to { transform: rotate(378deg); }
}
