/* ==========================================================================
   Rafter — 公司主页
   极简黑白风格 · 纯手写 CSS，无任何依赖
   与 Kimi Chen / Rafter 两个个人主页共用同一套设计令牌（颜色/字体/圆角/缓动）
   目录：01 变量主题 / 02 基础重置 / 03 排版与工具 / 04 页头导航
        05 Hero / 06 通用区块 / 07 业务卡片 / 08 团队 / 09 时间线
        10 公司信息表 / 11 联系 / 12 页脚 / 13 动效 / 14 响应式
   ========================================================================== */

/* ---------- 01 变量主题 ---------- */
:root {
  --bg:            #fafafa;
  --bg-soft:       #f2f2f2;
  --bg-elev:       #ffffff;
  --fg:            #0a0a0a;
  --fg-soft:       #4a4a4a;
  --fg-mute:       #8a8a8a;
  --line:          #e2e2e2;
  --line-strong:   #0a0a0a;
  --accent:        #0a0a0a;
  --accent-fg:     #ffffff;
  --shadow:        0 1px 2px rgba(0, 0, 0, .05);

  --font-sans: "Inter", "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont,
               "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --wrap:     1080px;
  --radius:   2px;
  --dur:      .55s;
  --ease:     cubic-bezier(.16, .84, .44, 1);
}

html[data-theme="dark"] {
  --bg:          #0b0b0b;
  --bg-soft:     #141414;
  --bg-elev:     #121212;
  --fg:          #f5f5f5;
  --fg-soft:     #b4b4b4;
  --fg-mute:     #7a7a7a;
  --line:        #262626;
  --line-strong: #f5f5f5;
  --accent:      #f5f5f5;
  --accent-fg:   #0b0b0b;
  --shadow:      0 1px 2px rgba(0, 0, 0, .5);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s ease, color .3s ease;
}

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

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

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- 03 排版与工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 28px;
}

.muted { color: var(--fg-mute); }

code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1px 5px;
}

/* ---------- 04 页头导航 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--fg);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  transition: transform .3s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text { font-size: 15px; }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 6px 12px;
  font-size: 14.5px;
  color: var(--fg-soft);
  border-radius: var(--radius);
  transition: color .2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--fg); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .3s var(--ease);
}
.theme-toggle:hover { border-color: var(--fg); background: var(--bg-soft); }
.theme-toggle:active { transform: scale(.94); }

.theme-toggle-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
  transition: transform .5s var(--ease);
}
html[data-theme="dark"] .theme-toggle-icon { transform: rotate(180deg); }

.scroll-progress {
  height: 2px;
  width: 0;
  background: var(--fg);
  transition: width .1s linear;
}

/* ---------- 05 Hero ---------- */
.hero {
  padding-top: 168px;
  padding-bottom: 96px;
}

/* Hero 不在页面最上面时（上面还有愿景版块）—— 顶部留白收回来，它不再需要让开固定页头 */
.hero--after { padding-top: 84px; }
@media (max-width: 860px) {
  .hero--after { padding-top: 56px; }
}

.hero-eyebrow {
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5.4rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.035em;
}
.hero-title .line { display: block; }
.hero-title .line:first-child {
  font-size: .42em;
  font-weight: 400;
  color: var(--fg-mute);
  letter-spacing: .02em;
  margin-bottom: .35em;
}
.hero-name {
  background-image: linear-gradient(transparent 84%, var(--fg) 84%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 1.1s var(--ease) .2s;
}
.hero.is-ready .hero-name { background-size: 100% 100%; }

.hero-sub {
  margin: 30px 0 0;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  color: var(--fg);
  max-width: 32em;
}

.hero-note {
  margin: 18px 0 0;
  font-size: 1.02rem;
  color: var(--fg-soft);
  max-width: 36em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--accent); color: var(--accent-fg); }
.btn-solid:hover { background: transparent; color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--fg); background: var(--bg-soft); }

.hero-rule {
  margin-top: 72px;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease) .35s;
}
.hero.is-ready .hero-rule { transform: scaleX(1); }

/* ---------- 06 通用区块 ---------- */
.section { padding-block: 84px; scroll-margin-top: 88px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-mute);
  letter-spacing: .1em;
}
.section-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.02em;
}
.section-lead {
  margin: -28px 0 42px;
  font-size: 1.02rem;
  color: var(--fg-soft);
  max-width: 44em;
}

/* ---------- 07 业务卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card {
  position: relative;
  padding: 30px 26px 32px;
  background: var(--bg);
  transition: background-color .3s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.card:hover { background: var(--bg-soft); }
.card:hover::before { transform: scaleX(1); }

.card-icon { font-size: 24px; line-height: 1; margin-bottom: 16px; }
.card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.card-title .muted {
  font-size: .82em;
  font-weight: 400;
  letter-spacing: .01em;
}
.card-desc {
  margin: 0;
  font-size: 14.6px;
  line-height: 1.7;
  color: var(--fg-soft);
}

/* ---------- 08 团队 ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* 只有一位成员时收窄，避免单张卡被拉伸成整行宽 */
.team-grid--single { max-width: 620px; }

.member {
  position: relative;
  padding: 32px 28px 34px;
  background: var(--bg);
  transition: background-color .3s ease;
}
.member::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.member:hover { background: var(--bg-soft); }
.member:hover::before { transform: scaleX(1); }

.member-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--fg-mute);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }

.member-name {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.member-role {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.member-bio {
  margin: 0 0 18px;
  font-size: 14.8px;
  line-height: 1.75;
  color: var(--fg-soft);
}
.member-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13.5px;
}
.member-links a {
  border-bottom: 1px solid var(--line);
  transition: border-color .25s ease, color .25s ease;
}
.member-links a:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- 09 时间线 ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
}
.timeline-item {
  position: relative;
  padding: 0 0 38px 34px;
  border-left: 1px solid var(--line);
}
.timeline-item:last-child { padding-bottom: 4px; }
.timeline-dot {
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--fg);
  transition: background-color .25s ease, transform .25s var(--ease);
}
.timeline-item:hover .timeline-dot { background: var(--fg); transform: scale(1.25); }

.timeline-when {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.timeline-title {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.timeline-body p {
  margin: 0;
  font-size: 15px;
  color: var(--fg-soft);
  max-width: 48em;
}

/* ---------- 10 公司信息表 ---------- */
.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  max-width: 780px;
}
.fact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.fact-key {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding-top: 3px;
}
.fact-val { color: var(--fg); }
.fact-val .muted { font-size: 13.5px; }

/* ---------- 11 联系 ---------- */
.contact-lead {
  margin: 0 0 34px;
  font-size: 1.05rem;
  color: var(--fg-soft);
  max-width: 40em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.contact-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s ease, transform .3s var(--ease), background-color .25s ease;
}
a.contact-card:hover {
  border-color: var(--fg);
  transform: translateY(-3px);
  background: var(--bg-soft);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.contact-value {
  font-size: 1.02rem;
  font-weight: 500;
  word-break: break-all;
}
.contact-arrow {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 15px;
  color: var(--fg-mute);
  transition: transform .3s var(--ease), color .25s ease;
}
a.contact-card:hover .contact-arrow { transform: translate(3px, -3px); color: var(--fg); }
.contact-card-static { opacity: .92; }

.contact-email {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin-top: 14px;
  padding: 30px 34px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s ease, background-color .25s ease, transform .3s var(--ease);
}
.contact-email:hover {
  border-color: var(--fg);
  background: var(--bg-soft);
  transform: translateY(-3px);
}
.contact-email-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.contact-email-value {
  font-size: clamp(1.05rem, 3.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -.01em;
  word-break: break-all;
}
.contact-email-arrow {
  position: absolute;
  top: 28px;
  right: 32px;
  font-size: 17px;
  color: var(--fg-mute);
  transition: transform .3s var(--ease), color .25s ease;
}
.contact-email:hover .contact-email-arrow { transform: translate(3px, -3px); color: var(--fg); }

.contact-tip {
  margin: 22px 0 0;
  font-size: 13.5px;
  color: var(--fg-mute);
}

/* ---------- 愿景版块（名字的来历） ---------- */
.vision {
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
  padding-block: 76px;
  scroll-margin-top: 88px;
}
.vision-head { text-align: center; margin: 54px 0 46px; }
.vision-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.vision-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.8vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.02em;
}
.vision-plus { color: var(--fg-mute); font-weight: 400; padding-inline: 2px; }
.vision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 54px;
}
.vision-piece {
  margin: 0;
  padding: 28px 26px 30px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s ease, transform .3s var(--ease);
}
.vision-piece:hover { border-color: var(--fg); transform: translateY(-3px); }
.vision-part {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: .02em;
}
.vision-name { margin: 0 0 10px; font-size: 1.02rem; font-weight: 600; }
.vision-desc { margin: 0; font-size: 14.5px; line-height: 1.75; color: var(--fg-soft); }
/* slogan 是封面第一行：拆两行，字号排在方程之上 */
.vision-slogan {
  margin: 0;
  text-align: center;
  font-size: clamp(1.6rem, 5.2vw, 3rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .01em;
}
.vision-slogan .line { display: block; }

/* 英文副行：小号灰字，中英对照 */
.vision-slogan-en {
  margin: 26px 0 0;
  text-align: center;
  font-size: clamp(.82rem, 1.6vw, 1rem);
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--fg-mute);
}
/* 短分隔线在最下面，把封面和"名字的来历"分开 */
.vision-slogan-en::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin: 34px auto 0;
  background: var(--fg);
  opacity: .6;
}
@media (max-width: 860px) {
  .vision { padding-block: 58px; }
  .vision-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 40px; }
}
/* 愿景版块放在页面最上面时（首屏就是它）：顶部让开固定页头，并去掉上边线。
   这两条必须排在上面那条 media 之后 —— 否则会被 .vision 的 padding-block 盖掉。
   封面变成两行 + 英文副行后整体更高，所以顶部留白比原来收了一点。 */
.vision--lead { border-top: 0; padding-top: 124px; }
@media (max-width: 860px) {
  .vision--lead { padding-top: 92px; }
}

/* ---------- 12 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-block: 30px;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg-mute);
}
.footer-inner p { margin: 0; }
.footer-meta a { border-bottom: 1px solid var(--line); transition: border-color .25s ease, color .25s ease; }
.footer-meta a:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- 13 动效（滚动入场） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-name { background-size: 100% 100%; }
  .hero-rule { transform: scaleX(1); }
}

/* ---------- 14 响应式 ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .hero { padding-top: 132px; padding-bottom: 72px; }
  .section { padding-block: 62px; }
  .section-head { margin-bottom: 34px; }
  .section-lead { margin-top: -20px; margin-bottom: 32px; }
  .nav { display: none; }
  .header-inner { height: 58px; }
  html { scroll-padding-top: 76px; }
  .brand-text { display: none; }
  .contact-email { padding: 24px 22px; }
  .contact-email-arrow { top: 22px; right: 20px; }
  .fact-list li { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 460px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .card { padding: 26px 20px 28px; }
  .member { padding: 26px 20px 28px; }
}
