/* 首页：两屏 + 墨洗过渡 */
body.home { overflow: hidden; height: 100%; }

.page {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

/* 平滑翻页：两屏交叉淡化 + 轻微位移。
   全程保留宣纸底色，任何时刻都不会出现纯黑遮罩。 */
.page.is-leaving  { animation: pageOut .5s cubic-bezier(.4,0,.7,.25) both; pointer-events: none; }
.page.is-entering { animation: pageIn .62s cubic-bezier(.2,.75,.25,1) both; }
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(var(--out-y, -22px)); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(var(--in-y, 22px)); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 背景层 */
.landscape {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: min(46vh, 400px);
  z-index: 1;
  pointer-events: none;
}
/* 用 CSS 模糊（GPU）代替 SVG feGaussianBlur，静态层只算一次 */
.landscape svg { width: 100%; height: 100%; display: block; filter: blur(1.4px); }
.branch {
  position: fixed;
  right: 0; bottom: 0;
  width: clamp(150px, 22vw, 300px);
  height: clamp(180px, 30vh, 330px);
  z-index: 2;
  pointer-events: none;
  opacity: .85;
}
.branch svg { width: 100%; height: 100%; }
.specks { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.specks i {
  position: absolute;
  display: block;
  width: 4px; height: 4px;
  border-radius: 50% 45% 55% 48%;
  background: var(--ink);
  opacity: .17;
}
.specks i:nth-child(1) { left: 12%; top: 24%; width: 6px; height: 5px; opacity: .13; }
.specks i:nth-child(2) { left: 21%; top: 71%; }
.specks i:nth-child(3) { right: 27%; top: 17%; width: 3px; height: 3px; }
.specks i:nth-child(4) { right: 13%; top: 42%; width: 7px; height: 6px; opacity: .1; }
.specks i:nth-child(5) { left: 47%; top: 88%; width: 3px; height: 3px; opacity: .2; }

/* 角款 */
.mark-right {
  right: clamp(22px, 4vw, 62px);
  top: clamp(26px, 7vh, 76px);
  font-size: 15px;
  letter-spacing: 0;
}

/* ---------- 第一屏：题字 ---------- */
.title-block {
  position: absolute;
  left: clamp(30px, 11vw, 190px);
  top: 50%;
  transform: translateY(-52%);
  z-index: 12;
  width: max-content;
  max-width: 88vw;
}
.page-one.first-intro.is-active .title-block { animation: titleIn 1.35s cubic-bezier(.2,.78,.24,1) both; }
@keyframes titleIn {
  from { opacity: 0; transform: translateY(calc(-52% + 30px)); }
  to   { opacity: 1; transform: translateY(-52%); }
}

.title { margin: 0; line-height: 1; font-weight: 400; }
/* 标题是 SVG 矢量字形，用宽度控制大小，任何设备显示都一致 */
.line {
  display: block;
  width: auto;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}
.line-cn {
  width: clamp(210px, 32vw, 440px);
  transform: scaleX(.95) skewX(-1.5deg);
  transform-origin: left center;
}
.line-en {
  width: clamp(230px, 36vw, 480px);
  margin-left: clamp(14px, 5.5vw, 92px);
  margin-top: clamp(2px, .8vw, 12px);
  transform: skewX(-3deg);
  transform-origin: left center;
}

.title-side {
  position: absolute;
  left: calc(100% + clamp(14px, 3vw, 46px));
  top: 4%;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.underline-stroke {
  display: block;
  width: clamp(280px, 38vw, 560px);
  height: 26px;
  margin-top: 12px;
  margin-left: clamp(14px, 5.5vw, 92px);
  opacity: .8;
}
.underline-stroke path { display: block; }

/* 下滑提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 46px);
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(27,26,23,.74);
  font-size: 11px;
  letter-spacing: .3em;
  text-decoration: none;
  text-shadow: 0 0 7px var(--paper), 0 0 16px var(--paper), 0 0 24px var(--paper);
  transition: color .3s;
}
.scroll-hint:hover { color: var(--ink); }
.hint-line { display: block; width: 1px; height: 34px; background: var(--ink-faint); }
.hint-dot {
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: .62;
  animation: hintFloat 2.4s ease-in-out infinite;
}
@keyframes hintFloat {
  0%,100% { transform: translateY(0) scale(1); opacity: .6; }
  50%     { transform: translateY(9px) scale(.75); opacity: .3; }
}
.scroll-hint--up {
  left: clamp(22px, 4vw, 62px);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  gap: 10px;
}

/* ---------- 第二屏：两处入口 ---------- */
.two-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(26px, 5vh, 60px);
  z-index: 12;
  padding: 8vh 4vw;
}
.page-two.first-intro.is-active .two-inner { animation: twoIn 1s cubic-bezier(.2,.78,.24,1) both; }
@keyframes twoIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.two-label {
  margin: 0;
  font-size: 13px;
  letter-spacing: .62em;
  color: var(--ink-soft);
  text-indent: .62em;
}
.page-two.first-intro.is-active .two-label  { animation: riseIn .9s .05s cubic-bezier(.2,.78,.24,1) both; }
.page-two.first-intro.is-active .entries    { animation: riseIn .9s .18s cubic-bezier(.2,.78,.24,1) both; }
.page-two.first-intro.is-active .two-foot   { animation: riseIn .9s .34s cubic-bezier(.2,.78,.24,1) both; }

.entries {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 7vw, 116px);
  flex-wrap: wrap;
}
.enso {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(210px, 24vw, 300px);
  height: clamp(210px, 24vw, 300px);
  color: var(--ink);
  text-decoration: none;
  isolation: isolate;
  transition: transform .55s cubic-bezier(.2,.8,.25,1);
}
.enso::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,26,23,.09) 0%, rgba(27,26,23,.04) 55%, transparent 72%);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .5s, transform .5s;
}
.enso:hover { transform: translateY(-7px); }
.enso:hover::before { opacity: 1; transform: scale(1); }
.enso:focus-visible { outline-offset: 8px; }

