/* ==========================================================================
   Moolei Studio — Design Tokens & Base Styles
   Minimal · Quiet · Personal · Independent · Editorial
   ========================================================================== */

:root {
  /* 颜色 — 黑白灰，极低饱和 */
  --bg: #fafafa;
  --bg-soft: #f4f4f3;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --border: #e6e6e4;
  --surface: #ffffff;

  /* 深色主题（用于 theme: dark 的项目） */
  --bg-dark: #111111;
  --text-dark: #eeeeee;
  --muted-dark: #9a9a9a;
  --border-dark: #2a2a2a;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 64px;
  --space-2xl: 96px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 12px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 布局 */
  --max-width: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.6;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* 通用容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ==========================================================================
   导航
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-nav__logo {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.site-nav__links {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

.site-nav__links a {
  font-size: 14px;
  color: var(--muted);
}

.site-nav__links a:hover {
  color: var(--text);
  opacity: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0 var(--space-lg);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-footer__brand {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: var(--space-lg);
}

.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  justify-content: space-between;
}

.site-footer__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__group a {
  font-size: 13px;
  color: var(--muted);
}

.site-footer__group a:hover {
  color: var(--text);
  opacity: 1;
}

.site-footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--faint);
}

.site-footer__bottom a {
  font-size: 12px;
  color: var(--faint);
}

.site-footer__bottom a:hover {
  color: var(--text);
  opacity: 1;
}

/* ==========================================================================
   通用排版
   ========================================================================== */
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  opacity: 0.7;
}

/* ==========================================================================
   滚动动画
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
