/* ============================================================
   开屏 · 信号落到基线
   字母不旋转不斜切（那样中途是一团乱码），而是按正弦错位 + 轻微
   失焦依次落回基线，读作“一段信号稳定成站名”。
   整条时间线纯 CSS 驱动：无 JS 也会自己收场，不会卡住首屏。
   ============================================================ */

:root {
  --sp-ease: cubic-bezier(.22, .9, .28, 1);
  --sp-spring: cubic-bezier(.24, 1.32, .4, 1);
  --sp-out: 2.9s;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--c-paper);
  color: var(--c-ink);
  overflow: hidden;
  animation: sp-out .46s var(--sp-ease) var(--sp-out) forwards;
}

/* 交互跳过：任何点击/按键立刻收场 */
.splash.hide {
  animation: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes sp-out {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.05);
  }
}

/* 曲线类名独立于页面的 .harman-bg：那个类默认 opacity:0，会吃掉开屏 */
.splash .sp-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transform: perspective(900px) rotateX(9deg) scale(1.06);
}

.splash .sp-grid {
  stroke: rgba(31, 30, 29, .07);
  stroke-width: 1;
}

/* 哈曼曲线：在收场前 1.7s 就画完，不再被定时淡出切断 */
.splash .sp-curve {
  fill: none;
  stroke: url(#sp-hg);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: sp-draw 1.05s var(--sp-ease) .08s forwards;
}

@keyframes sp-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.splash .sp-wave stop {
  stop-color: var(--c-ink);
}

/* ---------- 站名 ---------- */
.wordmark {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  font-family: var(--c-font-display);
  font-weight: 600;
  font-size: clamp(42px, 7.4vw, 76px);
  line-height: 1;
  letter-spacing: -.012em;
  perspective: 620px;
  perspective-origin: 50% 42%;
}

/* 每个字母的波形错位量 --y 写在标记里，--i 控制依次落下的节拍。
   字母以基线为轴翻板合上，跟扇形导航、弹窗是同一套 3D 语言。 */
.wordmark i {
  display: inline-block;
  font-style: normal;
  opacity: 0;
  transform-origin: 50% 100%;
  animation: sp-tune .68s var(--sp-spring) both;
  animation-delay: calc(150ms + var(--i) * 46ms);
}

@keyframes sp-tune {
  0% {
    opacity: 0;
    transform: translateY(var(--y)) rotateX(-74deg) scale(.94);
    filter: blur(2.4px);
  }
  55% {
    opacity: 1;
    transform: translateY(calc(var(--y) * -.16)) rotateX(13deg) scale(1.02);
    filter: blur(.6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

/* HiFi 上陶土色，index 上墨色：把“Hi-Fi · index”的断点读出来 */
.wordmark .hi {
  color: var(--c-clay);
}

/* 字母全部落定后，HiFi 底下透出一条基线，像信号接了地 */
.wordmark::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.18em;
  width: 44%;
  height: 2px;
  background: var(--c-clay);
  opacity: .45;
  transform: scaleX(0);
  transform-origin: left center;
  animation: sp-base .55s var(--sp-ease) 1.14s forwards;
}

@keyframes sp-base {
  to {
    transform: scaleX(1);
  }
}

/* ---------- 频率轴：让开屏顺带讲清“这是关于声音的” ----------
   四个刻度依次点亮，读作一次校准扫过频段。 */
.sp-axis {
  position: relative;
  z-index: 2;
  display: flex;
  gap: clamp(18px, 5vw, 54px);
  margin-top: 26px;
  font-family: var(--c-font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--c-muted);
}

.sp-axis span {
  position: relative;
  padding-top: 9px;
  opacity: 0;
  animation: sp-up .42s var(--sp-ease) both;
}

.sp-axis span:nth-child(1) { animation-delay: .95s; }
.sp-axis span:nth-child(2) { animation-delay: 1.08s; }
.sp-axis span:nth-child(3) { animation-delay: 1.21s; }
.sp-axis span:nth-child(4) { animation-delay: 1.34s; }

.sp-axis span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--c-line-2);
}

/* ---------- 一句话说明 ---------- */
.sp-line {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1.75;
  color: var(--c-ink-3);
  opacity: 0;
  animation: sp-up .55s var(--sp-ease) 1.5s forwards;
}

.sp-line b {
  color: var(--c-ink);
  font-weight: 600;
}

@keyframes sp-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 电源指示灯：亮一下就定住，不循环 ---------- */
.sp-lamp {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  font-family: var(--c-font-label);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--c-muted);
  opacity: 0;
  animation: sp-up .5s var(--sp-ease) 1.85s forwards;
}

.sp-lamp::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-line-2);
  animation: sp-warm .7s var(--sp-ease) 1.9s forwards;
}

@keyframes sp-warm {
  to {
    background: var(--c-clay);
    box-shadow: 0 0 0 3px rgba(204, 120, 92, .16);
  }
}

/* ---------- 跳过提示：早点亮，否则等它出现时已经没必要跳了 ---------- */
.sp-skip {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 2;
  transform: translateX(-50%);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--c-muted);
  opacity: 0;
  animation: sp-skip-in .5s var(--sp-ease) .7s forwards;
}

@keyframes sp-skip-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================================
   窄屏（手机）：同一套语言，砍掉频率轴和网格，留说明与指示灯
   原来是 .mobile 前缀（手机版页面），手机版下线后改挂视口条件，
   电脑版在手机上走同一条时间线。
   ============================================================ */
@media (max-width: 700px) {
  .splash {
    --sp-out: 2.05s;
    gap: 0;
  }
  .wordmark {
    font-size: clamp(38px, 11.4vw, 54px);
  }
  .wordmark i {
    animation-duration: .54s;
    animation-delay: calc(110ms + var(--i) * 34ms);
  }
  .wordmark::after {
    animation-delay: .92s;
  }
  .sp-axis,
  .splash .sp-grid {
    display: none;
  }
  .sp-line {
    margin-top: 16px;
    font-size: 13px;
    animation-delay: .8s;
  }
  .sp-lamp {
    margin-top: 22px;
    animation-delay: 1.15s;
  }
  .sp-lamp::before {
    animation-delay: 1.2s;
  }
  .sp-skip {
    bottom: 26px;
    animation-delay: .55s;
  }
  .splash .sp-curve {
    animation-duration: .8s;
  }
}

/* ============================================================
   尊重系统的“减少动态效果”：直接给终态，不放动画
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* 收场只留纯不透明度淡出（不缩放、不位移），否则开屏会永远盖住首屏 */
  .splash {
    animation: sp-fade .3s linear .9s forwards;
  }
  @keyframes sp-fade {
    to {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
  }
  .splash .sp-curve,
  .wordmark i,
  .wordmark::after,
  .sp-axis span,
  .sp-line,
  .sp-lamp,
  .sp-lamp::before,
  .sp-skip {
    animation: none !important;
    opacity: 1;
    filter: none;
    transform: none;
    stroke-dashoffset: 0;
  }
  .wordmark i {
    transform: none !important;
  }
  .wordmark::after {
    transform: scaleX(1);
  }
  .sp-skip {
    transform: translateX(-50%);
  }
  .splash {
    background: var(--c-paper);
  }
  .sp-lamp::before {
    background: var(--c-clay);
    box-shadow: 0 0 0 3px rgba(204, 120, 92, .16);
  }
}
