/* =========================================================================
   自托管字体（均为 SIL Open Font License, OFL）：
   - IBM Plex Serif（对应 zed 的 "plexSerif" 衬线，用于所有标题）
   - iA Writer Quattro（对应 zed 的 "writer" 无衬线，用于导航/正文 sans）
   - Lilex（对应 zed 的 "zedMono" 等宽，用于正文/命令行）
   许可证见 fonts/ 目录。
   ========================================================================= */
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/plexserif-300.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plexserif-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plexserif-500.woff2") format("woff2");
}
@font-face {
  font-family: "iA Writer Quattro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/iawriterquattro-400.woff2") format("woff2");
}
@font-face {
  font-family: "iA Writer Quattro";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/iawriterquattro-400i.woff2") format("woff2");
}
@font-face {
  font-family: "iA Writer Quattro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/iawriterquattro-700.woff2") format("woff2");
}
@font-face {
  font-family: "Lilex";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lilex-400.woff2") format("woff2");
}
@font-face {
  font-family: "Lilex";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/lilex-500.woff2") format("woff2");
}
@font-face {
  font-family: "Lilex";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/lilex-600.woff2") format("woff2");
}

/* =========================================================================
   个人网站 · 设计语言参考 zed.dev/team
   - 背景：纸张米白 #f7f7f2
   - 标题：IBM Plex Serif，深靛蓝 lab(36.33% 31.17 -81)
   - 正文：Lilex（等宽），石板灰 oklch(0.359 0.015 262.88)
   ========================================================================= */

:root {
  --bg: #f7f7f2;
  --ink: oklch(0.358979 0.0154914 262.882);
  --ink-strong: #111114;
  --accent: lab(36.3314% 31.1715 -81.0014);
  --accent-bright: #1e69f6;
  --color-accent-blue: #1e69f6;
  --muted: color-mix(in oklch, oklch(0.358979 0.0154914 262.882), white 42%);
  --line: color-mix(in oklch, oklch(0.358979 0.0154914 262.882), white 78%);
  --line-strong: color-mix(in oklch, oklch(0.358979 0.0154914 262.882), white 62%);
  --content-w: 960px;
  /* 铺满屏幕的顶栏 / 页脚左右边距（随屏宽自适应） */
  --edge-pad: clamp(20px, 5vw, 64px);
  /* 居中正文左右内边距 */
  --content-pad: clamp(20px, 4vw, 40px);

  --font-serif: "IBM Plex Serif", Georgia, "Songti SC", serif;
  --font-mono: "Lilex", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "iA Writer Quattro", ui-sans-serif, system-ui, "PingFang SC", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 全屏纸张质感 · 细密胶片颗粒（参考 zed.dev 的背景噪点）。
   - 高频 fractalNoise 生成细颗粒；保留很低的饱和度（saturate 0.22），
     让每颗噪点带极淡的随机色相 —— 混出淡淡的粉 / 蓝 / 灰
   - 以中灰为中心，用 soft-light 融合：既不压暗纸面，又能提亮/压暗出颗粒感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.85'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.35' intercept='-0.2'/%3E%3CfeFuncG type='linear' slope='1.35' intercept='-0.2'/%3E%3CfeFuncB type='linear' slope='1.35' intercept='-0.2'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}


a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

/* ------------------------------- 整页容器：占据视口剩余空间，独立滚动 */
.page {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

/* 细而克制的滚动条，贴合整体风格 */
.page::-webkit-scrollbar {
  width: 10px;
}
.page::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 999px;
}
.page::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.page {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* --------------------------------- 正文：居中、加宽、自适应 */
.content {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) var(--content-pad) 88px;
  flex: 1;
}

.hero-cat {
  display: block;
  width: clamp(180px, 36vw, 320px);
  height: auto;
  margin: 0 auto 28px;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 340;
  font-size: 38px;
  line-height: 1.2;
  color: var(--accent);
  margin: 0 0 26px;
  letter-spacing: -0.01em;
}

.lede {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 14px;
}
.lede + .lede {
  margin-top: 0;
}

/* 分区 */
.section {
  padding-top: 40px;
  margin-top: 40px;
  scroll-margin-top: 24px;
}
.section:first-of-type {
  margin-top: 34px;
  padding-top: 0;
}

.section__label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

/* 条目：仿 zed 团队成员卡片（姓名 + 角色标签 + 等宽简介） */
.entry {
  margin-bottom: 34px;
}
.entry__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.entry__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink-strong);
  margin: 0;
}
.entry__role {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.entry__body p {
  margin: 0 0 10px;
}
.entry__meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.entry__meta a:hover {
  color: var(--accent);
}

/* Movies · Letterboxd 最近观影 */
.inline-link {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.inline-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.movie-status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}
.movie-status a {
  color: var(--ink-strong);
}
.movie-status a:hover {
  color: var(--accent);
}
.movie-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.movie-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--line);
  cursor: default;
  transition: border-color 0.15s ease;
}
.movie-card::before {
  display: none;
}
.movie-card::after {
  display: none;
}
.movie-card__poster {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--line);
}
.movie-card__poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.movie-card__title {
  display: none;
}
.movie-card__meta {
  display: none;
}
.movie-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--accent-bright);
}
.movie-rating--empty {
  color: var(--muted);
}
.movie-rating__star {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 13px;
  line-height: 13px;
}
.movie-rating__star::before,
.movie-rating__star--half::after {
  content: "★";
  position: absolute;
  inset: 0;
  font-size: 10px;
}
.movie-rating__star--full::before {
  color: var(--accent-bright);
}
.movie-rating__star--empty::before {
  color: rgba(255, 255, 255, 0.28);
}
.movie-rating__star--half::before {
  color: rgba(255, 255, 255, 0.28);
}
.movie-rating__star--half::after {
  width: 50%;
  overflow: hidden;
  color: var(--accent-bright);
}

/* Photos · 生活照片网格 */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.photo-card {
  display: block;
}
.photo-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--line);
}
.photo-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Elsewhere · 外链列表（参考 zed.dev：小标签 + 值 + ↗ 箭头、细分隔线、hover 箭头上移） */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.link-card__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.link-card__value {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-strong);
  transition: color 0.14s ease;
}
.link-card__arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.14s ease, color 0.14s ease;
}
.link-card:hover .link-card__value {
  color: var(--accent);
}
.link-card:hover .link-card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* 内联强调 · 仿 zed 文档的内联代码 chip：浅灰底 + 圆角 + 细边框 */
.k {
  padding: 0.1em 0.4em;
  background-color: color-mix(in oklab, var(--color-accent-blue) 10%, transparent);
  color: var(--ink-strong);
  font-family: var(--font-mono);
  font-size: 0.92em;
  white-space: nowrap;
}
.arrow {
  color: var(--muted);
  font-size: 11px;
}

/* 页脚（与正文同宽、居中、无边框） */
.footer {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 44px var(--content-pad) 56px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 6px 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 640px) {
  .page-title {
    font-size: clamp(26px, 8vw, 34px);
  }
  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .footer {
    flex-direction: column;
  }
}
