/* ==========================================================================
   广东千策数字科技有限公司 — 单屏首页样式
   设计方向：企业图纸 / Blueprint Ledger
   深墨底 · 极细网格 · 等宽编号 · 朱砂点缀（仅装饰）
   页面构成：顶栏 + 首屏 + 页脚
   ========================================================================== */

/* ---------- 1. Design Tokens ------------------------------------------- */
:root {
  /* 底色层级：偏冷墨黑，避免纯黑 #000 的廉价感 */
  --bg:          #0e1215;
  --bg-alt:      #111619;

  /* 分隔线：极细、低对比，构成"图纸"的骨架 */
  --line:        #232b31;
  --line-soft:   #1c242b;

  /* 文字层级（对比度均已按 WCAG AA 核算） */
  --fg:          #e8ecef;   /* 15.4:1 */
  --fg-2:        #9aa5ae;   /*  7.6:1 */
  --fg-3:        #7d8791;   /*  5.2:1 */

  /* 朱砂：3.65:1，仅限图形/装饰；文字须用 --accent-text */
  --accent:      #b8492f;
  --accent-text: #d4715a;   /*  5.7:1 */

  --grid-line:   rgba(255, 255, 255, 0.030);
  --grid-cell:   76px;

  /* 排版 */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
               "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB",
               system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", Consolas,
               "Liberation Mono", Menlo, monospace;

  --lh-tight: 1.08;
  --lh-body:  1.85;

  /* 间距（4px 基准） */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s6: 24px;  --s8: 32px;  --s12: 48px; --s16: 64px;
  --header-h: 72px;
  /* 页脚实测高度约 152px；写成变量便于和首屏的 min-height 做减法 */
  --foot-h: 152px;
  --gutter: clamp(20px, 5vw, 56px);
  --wrap: 1240px;

  /* 缓动：统一用 ease-out-quart / expo，避免回弹 */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:  0.9s;

  color-scheme: dark;
}

/* ---------- 2. Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262f35; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #333d44; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 14px;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- 3. 顶栏 ----------------------------------------------------
   单屏页面不需要导航（没有可跳转的目标），顶栏只承担品牌署名，
   右侧用一行元信息平衡构图。
   ---------------------------------------------------------------------- */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease),
              border-color 0.4s var(--ease);
}
.site-head.is-stuck {
  background: rgba(14, 18, 21, 0.86);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
  height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: var(--s3); }
.brand .mark { width: 26px; height: 26px; flex: none; display: block; }
.brand .mark rect { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.brand .mark text { fill: var(--fg); }

.brand-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  padding-left: var(--s3);
  border-left: 1px solid var(--line);
  margin-left: var(--s1);
}

.head-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}

/* ---------- 4. Hero ---------------------------------------------------- */
.hero {
  position: relative;
  /* 撑满一屏：减去顶栏与页脚的实际高度，让「首屏 + 页脚」正好一屏，
    900px 高的笔记本上不需滚动即可看全。
    若窗口更矮，min-height 退让为内容自身高度，页面转为可滚动，不会挤坏版面。 */
  min-height: calc(100svh - var(--header-h) - var(--foot-h));
  display: flex;
  align-items: center;
  /* 上下留白取不同值：内容整体略高于几何中心，视觉上更稳
     （人对"居中"的感知位置比几何中心偏高约 3-5%） */
  padding-block: clamp(48px, 9vh, 104px) clamp(56px, 11vh, 124px);
  overflow: hidden;
}

/* 图纸网格 + 四周淡出 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-cell) var(--grid-cell);
  -webkit-mask-image: radial-gradient(120% 88% at 50% 34%, #000 12%, transparent 76%);
          mask-image: radial-gradient(120% 88% at 50% 34%, #000 12%, transparent 76%);
  pointer-events: none;
}
/* 极淡的朱砂氛围光。
   关键：半径必须让渐变在容器底边之前就衰减到 0，否则会在与页脚的交界处
   留下一条「暖色被切断」的横向缝（实测约 2% 色温差，肉眼可见）。 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 30% at 6% 70%, rgba(184, 73, 47, 0.11), transparent 72%);
  pointer-events: none;
}

.hero-frame {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* 四角定位标记——图纸语汇。四个角都画，才读得出"这里是取景框"；
   只画两个角会因为孤立而像渲染残留。 */
