/* ==========================================================
   base.css — 设计变量 / 字体 / 通用组件
   改颜色、字号、间距优先改这里的变量
   ========================================================== */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("../assets/fonts/BigShouldersDisplay.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* 色彩 */
  --ink: #0a0a0b;
  --ink-2: #121214;
  --ink-3: #1a1a1d;
  --line: rgba(237, 235, 230, 0.1);
  --line-2: rgba(237, 235, 230, 0.22);
  --paper: #edebe6;
  --mute: #8d8a85;
  --dim: #55534f;
  --rec: #ff3b1f;

  /* 字体 */
  --f-display: "Big Shoulders Display", "PingFang SC", "Noto Sans SC", sans-serif;
  --f-cn: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* 字号 */
  --fs-mega: clamp(64px, 14vw, 220px);
  --fs-h1: clamp(40px, 7.2vw, 96px);
  --fs-h2: clamp(30px, 4.4vw, 56px);
  --fs-h3: clamp(20px, 2vw, 28px);
  --fs-body: clamp(15px, 1.1vw, 17px);
  --fs-meta: clamp(11px, 0.8vw, 12px);

  /* 布局 */
  --max: 1440px;
  --gutter: clamp(20px, 5vw, 80px);
  --section: clamp(96px, 12vw, 160px);
  --radius: 4px;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-cn);
  font-size: var(--fs-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; -webkit-touch-callout: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--rec); color: #fff; }

/* ---------- 通用工具 ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono {
  font-family: var(--f-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
}
.display { font-family: var(--f-display); font-weight: 900; letter-spacing: -0.01em; line-height: 0.86; text-transform: uppercase; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.rec { color: var(--rec); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* REC 指示灯 */
.rec-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 10px var(--rec);
  animation: rec-blink 1.6s steps(1) infinite;
  vertical-align: middle;
}
@keyframes rec-blink { 50% { opacity: 0.15; } }

/* 取景框角标：给容器加 .frame，内部放 <i class="corner tl"></i> 等 */
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--line-2); border-style: solid; border-width: 0; pointer-events: none; z-index: 3; }
.corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* 按钮 */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 26px;
  font-family: var(--f-cn); font-size: 15px; font-weight: 500; letter-spacing: 0.04em;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
  white-space: nowrap;
}
.btn .arrow { font-family: var(--f-mono); transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translate(3px, 0); }
.btn--solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--solid:hover { background: #fff; }
.btn--ghost:hover { border-color: var(--paper); }
.btn::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--rec);
  margin-right: -6px; opacity: 0; transform: scale(0);
  transition: all 0.4s var(--ease);
}
.btn:hover::before { opacity: 1; transform: scale(1); margin-right: 0; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 2px;
  white-space: nowrap;
}

/* 胶片颗粒 */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 100;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

/* 进入视口动画 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
