:root {
  --public-bg: #f7f7fb;
  --public-surface: #ffffff;
  --public-ink: #181520;
  --public-muted: #514c5e;
  --public-faint: #9a95ab;
  --public-line: #dfddea;
  --public-accent: #5b3df5;
  --public-accent-hover: #6d52f7;
  --public-accent-pressed: #4a2fd0;
  --public-nav-bg: #0f0d15;
}

* { box-sizing: border-box; }

html { background: var(--public-bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--public-ink);
  background: var(--public-bg);
  font-family: "IBM Plex Sans", "Noto Sans SC", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
a { font: inherit; }

.public-topbar {
  position: relative;
  z-index: 20;
  width: 100%;
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--public-line);
  background: var(--public-surface);
}

.public-topbar .brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--public-ink);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.public-topbar .brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--public-accent);
  box-shadow: none;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.desktop-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav a {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  color: var(--public-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--public-accent-pressed);
  background: #f1efff;
}

.desktop-nav .topbar-cta {
  color: #fff;
  background: var(--public-nav-bg);
}

.desktop-nav .topbar-cta:hover {
  color: #fff;
  background: #282331;
}

.compact-nav { display: none; }

.mobile-menu { position: relative; }

.mobile-menu summary {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--public-ink);
  cursor: pointer;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:hover { background: #f1f0f6; }

.menu-glyph,
.menu-glyph::before,
.menu-glyph::after {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
}

.menu-glyph { position: relative; }
.menu-glyph::before,
.menu-glyph::after { content: ""; position: absolute; left: 0; }
.menu-glyph::before { top: -6px; }
.menu-glyph::after { top: 6px; }

.mobile-menu-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: 200px;
  padding: 8px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--public-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(32, 24, 74, 0.16);
}

.mobile-menu-panel a {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 9px;
  color: var(--public-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.mobile-menu-panel a:hover { color: var(--public-accent); background: #f3f1ff; }

.profile-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #d5d0e2;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #8c75ff, #4326d8);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
}

.public-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px 32px;
  border-top: 1px solid var(--public-line);
  color: var(--public-faint);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.public-footer nav {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.public-footer a { color: var(--public-muted); text-decoration: none; }
.public-footer a:hover { color: var(--public-accent); }

@media (max-width: 900px) {
  .public-topbar {
    height: 64px;
    padding: 0 24px;
  }

  .desktop-nav a:not(.topbar-cta) { display: none; }
}

@media (max-width: 640px) {
  .public-topbar {
    height: 60px;
    padding: 0 16px;
  }

  .desktop-nav { display: none; }

  .compact-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .public-footer { padding: 34px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
