/* =========================================================
   朱兴宇 · Samuel Zhu 个人网站
   Apple 式极简。浅色页面 + 摄影背景。
   零依赖，原生 CSS。
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  /* 中性色阶（近白 / 近黑，避免纯黑纯白） */
  --paper:      #ffffff;   /* 页面底 */
  --paper-2:    #f7f6f3;   /* 次级面 */
  --card:       #ffffff;
  --ink:        #17161a;   /* 主文字 */
  --ink-soft:   #56545c;   /* 次级文字 */
  --ink-faint:  #8a8890;   /* 三级文字 */
  --line:       rgba(23,22,26,.10);
  --line-2:     rgba(23,22,26,.16);

  /* 单一强调色，全站锁定 */
  --accent:     #e4572e;   /* 暖橙 */
  --accent-ink: #c0431f;

  /* 圆角系统：容器 20px，交互元素 pill */
  --r-card: 22px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(23,22,26,.04), 0 18px 50px -24px rgba(23,22,26,.28);
  --shadow-lg: 0 2px 4px rgba(23,22,26,.05), 0 40px 90px -40px rgba(23,22,26,.35);

  --ease: cubic-bezier(.16,1,.3,1);
  --wrap: 1120px;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", system-ui, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.only-desktop { display: none; }
@media (min-width: 720px) { .only-desktop { display: initial; } }

a { color: inherit; text-decoration: none; }
strong { font-weight: 650; }
em { font-style: normal; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; }
.nav__name { font-size: 17px; letter-spacing: -.02em; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  padding: 7px 13px; font-size: 14px; color: var(--ink-soft);
  border-radius: var(--r-pill); transition: color .3s, background .3s;
}
.nav__links a:hover { color: var(--ink); background: var(--line); }
.nav__cta { color: var(--ink) !important; font-weight: 550; }
.nav__cta:hover { background: var(--accent) !important; color: #fff !important; }
@media (max-width: 640px) { .nav__links a:not(.nav__cta) { display: none; } }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100dvh; display: flex; align-items: center;
  padding: 96px 0 80px; overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; width: 100%; }

.hero__eyebrow {
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 22px;
}
.hero__title {
  margin: 0; font-weight: 640; letter-spacing: -.03em; line-height: 1.04;
  font-size: clamp(2.5rem, 8.5vw, 5.75rem);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line__i {
  display: block; transform: translateY(110%);
  animation: lineUp .95s var(--ease) forwards;
}
.hero__title .line:nth-child(1) .line__i { animation-delay: .08s; }
.hero__title .line:nth-child(2) .line__i { animation-delay: .20s; }
.hero__title .line:nth-child(3) .line__i { animation-delay: .32s; }
.hero__title em { color: var(--accent); }
@keyframes lineUp { to { transform: translateY(0); } }

.hero__lede {
  margin: 30px 0 0; max-width: 33ch; font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink-soft); line-height: 1.55;
}
.hero__actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero__hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2;
}
.hero__hint span {
  display: block; width: 1px; height: 46px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: hintPulse 2.4s var(--ease) infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .3; transform: scaleY(.7); } 50% { opacity: 1; transform: scaleY(1); } }

/* 背景光斑 */
.hero__field { position: absolute; inset: 0; z-index: 1; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  will-change: transform;
}
.blob--1 { width: 46vw; height: 46vw; top: -12vw; right: -8vw;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 62%);
  opacity: .32; animation: drift1 24s var(--ease) infinite alternate; }
.blob--2 { width: 40vw; height: 40vw; bottom: -14vw; left: -10vw;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--ink) 60%, var(--accent)), transparent 60%);
  opacity: .16; animation: drift2 30s var(--ease) infinite alternate; }
.blob--3 { width: 30vw; height: 30vw; top: 40%; left: 46%;
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 65%);
  opacity: .12; animation: drift1 20s var(--ease) infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(-6vw, 5vw, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(7vw, -4vw, 0) scale(1.1); } }

