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

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

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 氛围层：暖光径向渐变 + 极细纸张颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(52rem 34rem at 8% -6%, var(--color-accent-soft), transparent 62%),
    radial-gradient(44rem 32rem at 96% 10%, rgba(154, 103, 0, 0.07), transparent 58%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="stage"]::before {
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(255, 92, 56, 0.18), transparent 60%),
    radial-gradient(50rem 36rem at 92% 100%, rgba(232, 176, 75, 0.12), transparent 58%);
}

body > * {
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

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

.is-hidden {
  display: none !important;
}

/* 编排入场序列 */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: riseIn 220ms var(--ease-out) both;
}
.reveal-1 { animation-delay: 0ms; }
.reveal-2 { animation-delay: 40ms; }
.reveal-3 { animation-delay: 80ms; }
.reveal-4 { animation-delay: 120ms; }

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