/* ============================================================
 * 基础层：重置、排版、链接、可访问性
 * ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 157, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(94, 234, 212, 0.06), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: #a9b8ff;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: rgba(139, 157, 255, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #0b1020;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* 星空画布：固定铺满，永远在内容之下且不拦截交互 */
.stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

main,
.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

.wrap {
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
}

.muted {
  color: var(--text-dim);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  text-transform: uppercase;
}

/* 入场动画：默认可见（无 JS 也能读），JS 才把视口外的元素隐藏后再淡入 */
.reveal {
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.is-entering {
  opacity: 0;
  transform: translateY(16px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(var(--wrap), 100% - 32px);
  }
}