.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 13px 26px; border-radius: var(--r-pill); font-size: 15px; font-weight: 550;
  letter-spacing: -.01em; border: 1px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease), background .35s, border-color .35s, color .35s, box-shadow .35s;
}
.btn--primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- 通用区块 ---------- */
.section { padding: clamp(88px, 13vw, 168px) 0; }
.section__title {
  margin: 0; font-weight: 640; letter-spacing: -.025em; line-height: 1.08;
  font-size: clamp(2rem, 5vw, 3.4rem);
}
.section__sub { margin: 18px 0 0; color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 46ch; }

/* 滚动进场 */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 关于 ---------- */
.about { border-top: 1px solid var(--line); }
.about__grid { display: grid; grid-template-columns: 1fr; gap: 34px; }
@media (min-width: 860px) { .about__grid { grid-template-columns: 200px 1fr; gap: 64px; } }
.about__label {
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  font-weight: 600; padding-top: 8px;
}
.about__body { max-width: 62ch; }
.lead { font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.4; letter-spacing: -.02em; margin: 0 0 26px; font-weight: 500; }
.about__body p { margin: 0 0 20px; color: var(--ink-soft); font-size: 1.075rem; }
.about__body .lead { color: var(--ink); }

.facts { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 0; }
.facts li {
  display: flex; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); align-items: baseline;
}
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts__k { flex: 0 0 64px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.facts__v { color: var(--ink); font-size: 1.02rem; }

/* ---------- 在做：粘性堆叠 ---------- */
.work .section__title, .work .section__sub { }
.stack { max-width: var(--wrap); margin: 56px auto 0; padding: 0 24px; }
.stack__card {
  position: sticky; top: 96px; margin-bottom: 28px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: clamp(30px, 5vw, 60px);
  display: grid; grid-template-columns: 1fr; gap: 20px;
  overflow: hidden;
}
@media (min-width: 800px) { .stack__card { grid-template-columns: 120px 1fr; gap: 40px; align-items: start; } }
.stack__card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
}
.card--content::after { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--ink) 8%, transparent), transparent 55%); }
.card--product::after { background: radial-gradient(120% 100% at 100% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 52%); }
.stack__index {
  font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 640; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.4px var(--line-2); line-height: 1; position: relative; z-index: 1;
}
.stack__content { position: relative; z-index: 1; max-width: 60ch; }
.stack__content h3 { margin: 0 0 16px; font-size: clamp(1.4rem, 3.2vw, 2.1rem); letter-spacing: -.02em; font-weight: 600; }
.stack__content p { margin: 0; color: var(--ink-soft); font-size: 1.06rem; line-height: 1.62; }
/* ---------- 喜欢：横向滚动 ---------- */
.likes { border-top: 1px solid var(--line); overflow: hidden; }
.rail {
  display: flex; gap: 22px; margin-top: 52px; padding: 8px 24px 30px;
  max-width: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail::before, .rail::after { content: ""; flex: 0 0 max(0px, calc((100vw - var(--wrap)) / 2)); }
.tile {
  scroll-snap-align: start; flex: 0 0 clamp(280px, 78vw, 360px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 32px 30px 34px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 300px;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s;
}
.tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.tile__no {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
  font-weight: 600; margin-bottom: auto;
}
.tile h3 { margin: 60px 0 12px; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.24; font-weight: 600; }
.tile p { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.rail__hint { max-width: var(--wrap); margin: 4px auto 0; padding: 0 24px; color: var(--ink-faint); font-size: 13px; letter-spacing: .04em; }

/* ---------- 联系 ---------- */
.contact { border-top: 1px solid var(--line); text-align: left; }
.contact__title { margin: 0; font-size: clamp(1.9rem, 5vw, 3.4rem); letter-spacing: -.025em; line-height: 1.12; font-weight: 640; }
.contact__grid { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 48px; }
@media (min-width: 720px) { .contact__grid { grid-template-columns: repeat(2, 1fr); } }
.contact__item {
  display: flex; flex-direction: column; gap: 8px; padding: 26px 0; border-top: 1px solid var(--line);
  transition: color .3s;
}
@media (min-width: 720px) { .contact__item { padding: 8px 4px; border-top: 0; } }
.contact__k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.contact__v { font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; transition: color .3s; }
a.contact__item:hover .contact__v { color: var(--accent); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; justify-content: space-between; }
.footer__name { font-weight: 600; letter-spacing: -.01em; }
.footer__note { color: var(--ink-faint); font-size: 14px; }

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__title .line__i { animation: none; transform: none; }
  .blob { animation: none; }
  .hero__hint span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* =========================================================
   摄影胶片版首屏
   ========================================================= */
.photo-hero {
  min-height: 100svh;
  color: var(--ink);
  background: var(--paper);
  isolation: isolate;
}

.photo-hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.photo-hero__backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 56%;
  filter: saturate(.9) contrast(1.02) brightness(1.04);
  transform: scale(1.06);
}

.photo-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(246, 245, 243, .94), rgba(246, 245, 243, .64) 44%, rgba(246, 245, 243, .16)),
    linear-gradient(180deg, rgba(246, 245, 243, .1), rgba(246, 245, 243, .74));
}

