/* ============================================================
   WEHOMOSAPIENS — 洞穴即星空
   原始（洞壁 / 火 / 骨 / 颜料） × 未来（星空 / 细线 / 辉光）
   ============================================================ */

:root {
  --bg: #0d0c0a;                  /* 洞壁 / 深空 */
  --bg-soft: #161411;             /* 稍亮的岩面 */
  --bone: #e9e3d7;                /* 骨白，主文字 */
  --bone-dim: rgba(233, 227, 215, 0.55);
  --accent: #47B5B8;              /* 主色：青碧 */
  --accent-2: #B69B9B;            /* 副色：灰紫，可按需调整 */
  --star: #9ecfe0;                /* 星光 */
  --line: rgba(233, 227, 215, 0.16);   /* 发丝分割线 */

  /* 昼（第二屏） */
  --day: #e7e7e3;                 /* 岩石的灰白色，昼屏底色 */
  --day-soft: #d9d9d3;            /* 昼屏稍深的岩面 */
  --ink2: #1c1712;                /* 昼屏主文字 */
  --ink-dim: rgba(28, 23, 18, 0.6);
  --day-line: rgba(28, 23, 18, 0.18);

  /* 全站衬线：Spectral（英，OFL）+ Noto Serif SC（中，OFL，均可免费商用） */
  --font-display: "Spectral", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-mono: "Spectral", "Noto Serif SC", "Songti SC", "STSong", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font-display);
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

/* ── 导航 ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 12, 10, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(-100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.4s;
}
body.is-loaded .nav { transform: translateY(0); }

.nav__logo {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--bone);
  text-decoration: none;
}

.nav__links { display: flex; gap: 1.75rem; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.nav__links a:hover { color: var(--accent); border-color: var(--accent); }

/* ── 第一屏 Hero ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 0 2rem;
  overflow: hidden;
}

.hero__frame {
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.hero__subtitle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease 0.2s, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}
/* 标语前的火种小方块 */
.hero__subtitle::before {
  content: "";
  width: 0.8em;
  height: 0.8em;
  flex: none;
  background: var(--accent);
}
body.is-loaded .hero__subtitle { opacity: 1; transform: none; }

.hero__title {
  font-size: clamp(2.6rem, 10.5vw, 9.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* 标题按行渲染 */
.hero__title-line {
  display: block;
  width: fit-content;
}

/* 第一行："选中反色"高亮，像被鼠标框选的文字 */
.hero__title-line--hl {
  background: var(--accent);
  color: var(--bg);
  padding: 0 0.14em;
}

/* 每个字母单独包裹，做逐字入场 */
.hero__title .char {
  display: inline-block;
  overflow: hidden;
}
.hero__title .char > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
body.is-loaded .hero__title .char > span { transform: translateY(0); }

.hero__rule {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 2rem 0 1.5rem;
  width: 0;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1) 1.1s;
}
body.is-loaded .hero__rule { width: min(38rem, 60%); }

.hero__tagline {
  display: inline-block;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  padding-bottom: 0.55rem;
  /* 手绘感赭石划线 */
  /* background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Cpath d='M2 6 C 25 1, 45 9, 62 5 S 100 2, 118 6' fill='none' stroke='%2347B5B8' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% 0.5rem; */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s ease 1.3s, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.3s;
}
body.is-loaded .hero__tagline { opacity: 1; transform: none; }

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--bone-dim);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.9s ease 1.8s, color 0.15s;
}
.hero__scroll-hint:hover { color: var(--bone); }
body.is-loaded .hero__scroll-hint {
  opacity: 1;
  animation: hint-bob 2.4s ease-in-out 2.6s infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ── 星空底层：随机星点，明灭闪烁 ───────────────────── */
.hero__stars {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__stars span {
  position: absolute;
  border-radius: 50%;
  background: var(--bone);
  opacity: 0.5;
  animation: twinkle var(--tw, 3s) ease-in-out var(--td, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.9; }
}

/* ── 星座 / 星轨（原始导航术 × 太空时代） ────────────── */
.hero__sky {
  position: absolute;
  right: clamp(1rem, 5vw, 5rem);
  top: 50%;
  margin-top: -17rem;
  z-index: 0;
  width: 34rem;
  height: 34rem;
}

/* 连线：加载后逐段描绘出来 */
.sky__line {
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0.9s);
}
body.is-loaded .sky__line { stroke-dashoffset: 0; }

.sky__line { stroke: var(--bone); stroke-width: 0.75; opacity: 0.3; }

.sky__star {
  fill: var(--bone);
  opacity: 0;
  transition: opacity 0.6s ease var(--d, 1.4s);
}
body.is-loaded .sky__star { opacity: 1; }

/* Alcyone：昴星团最亮星，主色实心 + 明灭的硬边光环 */
.sky__ember {
  fill: var(--accent);
  opacity: 0;
  transition: opacity 0.8s ease 1.5s;
}
body.is-loaded .sky__ember { opacity: 1; }

.sky__ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  opacity: 0;
  transition: opacity 0.8s ease 1.7s;
  animation: ring-pulse 4.5s ease-in-out 2.6s infinite;
}
body.is-loaded .sky__ring { opacity: 1; }
@keyframes ring-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}

