/* =============================================================
 * donutlab · minimal edition (Apple-style)
 * ============================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #fbfbfd;
  --bg-mid: #f5f5f7;

  --fg: #1d1d1f;
  --fg-muted: #6e6e73;
  --fg-soft: #86868b;

  --line: #e6e6e6;
  --line-soft: #f0f0f3;

  --accent: #0066cc;

  --max: 1080px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* =============================================================
 * 重置与基础
 * ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .25s var(--ease), opacity .25s var(--ease);
}

img, svg { display: block; max-width: 100%; }

::selection { background: rgba(0, 102, 204, .18); color: var(--fg); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================================
 * 导航（Apple-style sticky + blur）
 * ============================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  font-size: 14px;
  color: var(--fg);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}

.nav.is-scrolled {
  background: rgba(255, 255, 255, .92);
  border-bottom-color: rgba(0, 0, 0, .08);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -.005em;
  justify-self: start;
  cursor: pointer;
  transition: opacity .25s var(--ease);
}
.nav__brand:hover { opacity: .65; }

.nav__logo {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.nav__center {
  justify-self: center;
  display: flex;
  gap: 32px;
}

.nav__center a {
  color: var(--fg);
  opacity: .8;
  font-weight: 400;
  position: relative;
}

.nav__center a:hover { opacity: 1; }
.nav__center a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.nav__center a:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 820px) {
  .nav__center { display: none; }
  .nav { grid-template-columns: 1fr auto; }
}

/* =============================================================
 * HERO
 * ============================================================= */
.hero {
  padding: 96px 0 24px;
  text-align: center;
  position: relative;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  margin: 0 0 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-soft);
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.hero__title {
  margin: 0;
  font-size: clamp(48px, 8.5vw, 104px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 920px;
  color: var(--fg);
}

.hero__title span {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.hero__title.is-visible span { opacity: 1; transform: none; }
.hero__title.is-visible span:nth-child(1) { transition-delay: .05s; }
.hero__title.is-visible span:nth-child(2) { transition-delay: .22s; }

.accent {
  background: linear-gradient(135deg, #1d1d1f 0%, #6e6e73 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__lede {
  margin: 28px auto 0;
  font-size: clamp(19px, 2.2vw, 23px);
  color: var(--fg-muted);
  letter-spacing: -.005em;
  max-width: 540px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease) .55s, transform 1s var(--ease) .55s;
}

.hero__cta {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease) .75s, transform 1s var(--ease) .75s;
}

.hero__hint {
  margin-top: 72px;
  font-size: 26px;
  color: var(--fg-soft);
  animation: hint 2.6s ease-in-out infinite;
  user-select: none;
}

@keyframes hint {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* 当 hero__inner 进入视口，触发一行入场 */
.hero__inner.is-visible .eyebrow,
.hero__inner.is-visible .hero__lede,
.hero__inner.is-visible .hero__cta { opacity: 1; transform: none; }
.hero__inner.is-visible .hero__title.is-visible span { opacity: 1; transform: none; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  padding: 12px 22px;
  border-radius: 980px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .35s var(--ease), background .25s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease),
              box-shadow .35s var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--fg);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.btn--primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.btn--secondary {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}
.btn--secondary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 102, 204, .25);
}

@media (max-width: 540px) {
  .btn { padding: 11px 18px; font-size: 15px; }
  .contact__mail { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
}

/* =============================================================
 * 通用 section
 * ============================================================= */
.section {
  padding: clamp(80px, 12vw, 144px) 0;
  border-top: 1px solid var(--line-soft);
}

.kicker {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-soft);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.h2 {
  margin: 0 0 24px;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 760px;
}

.bigtext {
  margin: 0 0 24px;
  font-size: clamp(40px, 7.4vw, 84px);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.05;
  max-width: 880px;
  color: var(--fg);
}

.bigtext em {
  font-style: normal;
  color: var(--fg-muted);
}

.lede {
  margin: 0;
  font-size: clamp(17px, 1.9vw, 21px);
  color: var(--fg-muted);
  max-width: 640px;
  letter-spacing: -.005em;
  line-height: 1.55;
}

.lede em {
  font-style: normal;
  color: var(--fg);
  border-bottom: 1px solid rgba(0, 0, 0, .15);
  padding-bottom: 1px;
}

/* =============================================================
 * PHILOSOPHY · 主张
 * ============================================================= */
.philosophy {
  background: var(--bg);
}

.philosophy .lede {
  margin-top: 32px;
}

/* =============================================================
 * WORK · 作品卡（四宫格，圆角 + 细线分割）
 * ============================================================= */
.work {
  background: var(--bg);
}

.work__grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  overflow: hidden;
}

.card {
  position: relative;
  padding: 56px 48px;
  background: var(--bg);
  transition: background .35s var(--ease);
}