.enso-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform .7s cubic-bezier(.2,.8,.25,1), opacity .5s;
}
.enso-ring path { transition: stroke .5s; }
.enso:hover .enso-ring { transform: rotate(9deg) scale(1.045); }
.enso:hover .enso-ring path { stroke: rgba(27,26,23,.92); }

.enso-word {
  position: relative;
  font-family: var(--font-shou);
  font-size: clamp(38px, 4.4vw, 58px);
  letter-spacing: .1em;
  text-indent: .1em;
  line-height: 1.2;
}
.enso-word--small { font-size: clamp(30px, 3.5vw, 46px); }
.enso-sub {
  position: relative;
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-soft);
  opacity: .75;
}
.two-foot {
  margin: 0;
  font-size: 12px;
  letter-spacing: .45em;
  color: var(--ink-soft);
  opacity: .7;
}

/* ---------- 墨滴拖尾过渡 ----------
   一滴墨从纸下方往上滑，身后拖出一条渐细渐淡的墨迹。
   动画由 assets/js/home.js 的 startTrail() 用 canvas 逐帧绘制，
   这里只负责铺满屏幕与淡出。 */
.wash {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.wash.is-on { opacity: 1; }

.ink-trail {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: opacity;
}

/* 页标 */
.dots {
  position: fixed;
  right: clamp(16px, 2.6vw, 42px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dot {
  appearance: none;
  border: 0;
  padding: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(27,26,23,.2);
  cursor: pointer;
  transition: background .35s, transform .35s, box-shadow .35s;
}
.dot.is-on {
  background: var(--ink);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(27,26,23,.07);
}
.dot:hover { background: rgba(27,26,23,.55); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .title-side { display: none; }
  .mark-right { font-size: 11px; }
}
@media (max-width: 760px) {
  .title-block { left: 26px; top: 44%; }
  .line-cn { width: min(64vw, 300px); }
  .line-en { width: min(72vw, 330px); margin-left: 18px; }
  .underline-stroke { width: 66vw; margin-left: 18px; }
  .scroll-hint { left: auto; right: 26px; transform: none; bottom: 24px; }
  .scroll-hint--up { right: 26px; left: auto; top: auto; bottom: 24px; transform: none; }
  .entries { gap: 18px; }
  .enso { width: 190px; height: 190px; }
  .two-inner { gap: 22px; }
  .two-label { font-size: 12px; }
  .branch { opacity: .55; width: 150px; }
  .dots { right: 12px; }
}
@media (max-height: 560px) {
  .title-block { top: 42%; }
  .line-cn { width: min(26vw, 40vh, 340px); }
  .line-en { width: min(30vw, 34vh, 370px); }
  .enso { width: 170px; height: 170px; }
  .two-inner { gap: 12px; }
  .scroll-hint { bottom: 12px; }
  .landscape { height: 34vh; }
}
