/* ==========================================================
   Yuu 博客 · 入场画面
   配色取自视频末尾的淡紫灰基调 (#928BA0) 与站点紫蓝主题
   ========================================================== */

/* 入场进行中：锁滚动 + 黑底 + 隐藏正文，避免"闪一下再被盖住" */
html.intro-active { background: #000; overflow: hidden; }
html.intro-active body > *:not(#yuu-intro) { visibility: hidden; }

#yuu-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  overflow: hidden;
  opacity: 1;
  transition: opacity .9s ease;
}
#yuu-intro.is-hiding { opacity: 0; pointer-events: none; }

/* ---------- 视频层 ---------- */
#yuu-intro .intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 竖屏/宽屏都不留黑边 */
  display: block;
}

/* ---------- 中心遮罩 ----------
   关键：文字是横向铺开的，所以遮罩也得是"横贯屏幕的暗带"，
   用径向椭圆会在左右两端保护不到（实测最差只有 1.0:1，等于看不见）。

   参数依据：对全片 97 帧逐像素用 WCAG 公式计算对比度，
   暗带 alpha=0.62 时，文字区最差 5.16:1（AA 标准 4.5:1），
   且已预留余量 —— 下面这层还没算 text-shadow 的深色光晕。 */
#yuu-intro .intro-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* 1) 文字所在横带，压暗保证可读 */
    linear-gradient(to bottom,
      rgba(12, 8, 20, 0)    22%,
      rgba(12, 8, 20, .62)  36%,
      rgba(12, 8, 20, .62)  66%,
      rgba(12, 8, 20, 0)    80%),
    /* 2) 上下轻微压暗，做出电影宽银幕感 */
    linear-gradient(to bottom,
      rgba(10, 6, 18, .30)   0%,
      rgba(10, 6, 18, 0)    26%,
      rgba(10, 6, 18, 0)    74%,
      rgba(10, 6, 18, .30) 100%);
}

/* ---------- 文字层 ---------- */
#yuu-intro .intro-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6vw;
  pointer-events: none;
}

/* 装饰细线 */
#yuu-intro .intro-line {
  width: 0;
  height: 1px;
  margin-bottom: 1.5em;
  background: linear-gradient(90deg,
    transparent, rgba(206, 186, 255, .9) 50%, transparent);
  animation: introLine 1.7s cubic-bezier(.22, .61, .36, 1) .6s forwards;
}

/* 主标题 */
#yuu-intro .intro-title {
  margin: 0;
  font-size: clamp(1.45rem, 5.2vw, 3.3rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .12em;
  text-indent: .12em;          /* 抵消末字多出的字距 */
  color: #F6F3FC;              /* 近白冷紫，与背景淡紫同色系 */
  opacity: 0;
  transform: translateY(18px);
  filter: blur(8px);
  text-shadow:
    0 1px 3px  rgba(12, 7, 20, .95),   /* 紧贴字形的硬边，保证笔画清晰 */
    0 0 10px   rgba(12, 7, 20, .85),
    0 2px 26px rgba(12, 7, 20, .80),   /* 中距柔化 */
    0 0 70px   rgba(150, 110, 240, .40); /* 远距紫光，呼应站点主题色 */
  animation: introTitle 2s cubic-bezier(.22, .61, .36, 1) 1s forwards;
}

/* 副标题 */
#yuu-intro .intro-sub {
  margin: 1.4em 0 0;
  font-size: clamp(.75rem, 1.6vw, 1rem);
  font-weight: 400;
  letter-spacing: .34em;
  text-indent: .34em;
  color: rgba(226, 216, 248, .80);
  opacity: 0;
  transform: translateY(10px);
  text-shadow: 0 1px 12px rgba(14, 8, 24, .9);
  animation: introSub 1.6s cubic-bezier(.22, .61, .36, 1) 1.9s forwards;
}

/* ---------- 跳过按钮 ---------- */
#yuu-intro .intro-skip {
  position: absolute;
  right: clamp(16px, 4vw, 46px);
  bottom: clamp(16px, 4vw, 46px);
  padding: .55em 1.5em;
  font-family: inherit;
  font-size: .82rem;
  letter-spacing: .16em;
  text-indent: .16em;
  color: rgba(246, 243, 252, .74);
  background: rgba(16, 10, 26, .30);
  border: 1px solid rgba(246, 243, 252, .26);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color .3s, border-color .3s, background .3s, transform .3s;
  animation: introFadeIn .9s ease 2.4s forwards;
}
#yuu-intro .intro-skip:hover {
  color: #fff;
  border-color: rgba(200, 180, 255, .72);
  background: rgba(74, 44, 130, .52);
  transform: translateY(-1px);
}

/* ---------- 动画 ---------- */
@keyframes introLine  { to { width: min(340px, 46vw); } }
@keyframes introTitle {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes introSub   { to { opacity: 1; transform: translateY(0); } }
@keyframes introFadeIn{ to { opacity: 1; } }

/* 小屏微调 */
@media (max-width: 600px) {
  #yuu-intro .intro-title { letter-spacing: .08em; text-indent: .08em; }
  #yuu-intro .intro-line  { margin-bottom: 1.1em; }
}
