/* ============================================================
   Bonk — Base / Reset
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.75rem, 6.5vw, var(--text-8xl));
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: clamp(1.9rem, 4vw, var(--text-6xl));
  letter-spacing: var(--tracking-tighter);
}

h3 {
  font-size: var(--text-2xl);
}

p {
  line-height: var(--leading-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

code, kbd, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "calt" 1;
}

strong {
  font-weight: 600;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ---- Focus states (accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Selection ---- */
::selection {
  background: rgba(124, 58, 237, 0.18);
  color: var(--text-primary);
}

/* ---- Scrollbar (WebKit) ---- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* ---- Utility ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.gradient-text {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 真实应用图标（深色圆角方块）在浅色页面的呈现 */
.app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* 滚动入场动画初始态（main.js 中 IntersectionObserver 触发） */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
