/* ==========================================================
   Rainy · 个人学习分享与学习成果展示
   主色取自定义标志的蓝色 #00A8F8
   ========================================================== */

:root{
  --bg:        #f8f7f4;
  --surface:   #ffffff;
  --ink:       #14171c;
  --ink-2:     #414852;
  --muted:     #79808b;
  --line:      #e6e2da;
  --line-2:    #d6d1c7;
  --brand:     #00a8f8;
  --brand-deep:#0a6ea8;
  --brand-tint:#eaf6fe;

  --wrap: 1120px;
  --radius: 14px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
}

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

html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0; }
h1, h2, h3{ margin: 0; font-weight: 600; letter-spacing: -.01em; }

.wrap{
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- 顶部导航 ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 247, 244, .78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}

.site-header.scrolled{
  border-bottom-color: var(--line);
  background: rgba(248, 247, 244, .92);
}

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

.brand{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: opacity .2s ease;
}

.brand:hover{ opacity: .7; }

.brand-mark{
  width: 39px;
  height: 28px;
  object-fit: contain;
}

.brand-name{
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: .01em;
  color: var(--ink);
}

.nav{
  display: flex;
  gap: 30px;
}

.nav a{
  position: relative;
  font-size: 14px;
  color: var(--ink-2);
  padding: 4px 0;
  transition: color .2s ease;
}

.nav a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.nav a:hover{ color: var(--ink); }
.nav a:hover::after{ transform: scaleX(1); }

/* ---------- 首屏 ---------- */

.hero{
  position: relative;
  overflow: hidden;
  padding: 84px 0 96px;
}

.hero::before{
  /* 标志放大后作为极淡的背景装饰 */
  content: "";
  position: absolute;
  right: -20px;
  top: 26px;
  width: 560px;
  height: 398px;
  background: url("../img/logo.svg") no-repeat center / contain;
  opacity: .07;
  pointer-events: none;
}

.hero::after{
  content: "";
  position: absolute;
  right: 6%;
  top: 6%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 168, 248, .10), rgba(0, 168, 248, 0) 62%);
  pointer-events: none;
}

.hero .wrap{ position: relative; z-index: 1; }

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 26px;
}

.eyebrow::before{
  content: "";
  width: 26px;
  height: 1px;
  background: var(--brand);
}

.hero h1{
  font-family: var(--font-serif);
  font-size: clamp(58px, 9.5vw, 108px);
  line-height: .92;
  letter-spacing: -.03em;
  color: var(--ink);
}

.hero-lead{
  max-width: 690px;
  margin-top: 30px;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.75;
  color: var(--ink-2);
  letter-spacing: .005em;
}

.hero-sub{
  max-width: 660px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

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

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 14.5px;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn-solid{
  background: var(--ink);
  color: #fff;
}

.btn-solid:hover{
  background: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 110, 168, .22);
}

.btn-line{
  border-color: var(--line-2);
  color: var(--ink-2);
  background: transparent;
}

