/*
 * site.css — 你讲 SayIt 落地页样式
 * 所有颜色、字号、字重、间距、圆角、动效时长均来自 tokens.css（由 design/tokens.json 生成）：
 *   --ds-*            通用段（色彩、圆角、阴影、动效、字体、字阶、字重、字距、容器）
 *   --ds-dark-color-* 通用段深色的恒定别名，首屏与手机框用它在浅色模式下保持墨底
 *   --sayit-*         特有段（冒号几何、灯色、间距、尺寸、版面、按压缩放）
 * 本文件只负责布局与组件，不得出现手抄的 token 数值。
 * 例外（媒体查询不能引用变量）：断点数值写在注释里并标明对应 token；手机框尺寸是设备示意，非 token。
 */

/* ---------- 字体（Inter 可变字体自托管；CJK 走 --ds-font-sans 的系统字体栏，不加载网页字体） ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

/* ---------- 主题 ----------
 * tokens.css 已经把 --ds-color-* 的深浅两套挂在 :root / prefers-color-scheme: light /
 * [data-theme="light"] 上，本文件不再做映射。首屏（.hero）与手机框（.phone）把用到的
 * --ds-color-* 重新指向 --ds-dark-color-*，因此在任何主题下都是墨底（DESIGN_SYSTEM §1 第 6 条、§10）。
 */
.hero,
.phone {
  color-scheme: dark;
  --ds-color-bg: var(--ds-dark-color-bg);
  --ds-color-surface: var(--ds-dark-color-surface);
  --ds-color-fg: var(--ds-dark-color-fg);
  --ds-color-fg-muted: var(--ds-dark-color-fg-muted);
  --ds-color-accent: var(--ds-dark-color-accent);
  --ds-color-accent-hover: var(--ds-dark-color-accent-hover);
  --ds-color-accent-fg: var(--ds-dark-color-accent-fg);
  --ds-color-accent-soft: var(--ds-dark-color-accent-soft);
  --ds-color-border: var(--ds-dark-color-border);
  --ds-color-border-strong: var(--ds-dark-color-border-strong);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ds-color-bg);
  color: var(--ds-color-fg);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
  line-height: var(--ds-text-base--line-height);
  font-weight: var(--ds-weight-normal);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  padding: 0;
  list-style: none;
}

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

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

::selection {
  background: var(--ds-color-selection);
}

/* 焦点态：accent-soft 焦点环（§9） */
:focus-visible {
  outline: none;
  box-shadow: var(--ds-shadow-ring);
  border-radius: var(--ds-radius-sm);
}

.visually-hidden {
  position: absolute !important;
  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;
}

/* 容器：内容宽 --ds-container-content；侧边距 16 px，≥ 600 px 时 24 px（sayit.layout.page-gutter / wide-breakpoint） */
.container {
  width: 100%;
  max-width: var(--ds-container-content);
  margin-inline: auto;
  padding-inline: var(--sayit-layout-page-gutter);
}
@media (min-width: 600px) { /* = --sayit-layout-wide-breakpoint */
  .container {
    padding-inline: var(--sayit-layout-page-gutter-wide);
  }
}

/* ---------- 字标 ---------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--sayit-size-touch-target-min);
  font-family: var(--sayit-brand-wordmark-font);
  font-size: var(--ds-text-sm);
  line-height: var(--ds-text-sm--line-height);
  font-weight: var(--sayit-brand-wordmark-weight);
  color: var(--ds-color-fg);
  white-space: nowrap;
}
.wordmark-en {
  letter-spacing: var(--sayit-brand-wordmark-en-letter-spacing);
}

/* ---------- 品牌符号：冒号 ----------
 * 两个相同实心圆点竖排，d = 0.14em、圆心距 0.35em，下点落基线（§2、§4）。
 * 空的 inline-block 以底边对齐基线，因此下点天然落在基线上。
 */
.colon {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  width: var(--sayit-brand-colon-inline-dot-em);
  height: calc(var(--sayit-brand-colon-inline-center-distance-em) + var(--sayit-brand-colon-inline-dot-em));
}
.colon::before,
.colon::after {
  content: "";
  position: absolute;
  left: 0;
  width: var(--sayit-brand-colon-inline-dot-em);
  height: var(--sayit-brand-colon-inline-dot-em);
  border-radius: var(--ds-radius-full);
  background: var(--ds-color-accent);
}
.colon::before {
  top: 0;
}
.colon::after {
  bottom: 0;
}

/* ---------- 首屏 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ds-color-bg);
  color: var(--ds-color-fg);
}

.hero-top {
  display: flex;
  align-items: center;
  padding-block: var(--sayit-space-2);
}

.hero-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: var(--sayit-space-8);
}

.slogan {
  font-size: var(--ds-text-3xl);
  line-height: var(--ds-text-3xl--line-height);
  font-weight: var(--ds-weight-medium);
  letter-spacing: var(--ds-tracking-normal); /* 中文字距 0 */
  text-align: left;
  text-wrap: balance;
}
.slogan:lang(en) {
  letter-spacing: var(--ds-tracking-tight);
}
/* 冒号必须与最后一字同行（§9） */
.slogan-tail {
  white-space: nowrap;
}
/* 中文：最后一字与标志之间 0.1em；英文 0.06em */
.slogan:lang(zh) .colon {
  margin-left: var(--sayit-brand-colon-inline-leading-gap-zh-em);
}
.slogan:lang(en) .colon {
  margin-left: var(--sayit-brand-colon-inline-leading-gap-en-em);
}
@media (min-width: 64rem) { /* = ds.breakpoint.lg；桌面放大到 --ds-text-5xl */
  .slogan {
    font-size: var(--ds-text-5xl);
    line-height: var(--ds-text-5xl--line-height);
  }
}

