:root {
  --ink: #000;
  --fg: 236, 241, 255;
  --sans: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ink);
  color: rgb(var(--fg));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- 胶片质感 ---------- */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 52%, rgba(0, 0, 0, .7) 100%);
}
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: screen;
  background-size: 256px 256px;
}

/* ---------- 欢迎页：多语言轮播 ---------- */
#welcome {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 20vh;
  pointer-events: none;
  visibility: hidden;
}
#welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 62% 36% at 50% 40%, rgba(0, 0, 0, .58), transparent 72%);
  opacity: 0;
  transition: opacity 3s ease;
}
body.finale #welcome { visibility: visible; }
body.finale #welcome::before { opacity: 1; }

.greetings {
  list-style: none;
  position: relative;
  width: min(92vw, 1180px);
  height: 3em;
  font-size: clamp(21px, 3.3vw, 46px);
}
.greetings li {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
  font-family: var(--sans);
  font-weight: 200;
  /* 字距固定不变：字距动画会让长句在过渡中途从两行跳回一行，看起来像闪了一下 */
  letter-spacing: .06em;
  color: rgba(var(--fg), .95);
  text-shadow: 0 0 30px rgba(0, 0, 0, .85);
  opacity: 0;
  filter: blur(14px);
  transform: scale(1.06);
  will-change: opacity, filter, transform;
  transition: opacity 1.5s ease, filter 1.8s ease, transform 3s var(--ease);
}
.greetings li.on {
  opacity: 1;
  filter: blur(0);
  transform: none;
}
.greetings li.out {
  opacity: 0;
  filter: blur(10px);
  transform: scale(.97);
  transition-duration: 1s, 1.1s, 1.2s;
}
/* 连写文字不能加字距 */
.greetings li[lang="ar"], .greetings li[lang="hi"] { letter-spacing: 0; }

/* ---------- 控制 ---------- */
#ui {
  position: fixed;
  right: clamp(10px, 2.4vw, 36px);
  bottom: 0;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2px;
}
#ui button {
  appearance: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: rgba(var(--fg), .42);
  cursor: pointer;
  transition: color .4s ease, opacity .8s ease;
}
#ui button:hover { color: rgba(var(--fg), .95); }
#ui button:focus-visible { outline: 1px solid rgba(var(--fg), .5); outline-offset: 0; }
#ui svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#btn-sound .on { display: none; }
#btn-sound[aria-pressed="true"] .on { display: inline; }
#btn-sound[aria-pressed="true"] .off { display: none; }
body.finale #btn-skip { opacity: 0; pointer-events: none; }

#progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(var(--fg), .06);
  transition: opacity 1.2s ease;
}
#progress i {
  display: block;
  height: 100%;
  width: 0;
  background: rgba(var(--fg), .45);
}
body.finale #progress { opacity: 0; }

.embedded #welcome,.embedded #ui,.embedded #progress,.embedded .grain{display:none!important}

.experience #ui,.experience #progress{display:none!important}
.experience #welcome{transition:opacity .8s ease,filter .8s ease}
.experience body.departing #welcome{opacity:0;filter:blur(9px)}
.experience .grain{display:none}
@media(prefers-reduced-motion:reduce){.experience #welcome,.experience .greetings li{transition:none!important}}

#ui{gap:8px}#ui button.glass{color:rgba(var(--fg),.75)!important}#ui button.glass:hover{color:rgba(var(--fg),1)!important}
