/* ============ Meta Ink — 一池墨 ============ */
@font-face {
  font-family: "GS Sans";
  src: url("/fonts/gs-sans-variable.woff2") format("woff2-variations"),
       url("/fonts/gs-sans-variable.woff2") format("woff2");
  font-weight: 250 700;
  font-style: normal;
  font-display: optional;
}

:root {
  --paper: #ece4d2;
  --paper-dim: rgba(236, 228, 210, 0.55);
  --ink-bg: #0b0a08;
  --seal: #a63a2e;
  --glow: rgba(216, 206, 186, 0.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink-bg);
  color: var(--paper);
  font-family: "GS Sans", "PingFang SC", "Heiti SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body { cursor: crosshair; }
@media (pointer: coarse) { body { cursor: default; } }

/* ---------- 层 1:墨境底图 ---------- */
#pixel-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 层 2:水面微光/暗角/颗粒 ---------- */
.water-sheen {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      178deg,
      transparent 0 14px,
      rgba(236, 228, 210, 0.028) 14px 15px,
      transparent 15px 34px
    );
  mask-image: linear-gradient(to top, black 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, black 30%, transparent 95%);
  animation: sheenDrift 14s linear infinite;
  will-change: background-position;
}
@keyframes sheenDrift {
  from { background-position: 0 0; }
  to { background-position: 240px 0; }
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, transparent 55%, rgba(5, 4, 3, 0.55) 100%),
    linear-gradient(to bottom, rgba(5, 4, 3, 0.35), transparent 22%, transparent 72%, rgba(5, 4, 3, 0.5));
}

.grain {
  position: fixed;
  inset: -20%;
  width: 140%;
  height: 140%;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.4s steps(2) infinite;
  will-change: transform;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1.2%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- 层 3:墨痕画布 ---------- */
#ink-live {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- 关于卡片 ---------- */
.about {
  position: fixed;
  top: 74px;
  left: 26px;
  z-index: 9;
  max-width: 300px;
  padding: 18px 20px;
  background: rgba(16, 14, 11, 0.82);
  border: 1px solid rgba(236, 228, 210, 0.14);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  animation: aboutIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes aboutIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.about__line { font-size: 14px; font-style: italic; color: var(--paper); margin-bottom: 10px; }
.about__mail { font-size: 14px; color: var(--paper-dim); text-decoration: none; border-bottom: 1px solid rgba(236, 228, 210, 0.3); }
.about__mail:hover { color: var(--paper); }
.about__fine { margin-top: 12px; font-size: 11px; color: rgba(236, 228, 210, 0.35); }

/* ---------- 主文案 ---------- */
.hero {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.hero__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#glyphs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}
.hero__tag {
  position: absolute;
  left: 8vw;
  /* 由 JS 按标题粒子实际底部写入 --tag-top,任何视口下都不与标题重叠 */
  top: var(--tag-top, 72vh);
  margin: 0;
  max-width: 34ch;
  font-size: clamp(15px, 1.55vw, 20px);
  line-height: 1.75;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
  min-height: 3.6em;
}
.hero__tag .caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: rgba(236, 228, 210, 0.6);
  animation: caretBlink 0.9s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* ---------- 底部 dock ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 26px 22px;
}
.hint {
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(236, 228, 210, 0.38);
}
.hint__item {
  color: inherit;
  text-decoration: none;
}
a.hint__item:hover,
a.hint__item:focus-visible {
  color: rgba(236, 228, 210, 0.7);
}
.hint b { font-weight: 400; color: rgba(236, 228, 210, 0.7); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .dock { padding: 14px 18px 18px; }
  .grain { display: none; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .water-sheen,
  .grain,
  .hero__tag .caret {
    animation: none !important;
  }
}