.card:hover {
  background: var(--bg-soft);
}

.card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  margin-bottom: 28px;
  background: var(--bg-mid);
  position: relative;
  overflow: hidden;
}

/* 卡片缩略图：四种极简纯色 + 微结构 */
.card__thumb--01 {
  background: linear-gradient(135deg, #f5f5f7 0%, #ededef 100%);
}
.card__thumb--01::before,
.card__thumb--01::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, .04);
}
.card__thumb--01::before {
  width: 24%;
  height: 24%;
  top: 28%;
  left: 26%;
}
.card__thumb--01::after {
  width: 36%;
  height: 36%;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .06);
}

.card__thumb--02 {
  background: #f7f7f9;
}
.card__thumb--02::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0,
    transparent 33.3%,
    rgba(0, 0, 0, .04) 33.3%,
    rgba(0, 0, 0, .04) calc(33.3% + 1px),
    transparent calc(33.3% + 1px),
    transparent 66.6%,
    rgba(0, 0, 0, .04) 66.6%,
    rgba(0, 0, 0, .04) calc(66.6% + 1px),
    transparent calc(66.6% + 1px)
  );
}
.card__thumb--02::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 25%;
  width: 22%;
  height: 8%;
  background: rgba(0, 0, 0, .65);
  border-radius: 4px;
  transform: translateX(-50%);
}

.card__thumb--03 {
  background: #f4f4f6;
}
.card__thumb--03::before {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
}
.card__thumb--03::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .25);
}

.card__thumb--04 {
  background: linear-gradient(135deg, #f6f6f8 0%, #ececef 100%);
}
.card__thumb--04::before {
  content: "";
  position: absolute;
  inset: 28% 18%;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
}
.card__thumb--04::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, .12);
  transform: translateY(-50%);
}

.card__num {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-soft);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.card__title {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--fg);
}

.card__desc {
  margin: 0;
  font-size: 15.5px;
  color: var(--fg-muted);
  max-width: 460px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .work__grid { grid-template-columns: 1fr; border-radius: 16px; }
  .card { padding: 40px 28px; }
}

/* =============================================================
 * TRANSIT · 极繁 vs 极简 并排
 * ============================================================= */
.transit {
  background: var(--bg);
}

.transit__pair {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.transit__col {
  padding: 56px 48px;
  position: relative;
}

.transit__col--after { background: var(--bg-soft); }

.transit__label {
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

.transit__col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 18px;
  line-height: 1.4;
}

.transit__col li {
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--fg);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.transit__col li:last-child { border-bottom: 1px solid var(--line-soft); }

.transit__col li::before {
  content: "·";
  color: var(--fg-soft);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: -2px;
}

.transit__col--after li::before { color: var(--accent); }

@media (max-width: 820px) {
  .transit__pair { grid-template-columns: 1fr; }
  .transit__col { padding: 40px 28px; }
}

/* =============================================================
 * CONTACT
 * ============================================================= */
.contact {
  background: var(--bg);
}

.contact__title {
  margin-top: 4px;
  font-size: clamp(32px, 5vw, 56px);
}

.contact__mail {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: -.01em;
  position: relative;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* 箭头：hover 时右移 */
.contact__mail::before {
  content: "→";
  display: inline-block;
  margin-left: .35em;
  transition: transform .4s var(--ease);
}
.contact__mail:hover::before {
  transform: translateX(6px);
}

/* 下划线：默认隐藏，hover 从左往右展开 */
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: .35em;
  bottom: .12em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s var(--ease);
}
.contact__mail:hover::after {
  transform: scaleX(1);
}

.contact .lede { margin-top: 36px; }

/* =============================================================
 * Footer
 * ============================================================= */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 36px 0;
  background: var(--bg);
  font-size: 13px;
  color: var(--fg-soft);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .25s var(--ease);
}
.footer__brand:hover { opacity: .75; }
.footer__brand > span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1.1;
}

.footer__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .06),
    0 1px 2px rgba(0, 0, 0, .06);
  flex-shrink: 0;
}

.footer__name { color: var(--fg); }
.footer__role {
  color: var(--fg-soft);
  font-weight: 400;
  font-size: 13px;
}

.footer__meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
}

/* =============================================================
 * Scroll-driven entrance
 * ============================================================= */
[data-stagger] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-stagger].is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================================
 * 减少动效
 * ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-stagger],
  .hero__title span,
  .eyebrow, .hero__lede, .hero__cta {
    opacity: 1 !important;
    transform: none !important;
  }
  .nav { background: rgba(255, 255, 255, .92); border-bottom-color: rgba(0,0,0,.08); }
}

/* =============================================================
 * 小屏
 * ============================================================= */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .section { padding: 80px 0; }
  .hero { padding-top: 64px; }
  .hero__hint { margin-top: 56px; }
  .footer__inner { justify-content: flex-start; }
}
