/* —— 自托管子集字体（OFL 许可）——
   字符表见 scripts/font-chars.txt，重新子集化跑 scripts/subset-fonts.sh */
@font-face {
  font-family: "LXGW WenKai Screen";
  src: url("/assets/fonts/lxgw-wenkai-screen-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Long Cang";
  src: url("/assets/fonts/longcang-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f1e3;
  --ink: #2b2620;
  --muted: #7a7264;
  --seal: #d8472b;
  --marker: #ffd95e;
  --pen: #2f6f52;
  --hand: "Long Cang", "Kaiti SC", "STKaiti", "KaiTi", cursive;
  --wenkai: "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--wenkai);
  background:
    radial-gradient(rgba(43, 38, 32, 0.07) 1px, transparent 1.4px) 0 0 / 26px 26px,
    var(--paper);
  overflow-x: hidden;
}

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

.desk {
  position: relative;
  width: min(1020px, calc(100% - 48px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 56px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* —— 进场：每样东西像被放到桌上 —— */
@keyframes settle {
  from { opacity: 0; transform: translateY(16px) rotate(var(--r, 0deg)) scale(1.02); }
  to   { opacity: 1; transform: translateY(0) rotate(var(--r, 0deg)) scale(1); }
}
.settle { --r: 0deg; opacity: 0; animation: settle 520ms cubic-bezier(.2,.8,.3,1) forwards; }

/* —— 主画面 —— */
.hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

/* 拍立得照片 */
.polaroid {
  --r: -4deg;
  position: relative;
  width: 300px;
  margin: 0;
  padding: 12px 12px 46px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(43, 38, 32, 0.18), 0 2px 6px rgba(43, 38, 32, 0.1);
  transform: rotate(var(--r));
  transition: transform 360ms cubic-bezier(.2,.8,.3,1);
  animation-delay: 160ms;
}
.polaroid:hover { transform: rotate(-1deg) translateY(-4px); }
.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 40%;
}
.polaroid .tape {
  position: absolute;
  top: -14px; left: 50%;
  width: 96px; height: 28px;
  background: rgba(255, 230, 150, 0.65);
  border-left: 1px dashed rgba(43, 38, 32, 0.12);
  border-right: 1px dashed rgba(43, 38, 32, 0.12);
  transform: translateX(-50%) rotate(2deg);
}
.polaroid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  text-align: center;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--muted);
}

.who { position: relative; }
h1 {
  margin: 0;
  font-size: 76px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation-delay: 260ms;
}
.tagline {
  margin: 22px 0 0;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 700;
  animation-delay: 360ms;
}
.tagline mark {
  color: inherit;
  background: linear-gradient(104deg, transparent 2%, var(--marker) 4%, var(--marker) 96%, transparent 98%);
  padding: 2px 10px;
  border-radius: 2px;
}
.note-hand {
  margin: 18px 0 0;
  font-family: var(--hand);
  font-size: 26px;
  color: var(--pen);
  animation-delay: 460ms;
}

/* —— 便利贴：项目区，可以一直往桌上贴 —— */
.row2 {
  margin-top: 64px;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
  gap: 56px;
  align-items: start;
}
.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: stretch;
}
.sticky {
  --r: 1.6deg;
  position: relative;
  display: block;
  flex: 1 1 260px;
  max-width: 380px;
  padding: 26px 28px 24px;
  color: inherit;
  background: linear-gradient(180deg, #fff3ad, #ffe98e);
  box-shadow: 0 12px 26px rgba(43, 38, 32, 0.16);
  transform: rotate(var(--r));
  transition: transform 320ms cubic-bezier(.2,.8,.3,1), box-shadow 320ms;
  animation-delay: 560ms;
}
/* 第 2、3、4 张便利贴自动换颜色和角度，加新项目不用挑色 */
.notes > .sticky:nth-child(4n+2) {
  --r: -1.8deg;
  background: linear-gradient(180deg, #d9ecff, #c5e1fb);
}
.notes > .sticky:nth-child(4n+2) .eyebrow { color: #3c6285; }
.notes > .sticky:nth-child(4n+3) {
  --r: 1.2deg;
  background: linear-gradient(180deg, #def6d5, #cdeec2);
}
.notes > .sticky:nth-child(4n+3) .eyebrow { color: #4a7a3d; }
.notes > .sticky:nth-child(4n) {
  --r: -1.4deg;
  background: linear-gradient(180deg, #ffe0e6, #ffd0da);
}
.notes > .sticky:nth-child(4n) .eyebrow { color: #9c4a5e; }
.sticky::after { /* 折角 */
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  border-style: solid;
  border-width: 0 0 26px 26px;
  border-color: transparent transparent rgba(43, 38, 32, 0.10) transparent;
}
.sticky:hover {
  transform: rotate(0.2deg) translateY(-5px);
  box-shadow: 0 20px 36px rgba(43, 38, 32, 0.2);
}
.sticky .eyebrow {
  font-family: var(--hand);
  font-size: 24px;
  color: #8a6d1d;
}
.sticky strong {
  display: block;
  margin-top: 6px;
  font-size: 40px;
  line-height: 1.1;
}
.sticky p {
  margin: 10px 0 0;
  font-size: 19px;
  color: #5c5132;
}
.sticky .go {
  display: inline-block;
  margin-top: 16px;
  font-size: 17px;
  color: #2b2620;
  border-bottom: 2px solid rgba(43, 38, 32, 0.5);
}
.sticky:hover .go { border-bottom-color: var(--seal); color: var(--seal); }

/* —— 平台贴纸 —— */
.dock-zone { animation-delay: 660ms; }
.dock-title {
  margin: 0 0 14px;
  font-family: var(--hand);
  font-size: 26px;
  color: var(--muted);
}
.dock {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.dock a,
.dock button {
  --r: 0deg;
  appearance: none;
  cursor: pointer;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border: 3px solid #fffdf8;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  box-shadow: 0 3px 8px rgba(43, 38, 32, 0.16);
  transform: rotate(var(--r));
  transition: transform 240ms cubic-bezier(.2,.8,.3,1);
}
.dock > *:nth-child(1) { --r: -3deg; background: #cfe6ff; }
.dock > *:nth-child(2) { --r: 2deg;  background: #ffd6cc; }
.dock > *:nth-child(3) { --r: -2deg; background: #d6f3cf; }
.dock > *:nth-child(4) { --r: 3deg;  background: #ffe6a6; }
.dock > *:nth-child(5) { --r: -1deg; background: #e7dcff; }
.dock a:hover,
.dock button:hover { transform: rotate(0deg) translateY(-4px) scale(1.04); }
a:focus-visible,
.dock button:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 4px;
}
.platform-note {
  min-height: 34px;
  margin: 16px 0 0;
  font-family: var(--hand);
  font-size: 26px;
  color: var(--seal);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms, transform 300ms;
}
.platform-note.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .desk { width: min(100% - 40px, 560px); padding: 40px 0 48px; }
  .hero { grid-template-columns: 1fr; gap: 36px; justify-items: start; }
  .polaroid { width: min(78%, 280px); }
  h1 { font-size: 56px; }
  .tagline { font-size: 27px; }
  .note-hand { font-size: 24px; }
  .row2 { margin-top: 44px; grid-template-columns: 1fr; gap: 40px; }
  .sticky { flex: 1 1 100%; max-width: none; }
  .sticky strong { font-size: 34px; }
}

@media (max-width: 420px) {
  .desk { width: min(100% - 28px, 560px); padding: 32px 0 40px; }
  .polaroid { width: min(82%, 240px); }
  h1 { font-size: 48px; }
  .tagline { font-size: 24px; }
  .note-hand { font-size: 22px; }
  .sticky strong { font-size: 30px; }
  .sticky p { font-size: 17px; }
  .dock { gap: 10px; }
  .dock a,
  .dock button { padding: 0 16px; font-size: 16px; }
  .platform-note { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .settle { animation: none; opacity: 1; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
