/* ==========================================================================
   Cyhao — 个人主页
   极简黑白 / 大字号 / 纯手写
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #f2f1ed;
  --bg-elev: #ffffff;
  --fg: #111110;
  --fg-soft: #4a4a46;
  --fg-mute: #8b8b85;
  --line: rgba(17, 17, 16, 0.14);
  --line-strong: rgba(17, 17, 16, 0.32);
  --invert-bg: #111110;
  --invert-fg: #f2f1ed;

  --font-sans: "Archivo", "Inter", "Helvetica Neue", "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --gutter: clamp(20px, 4.6vw, 72px);
  --maxw: 1600px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --head-h: 68px;
}

html[data-theme="dark"] {
  --bg: #0c0c0c;
  --bg-elev: #141413;
  --fg: #f0efea;
  --fg-soft: #b9b8b1;
  --fg-mute: #77766f;
  --line: rgba(240, 239, 234, 0.14);
  --line-strong: rgba(240, 239, 234, 0.34);
  --invert-bg: #f0efea;
  --invert-fg: #0c0c0c;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* 页面顶部锚点（固定顶栏不能当锚点，浏览器会认为它一直在视口内） */
.anchor-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ---------- Utilities ---------- */
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}

.label--muted { color: var(--fg-mute); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  transform: translateY(-150%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
}
html[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.16; }

/* ---------- Scroll progress ---------- */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  background: transparent;
  pointer-events: none;
}
.page-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar__mark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.topbar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  align-self: center;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}
.topbar__suffix {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
}

.topbar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}
.topbar__nav a {
  position: relative;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--fg-soft);
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}
.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.35s var(--ease);
}
.topbar__nav a:hover { color: var(--fg); }
.topbar__nav a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clock {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.5s var(--ease);
}
.theme-toggle:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: rotate(-25deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--head-h) + clamp(20px, 3.4vw, 54px)) var(--gutter) 0;
}

.hero__meta {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* --- 巨型名字 --- */
.hero__name {
  margin: clamp(8px, 1.6vw, 22px) 0 0;
  padding-bottom: 0.16em;
  font-size: clamp(76px, 19vw, 312px);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.055em;
}
.hero__name-inner {
  display: block;
}

/* --- 名字下面的双栏正文 --- */
.hero__body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.6vw, 24px);
  row-gap: clamp(20px, 3vw, 40px);
  align-items: start;
  margin-top: clamp(16px, 1.8vw, 32px);
}

.hero__col {
  grid-column: 1 / span 7;
  display: flex;
  flex-direction: column;
}

.hero__role {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill--ghost {
  border-color: var(--line-strong);
  color: var(--fg-soft);
  border-style: dashed;
}

.hero__statement {
  margin-top: clamp(28px, 3vw, 42px);
  font-size: clamp(28px, 3.9vw, 58px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* 「王道」下方压一条粗黑线，像马克笔划过，不遮字形 */
.hero__statement .ink {
  position: relative;
  display: inline-block;
  padding: 0 0.04em;
  background-image: linear-gradient(var(--fg), var(--fg));
  background-repeat: no-repeat;
  background-position: 0 94%;
  background-size: 0% 0.14em;
  transition: background-size 0.8s var(--ease) 0.95s;
  will-change: background-size;
}
.hero__statement.is-revealed .ink {
  background-size: 100% 0.14em;
}

.hero__lede {
  margin-top: clamp(18px, 2.2vw, 30px);
  max-width: 48ch;
  font-size: clamp(15px, 1.12vw, 16.5px);
  line-height: 1.9;
  color: var(--fg-soft);
}

/* --- 头像 --- */
.hero__portrait {
  grid-column: 8 / span 5;
  grid-row: 1 / span 2;
  margin-top: clamp(4px, 1vw, 14px);
  position: relative;
}

.hero__portrait-frame {
  position: relative;
  overflow: hidden;
  background: var(--fg);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}
.hero__portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(1.02) contrast(1.02);
  transform: scale(1.04);
  transition: transform 1.2s var(--ease), filter 0.9s var(--ease);
  will-change: transform;
}
.hero__portrait:hover .hero__portrait-frame img {
  transform: scale(1);
  filter: saturate(1.08) contrast(1.02) brightness(1.03);
}

.hero__portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.hero__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(44px, 6vw, 96px);
  padding-bottom: clamp(28px, 3.4vw, 48px);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}
.scroll-cue__line {
  display: block;
  width: 54px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}
.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: translateX(-100%);
  animation: cue 2.4s var(--ease-io) infinite;
}
@keyframes cue {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  overflow: hidden;
  background: var(--bg);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 30px;
  padding-right: 14px;
  flex: none;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-size: clamp(15px, 1.45vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marquee__sep {
  font-size: 12px;
  color: var(--fg-mute);
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-33.3333%, 0, 0); }
}

