/* ==========================================================================
   云间AI · 基础重置、深空渐变底图、动态流光层、排版规范与无障碍降级
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #06080d;
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  letter-spacing: 0.015em;
  overflow-x: clip;
  position: relative;
}

/* 全屏 60fps 动态流光流体 + 深空点阵星尘画布 */
.ambient-fluid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main,
footer {
  position: relative;
  z-index: 2;
}

header {
  z-index: 90;
}

/* 浏览器原生表层定制：选区、滚动条 */
::selection {
  background-color: rgba(217, 119, 87, 0.34);
  color: var(--ink-primary);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #06080d;
}

::-webkit-scrollbar-thumb {
  background: #232a38;
  border-radius: 999px;
  border: 2px solid #06080d;
}

::-webkit-scrollbar-thumb:hover {
  background: #384359;
}

/* 标题与正文基线 */
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink-primary);
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}

h3,
h4 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  color: var(--ink-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* 键盘焦点可见性（柔和无违和双环，不破坏胶囊与绿色按钮圆角） */
:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #06080d,
    0 0 0 4px rgba(244, 241, 234, 0.42);
}

/* 跳过导航辅助链接 */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: #0b0d10;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-expo);
}

.skip-link:focus {
  top: 16px;
}

/* 版心容器 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 滚动显露状态 */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 600ms var(--ease-expo),
    transform 600ms var(--ease-expo);
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js-ready [data-reveal="delay-1"] { transition-delay: 80ms; }
.js-ready [data-reveal="delay-2"] { transition-delay: 160ms; }
.js-ready [data-reveal="delay-3"] { transition-delay: 240ms; }

/* 完整降级动效支持 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
