/* 基础与无脚本回退 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  position: relative;
  min-height: 100svh;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fff;
  background: #0317ad;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #a5ffff; outline-offset: 5px; }

/* 原视频使用相同的画框，交接时保留片尾直到循环视频出帧。 */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #0cdef6 0%, #0b8ff0 20%, #0565d0 36%, #003abe 59%, #050baa 100%);
  contain: strict;
}
.stage-frame {
  position: absolute;
  inset: 0;
  background: #469ce5 url("assets/images/background.jpg") center / cover no-repeat;
}
.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-video-intro { z-index: 1; background: #fff; }
.stage-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 38%, rgba(0, 22, 94, .1) 68%, rgba(0, 16, 73, .16));
}

/* 个人介绍 */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 72px 12vw 100px;
}
.hero-card {
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-shadow: 0 1px 18px rgba(4, 32, 84, .5);
  opacity: 1;
  visibility: visible;
  transition: opacity .65s ease .12s, transform .65s ease .12s;
}
html[data-content="waiting"] .hero-card,
html[data-content="waiting"] .site-footer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
html[data-content="waiting"] .hero-card { transform: translateY(8px); }
.hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 6px 26px rgba(0, 24, 70, .22);
}
.hero-label { margin: 22px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .38em; opacity: .8; }
/* 负左边距抵掉 "P" 自带的字形留白，让标题的视觉左边缘和头像、正文对齐。 */
.hero-title { margin: 6px 0 12px -0.078em; font-size: clamp(42px, 6vw, 64px); line-height: 1.15; letter-spacing: .02em; }
.hero-title:focus { outline: none; }
.hero-text { margin: 0 0 30px; font-size: clamp(15px, 1.7vw, 18px); line-height: 1.95; opacity: .95; }
.hero-links h2 { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .32em; opacity: .78; }
/* 图标用 em 跟随正文的 font-size：5 个图标加 4 个间隙正好等于正文那两行的宽度，
   左右边缘便和正文对齐。 */
.link-icons { display: flex; flex-wrap: wrap; gap: .54em; font-size: clamp(15px, 1.7vw, 18px); }
.link-icons a {
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .28);
  transition: background .2s ease, transform .2s ease;
}
.link-icons a svg { width: 45%; height: 45%; }
.link-icons a:hover { background: rgba(255, 255, 255, .26); transform: translateY(-3px); }
.site-footer {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 2;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 25, 90, .55);
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 12px rgba(4, 32, 84, .5);
  transition: opacity .6s ease;
  pointer-events: none;
}

/* 首次开场：资源短等候与海浪退场。 */
.intro { display: none; position: fixed; inset: 0; z-index: 50; overflow: hidden; }
html[data-intro="loading"] .intro,
html[data-intro="leaving"] .intro,
html[data-intro="playing"] .intro { display: block; }
html[data-intro="leaving"] .intro,
html[data-intro="playing"] .intro { pointer-events: none; }
.intro-waves {
  position: absolute;
  inset: -2px 0;
  background: #469ce5;
  transform: translate3d(0, 0, 0);
  transition: transform 1.1s cubic-bezier(.55, .08, .25, 1);
}
html[data-intro="leaving"] .intro-waves { transform: translate3d(0, calc(100% + 122px), 0); will-change: transform; }
.waves { position: absolute; bottom: calc(100% - 2px); left: -4%; width: 108%; height: 120px; }
.waves svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; fill: #469ce5; }
.waves svg:nth-child(1) { bottom: 22px; opacity: .3; transform: translateX(-2%); }
.waves svg:nth-child(2) { bottom: 10px; opacity: .55; transform: translateX(2%); }
.intro-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity .25s ease, transform .35s ease;
}
.intro-loading h2 { margin: 0; font-size: clamp(40px, 7vw, 68px); letter-spacing: .04em; font-weight: 650; line-height: 1.2; }
.intro-loading p { margin: 16px 0 0; font-size: 13px; letter-spacing: .3em; opacity: .82; }
.intro-line { width: 32px; height: 1px; margin-top: 28px; background: rgba(255, 255, 255, .6); }
html[data-intro="leaving"] .intro-loading,
html[data-intro="playing"] .intro-loading { opacity: 0; visibility: hidden; transform: translateY(-10px); }

/* 竖屏中让人物留在左上方，为正文留出空间。 */
@media (max-width: 720px) {
  .stage-frame {
    height: 62svh;
    top: -4svh;
    bottom: auto;
    background-position: 14% center;
    -webkit-mask-image: linear-gradient(#000 0 84%, transparent 100%);
    mask-image: linear-gradient(#000 0 84%, transparent 100%);
  }
  .stage-video { object-position: 14% center; }
  .stage-shade {
    background: linear-gradient(180deg, transparent 12%, rgba(2, 49, 154, .12) 30%, rgba(3, 32, 131, .65) 52%, rgba(1, 13, 91, .75) 100%);
  }
  .hero { justify-content: center; align-items: flex-end; padding: max(260px, 43svh) 24px 132px; }
  .hero-card { align-items: center; text-align: center; }
  .hero-avatar { width: 60px; height: 60px; }
  .hero-label { margin-top: 17px; }
  .hero-title { font-size: 46px; }
  .hero-text { margin-bottom: 22px; }
  .link-icons { justify-content: center; gap: 12px; }
  .link-icons a { width: 44px; height: 44px; }
  .site-footer { left: 12px; right: 12px; bottom: max(15px, env(safe-area-inset-bottom)); padding: 0; background: none; text-align: center; font-size: 11px; }
  .waves { height: 75px; }
}
@media (max-height: 560px) and (min-width: 721px) {
  .hero { padding: 28px 10vw 92px; }
  .hero-avatar { width: 48px; height: 48px; }
  .hero-label { margin-top: 12px; }
  .hero-title { font-size: 42px; margin-bottom: 8px; }
  .hero-text { margin-bottom: 16px; font-size: 15px; line-height: 1.65; }
  .link-icons { font-size: 15px; }
  .hero-links h2 { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
  .hero-card, .site-footer { opacity: 1 !important; visibility: visible !important; }
  .hero-card { transform: none; }
  .hero-card, .link-icons a { transition: none; }
}