/* ── 光标跟随点：页面感知你的存在 ───────────────────── */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  /* 硬边圆环，无模糊光晕 */
  box-shadow: 0 0 0 3px rgba(71, 181, 184, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, scale 0.25s ease;
}
.cursor.is-active { opacity: 1; }
.cursor.is-hover { scale: 2.4; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ── 第二屏 业务与产品：洞穴之外的白昼 ──────────────── */
/* 夜里的星，在昼屏对应岩面上的凿刻凹点；顶部的深色剪影
   是洞口上沿——下滑一次，如同走出洞穴、走进天光 */
.products {
  position: relative;
  min-height: 100vh;
  padding: 72px clamp(0rem, 7vw, 8rem) 0;
  color: var(--ink2);
  background-color: var(--day);
  background-image:
    radial-gradient(1.5px 1.5px at 6% 10%, rgba(28, 23, 18, 0.3), transparent),
    radial-gradient(1px 1px at 14% 22%, rgba(28, 23, 18, 0.25), transparent),
    radial-gradient(1px 1px at 21% 8%, rgba(182, 155, 155, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 30% 18%, rgba(28, 23, 18, 0.22), transparent),
    radial-gradient(1px 1px at 38% 42%, rgba(71, 181, 184, 0.45), transparent),
    radial-gradient(1px 1px at 47% 12%, rgba(28, 23, 18, 0.28), transparent),
    radial-gradient(1.5px 1.5px at 55% 26%, rgba(28, 23, 18, 0.2), transparent),
    radial-gradient(1px 1px at 63% 55%, rgba(182, 155, 155, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 71% 9%, rgba(28, 23, 18, 0.3), transparent),
    radial-gradient(1px 1px at 79% 34%, rgba(28, 23, 18, 0.22), transparent),
    radial-gradient(1px 1px at 86% 16%, rgba(71, 181, 184, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 93% 44%, rgba(28, 23, 18, 0.25), transparent),
    radial-gradient(1px 1px at 50% 82%, rgba(28, 23, 18, 0.18), transparent),
    radial-gradient(1px 1px at 88% 80%, rgba(28, 23, 18, 0.2), transparent),
    linear-gradient(180deg, #f4f4f1 0%, var(--day) 300px, #dcdcd6 100%);
}

/* 洞口上沿：深色钟乳石剪影，硬边，衔接第一屏的夜 */
.products::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='60' viewBox='0 0 240 60'%3E%3Cpolygon points='0,0 240,0 240,14 214,30 196,8 168,48 148,12 118,36 92,6 64,56 40,14 16,40 0,20' fill='%230d0c0a'/%3E%3C/svg%3E") repeat-x left top / 240px 60px;
}

.products__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  border-bottom: 1px solid var(--day-line);
}

.products__title {
  flex: 1;
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink2);
}

.products__count {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

/* ── 业务 Tab：物理开关，未选中凸起、选中按下 ───────── */
.biz-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--day-line);
}

.biz-tab {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--day-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-dim);
  cursor: pointer;
  /* 凸起：顶边受光 + 右下硬影 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              2px 2px 0 rgba(28, 23, 18, 0.14);
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.biz-tab:hover {
  border-color: var(--ink2);
  color: var(--ink2);
}

/* 选中 = 按下：内凹阴影，位移一格 */
.biz-tab.is-active {
  background: var(--ink2);
  border-color: var(--ink2);
  color: var(--day);
  transform: translate(1px, 1px);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.45);
}

