/* 配色取自游戏标题画面：顶上的深蓝夜空、地平线的黄昏、界面上的玻璃面板 */
:root {
  --bg: #031127; --deep: #020812; --panel: rgba(13, 30, 54, .72); --line: rgba(120, 160, 210, .18);
  --text: #eaf1f8; --muted: #a3b6ca; --accent: #3aa7f5; --gold: #ffd273;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  position: relative; margin: 0; color: var(--text);
  background: linear-gradient(180deg, #031127 0%, #06183a 40%, #04122b 75%, #020a1a 100%) fixed, #031127;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* 星星：一层很淡、固定不动的点（隐私页、支持页的底，也是首页最后那段深空的底） */
body::before, .scene[data-scene="space"] {
  background-image:
    radial-gradient(1px 1px at 23px 41px, #fff, transparent),
    radial-gradient(1px 1px at 141px 97px, rgba(255, 255, 255, .8), transparent),
    radial-gradient(1.5px 1.5px at 207px 173px, #fff, transparent),
    radial-gradient(1px 1px at 79px 211px, rgba(200, 220, 255, .8), transparent),
    radial-gradient(1px 1px at 263px 29px, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 311px 251px, rgba(255, 240, 220, .8), transparent),
    radial-gradient(1.5px 1.5px at 53px 307px, rgba(255, 255, 255, .9), transparent),
    radial-gradient(1px 1px at 181px 331px, rgba(255, 255, 255, .6), transparent);
  background-size: 340px 340px;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
nav a { margin-left: 20px; color: var(--muted); font-size: 15px; }
nav a:hover { color: var(--text); text-decoration: none; }
.k { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

.cta { display: inline-block; padding: 14px 24px; border-radius: 14px; background: var(--accent); color: #04233a; font-weight: 700; }
.cta:hover { text-decoration: none; filter: brightness(1.08); }
.cta.soon { background: rgba(13, 30, 54, .55); color: #e2ebf4; border: 1px solid rgba(170, 205, 245, .32); cursor: default; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.note { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ 首页：滚动的旅程 */
body.journey { background: var(--deep); }
body.journey::before { display: none; }

/* 后面固定的一叠场景。当前那一章的画面淡入，同时慢慢推近，像镜头在往前走 */
.scenes { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--deep); }
.scene {
  position: absolute; inset: -1%; opacity: 0; transform: scale(1.02);
  background-color: var(--deep); background-repeat: no-repeat; background-size: cover; background-position: var(--pos, center);
  transition: opacity 1.5s var(--ease), transform 10s var(--ease); will-change: opacity, transform;
}
.scene.on { opacity: 1; transform: scale(1); }
.scene[data-scene="dusk"] { background-image: url('/img/bg/dusk-desktop.webp'); --pos: center 60%; }
@media (orientation: portrait) {
  .scene[data-scene="dusk"] { background-image: url('/img/bg/dusk.webp'); }
}
.scene[data-scene="orbit"] { --pos: 55% 40%; }
.scene[data-scene="moon"] { --pos: 45% 40%; }
.scene[data-scene="mars"] { --pos: 55% 45%; }
.scene[data-scene="jupiter"] { --pos: 60% 40%; }
.scene[data-scene="europa"] { --pos: 50% 30%; }
.scene[data-scene="space"] { background-size: 340px 340px; background-repeat: repeat; opacity: 0; }
.scene[data-scene="space"].on { opacity: .7; }
/* 压暗：左边压给文字，上面压给导航栏，下面一圈暗角 */
.scenes-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 8, 18, .6) 0%, rgba(2, 8, 18, 0) 16%, rgba(2, 8, 18, 0) 70%, rgba(2, 8, 18, .55) 100%),
    linear-gradient(90deg, rgba(2, 8, 18, .86) 0%, rgba(2, 8, 18, .55) 36%, rgba(2, 8, 18, 0) 68%);
}

/* 顶上一条细细的进度线 */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; pointer-events: none; }
.progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent), var(--gold)); }