.hero-inner { position: relative; }
.hero-inner::before,
.hero-inner::after,
.hero-inner .tick {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero-inner::before { content: ""; top: -16px;    left: -16px;  border-right: 0; border-bottom: 0; }
.hero-inner::after  { content: ""; bottom: -16px; right: -16px; border-left: 0;  border-top: 0; }
.hero-inner .tick--tr { top: -16px;    right: -16px; border-left: 0;  border-bottom: 0; }
.hero-inner .tick--bl { bottom: -16px; left: -16px;  border-right: 0; border-top: 0; }

/* 公司名称 = 全页视觉重心。
   单屏页面下没有后续区块分流注意力，标题可以再放大一档，
   让"公司叫什么"成为唯一的信息焦点。 */
.hero-name { line-height: var(--lh-tight); }

.hero-name .l1 {
  display: block;
  font-size: clamp(3.4rem, 11.6vw, 8.2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-wrap: balance;
}
.hero-name .l2 {
  display: block;
  margin-top: clamp(10px, 1.4vw, 20px);
  font-size: clamp(1.1rem, 3.3vw, 2.35rem);
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  text-wrap: balance;
}

/* 量度尺：长细线 + 朱砂短段 */
.hero-scale {
  display: flex;
  align-items: center;
  gap: 0;
  margin: clamp(38px, 6vh, 66px) 0;
  max-width: 720px;
}
.hero-scale i { display: block; height: 1px; }
.hero-scale .seg-accent { width: 56px; background: var(--accent); }
.hero-scale .seg-line   { flex: 1; background: var(--line); }

.hero-lede {
  /* 用 em 控制行宽 = 控制每行中文字数（中文 1 字 = 1em）。
     不要用 ch：ch 取决于字体数字宽度，对中文误差很大。 */
  max-width: 36em;
  font-size: clamp(14px, 1.15vw, 16px);
  line-height: 1.95;
  color: var(--fg-2);
}

/* ---------- 5. 页脚 -----------------------------------------------------
   单屏页面下页脚不做成"页面底部通栏"，而是压成一条署名条，
   让「首屏 + 页脚」在 900px 高的笔记本上正好一屏装完，不需要滚动。
   ---------------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding-block: clamp(20px, 3vh, 30px);
  background: var(--bg-alt);
}
.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2) var(--s6);
}
.foot-name {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  font-weight: 400;
  letter-spacing: 0.1em;
}
.foot-en {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.foot-bot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s6);
  margin-top: clamp(14px, 2vh, 20px);
  padding-top: clamp(14px, 2vh, 20px);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}

/* ---------- 6. 滚动揭示动效 -------------------------------------------
   关键：默认状态是「可见」。只有 html 拿到 .anim 类（由 <head> 内联脚本在
   解析前加上）才进入隐藏待播状态。这样即使脚本加载失败或被拦截，
   内容也不会消失——对企业官网是必须的兜底。
   ---------------------------------------------------------------------- */
html.anim [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: var(--d, 0ms);
}
html.anim [data-reveal].is-in { opacity: 1; transform: none; }

html.anim .hero-name .l1,
html.anim .hero-name .l2 {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
html.anim.is-ready .hero-name .l1 { opacity: 1; transform: none; }
html.anim.is-ready .hero-name .l2 {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}

/* 首屏内其余元素按顺序错开出现，制造阅读节奏 */
.hero-scale { --d: 260ms; }
.hero-lede  { --d: 400ms; }

/* ---------- 7. 响应式 --------------------------------------------------
   断点取在 TALL 这一层：手机上「首屏 + 页脚」本来就超过一屏高度，
   若强行按 calc(100svh - ...) 压缩，会把内容挤到不可读。
   手机端改为按内容自然撑开，滚动一次即可，是合理取舍。
   ---------------------------------------------------------------------- */
@media (max-width: 680px) {
  :root {
    --lh-body: 1.8;
    --grid-cell: 54px;
    --grid-line: rgba(255, 255, 255, 0.026);
    --header-h: 64px;
    --foot-h: 200px;
  }
  /* 390px 宽度下「印章标记 + 品牌名 + 右侧元信息」放不下：
     收起品牌文字与元信息，只留印章标记（公司名在首屏已完整呈现） */
  .brand-sub,
  .brand-name,
  .head-meta { display: none; }
  .hero {
    min-height: auto;
    padding-block: clamp(32px, 6vh, 56px);
  }
  .hero-inner::before, .hero-inner::after, .hero-inner .tick { display: none; }
}

/* ---------- 8. 无障碍：尊重减弱动效偏好 ------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  html.anim [data-reveal],
  html.anim .hero-name .l1,
  html.anim .hero-name .l2 { opacity: 1; transform: none; }
}

/* ---------- 9. 打印 -----------------------------------------------
   两个必须处理的问题：
   1) 打印时没有滚动，处于"待揭示"状态的元素会印成空白 → 强制落到终态；
   2) 深色背景默认不被打印，但浅色文字会 → 必须整套翻成浅色主题，
      否则得到的是白纸上的白字。
   ------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #ffffff;      --bg-alt: #ffffff;
    --line: #c6ccd1;    --line-soft: #e0e5e9;
    --fg: #14181b;      --fg-2: #3c444a;      --fg-3: #616a71;
    --accent: #8c3722;  --accent-text: #8c3722;
    --grid-line: transparent;
  }
  html.anim [data-reveal],
  html.anim .hero-name .l1,
  html.anim .hero-name .l2 { opacity: 1 !important; transform: none !important; }

  .site-head { position: static; }
  .site-head.is-stuck { background: none; backdrop-filter: none; border-bottom-color: var(--line-soft); }
  .hero { min-height: auto; padding-block: 20px; }
  .hero::before, .hero::after { display: none; }
  .hero-inner::before, .hero-inner::after, .tick { display: none; }
}