.biz-tab__code {
  font-size: 0.72em;
  letter-spacing: 0.1em;
  margin-right: 0.6em;
  opacity: 0.65;
}

/* 当前业务的描述，安静地在 Tab 栏右侧 */
.biz-tabs__desc {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-dim);
}

.products__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem;
}

/* ── 产品线分栏：等宽竖排，体现平级 ────────────────── */
.business__lines {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.line:not(:last-child) {
  border-right: 1px solid var(--day-line);
}

.line__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--day-line);
  background: var(--day-soft);
}

.line__name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

/* 产品线星点标记：主色 / 副色 / 墨轮换 */
.line__chip {
  width: 0.7em;
  height: 0.7em;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--day-line);   /* 保证在任何底色上都可见 */
}

.line__description {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-dim);
  flex: 1;
}

.line__count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

/* 滚动入场 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease, box-shadow 0.25s ease;
}

/* ── 产品条目：凸起的石板 ─────────────────────────── */
.product {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--day-line);
  border-radius: 6px;
  color: var(--ink2);
  /* 石面纹理 + 顶边受光、右下浅影：像一块凸起的石板 */
  background-color: rgba(255, 255, 255, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85),
              2px 2px 0 rgba(28, 23, 18, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
              background-color 0.25s ease, transform 0.25s ease;
}

/* 悬停：石板被掀起，影子加深 */
.product:hover {
  background-color: rgba(255, 255, 255, 0.92);
  border-color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              5px 5px 0 rgba(28, 23, 18, 0.22);
  transform: translate(-2px, -3px);
}

.product__head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product__icon {
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  border: 1px solid var(--day-line);
  border-radius: 50%;            /* 圆形：星球意象 */
  object-fit: cover;
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* 无图标时的首字母占位 */
.product__icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink2);
  color: var(--accent);
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
}

.product:hover .product__icon {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(182, 155, 155, 0.4);
}

.product__name {
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.product__description {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--ink-dim);
}

.product__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 1rem;
  border: 1px solid var(--day-line);
  border-radius: 4px;            /* 小圆角矩形 */
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink2);
  text-decoration: none;
  /* 常态存在的硬边投影 */
  box-shadow: 2px 2px 0 rgba(28, 23, 18, 0.14);
  transition: border-color 0.2s, background 0.15s, color 0.15s,
              box-shadow 0.15s, transform 0.15s;
}

.product__link:hover {
  background: var(--ink2);
  border-color: var(--ink2);
  color: var(--day);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(28, 23, 18, 0.2);
}

/* ── 页脚 ──────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  background: #080706;
  padding: 3rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.footer__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.footer__email {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 900;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.footer__email:hover { border-color: var(--accent); color: var(--accent); }

.footer__copyright {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
}

/* ── 响应式 ────────────────────────────────────────── */
@media (max-width: 720px) {
  .products { padding-left: 0; padding-right: 0; }
  .business__lines {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
  .line:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--day-line);
  }
  .hero__sky {
    scale: 0.55;
    transform-origin: right center;
  }
  .nav { padding: 0.85rem 1.25rem; }
  .hero, .products__header, .product, .footer,
  .line__header, .biz-tabs { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ── 尊重减少动效偏好 ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
}
