/* ============================================================
   TR° 视觉设计档案 · 样式表
   仅两个主题变量集，其余组件共用
   ============================================================ */

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/manrope-400.ttf) format('truetype');
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/manrope-500.ttf) format('truetype');
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/manrope-700.ttf) format('truetype');
}

:root {
  --paper: #f2efe8;
  --paper-2: #e9e5db;
  --ink: #14130f;
  --muted: #6e6a61;
  --line: rgba(20, 19, 15, 0.14);
  --line-strong: rgba(20, 19, 15, 0.28);
  --accent: #e8441c;
  --maxw: 1320px;
  --gut: clamp(20px, 4vw, 48px);
  --f: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --f-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 0.72, 0.2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0b0b0a;
  --paper-2: #131312;
  --ink: #f2efe8;
  --muted: #8f8b81;
  --line: rgba(242, 239, 232, 0.16);
  --line-strong: rgba(242, 239, 232, 0.32);
  --accent: #ff5a2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16.5px;
  line-height: 1.8;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

/* ---------------- 顶栏 ---------------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.3s;
}
.header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 66px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.logo span {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.nav { display: flex; gap: 26px; }
.nav a {
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.25s;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transition: right 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a:hover::after { right: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: border-color 0.25s, transform 0.25s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }

.menu-btn { display: none; }

/* 移动端抽屉 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--paper);
  padding: 84px var(--gut) 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease);
}
.sheet[data-open="true"] { transform: none; }
.sheet a {
  font-size: 30px;
  letter-spacing: -0.02em;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sheet .close {
  position: absolute;
  right: var(--gut);
  top: 20px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 通用文字 ---------------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -0.025em; }

.display {
  font-size: clamp(46px, 8.2vw, 126px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 26px 0 0;
  text-wrap: balance;
}
.display em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.75;
  margin: 26px 0 0;
  max-width: 54ch;
  color: var(--ink);
  opacity: 0.86;
}

.prose { max-width: 64ch; }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 700; }
.prose em { font-style: normal; color: var(--accent); }

/* ---------------- 首页 ---------------- */
.hero { padding: calc(66px + 11vh) 0 7vh; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 56px;
  align-items: start;
}

.hero-index { padding-top: 6px; }
.hero-index > .mono { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hero-index ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 11px; }
.hero-index li { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--muted); }
.hero-index li span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.hero-index li a { color: var(--ink); transition: color 0.25s; }
.hero-index li a:hover { color: var(--accent); }
.hero-index li i { font-style: normal; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; margin-left: auto; color: var(--muted); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  border-top: 1px solid var(--line);
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: 22px;
}
.hero-meta div span {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.hero-meta div b {
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: 0;
}

/* 作品行 */
.works { padding: 0 0 clamp(60px, 9vw, 120px); }

.work-row {
  display: grid;
  grid-template-columns: 74px 1fr 190px 54px;
  align-items: center;
  gap: 22px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: padding 0.35s var(--ease);
}
.work-row:last-child { border-bottom: 1px solid var(--line); }

.work-num {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  transition: color 0.3s;
}
.work-title {
  font-size: clamp(21px, 2.5vw, 33px);
  letter-spacing: -0.025em;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 16px;
  transition: color 0.3s;
}
.work-title small {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.work-tag { font-size: 13px; color: var(--muted); }
.work-tag i { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; margin-left: 8px; }
.work-arrow {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.35s var(--ease), background-color 0.3s, border-color 0.3s, color 0.3s;
}
.work-row:hover .work-arrow {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateX(4px);
}
.work-row:hover .work-num { color: var(--accent); }
.work-row:hover .work-title { color: var(--accent); }
.work-row:hover { padding-left: 8px; }

/* 跟随鼠标的预览图 */
.peek {
  position: fixed;
  z-index: 55;
  width: 300px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.96);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  background: var(--paper-2);
}
.peek[data-on="true"] { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- 作品页 ---------------- */
.phero { padding: calc(66px + 9vh) 0 clamp(40px, 6vw, 72px); }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 34px;
  transition: color 0.25s, gap 0.25s;
}
.crumb:hover { color: var(--ink); gap: 12px; }

.phero h1 {
  font-size: clamp(38px, 6.4vw, 86px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 20px 0 0;
}
.phero h1 small {
  display: block;
  font-family: var(--f-mono);
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.26em;
  color: var(--muted);
  margin-top: 18px;
  text-transform: uppercase;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px clamp(32px, 5vw, 72px);
  border-top: 1px solid var(--line);
  margin-top: clamp(38px, 5vw, 58px);
  padding-top: 20px;
}
.meta-bar div span {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.meta-bar div b { font-weight: 500; font-size: 14px; }

.hero-figure {
  margin: clamp(36px, 5vw, 64px) 0 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper-2);
}
.hero-figure img { width: 100%; }
.hero-figure figcaption {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 2px 0;
}

/* 章节 */
.section {
  padding: clamp(52px, 7vw, 108px) 0;
  scroll-margin-top: 72px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.section-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: clamp(26px, 4vw, 44px);
}
.section-main h2 { margin-bottom: 22px; }
.section-grid h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.028em;
  max-width: 26ch;
}
.section-grid > .mono { padding-top: 8px; }

.figures {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(24px, 3.4vw, 40px);
}
.figures.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figures.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

figure { margin: 0; }
figure img {
  width: 100%;
  border-radius: 4px;
  background: var(--paper-2);
  cursor: zoom-in;
  transition: transform 0.6s var(--ease), filter 0.4s;
}
figure img:hover { transform: scale(1.012); }
figcaption {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  padding-top: 10px;
}
figcaption b {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  flex: none;
  padding-top: 1px;
}

/* 技术要点 */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: clamp(24px, 3.4vw, 38px);
  border-top: 1px solid var(--line);
}
.specs div {
  padding: 20px 22px 20px 0;
  border-bottom: 1px solid var(--line);
}
.specs dt {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.specs dd { margin: 0; font-size: 14.5px; line-height: 1.65; }

/* 在线体验 */
.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 34px);
  background: var(--paper-2);
  margin-top: clamp(28px, 4vw, 44px);
}
.demo h3 { font-size: clamp(19px, 2vw, 24px); letter-spacing: -0.02em; }
.demo p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); max-width: 52ch; line-height: 1.7; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 上一件 / 下一件 */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.pager a {
  padding: clamp(26px, 4vw, 44px) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background-color 0.3s;
}
.pager a:last-child { text-align: right; align-items: flex-end; border-left: 1px solid var(--line); padding-left: clamp(20px, 4vw, 44px); }
.pager a:hover { color: var(--accent); }
.pager b { font-size: clamp(18px, 2vw, 24px); font-weight: 500; letter-spacing: -0.02em; }

