/* ============================================================
   栗鸥 Lio · 全站共用样式
   页面结构：
     index.html      首屏（hero 占满整个视口，不滚动）
     projects.html   项目
     about.html      关于
     stack.html      技术栈
     contact.html    联系
     guestbook.html  留言
   改配色 / 字体 / 间距只需要动下面的 :root 变量。
   ============================================================ */

:root{
  /* ── 色彩：全中性，强调色就是"黑"本身 ───────────────── */
  --bg:#FFFFFF;  --surface:#FAFAFA;
  --fg:#0A0A0A;  --fg-muted:#6F6F6F;  --line:#E5E5E5;
  --accent:#0A0A0A;

  /* ── 字体：避开 Inter / Roboto / Arial / 系统字体 / Space Grotesk ── */
  --font-display:"Fraunces","Noto Serif SC",Georgia,serif;
  --font-body:"IBM Plex Sans","Noto Sans SC",sans-serif;
  --font-mono:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* ── 字号阶梯：比例 1.25，全站只用这几档 ─────────────── */
  --step--1:.875rem; --step-0:1rem;      --step-1:1.25rem;  --step-2:1.5625rem;
  --step-3:1.9375rem; --step-4:2.4375rem;

  /* ── 间距：8pt 网格 ───────────────────────────────── */
  --space-2:8px; --space-3:12px; --space-4:16px; --space-6:24px;
  --space-8:32px; --space-12:48px; --space-16:64px; --space-24:96px;

  /* ── 度量 ─────────────────────────────────────────── */
  --container:1160px;   /* 宽画布：版心，不是阅读行宽 */
  --gutter:clamp(20px, 5vw, 56px);
  --measure:38em;       /* 正文段落：中文 ≤40 字/行 */
  --radius:2px;         /* 只留一档圆角 */

  /* 首屏背景图 —— 换背景只改这一行：
     url("assets/hero-sky-clean.jpg")   ✅ 当前使用：整张图铺满，中间那句英文已修掉
     url("assets/hero-sky.jpg")         原图（含英文 "BE JOYFUL ALWAYS"）
     url("assets/hero-sky-clouds.jpg")  只留云层带（1920×447）
     background-size 用 cover，任何屏幕比例都会铺满，不留白、不拉伸。      */
  --hero-img: url("assets/hero-sky-clean.jpg");
}
@media (prefers-color-scheme: dark){
  :root{ --bg:#000000; --surface:#0C0C0C; --fg:#FAFAFA; --fg-muted:#8C8C8C; --line:#242424; --accent:#FAFAFA; }
}

*,*::before,*::after{ box-sizing:border-box; }
/* 注册成"可插值颜色"，滚动驱动的顶栏变色才能在两种颜色之间平滑过渡 */
@property --hdr-fg{ syntax:"<color>"; inherits:true; initial-value:#FFFFFF; }
@property --hdr-bg{ syntax:"<color>"; inherits:true; initial-value:rgba(255,255,255,0); }
@property --hdr-line{ syntax:"<color>"; inherits:true; initial-value:rgba(255,255,255,0); }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; min-height:100dvh;
  display:flex; flex-direction:column;          /* 让 footer 永远贴底 */
  background:var(--bg); color:var(--fg);
  font-family:var(--font-body);
  font-size:clamp(1rem, .94rem + .22vw, 1.125rem);
  line-height:1.75;
  font-synthesis-weight:none;
}
.wrap{ width:100%; max-width:var(--container); margin:0 auto; padding:0 var(--gutter); }
main{ flex:1 0 auto; display:flex; flex-direction:column; }

/* 焦点态必须可见（Vercel 规则：禁止只写 outline:none） */
:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; border-radius:1px; }

.skip{ position:absolute; left:-9999px; }
.skip:focus{ position:static; display:inline-block; padding:var(--space-2) var(--space-4); }