.promise {
  margin-top: var(--sayit-space-5);
  max-width: var(--sayit-type-scale-reading-measure-em);
  font-size: var(--ds-text-base);
  line-height: var(--ds-text-base--line-height);
  font-weight: var(--ds-weight-normal);
  color: var(--ds-color-fg-muted);
}

.hero-actions {
  margin-top: var(--sayit-space-6);
}

/* ---------- 按钮 Button.primary ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sayit-size-button-height);
  padding-inline: var(--sayit-size-button-padding-x);
  border-radius: var(--ds-radius-full);
  background: var(--ds-color-accent);
  color: var(--ds-color-accent-fg);
  font-size: var(--ds-text-sm);
  line-height: var(--ds-text-sm--line-height);
  font-weight: var(--ds-weight-medium);
  white-space: nowrap;
  user-select: none;
  transition:
    transform var(--ds-duration-fast) var(--ds-ease-standard),
    background-color var(--ds-duration-base) var(--ds-ease-standard);
}
.button:hover {
  background: var(--ds-color-accent-hover);
}
.button:active {
  transform: scale(var(--sayit-motion-press-scale));
  transition-timing-function: var(--ds-ease-emphasized);
}
.button:focus-visible {
  border-radius: var(--ds-radius-full);
}

/* ---------- 第二节：三行事实 + 手机框 ---------- */
.facts {
  padding-block: var(--sayit-space-8);
  background: var(--ds-color-bg);
  color: var(--ds-color-fg);
}
.facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sayit-space-7);
  align-items: center;
}
@media (min-width: 64rem) { /* = ds.breakpoint.lg */
  .facts-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sayit-space-8);
  }
  .facts {
    padding-block: calc(var(--sayit-space-8) + var(--sayit-space-6));
  }
}

.fact-list {
  display: grid;
  gap: var(--sayit-space-5);
  max-width: var(--sayit-type-scale-reading-measure-em);
  font-size: var(--ds-text-base);
  line-height: var(--ds-text-base--line-height);
}

/* 手机框：永远墨色（见顶部主题块），框内只有 lamp.rest 灯色，静态，不呼吸、不随鼠标（§10）。
 * 宽度是设备示意，不是 token；外圆角 --ds-radius-2xl、内圆角 --ds-radius-xl。 */
.phone {
  justify-self: start;
  width: 216px; /* 示意尺寸，非 token */
  aspect-ratio: 9 / 19.5;
  padding: var(--sayit-space-2);
  border: var(--ds-border-hairline) solid var(--ds-color-border-strong);
  border-radius: var(--ds-radius-2xl);
  background: var(--ds-color-surface);
  box-shadow: var(--ds-shadow-md);
}
@media (min-width: 64rem) { /* = ds.breakpoint.lg */
  .phone {
    justify-self: end;
    width: 248px; /* 示意尺寸，非 token */
  }
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: var(--ds-radius-xl);
  background: var(--sayit-lamp-rest);
}

/* ---------- 下载锚点 ---------- */
.download {
  padding-block: var(--sayit-space-6) var(--sayit-space-8);
  scroll-margin-top: var(--sayit-space-6);
  background: var(--ds-color-bg);
}
.download-status {
  color: var(--ds-color-fg-muted);
  font-size: var(--ds-text-base);
  line-height: var(--ds-text-base--line-height);
}

/* ---------- 页脚 ---------- */
.footer {
  padding-block: var(--sayit-space-6) var(--sayit-space-7);
  border-top: var(--ds-border-hairline) solid var(--ds-color-border);
  background: var(--ds-color-bg);
  color: var(--ds-color-fg-muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sayit-space-4) var(--sayit-space-5);
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sayit-space-1);
  font-size: var(--ds-text-xs);
  line-height: var(--ds-text-xs--line-height);
  font-weight: var(--ds-weight-medium);
}
.lang-switch button {
  min-height: var(--sayit-size-touch-target-min);
  min-width: var(--sayit-size-touch-target-min);
  padding-inline: var(--sayit-space-2);
  color: var(--ds-color-fg-muted);
  border-radius: var(--ds-radius-sm);
  transition: color var(--ds-duration-fast) var(--ds-ease-standard);
}
.lang-switch button:hover {
  color: var(--ds-color-fg);
}
.lang-switch button[aria-pressed="true"] {
  color: var(--ds-color-fg);
  text-decoration: underline;
  text-decoration-color: var(--ds-color-accent);
  text-decoration-thickness: var(--sayit-size-focus-ring-width);
  text-underline-offset: var(--sayit-space-1);
}
.lang-switch .sep {
  color: var(--ds-color-fg-subtle);
}
.privacy {
  flex: 1 1 100%;
  max-width: var(--sayit-type-scale-reading-measure-em);
  font-size: var(--ds-text-xs);
  line-height: var(--ds-text-xs--line-height);
  font-weight: var(--ds-weight-normal);
  color: var(--ds-color-fg-muted);
}
@media (min-width: 64rem) { /* = ds.breakpoint.lg */
  .privacy {
    flex: 1 1 auto;
    order: 2;
    text-align: center;
  }
  .footer .wordmark {
    order: 3;
  }
}
.footer .wordmark {
  color: var(--ds-color-fg);
}

/* ---------- 动效 ----------
 * 整站唯一的位移动效是按钮按压缩放（--ds-duration-fast）。减弱动效时移除。
 */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .button:active {
    transform: none;
  }
}