/* ---------------- 关于 / 页脚 ---------------- */
.about {
  padding: clamp(60px, 8vw, 120px) 0;
  border-top: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
}
.about h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.028em; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags span {
  font-size: 12.5px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 46px 0 40px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-end;
}
.footer .mark {
  font-size: clamp(56px, 11vw, 140px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
}
.footer-note { font-size: 12.5px; color: var(--muted); max-width: 34ch; line-height: 1.7; }

/* ---------------- 灯箱 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, #0a0a09 94%, transparent);
  display: grid;
  place-items: center;
  padding: 5vh 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.lightbox[data-open="true"] { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox .cap {
  position: absolute;
  left: 5vw;
  bottom: 3.5vh;
  color: rgba(242, 239, 232, 0.7);
  font-size: 12.5px;
}
.lightbox .x {
  position: absolute;
  right: 5vw;
  top: 3.5vh;
  color: rgba(242, 239, 232, 0.8);
  font-size: 13px;
  border: 1px solid rgba(242, 239, 232, 0.28);
  border-radius: 999px;
  padding: 7px 16px;
}

/* ---------------- 入场动效 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 56px;
  align-items: start;
}

.hero-index { padding-top: 6px; }
.hero-index > .mono { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hero-index ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 11px; }
.hero-index li { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--muted); }
.hero-index li span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.hero-index li a { color: var(--ink); transition: color 0.25s; }
.hero-index li a:hover { color: var(--accent); }
.hero-index li i { font-style: normal; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; margin-left: auto; color: var(--muted); }

.hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .work-row { grid-template-columns: 56px 1fr 56px; }
  .work-tag { display: none; }
  .section-grid, .about-grid { grid-template-columns: 1fr; gap: 14px; }
  .section-grid > .mono { padding-top: 0; }
  .figures.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .peek { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .menu-btn { display: grid; }
  .header-inner { height: 60px; gap: 12px; }
  .hero { padding: calc(60px + 8vh) 0 5vh; }
  .display { font-size: clamp(38px, 12vw, 64px); }
  .work-row { grid-template-columns: 40px 1fr 36px; gap: 14px; padding: 22px 0; }
  .work-title { flex-direction: column; gap: 2px; align-items: flex-start; }
  .work-title small { font-size: 10px; }
  .figures.c2, .figures.c3 { grid-template-columns: 1fr; }
  .meta-bar { gap: 18px 28px; }
  .pager { grid-template-columns: 1fr; }
  .pager a:last-child {
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
    align-items: flex-start;
    padding-left: 0;
  }
  .demo { flex-direction: column; align-items: flex-start; }
  .demo .btn { width: 100%; justify-content: center; }
  .footer .mark { font-size: 22vw; }
  .sheet a { font-size: 26px; }
}