/* ── 顶栏：全站共用 ─────────────────────────────────────
   默认状态：透明 + 白字，浮在照片上，跟着页面滚走。
   这是**不支持滚动驱动动画**时的样子 —— 完全可用，只是没有吸顶。
   下面 @supports 那一段才会把它变成"吸顶 + 滚动时自动变色"。
   ⚠️ 两个颜色变量用 @property 注册过（见文件顶部），
      否则浏览器不知道怎么在白和黑之间插值，只会硬切。 */
header{
  position:absolute; top:0; left:0; right:0; z-index:20; flex:none;
  background:none; border-bottom:0;
}
header .wrap{
  display:flex; justify-content:space-between; align-items:baseline;
  gap:var(--space-3) var(--space-8); flex-wrap:wrap;
  padding-top:var(--space-4); padding-bottom:var(--space-4);
}
.brand{ font-weight:500; letter-spacing:-.01em; color:#fff; text-decoration:none; }
nav{ display:flex; gap:clamp(16px, 3vw, 40px); flex-wrap:wrap; font-size:var(--step--1); }
nav a{ color:rgba(255,255,255,.82); text-decoration:none; padding-block:5px; }
/* padding-block 只是把可点区域从 14px 抬到 24px（WCAG 2.2 的最小触控目标），视觉高度不变 */
nav a:hover, nav a[aria-current="page"]{ color:#fff; text-decoration:underline; text-underline-offset:4px; }
/* 底边线只在顶栏变成实心之后才有意义，默认透明 */
header{ border-bottom:1px solid var(--hdr-line, rgba(255,255,255,0)); }

/* ── 阅读进度线 ─────────────────────────────────────────
   固定在视口最上沿。首页改成可滚动之后也一并用上了。 */
body::after{
  content:""; position:fixed; top:0; left:0; right:0; height:2px; z-index:30;
  background:var(--accent); transform:scaleX(0); transform-origin:left center;
  pointer-events:none;
}
body.home::after{ display:none; }   /* 首页一屏不滚动，没有进度可言 */

/* ── 首页（只用于 index.html）：整屏照片 hero，不滚动 ─────
   main 是 flex 容器，.hero 用 flex:1 吃掉整个视口高度。
   背景用「渐变遮罩 + 照片」两层叠，遮罩是为了让白字在白云上也能读。
   换背景图：改 :root 里的 --hero-img 一行。                */
/* 首页用满宽：名字贴左、右侧那片天空留给大海鸥。
   内容页保持 1160 版心。 */
body.home header .wrap,
main.home .hero-inner{
  max-width:none;
  padding-left:clamp(20px, 4vw, 64px);
  padding-right:clamp(20px, 4vw, 64px);
}

main.home{ flex:1 0 auto; display:flex; min-height:100dvh; }
main.home > .hero{
  position:relative; flex:1; display:flex; overflow:hidden;
  background-color:#0A1E45;
  background-image:
    linear-gradient(180deg,
      rgba(4,16,40,.62) 0%,
      rgba(4,16,40,.20) 42%,
      rgba(4,16,40,.30) 62%,
      rgba(4,16,40,.76) 100%),
    var(--hero-img);
  background-size:cover, cover;
  background-position:center, center;
  background-repeat:no-repeat, no-repeat;
}
.hero-inner{
  position:relative; z-index:2;             /* 压在海鸥层之上 */
  flex:1; display:flex; flex-direction:column; justify-content:space-between;
  padding-top:clamp(88px, 15vh, 156px);    /* 给绝对定位的顶栏让位 */
  padding-bottom:clamp(24px, 4vh, 44px);
  min-height:0;
}
.hero h1{
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(2.75rem, min(9vw, 15vh), 8.5rem);
  line-height:.92; margin:0; text-wrap:balance;
  color:#fff; text-shadow:0 2px 28px rgba(0,0,0,.28);
}
.hero h1 .zh{ letter-spacing:0; }          /* 中文不收紧字距 */
.hero h1 .latin{ letter-spacing:-.035em; } /* 拉丁字母才收紧 */
.hero .lede{
  margin:clamp(16px, 2.5vh, 26px) 0 0;
  font-size:clamp(1.0625rem, 1.4vw, 1.25rem);
  color:rgba(255,255,255,.86); max-width:30em;
}
.hero-hint{ margin:0 0 var(--space-4); font-size:var(--step--1); color:rgba(255,255,255,.58); }
.hero .rule{ height:1px; background:rgba(255,255,255,.85); transform-origin:left center; }

/* 底部站点索引：那片本来是白云，白字压上去读不清，
   所以用一条实线 + 深色遮罩把它分成一块可读的信息区。
   四栏都是真导航，不是装饰。 */
.site-index{
  display:grid; grid-template-columns:repeat(4, minmax(0,1fr));
  gap:var(--space-4) clamp(20px, 3vw, 44px);
  padding-top:var(--space-6);
}
.site-index a{ display:block; color:#fff; text-decoration:none; }
.site-index b{ display:block; font-weight:500; font-size:1.0625rem; }
.site-index span{ display:block; margin-top:4px; font-size:var(--step--1); color:rgba(255,255,255,.66); }
.site-index a:hover b{ text-decoration:underline; text-underline-offset:4px; }
.site-index a:hover span{ color:rgba(255,255,255,.85); }
@media (max-width:820px){
  .site-index{ grid-template-columns:1fr 1fr; }
}
/* 矮屏（横屏手机、小笔记本）优先保住名字和索引，砍掉辅助信息 */
@media (max-height:720px){
  .hero-inner{ padding-top:clamp(76px, 13vh, 120px); }
  .hero-hint{ display:none; }
  .site-index span{ display:none; }
}

/* ── 海鸥：点一下就飞走，过一会儿换个位置飞回来 ─────────
   交互是纯装饰性的彩蛋，所以：键盘可用（真的 <button>）、
   尊重 prefers-reduced-motion（不动画，直接换位置）。
   位置和速度用 CSS 变量逐个调，不需要改 JS。          */
.gulls{ position:absolute; inset:0; z-index:1; pointer-events:none; }
.gull{
  position:absolute; left:var(--x, 50%); top:var(--y, 50%);
  width:calc(46px * var(--s, 1)); height:auto;
  padding:6px; margin:0; border:0; background:none; cursor:pointer;
  color:rgba(255,255,255,.92);
  transform:translate(-50%,-50%);
  transition:transform .25s ease;
  pointer-events:auto;
  -webkit-tap-highlight-color:transparent;
  filter:drop-shadow(0 2px 6px rgba(8,26,60,.5));
}
.gull:hover{ transform:translate(-50%,-50%) scale(1.15); color:#fff; }

/* 右侧那只大的：尺寸随视口走，不跟 --s 走，免得手机上大得离谱 */
.gull--lead{
  width:clamp(88px, 12vw, 168px);
  color:rgba(255,255,255,.95);
  filter:drop-shadow(0 8px 22px rgba(8,26,60,.5));
}
/* ── 海鸥的飞行姿态 ─────────────────────────────────────
   分两层，因为同一个元素上两个动画会互相覆盖 transform：
     svg  → 整只鸟的航迹（gull-soar，闭环回环，不再是直线来回）
     g    → 扇翅（gull-flap，翼尖上下扇）
   扇翅用 scaleY 压缩纵向：翼尖向身体收拢再打开，就是远处看鸟扇翅的样子。 */
.gull svg{
  display:block; width:100%; height:auto;
  animation:gull-soar var(--d, 10s) ease-in-out infinite;
}
.gull svg g,
.band-gull svg g{
  transform-box:fill-box;      /* 以鸟自身外框为参照，缩放才绕着自己转 */
  transform-origin:center;
  animation:gull-flap 2.4s ease-in-out infinite;
}
@keyframes gull-soar{
  0%,100%{ transform:translate3d(0,0,0) rotate(-3deg); }
  28%    { transform:translate3d(calc(var(--dx, 12px) * .55), calc(var(--dy, 8px) * -1), 0) rotate(2deg); }
  52%    { transform:translate3d(var(--dx, 12px), calc(var(--dy, 8px) * .25), 0) rotate(5deg); }
  78%    { transform:translate3d(calc(var(--dx, 12px) * .35), var(--dy, 8px), 0) rotate(-1deg); }
}
/* 下扑比上扬快、幅度也大一点 —— 对称的正弦看着像机器 */
@keyframes gull-flap{
  0%,100%{ transform:scaleY(1) translateY(0); }
  42%    { transform:scaleY(.56) translateY(1.6px); }
  58%    { transform:scaleY(.68) translateY(1px); }
}

/* 每只扇翅的快慢和相位都不同，否则八只像同一个模子刻出来的。
   ⚠️ 这八条必须排在下面的 .gull.away 之前：两者优先级相同，靠顺序决胜。 */
.gull:nth-child(1) svg g{ animation-duration:2.4s;  animation-delay:-.15s; }
.gull:nth-child(2) svg g{ animation-duration:2.9s;  animation-delay:-1.1s; }
.gull:nth-child(3) svg g{ animation-duration:2.2s;  animation-delay:-.7s; }
.gull:nth-child(4) svg g{ animation-duration:3.1s;  animation-delay:-1.85s; }
.gull:nth-child(5) svg g{ animation-duration:2.6s;  animation-delay:-.35s; }
.gull:nth-child(6) svg g{ animation-duration:3.4s;  animation-delay:-2.2s; }
.gull:nth-child(7) svg g{ animation-duration:2.05s; animation-delay:-1.4s; }
.gull:nth-child(8) svg g{ animation-duration:2.75s; animation-delay:-.9s; }

/* 惊飞：先向后"顿"一下，再斜着加速冲出去，同时侧身。
   原来是一条直线冲上去，这是整段里最假的地方。 */
.gull.away{ animation:gull-flee 1s cubic-bezier(.45,.05,.75,.35) forwards; }
.gull.away svg g{ animation-duration:.3s; }   /* 受惊时扇翅频率明显加快 */
@keyframes gull-flee{
  0%  { opacity:1; transform:translate(-50%,-50%) rotate(0deg); }
  22% { opacity:1; transform:translate(-50%,-50%) translate(-2.5vw,-7vh) scale(1.02) rotate(-7deg); }
  100%{ opacity:0; transform:translate(-50%,-50%) translate(22vw,-52vh) scale(.5) rotate(13deg); }
}
body.home :focus-visible{ outline-color:#fff; }   /* 黑描边在深蓝背景上看不见 */

@media (max-width:820px){
  /* 窄屏要让名字几乎顶满一行，所以 vw 系数比桌面大；
     仍然保留 vh 上限，防止横屏手机把整屏撑破。 */
  .hero h1{ font-size:clamp(2.75rem, min(21vw, 16vh), 5.5rem); }
  .gull{ width:calc(32px * var(--s, 1)); }
  /* 必须放在 .gull 之后：同优先级下后出现的胜出，
     否则大海鸥会被上面那条宽度规则压回普通大小。
     top 也在这里压过行内的 --y：窄屏欢迎语会换行到 34% 左右，
     主角海鸥再待在 33% 就会压在字上。 */
  .gull--lead{ width:clamp(72px, 20vw, 110px); top:47%; }
}

/* ── 首页入场：一次编排好的序列（全站唯一一处入场动效） ──────
   Anthropic 那份 frontend-design 里唯一被许可的"非用户触发"动效就是它：
     "A single orchestrated moment — one page-load sequence or one reveal —
      lands better than scattered effects."
   所以内容页不加入场：阅读页瞬间出现反而更专业，加了就是"每段都淡入"那种 AI 味。

   节奏（约 1.2 秒走完，只播一次）：
     0ms    名字升起
     100ms  欢迎语跟上
     260ms  实线从左拉出
     340ms+ 四栏索引依次就位
     120ms+ 海鸥成群从右上方飞入
   只用 transform / opacity。fill-mode 用 backwards 而不是 both：
   动画结束后元素回到自然样式，否则会把 hover 缩放和点击飞走一起锁死。 */
@media not (prefers-reduced-motion) {
  .hero h1,
  .hero .lede,
  .hero .rule,
  .hero-hint,
  .site-index a,
  .pageband h1,
  .pageband .lede,
  .gull{
    animation-duration:.85s;
    animation-timing-function:cubic-bezier(.22,.61,.36,1);
    animation-fill-mode:backwards;
  }
  .hero h1{ animation-name:enter-rise; }
  .hero .lede{ animation-name:enter-rise; animation-delay:.1s; }
  .hero .rule{ animation-name:enter-draw; animation-delay:.26s; animation-duration:.62s; }
  .hero-hint{ animation-name:enter-fade; animation-delay:.62s; animation-duration:.5s; }
  .site-index a{ animation-name:enter-rise; animation-duration:.55s; }
  /* 内页头图：标题和说明用同一段升起动画，节奏比首页更短促（内页不是主角） */
  .pageband h1{ animation-name:enter-rise; animation-duration:.7s; }
  .pageband .lede{ animation-name:enter-rise; animation-delay:.1s; animation-duration:.7s; }
  .site-index a:nth-child(1){ animation-delay:.34s; }
  .site-index a:nth-child(2){ animation-delay:.40s; }
  .site-index a:nth-child(3){ animation-delay:.46s; }
  .site-index a:nth-child(4){ animation-delay:.52s; }
  /* 海鸥：成群飞入。点击飞走之后同样靠这段动画飞回来 —— 不用再单独写一个"返回"动画 */
  .gull{ animation-name:enter-fly; animation-duration:1s; }
  .gull:nth-child(1){ animation-delay:.12s; }
  .gull:nth-child(2){ animation-delay:.30s; }
  .gull:nth-child(3){ animation-delay:.36s; }
  .gull:nth-child(4){ animation-delay:.42s; }
  .gull:nth-child(5){ animation-delay:.48s; }
  .gull:nth-child(6){ animation-delay:.54s; }
  .gull:nth-child(7){ animation-delay:.60s; }
  .gull:nth-child(8){ animation-delay:.66s; }
}
@keyframes enter-rise{
  from{ opacity:0; transform:translate3d(0, .22em, 0); }
  to  { opacity:1; transform:none; }
}
@keyframes enter-draw{
  from{ transform:scaleX(0); }
  to  { transform:scaleX(1); }
}
@keyframes enter-fade{
  from{ opacity:0; }
  to  { opacity:1; }
}
@keyframes enter-fly{
  0%  { opacity:0; transform:translate(-50%,-50%) translate3d(20vw,-16vh,0) scale(.72) rotate(-12deg); }
  62% { opacity:1; transform:translate(-50%,-50%) translate3d(-1.5vw,1.5vh,0) scale(1.04) rotate(3deg); }
  100%{ opacity:1; transform:translate(-50%,-50%) scale(1) rotate(0deg); }
}

/* ── 内页头图（pageband） ───────────────────────────────
   五个内页共用首页那张照片，靠不同的裁切位置 / 缩放 / 镜像做出差异：
   一个文件全站只下载一次，也不必再引入任何来源不明的图。
   页面标题从原来的左侧标题栏搬到了这里 —— 头图上放大字，
   正文回到浅色背景，阅读区不受影响。 */
.pageband{
  position:relative; overflow:hidden; color:#fff;
  display:flex; align-items:flex-end;
  min-height:clamp(290px, 42vh, 440px);
  padding-top:clamp(92px, 14vh, 148px);   /* 给绝对定位的顶栏让位 */
  padding-bottom:clamp(26px, 4vh, 46px);
}
.pageband::before{                         /* 照片层 */
  content:""; position:absolute; inset:0; z-index:0;
  background-image:var(--band-img, url("assets/hero-sky-clean.jpg"));
  background-size:var(--band-size, cover);
  background-position:var(--band-pos, center);
  background-repeat:no-repeat;
  transform:var(--band-flip, none);
}
.pageband::after{                          /* 遮罩层：保证白字在白云上也读得清 */
  content:""; position:absolute; inset:0; z-index:0;
  background:linear-gradient(180deg,
    rgba(4,16,40,.60) 0%, rgba(4,16,40,.26) 46%,
    rgba(4,16,40,.46) 74%, rgba(4,16,40,.80) 100%);
}
.band-inner{ position:relative; z-index:2; width:100%; }
.pageband h1{
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(2.5rem, min(7.5vw, 13vh), 5.25rem);
  line-height:.98; margin:0; letter-spacing:-.01em;
  text-shadow:0 2px 24px rgba(0,0,0,.3);
}
.pageband .lede{
  margin:clamp(10px, 1.6vh, 18px) 0 0;
  font-size:clamp(1rem, 1.2vw, 1.125rem);
  color:rgba(255,255,255,.84); max-width:34em;
}

/* 每页的裁切不同：项目看整片天，关于贴近云，技术栈镜像，
   联系只留空天，留言压在云顶 */
.band-projects{  --band-pos:50% 44%; --band-size:cover; }
.band-about{     --band-pos:30% 86%; --band-size:168%; }
.band-stack{     --band-pos:58% 10%; --band-size:152%; --band-flip:scaleX(-1); }
.band-contact{   --band-pos:58% 68%; --band-size:195%; }
.band-guestbook{ --band-pos:44% 98%; --band-size:150%; }
.band-articles{  --band-pos:62% 82%; --band-size:158%; }
.band-gallery{   --band-pos:20% 12%; --band-size:205%; --band-flip:scaleX(-1); }

/* ── 空状态：诚实但不刺眼（比"待填"体面） ─────────────── */
.empty{ color:var(--fg-muted); max-width:var(--measure); }

/* ── 文章列表 ─────────────────────────────────────────── */
.post-list{ list-style:none; padding:0; margin:0; display:grid; gap:clamp(28px, 4vw, 44px); }
.post-list a{ display:block; text-decoration:none; }
.post-list .d{ display:block; font-family:var(--font-mono); font-size:var(--step--1); color:var(--fg-muted); }
.post-list .t{ display:block; margin-top:var(--space-2); font-size:var(--step-1); font-weight:500; }
.post-list .s{ display:block; margin-top:var(--space-2); color:var(--fg-muted); max-width:var(--measure); }
.post-list a:hover .t{ text-decoration:underline; text-underline-offset:4px; }

/* ── 相册网格 ─────────────────────────────────────────── */
.album{
  display:grid; gap:var(--space-3);
  grid-template-columns:repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.album figure{ margin:0; }
.album img{ display:block; width:100%; height:auto; border-radius:var(--radius); background:var(--surface); }
.album figcaption{ margin-top:var(--space-2); font-size:var(--step--1); color:var(--fg-muted); }

/* 内页头图里的海鸥是纯装饰：不可点、不进无障碍树。
   点击互动是首页的彩蛋，内页不做，免得出现"点了没反应"的死按钮。 */
.gull--deco{ pointer-events:none; }

/* ── 内容区：照片下方的浅色阅读区（内页不再用左侧标题栏） ── */
section{
  padding:clamp(44px, 6vw, 84px) 0;
  border-top:1px solid var(--line);
}
.pagebody section:first-of-type{ border-top:0; padding-top:clamp(40px, 6vw, 76px); }
p{ max-width:var(--measure); margin:0 0 var(--space-4); }
a{ color:inherit; }

/* ── 作品：真实序列才编号（这里不编号） ──────────────── */
.work{ display:grid; gap:clamp(40px, 5vw, 72px); }
.work article{ display:grid; gap:var(--space-4); }
.work h2, .work h3{ font-size:var(--step-2); font-weight:500; margin:0; letter-spacing:-.01em; }
.work dl{
  margin:0; display:grid; grid-template-columns:6em minmax(0,1fr);
  gap:var(--space-2) var(--space-6); max-width:46em;
}
.work dt{ color:var(--fg-muted); font-size:var(--step--1); line-height:1.9; }
.work dd{ margin:0; }
.work .links{ display:flex; gap:var(--space-8); font-size:var(--step--1); }
.work .links a{ color:var(--fg-muted); text-decoration:underline; text-underline-offset:4px; }
.work .links a:hover{ color:var(--fg); }

/* ── 技术栈：等宽体的唯一正当用途 ───────────────────── */
.stack{ display:flex; flex-wrap:wrap; gap:var(--space-2); list-style:none; padding:0; margin:0; max-width:46em; }
.stack li{
  font-family:var(--font-mono); font-size:var(--step--1);
  border:1px solid var(--line); border-radius:var(--radius);
  padding:2px var(--space-3); color:var(--fg-muted);
}

/* ── 关于页顶部的速览表（从首屏挪过来的三格） ─────────── */
.facts{
  margin:0 0 var(--space-8); padding-bottom:var(--space-6);
  border-bottom:1px solid var(--line);
  display:grid; gap:var(--space-6) clamp(16px, 3vw, 40px);
  grid-template-columns:repeat(3, minmax(0,1fr));
  max-width:46em;
}
.facts dt{
  font-family:var(--font-mono); font-size:.75rem;
  color:var(--fg-muted); margin:0 0 var(--space-2);
}
.facts dd{ margin:0; }
@media (max-width:640px){ .facts{ grid-template-columns:1fr 1fr; } }

/* 联系页只有一条渠道时，把它放大 —— 与其显得空旷，不如变成"聚焦" */
.contact-line{
  font-size:clamp(1.25rem, 2vw, 1.75rem); line-height:1.5;
}
.contact-line a{ text-decoration-thickness:2px; text-underline-offset:6px; }

/* ── 滚动驱动动画（全站只用这几处，不是每段都加） ────────
   1) 阅读进度线：scroll() 时间轴，进度 = 页面滚动百分比
   2) 项目页头图里的海鸥：一开始滚动就飞走，滚回顶部又飞回来
   3) 项目标题钉住：sticky，读到哪儿标题跟到哪儿

   支持度（2026-08，caniuse）：Chrome/Edge 115+、Safari 26+、Firefox 160+，全球约 87%。
   不支持时：进度线保持不可见（scaleX 0）、海鸥安静待在头图里、标题照样钉住，
   内容完全可用 —— 也就是"反过来写"：默认是最终状态，只在支持时才叠动画。
   两处动效都包在 prefers-reduced-motion 里：滚动驱动的位移动效最容易引起不适。 */

/* 1) 阅读进度线（在顶栏那一节已经定义为 body::after 固定在视口上沿） */

/* 2) 项目页头图里的海鸥：一开始滚动就飞走，滚回顶部又回来。
      现在它在头图里，不再是左侧标题栏（标题栏已经取消）。 */
.band-gull{
  position:absolute; z-index:1; pointer-events:none;
  right:clamp(24px, 9vw, 150px); bottom:clamp(44px, 10vh, 104px);
  width:clamp(62px, 7vw, 104px);
  color:rgba(255,255,255,.92);
  filter:drop-shadow(0 4px 16px rgba(8,26,60,.5));
}
.band-gull svg{ display:block; width:100%; height:auto; }

/* 3) 项目标题钉住（不依赖滚动驱动动画，sticky 全浏览器可用） */
.work article h2{
  position:sticky; top:0; z-index:2;
  background:var(--bg); padding-block:var(--space-3);
  margin-block:calc(-1 * var(--space-3)) 0;
}

@supports (animation-timeline: scroll()) {
  @media not (prefers-reduced-motion) {
    body::after{
      animation: read-progress linear both;
      animation-timeline: scroll(root block);
    }
    .band-gull{
      animation: gull-startle linear both;
      animation-timeline: scroll(root block);
      animation-range: 0% 15%;
    }

    /* 顶栏吸顶 + 滚动变色。必须只在支持且未开启"减少动态效果"时启用：
       否则顶栏会固定成透明白字，压在白色正文上就看不见了。 */
    header{
      position:fixed;
      background-color:var(--hdr-bg);
      --hdr-fg:#FFFFFF;
      --hdr-bg:rgba(255,255,255,0);
      --hdr-line:rgba(255,255,255,0);
      animation: hdr-solid linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 66vh;          /* 首页：首屏快滚完时才变实心 */
    }
    body.sub header{ animation-range: 0 320px; }   /* 内页头图只有 40vh 高 */
    .brand{ color:var(--hdr-fg); }
    nav a{ color:color-mix(in srgb, var(--hdr-fg) 78%, transparent); }
    nav a:hover, nav a[aria-current="page"]{ color:var(--hdr-fg); }

    /* ── 首屏退场那段已撤掉：首页恢复成不滚动的一屏 ── */
  }
}
@keyframes hdr-solid{
  from{ --hdr-fg:#FFFFFF; --hdr-bg:rgba(255,255,255,0); --hdr-line:rgba(255,255,255,0); }
  to  { --hdr-fg:#0A0A0A; --hdr-bg:#FFFFFF; --hdr-line:#E5E5E5; }
}
@keyframes read-progress{ from{ transform:scaleX(0) } to{ transform:scaleX(1) } }
@keyframes gull-startle{
  0%  { opacity:.3;  transform:translate3d(0,0,0) scale(1) rotate(0deg); }
  30% { opacity:.34; transform:translate3d(-7px,-16px,0) scale(1.03) rotate(-6deg); }
  100%{ opacity:0;   transform:translate3d(10vw,-24vh,0) scale(.68) rotate(12deg); }
}

/* ── 占位符：故意显眼，填完删掉 class 即可 ────────────── */
.todo{ color:var(--fg-muted); border-bottom:1px dashed var(--line); }

footer{
  flex:none; border-top:1px solid var(--line);
  padding:var(--space-8) 0 var(--space-12); color:var(--fg-muted); font-size:var(--step--1);
}
footer .wrap{ display:grid; gap:var(--space-6); }
/* 顶栏不吸顶，长页面滚到底就够不着导航了 —— 页脚再给一份 */
.footnav{ display:flex; gap:clamp(16px, 3vw, 36px); flex-wrap:wrap; }
.footnav a{ color:var(--fg-muted); text-decoration:none; }
.footnav a:hover, .footnav a[aria-current="page"]{ color:var(--fg); text-decoration:underline; text-underline-offset:4px; }
.footrow{ display:flex; justify-content:space-between; gap:var(--space-6); flex-wrap:wrap; }
footer p{ margin:0; max-width:none; }
time{ font-variant-numeric:tabular-nums; }

/* ── 首页不滚动时页脚也要能待在最底部 ─────────────────── */
@media (max-height:620px){
  main.home > .hero{ padding-top:var(--space-6); padding-bottom:var(--space-6); }
}

@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}
@media (max-width:639px){
  .work dl{ grid-template-columns:1fr; gap:2px; }
  .work dt{ margin-top:var(--space-4); }
}