.photo-hero__inner {
  padding-top: 38px;
  padding-bottom: 120px;
}

.photo-hero .hero__eyebrow,
.photo-hero .hero__lede {
  color: var(--ink-soft);
  text-shadow: 0 1px 18px rgba(255, 255, 255, .5);
}

.photo-hero__title {
  max-width: 9.5ch;
  color: var(--ink);
  text-shadow: 0 10px 50px rgba(255, 255, 255, .42);
}

.photo-hero .btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.photo-hero .btn--ghost {
  color: var(--ink);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .42);
  backdrop-filter: blur(16px);
}

.film-ribbon {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  width: max-content;
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.film-ribbon--hero {
  position: absolute;
  z-index: 2;
  left: 46vw;
  top: 18vh;
  opacity: .24;
  transform: rotate(-9deg) translate3d(var(--film-x, 0px), 0, 0);
  pointer-events: none;
}

.film-ribbon--story {
  position: relative;
  transform: translate3d(var(--film-x, 0px), 0, 0);
  padding: 0 10vw;
  contain: paint;
}

.film-frame {
  position: relative;
  flex: 0 0 clamp(230px, 30vw, 420px);
  aspect-ratio: 16 / 10;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(23, 22, 26, .10);
  border-radius: 20px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(23,22,26,.14), rgba(23,22,26,.02)) border-box;
  box-shadow: 0 16px 42px rgba(23, 22, 26, .12);
  overflow: hidden;
  contain: paint;
}

.film-frame--tall {
  flex-basis: clamp(170px, 22vw, 300px);
  aspect-ratio: 9 / 14;
}

.film-frame::before,
.film-frame::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  height: 6px;
  background-image: radial-gradient(circle, rgba(23,22,26,.18) 1.3px, transparent 1.6px);
  background-size: 16px 6px;
  opacity: .22;
  z-index: 2;
}

.film-frame::before { top: 3px; }
.film-frame::after { bottom: 3px; }

.film-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  filter: saturate(.98) contrast(1.02);
  transition: transform .45s var(--ease), filter .45s var(--ease);
  will-change: transform;
}

.film-frame:hover img,
.film-frame:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.03) contrast(1.04);
}

.photo-story {
  min-height: 250vh;
  background:
    radial-gradient(circle at 18% 22%, rgba(228, 87, 46, .08), transparent 30%),
    linear-gradient(180deg, #ffffff, var(--paper) 58%, #ffffff);
  color: var(--ink);
  overflow: clip;
}

.photo-story__sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: clamp(34px, 8vh, 78px);
  padding: clamp(84px, 10vh, 120px) 0;
}

.photo-story__copy {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 48px));
  margin-left: max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
}

.photo-story__label {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.photo-story h2 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.8rem);
  line-height: .98;
  letter-spacing: -.045em;
  max-width: 12ch;
}

.photo-story__copy p:last-child {
  max-width: 44ch;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .photo-hero__inner {
    padding-bottom: 140px;
  }

  .photo-hero__title {
    max-width: 8ch;
  }

  .film-ribbon--hero {
    left: 18vw;
    top: auto;
    bottom: 78px;
    opacity: .3;
  }

  .photo-story {
    min-height: 210vh;
  }

  .photo-story__copy {
    margin-left: 24px;
  }

  .film-ribbon--story {
    padding: 0 24px;
  }

  .film-frame {
    flex-basis: 76vw;
  }

  .film-frame--tall {
    flex-basis: 54vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-ribbon,
  .film-ribbon--hero,
  .film-ribbon--story {
    transform: none !important;
  }
}