/* ==========================================================================
   Section shell
   ========================================================================== */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 140px) var(--gutter);
  scroll-margin-top: calc(var(--head-h) + 16px);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: end;
  gap: 24px;
  padding-bottom: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--line-strong);
}

.section__title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(38px, 6vw, 88px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.section__num {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  transform: translateY(-0.9em);
}
.section__desc {
  justify-self: end;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--fg-soft);
  text-align: right;
}

/* ==========================================================================
   Works
   ========================================================================== */
.work {
  border-bottom: 1px solid var(--line);
}
.work:first-child { border-top: 1px solid var(--line); }

.work__link {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.6vw, 24px);
  row-gap: clamp(18px, 2.4vw, 32px);
  align-items: start;
  padding: clamp(30px, 4vw, 64px) 0;
  position: relative;
  z-index: 0;
}

/* hover 时整行淡底 */
.work__link::before {
  content: "";
  position: absolute;
  inset: 0;
  left: calc(var(--gutter) * -0.55);
  right: calc(var(--gutter) * -0.55);
  background: var(--bg-elev);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s var(--ease);
}
.work__link:hover::before { opacity: 1; }

.work__text {
  grid-column: 1 / span 8;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work__meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.work__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  transition: color 0.4s var(--ease);
}
.work__link:hover .work__index { color: var(--fg); }
.work__year { margin-left: auto; }

.work__title {
  font-size: clamp(32px, 4.2vw, 66px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.06;
  transition: transform 0.55s var(--ease);
}
.work__link:hover .work__title { transform: translateX(8px); }

.work__desc {
  max-width: 50ch;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--fg-soft);
}

.work__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--fg-soft);
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}
.work__link:hover .tag { border-color: var(--line-strong); color: var(--fg); }

.work__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.arrow {
  transition: transform 0.5s var(--ease);
}
.work__link:hover .arrow,
.contact-link:hover .arrow { transform: translate(3px, -3px); }

/* --- 缩略图（纯代码生成，无外链） --- */
.work__thumb {
  grid-column: 10 / span 3;
  display: block;
  aspect-ratio: 4 / 4.9;
  min-height: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  background: var(--bg-elev);
  transition: transform 0.7s var(--ease), border-color 0.4s var(--ease);
  contain: layout paint;
}

/* 缩略图内部绝对定位，避免内容把 aspect-ratio 撑高 */
.work__thumb > .mock {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow: hidden;
}
.work__link:hover .work__thumb {
  transform: translateY(-5px);
  border-color: var(--line-strong);
}

.work__thumb--video {
  aspect-ratio: 4 / 3;
  grid-column: 9 / span 4;
}

.mock {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: clamp(14px, 1.7vw, 24px);
}

/* 模拟通知卡片 */
.mock--notify {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, var(--line) 27px 28px),
    var(--bg-elev);
}
.mock__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.mock__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.mock__title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
}
.mock__body { display: flex; flex-direction: column; gap: 12px; }
.mock__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: clamp(9px, 0.86vw, 11.5px);
  line-height: 1.5;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--line);
}
.mock__key {
  flex: none;
  min-width: 44px;
  color: var(--fg-mute);
}
.mock__val { color: var(--fg); }
.mock__row--dim .mock__val { color: var(--fg-soft); }
.mock__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mock__badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  padding: 3px 6px;
  background: var(--fg);
  color: var(--bg);
}
.mock__hint {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--fg-mute);
}

/* ---------- 视频封面 ---------- */
.work__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.02);
  transition: transform 1s var(--ease), filter 0.6s var(--ease);
  filter: saturate(1.02) contrast(1.02);
}
.work__link:hover .work__cover {
  transform: scale(1.06);
  filter: saturate(1.1) contrast(1.03) brightness(1.02);
}

.work__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(44px, 4.2vw, 60px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(12, 12, 12, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: transform 0.5s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.work__link:hover .work__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: #f2f1ed;
  color: #111110;
}

/* ==========================================================================
   About
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  padding-top: clamp(28px, 4vw, 56px);
}

.about__lead {
  grid-column: 1 / -1;
  max-width: 22ch;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.7vw, 58px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.about__lead .mark {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  font-style: normal;
}
/* 中文着重号：两个实心小圆点 */
.about__lead .mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.14em;
  height: 0.1em;
  background-image: radial-gradient(circle at 50% 50%, var(--fg) 45%, transparent 48%);
  background-size: 0.34em 0.1em;
  background-repeat: repeat-x;
}

