/* ============================================================
   DSS · NIR — 光谱 · 可信感知
   单页静态站点样式（无构建 / 无外部字体）
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --bg-0: #05070d;
  --bg-1: #0a1220;
  --ink: #e9f0fa;
  --muted: #93a3bb;
  --dim: #56637a;
  --line: rgba(130, 180, 255, .16);
  --cyan: #5ad7ff;
  --blue: #3b82f6;
  --amber: #ffc46b;
  --radius: 14px;

  --font-sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --pad: 40px;
  --wrap: 1180px;
  --nav-h: 64px;
}

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

html {
  background: var(--bg-0);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3, p { margin: 0; }

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- 2. 首屏 Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg-0);
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity .6s ease;
}

/* 两段视频（task-8）：开场播一次后淡出，粒子循环淡入并常驻循环。
   ambient 始终在 intro 之上，初始透明；播成功后才 is-active 淡入。 */
.hero-video--ambient {
  z-index: 1;
  opacity: 0;
}

.hero-video--ambient.is-active { opacity: 1; }

.hero-video--intro.is-hidden { opacity: 0; }

/* 顶部渐隐遮罩（task-7）：压在 video 之上、顶栏内容之下（z-index 2），
   把视频自带的角标（左上 19 TARGETS · 11 USABLE / 右上 v0.1 · PYGAME）压掉，
   避免从固定顶栏后透出与品牌/导航叠字；132px 以下全透，不影响光谱/粒子主体。 */
.hero-topscrim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 132px;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(5, 7, 13, .97) 0,
      rgba(5, 7, 13, .92) 48px,
      rgba(5, 7, 13, .55) 96px,
      rgba(5, 7, 13, 0) 132px);
}

/* ---------- 3. 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--nav-h);
  padding-inline: var(--pad);
  background: linear-gradient(180deg, rgba(5, 7, 13, .82), rgba(5, 7, 13, 0));
}

.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-item {
  position: relative;
  padding: 4px 2px;
  font-size: 14px;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item.is-on {
  color: var(--ink);
  border-bottom: 1px solid var(--cyan);
}

.nav-item.is-on:hover { color: var(--cyan); }

.nav-item.is-off {
  color: var(--dim);
  cursor: not-allowed;
}

/* 桌面/平板：每项头顶一个「即将上线」黄标太吵 → 默认隐藏，hover / focus 才显示。
   标签 right:0 与项右缘对齐，不会越出视口；移动端菜单内标签保持可见（见 §11）。 */
.nav-item .tag {
  opacity: 0;
  transition: opacity .15s ease;
}

.nav-item:hover .tag,
.nav-item:focus-visible .tag,
.nav-item:focus-within .tag {
  opacity: 1;
}

/* 触屏（无 hover 能力）设备：hover 永不发生，直接常显「即将上线」标签 */
@media (hover: none) {
  .nav-item .tag { opacity: 1; }
}

.tag {
  position: absolute;
  top: -12px;
  right: 0;
  padding: 0 3px;
  border: 1px solid rgba(255, 196, 107, .42);
  border-radius: 4px;
  background: rgba(5, 7, 13, .7);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .04em;
  white-space: nowrap;
}

.topbar-actions {
  display: none;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 18, 32, .5);
  cursor: pointer;
}

.menu-bar {
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--muted);
  transition: transform .15s ease, opacity .15s ease;
}

.menu-btn[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* 移动端菜单面板 */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 49;
  padding: 4px 20px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, .97);
  backdrop-filter: blur(10px);
}

.mobile-menu[hidden] { display: none; }

.mobile-nav { display: flex; flex-direction: column; }

.mnav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  text-decoration: none;
}