body.journey header.top { position: fixed; top: 0; left: 0; right: 0; z-index: 15; display: block; padding: 0; transition: background .4s, -webkit-backdrop-filter .4s, backdrop-filter .4s; }
body.journey header.top .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
body.journey.scrolled header.top { background: rgba(2, 8, 18, .55); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
body.journey nav a { color: #c6d4e2; }

/* 右边的章节导航：一列小点，当前那一章亮金色、显示名字 */
.rail { position: fixed; right: 28px; top: 50%; z-index: 12; transform: translateY(-50%); display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity .6s; }
body.past-intro .rail { opacity: 1; pointer-events: auto; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0; padding: 8px 0; color: rgba(225, 235, 245, .45); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.rail a:hover { text-decoration: none; color: #fff; }
.rail a::after { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; transition: all .4s var(--ease); }
.rail a span { opacity: 0; transform: translateX(8px); transition: all .4s var(--ease); }
.rail a:hover span, .rail a.on span { opacity: 1; transform: none; }
.rail a.on { color: #fff; }
.rail a.on::after { width: 10px; height: 10px; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 115, .7); }

/* 开场 */
.intro { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 110px 0 120px; }
.intro .wrap { width: 100%; }
.intro-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.intro h1 { margin: 26px 0 18px; font-size: clamp(46px, 7.4vw, 92px); line-height: 1.02; font-weight: 800; letter-spacing: -.025em; text-shadow: 0 4px 30px rgba(0, 0, 0, .45); }
.intro .lead { margin: 0 0 32px; max-width: 26em; font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: #d2deea; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: rgba(225, 235, 245, .7); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.scroll-cue:hover { text-decoration: none; color: #fff; }
.scroll-cue i { position: relative; width: 1px; height: 46px; overflow: hidden; background: rgba(255, 255, 255, .18); }
.scroll-cue i::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }

/* 每一章：占满一屏，左边是字，右边浮着一张游戏里的截图 */
.chapter { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0; }
.chapter-inner { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 72px; align-items: center; }
.chapter-text { max-width: 540px; }
.chapter h2 { margin: 0 0 20px; font-size: clamp(38px, 5.2vw, 66px); line-height: 1.04; font-weight: 800; letter-spacing: -.022em; text-wrap: balance; text-shadow: 0 4px 28px rgba(0, 0, 0, .5); }
.chapter p { margin: 0; max-width: 30em; font-size: 19px; line-height: 1.6; color: #d0dce8; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.phone {
  display: block; width: 250px; height: auto; border-radius: 34px; margin-right: 110px;
  border: 1px solid rgba(190, 215, 245, .22); box-shadow: 0 40px 90px rgba(0, 0, 0, .65), 0 0 0 6px rgba(8, 12, 18, .7);
  transform: translateY(calc(var(--py, 0) * 1px));
}

/* 进场：字和截图从下面浮上来（有脚本时才这么做，没脚本就直接显示） */
.js .chapter-text, .js .phone, .js .intro .wrap > * { opacity: 0; translate: 0 36px; transition: opacity 1s var(--ease), translate 1.1s var(--ease); }
.js .phone { transition-delay: .15s; }
.js .in .chapter-text, .js .in .phone, .js .intro.in .wrap > * { opacity: 1; translate: 0 0; }
.js .intro.in .wrap > :nth-child(2) { transition-delay: .08s; }
.js .intro.in .wrap > :nth-child(3) { transition-delay: .16s; }
.js .intro.in .wrap > :nth-child(4) { transition-delay: .24s; }
.js .intro.in .wrap > :nth-child(5) { transition-delay: .32s; }

/* 旅程之后：深空里放 iPhone Duo 和结尾 */
.after { padding: 16vh 0 4vh; }
.outro { padding: 18vh 0 16vh; text-align: center; }
.outro h2 { margin: 0 0 16px; font-size: clamp(38px, 5.6vw, 72px); line-height: 1.04; font-weight: 800; letter-spacing: -.022em; }
.outro p { margin: 0 auto 30px; max-width: 32em; font-size: 19px; color: #c6d3e0; }

/* ------------------------------------------------------------------ iPhone Duo */
.duo { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 40px; align-items: center; padding: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.duo h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; }
.duo p { margin: 0 0 14px; color: var(--muted); }
.duo ul { margin: 0 0 14px; padding-left: 20px; color: #cfdae6; font-size: 15px; }
.duo li { margin-bottom: 6px; }
.duo .note { margin: 0; font-size: 13px; }
/* iPhone Duo 的机身外框。尺寸按模拟器自带的设备外形数据画：合上时机身 514×706（屏幕 466×678），
   边框左 26、右 22、上下 14；铰链在左边，那一侧几乎是直角，另一侧是半径 80 的大圆角；
   音量键在顶边，侧边按键在右侧。是照着外形画的示意图，不是官方产品图。 */
.duo-shots { position: relative; display: flex; justify-content: center; align-items: center; padding: 10px 5% 14% 0; }
.device {
  position: relative; box-sizing: border-box; background: #07090c;
  box-shadow: inset 0 0 0 1.5px #7b8490, inset 0 0 0 3px #23282f, 0 30px 60px rgba(0, 0, 0, .6), 0 8px 18px rgba(0, 0, 0, .5);
}
.device img { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.device .key { position: absolute; background: linear-gradient(180deg, #8c96a3, #4a525d); }
/* 合上：外屏。外面套一层来定位和定宽：内边距的百分比是按父元素的宽度算的，套一层它才等于机身自己的宽度 */
.duo-closed { position: absolute; right: 0; bottom: 0; width: 31%; z-index: 2; transform: rotate(4deg); }
.device.closed {
  aspect-ratio: 514 / 706;
  padding: 2.72% 4.28% 2.72% 5.06%;
  border-radius: 2.7% 15.6% 15.6% 2.7% / 2% 11.3% 11.3% 2%;
}
.device.closed img { border-radius: 2.2% 12.4% 12.4% 2.2% / 1.5% 8.6% 8.6% 1.5%; }
/* 铰链：左边一条金属书脊 */
.device.closed::before {
  content: ''; position: absolute; left: 0; top: 0.6%; bottom: 0.6%; width: 2.4%;
  background: linear-gradient(90deg, #9aa3af, #555d68 45%, #262b32); border-radius: 60% 0 0 60% / 1.2% 0 0 1.2%;
}
.device.closed .key.vol { top: -0.75%; height: 0.75%; width: 12.8%; border-radius: 40% 40% 0 0 / 100% 100% 0 0; }
.device.closed .key.vol.up { left: 61.5%; }
.device.closed .key.vol.down { left: 45.9%; }
.device.closed .key.power { right: -1%; top: 28.6%; width: 1%; height: 16%; border-radius: 0 100% 100% 0 / 0 6% 6% 0; background: linear-gradient(90deg, #4a525d, #8c96a3); }
/* 展开：内屏，四个角都是大圆角，中间一道很淡的折痕 */
.device.open {
  flex: 1 1 auto; aspect-ratio: 979 / 697; padding: 1.43%;
  border-radius: 8.2% / 11.5%;
}
.device.open img { border-radius: 6.9% / 9.9%; }
.device.open::before {
  content: ''; position: absolute; left: 50%; top: 1.43%; bottom: 1.43%; width: 3px; margin-left: -1.5px; z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .22) 45%, rgba(255, 255, 255, .07) 60%, rgba(0, 0, 0, 0));
}
.device.open .key.power { right: -0.55%; top: 14%; width: 0.55%; height: 16%; border-radius: 0 100% 100% 0 / 0 6% 6% 0; background: linear-gradient(90deg, #4a525d, #8c96a3); }

/* ------------------------------------------------------------------ 隐私页、支持页 */
.doc { max-width: 720px; padding: 24px 0 64px; }
.doc h1 { font-size: 34px; line-height: 1.2; margin: 12px 0 6px; }
.doc .date { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.doc h2 { font-size: 21px; margin: 34px 0 8px; }
.doc p, .doc li { color: #cfdae6; }
.doc ul { padding-left: 22px; }
.doc .box { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }

footer { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 14px; }
body.journey footer { background: rgba(2, 8, 18, .6); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a { color: var(--muted); margin-left: 18px; }
footer a:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ 手机竖屏 */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  nav a { margin-left: 14px; }
  .rail { display: none; }
  /* 字在上、图在下：压暗改成整屏上下都压一些 */
  .scenes-shade {
    background: linear-gradient(180deg, rgba(2, 8, 18, .78) 0%, rgba(2, 8, 18, .5) 42%, rgba(2, 8, 18, .25) 62%, rgba(2, 8, 18, .75) 100%);
  }
  .scene[data-scene="dusk"] { --pos: center 58%; }
  .scene[data-scene="orbit"] { --pos: 62% 40%; }
  .scene[data-scene="moon"] { --pos: 38% 40%; }
  .scene[data-scene="jupiter"] { --pos: 68% 40%; }
  .scene[data-scene="europa"] { --pos: 48% 30%; }
  .intro { padding: 96px 0 120px; align-items: flex-start; }
  .intro h1 { margin-top: 22px; }
  .chapter { padding: 96px 0 72px; align-items: flex-start; }
  .chapter-inner { grid-template-columns: 1fr; gap: 40px; }
  .chapter p { font-size: 17px; }
  .phone { width: 200px; margin: 0 auto; }
  .duo { grid-template-columns: 1fr; gap: 26px; padding: 24px; }
  .duo h2 { font-size: 27px; }
  .outro { padding: 12vh 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene { transition: opacity .6s linear; transform: none !important; }
  .phone { transform: none; }
  .js .chapter-text, .js .phone, .js .intro .wrap > * { opacity: 1; translate: 0 0; transition: none; }
  .scroll-cue i::after { animation: none; }
}