.about__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.95;
  color: var(--fg-soft);
  padding-top: 6px;
}
.about__body p::first-letter { color: var(--fg); }

.facts {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  align-self: start;
}
.facts__item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.facts__item dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding-top: 3px;
}
.facts__item dd { color: var(--fg); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-list {
  border-top: 1px solid var(--line);
}
.contact-list li + li { border-top: 1px solid var(--line); }

.contact-link {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr) 24px;
  align-items: center;
  gap: 20px;
  padding: clamp(20px, 2.4vw, 32px) 0;
  position: relative;
  z-index: 0;
}
.contact-link::after {
  content: "";
  position: absolute;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  top: 0;
  bottom: 0;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease);
  z-index: -1;
}
.contact-link:hover { color: var(--bg); }
.contact-link:hover::after { transform: scaleY(1); }

.contact-link__label {
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.contact-link__handle {
  font-family: var(--font-mono);
  font-size: clamp(12px, 0.95vw, 13.5px);
  letter-spacing: 0.02em;
  color: var(--fg-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.35s var(--ease);
}
.contact-link:hover .contact-link__handle { color: inherit; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line-strong);
  background: var(--bg);
}
.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer__top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--fg-soft);
  transition: color 0.3s var(--ease);
}
.site-footer__top:hover { color: var(--fg); }
.site-footer__top:hover svg { transform: translateY(-2px); }
.site-footer__top svg { transition: transform 0.4s var(--ease); }

/* ==========================================================================
   Reveal animation
   ========================================================================== */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* 名字的字符级入场 */
.hero__name-inner {
  animation: nameIn 1.4s var(--ease) 0.1s both;
}
@keyframes nameIn {
  from {
    opacity: 0;
    transform: translate3d(0, 0.16em, 0);
    letter-spacing: -0.02em;
  }
  to {
    opacity: 1;
    transform: none;
    letter-spacing: -0.055em;
  }
}

/* 无 JS 时的兜底：不要等任何脚本，直接呈现最终状态 */
html:not(.js) .hero__name-inner {
  animation: none;
  opacity: 1;
  transform: none;
}
html:not(.js) .hero__statement .ink {
  background-size: 100% 0.14em;
}
html:not(.js) .marquee__track {
  animation: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero__col { grid-column: 1 / span 8; }
  .hero__portrait { grid-column: 9 / span 4; }
  .work__text { grid-column: 1 / span 8; }
  .work__thumb { grid-column: 10 / span 3; }
}

@media (max-width: 860px) {
  :root { --head-h: 60px; }

  .topbar__suffix,
  .clock { display: none; }

  .hero { padding-top: calc(var(--head-h) + 24px); }

  .hero__name {
    font-size: clamp(64px, 22vw, 150px);
    line-height: 0.84;
    letter-spacing: -0.045em;
  }

  .hero__body {
    grid-template-columns: 1fr;
    row-gap: 30px;
  }
  .hero__col,
  .hero__portrait { grid-column: 1 / -1; grid-row: auto; }
  .hero__statement { font-size: clamp(26px, 7.2vw, 44px); }
  .hero__lede { font-size: 15px; }

  .hero__portrait {
    margin-top: 0;
    max-width: 460px;
    width: 100%;
  }
  .hero__portrait-frame { aspect-ratio: 1 / 1; max-width: 78vw; }

  .section__head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }
  .section__desc { justify-self: start; text-align: left; }

  .work__link { row-gap: 22px; }
  .work__text { grid-column: 1 / -1; order: 2; }
  .work__thumb {
    grid-column: 1 / -1;
    order: 1;
    aspect-ratio: auto;
    height: 260px;
    max-width: none;
  }
  .work__thumb--video { height: 232px; }
  .work__title { font-size: clamp(28px, 7vw, 44px); }
  .mock__row { font-size: 10.5px; }

  .about__grid { grid-template-columns: 1fr; }
  .about__body { padding-top: 0; }

  .contact-link {
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
  }
  .contact-link__handle {
    grid-column: 1;
    grid-row: 2;
    font-size: 11px;
  }
  .contact-link .arrow { grid-column: 2; grid-row: 1 / span 2; }

  .marquee__track { animation-duration: 24s; }
}

@media (max-width: 560px) {
  .hero__meta { padding-bottom: 10px; }
  .hero__foot { flex-direction: column; align-items: flex-start; gap: 14px; }
  .contact-link__label { font-size: 20px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .about__lead { font-size: 26px; }
  .facts__item { grid-template-columns: 74px minmax(0, 1fr); }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