.mnav-item:last-child { border-bottom: 0; }
.mnav-item.is-on { color: var(--ink); }
.mnav-item.is-on:hover { color: var(--cyan); }
.mnav-item.is-off { color: var(--dim); cursor: not-allowed; }
.mobile-menu .tag { position: static; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(90, 215, 255, .85);
  flex: none;
}

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.btn-primary {
  border-color: rgba(90, 215, 255, .55);
  background: rgba(90, 215, 255, .10);
  color: var(--cyan);
}

.btn-primary:hover {
  background: rgba(90, 215, 255, .22);
  box-shadow: 0 0 24px rgba(90, 215, 255, .25);
}

.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
}

.btn-outline {
  min-height: 40px;
  padding: 0 20px;
  border-color: rgba(90, 215, 255, .5);
  background: rgba(90, 215, 255, .06);
  color: var(--cyan);
  font-size: 13px;
}

.btn-outline:hover {
  background: rgba(90, 215, 255, .16);
  box-shadow: 0 0 18px rgba(90, 215, 255, .2);
}

/* 不可点状态（卡片 6「即将开放」）：去掉强调色与 hover 反馈，保留键盘不可达（span，无 href） */
.btn-outline[aria-disabled="true"],
.btn-outline[aria-disabled="true"]:hover {
  border-color: rgba(130, 180, 255, .16);
  background: transparent;
  color: var(--dim);
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- 5. 视频无法自动播放时的兜底按钮 ---------- */
.play-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(90, 215, 255, .55);
  border-radius: 999px;
  background: rgba(5, 7, 13, .66);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background-color .15s ease, box-shadow .15s ease;
}

.play-fallback[hidden] { display: none; }

.play-fallback:hover {
  background: rgba(90, 215, 255, .18);
  box-shadow: 0 0 24px rgba(90, 215, 255, .25);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

/* ---------- 6. 下载区 ---------- */
.download {
  position: relative;
  padding: 88px 0 96px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  /* 锚点跳转时区块顶对齐视口顶，避免 hero 底部数字条从固定顶栏后露出；
     顶栏覆盖的 64px 由 padding-top（桌面 88 / 移动 84）让出 */
  scroll-margin-top: 0;
  overflow: hidden;
}

.download::before {
  content: "";
  position: absolute;
  top: -18%;
  left: -12%;
  width: 62%;
  height: 72%;
  background: radial-gradient(closest-side, rgba(59, 130, 246, .10), rgba(59, 130, 246, 0) 72%);
  pointer-events: none;
}

.download .wrap { position: relative; }

.section-title {
  margin: 12px 0 12px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.section-lede {
  max-width: 680px;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 18, 32, .55);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  border-color: rgba(90, 215, 255, .45);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}

.card-file {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}

.card-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 14px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid rgba(90, 215, 255, .32);
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}

.text-link:hover {
  border-bottom-color: var(--cyan);
  color: #9de8ff;
}

.note {
  max-width: 780px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ---------- 7. Footer ---------- */
.footer {
  padding: 44px 0 56px;
  border-top: 1px solid var(--line);
  background: var(--bg-0);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 760px;
}

.footer-title {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.footer-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .04em;
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}

.to-top:hover {
  border-color: rgba(90, 215, 255, .45);
  color: var(--cyan);
}

/* ---------- 8. 平板 760–1080px ---------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 9. 移动 <760px ---------- */
@media (max-width: 760px) {
  :root { --pad: 20px; }

  .nav { display: none; }
  .topbar-actions { display: flex; }
  .play-fallback {
    top: 50%;
    font-size: 12px;
  }

  /* 84px = 固定顶栏 64px + 20px 呼吸位：scroll-margin-top:0 后锚点内容不被顶栏遮住 */
  .download { padding: 84px 0 72px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .section-lede { margin-bottom: 28px; }
  .card { padding: 20px; }
  .card-actions { gap: 4px 18px; }
  .text-link { min-height: 44px; }
  .btn-outline { min-height: 44px; }
  .to-top { min-height: 44px; }

  .footer-inner { flex-direction: column; }
}

/* ---------- 10. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
