/* ============================================================
   不破不立 · 落地页
   base.css — 设计令牌、重置、排版与基础组件
   视觉方向：纸感编辑排版 / 硬边框 / 无渐变 / 无玻璃拟态
   ============================================================ */

:root {
  /* 纸张与油墨 */
  --paper: #f0eadc;
  --paper-2: #e7dfcd;
  --paper-3: #dbd2bd;
  --paper-bright: #f8f4e9;
  --ink: #151410;
  --ink-2: #302d25;
  --muted: #6d6350;
  --line: rgba(21, 20, 16, 0.16);
  --line-strong: rgba(21, 20, 16, 0.42);

  /* 强调色，全部为纯色 */
  --red: #d5381f;
  --red-deep: #a92a16;
  --blue: #1d3a8f;
  --ochre: #d8a41d;

  /* 排版 */
  --font-sans:
    "HarmonyOS Sans SC", "Alibaba PuHuiTi 3.0", "Source Han Sans SC", "Noto Sans SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif:
    "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-mono:
    "JetBrains Mono", "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;

  /* 布局 */
  --shell-max: 1440px;
  --gutter: clamp(18px, 4.4vw, 64px);
  --header-h: 66px;
  --radius: 0px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.75, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 220ms;
  --med: 460ms;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: clip;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸张颗粒：由 main.js 生成并与画布纹理无关的静态噪点 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  background-image: var(--grain, none);
  background-size: 140px 140px;
  opacity: 0.34;
  mix-blend-mode: multiply;
}

::selection {
  background: var(--red);
  color: var(--paper-bright);
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

h1,
h2,
h3,
h4 {
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

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

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

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

code,
pre {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* ── 布局容器 ─────────────────────────────────────────────── */

.shell {
  width: min(var(--shell-max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* ── 通用文字 ─────────────────────────────────────────────── */

.display {
  font-size: clamp(38px, 6.4vw, 92px);
  /* 中文行高低于 1 会让上下行笔画相撞，这里收在 1.04 保持紧凑又不重叠 */
  line-height: 1.04;
  letter-spacing: -0.045em;
  /* 这些标题手动控制断行；balance 会把单行硬拆成三行，留下孤字 */
  text-wrap: wrap;
}

.display b {
  font-weight: 900;
  color: var(--red);
  /* 用下划线强调，避免任何渐变文字 */
  box-shadow: inset 0 -0.12em 0 var(--ink);
}

.index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.index::before {
  content: "";
  width: 26px;
  height: 6px;
  background: var(--red);
  display: inline-block;
}

.index--light {
  color: rgba(240, 234, 220, 0.62);
}

.index--light::before {
  background: var(--red);
}

.lede {
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.7;
  letter-spacing: -0.01em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  background: var(--paper-bright);
}

.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
}

.outline-light {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--paper);
  paint-order: stroke fill;
}

.link-underline {
  position: relative;
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--ink);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.link-underline:hover {
  color: var(--red);
  border-color: var(--red);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 500;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform var(--fast) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--red);
}

/* ── 按钮 ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 50px;
  padding: 14px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  background: transparent;
  transition:
    transform 320ms var(--ease),
    box-shadow 320ms var(--ease),
    background-color 200ms var(--ease),
    color 200ms var(--ease);
}

.btn-arrow {
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  transition: transform 320ms var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateY(3px);
}

.btn--solid {
  background: var(--red);
  color: var(--paper-bright);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn--solid:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
  background: var(--red-deep);
}

.btn--solid:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--lg {
  min-height: 60px;
  padding: 18px 30px;
  font-size: 16px;
  min-width: 260px;
}

.btn--sm {
  min-height: 38px;
  padding: 9px 16px;
  font-size: 13px;
  gap: 10px;
}

.btn--ghost {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13.5px;
  background: var(--paper-bright);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--ghost:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--paper);
}

.btn--ghost[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.btn--download {
  width: 100%;
  min-height: 64px;
  padding: 18px 24px;
  margin-top: 4px;
  background: var(--ink);
  color: var(--paper-bright);
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--red);
  font-size: 16px;
}

.btn--download:hover {
  transform: translate(-2px, -2px);
  box-shadow: 12px 12px 0 var(--red);
  background: var(--red);
}

.btn--download:active {
  transform: translate(4px, 4px);
  box-shadow: 3px 3px 0 var(--red);
}

.btn--download:focus-visible {
  outline-color: var(--paper);
}

/* ── 滚动条 ───────────────────────────────────────────────── */

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

::-webkit-scrollbar-track {
  background: var(--paper-2);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-2);
  border: 3px solid var(--paper-2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}