.btn-line:hover{
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.stats{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 76px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.stats li{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats b{
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  font-feature-settings: "tnum";
}

.stats span{
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- 通用区块 ---------- */

.section{
  padding: 92px 0;
}

.section-line{
  border-top: 1px solid var(--line);
}

.label{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 20px;
}

.label i{
  font-style: normal;
  font-family: var(--font-serif);
  color: var(--brand);
  letter-spacing: .06em;
}

.split{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  align-items: start;
}

.split .label{
  margin-top: 6px;
  margin-bottom: 0;
}

.split-body h2{
  font-size: clamp(24px, 3.2vw, 33px);
  line-height: 1.35;
  margin-bottom: 20px;
}

.split-body p{
  max-width: 660px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

.split-body p + p{ margin-top: 16px; }

.section-head{ margin-bottom: 44px; }

.section-head h2{
  font-size: clamp(24px, 3.2vw, 33px);
  line-height: 1.35;
}

.section-desc{
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- 项目卡片 ---------- */

.works{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.work{
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1),
              border-color .35s ease,
              box-shadow .35s ease;
}

.work::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.work:hover{
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 14px 34px -18px rgba(20, 23, 28, .28);
}

.work:hover::before{ transform: scaleX(1); }

.work-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-index{
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--muted);
  transition: color .3s ease;
}

.work:hover .work-index{ color: var(--brand); }

.work-state{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--muted);
}

.work-state::before{
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-2);
}

.work-state.is-live{ color: var(--brand-deep); }
.work-state.is-live::before{ background: var(--brand); }

.work h3{
  margin-top: 16px;
  font-size: 18.5px;
  line-height: 1.45;
}

.work p{
  margin-top: 11px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.work-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .03em;
}

.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
}

.tags li{
  font-size: 11.5px;
  letter-spacing: .03em;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 4px;
}

/* 首个项目：横向大卡 */

.work-featured{
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 44px;
  align-items: center;
  padding: 38px 36px;
}

.work-featured h3{
  font-size: clamp(20px, 2.4vw, 25px);
  margin-top: 18px;
}

.work-featured p{
  font-size: 14.5px;
  max-width: 520px;
}

.work-visual svg{
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* ---------- 能力方向 ---------- */

.focus-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.focus-item{
  background: var(--surface);
  padding: 26px 24px;
  transition: background .3s ease;
}

.focus-item:hover{ background: #fcfcfa; }

.focus-item h3{
  font-size: 15px;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-item h3::before{
  content: "";
  width: 4px;
  height: 4px;
  background: var(--brand);
  border-radius: 50%;
  flex: none;
}

.focus-item p{
  margin-top: 8px;
  padding-left: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */

.site-footer{
  background: #11151a;
  color: #a3aab4;
  padding: 56px 0 40px;
  margin-top: 20px;
}

.footer-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.footer-brand{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: #f2f4f6;
}

.footer-brand img{ opacity: .95; }

.footer-nav{
  display: flex;
  gap: 26px;
  font-size: 13.5px;
}

.footer-nav a{
  color: #a3aab4;
  transition: color .2s ease;
}

.footer-nav a:hover{ color: #fff; }

.footer-legal{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 26px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #7d848e;
}

.beian{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beian a{
  color: #98a0aa;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  padding-bottom: 1px;
  transition: color .2s ease, border-color .2s ease;
}

.beian a:hover{
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}

.beian .dot{ color: #4c525b; }
.beian .muted{ color: #6b727c; }

/* ---------- 入场动画 ---------- */

/* 渐进增强：仅当 JS 就绪时才隐藏等待入场，避免脚本失效导致内容不可见 */

.reveal{
  transition: opacity .75s cubic-bezier(.2, .7, .3, 1),
              transform .75s cubic-bezier(.2, .7, .3, 1);
}

.js .reveal{
  opacity: 0;
  transform: translateY(16px);
  will-change: opacity, transform;
}

.js .reveal.in{
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- 响应式 ---------- */

@media (max-width: 980px){
  .work-featured{
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .work-visual{ order: -1; }
  .work-visual svg{ max-width: 420px; }
  .split{
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .split .label{ margin-bottom: 20px; }
}

@media (max-width: 820px){
  .wrap{ padding: 0 22px; }
  .hero{ padding: 60px 0 72px; }
  .hero::before, .hero::after{ display: none; }
  .stats{
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 16px;
    margin-top: 54px;
  }
  .works{ grid-template-columns: 1fr; }
  .work-featured{ padding: 30px 24px; }
  .focus-grid{ grid-template-columns: repeat(2, 1fr); }
  .section{ padding: 68px 0; }
  .nav{ gap: 20px; }
  .nav a{ font-size: 13.5px; }
}

@media (max-width: 520px){
  .header-inner{ height: 60px; }
  .hero h1{ font-size: 52px; }
  .hero-lead{ margin-top: 22px; }
  .hero-actions .btn{ flex: 1 1 auto; }
  .focus-grid{ grid-template-columns: 1fr; }
  .footer-top{ flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-legal{ flex-direction: column; align-items: flex-start; }
  .stats b{ font-size: 26px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .js .reveal,
  .js .reveal.in{
    opacity: 1;
    transform: none;
    transition: none;
  }
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
