/* jiaxuli.com homepage: the starfield journey (loads after site.css) */

/* ---------------- Journey: the sticky starfield stage ---------------- */

.journey { position: relative; }
.js .journey { padding-bottom: calc(100lvh - 100svh); }

.stage {
  position: relative;
  overflow: hidden;
  background: #000104;
}
.js .stage {
  position: sticky; top: 0; z-index: 1;
  height: 100vh; height: 100lvh;
  margin-bottom: -100vh; margin-bottom: -100lvh;
  touch-action: none; /* vertical swipes step between sections in JS */
  -webkit-user-select: none; user-select: none;
}
.js .stage .panel { -webkit-user-select: text; user-select: text; cursor: auto; }

.sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky { background: #000104; }
.no-js .sky, .no-js .veil, .no-js .rail { display: none; }

.slot { height: 100vh; height: 100svh; }
.no-js .slots { display: none; }

/* Section progress */
.rail {
  position: absolute; z-index: 5;
  left: max(20px, env(safe-area-inset-left));
  top: 50%; transform: translateY(-50%);
}
.rail-list { position: relative; }
.rail-list button {
  display: flex; align-items: center; gap: 14px;
  height: auto; padding: 3px 8px 3px 0; margin: 0; /* compact: 6px between dots */
  border: 0; background: none; color: var(--text); cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1; letter-spacing: -0.01em;
  transition: padding 0.5s var(--ease-out);
}
/* hovering (or tabbing into) the rail spreads the dots out and shows the names */
.rail:hover .rail-list button, .rail:focus-within .rail-list button { padding-top: 8px; padding-bottom: 8px; }
.rail-tick {
  width: 6px; height: 6px; border-radius: 3px; flex: none;
  background: #4a4a50; box-shadow: 0 0 0 3px #02030a00;
  transition: height 0.6s var(--ease-out), background 0.6s var(--ease);
}
.rail-list .is-active .rail-tick { height: 16px; background: #fff; box-shadow: 0 0 12px rgba(160, 190, 255, 0.65); }
.rail-list .is-passed .rail-tick { background: #a1a1a6; }
.rail-label {
  opacity: 0; transform: translateX(-6px); color: var(--text-2); white-space: nowrap;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.3s;
}
.rail-list .is-active .rail-label { color: var(--text); }
.rail:hover .rail-label, .rail:focus-within .rail-label { opacity: 1; transform: none; }
.rail-list button:hover .rail-label { color: var(--text); }

/* ---------------- Panels: a title, one line, a few links ---------------- */

.panels { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.panel { text-align: center; }
.js .panel {
  position: absolute; left: 0; right: 0;
  bottom: 0; bottom: calc(100lvh - 100dvh);
  max-width: calc(820px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) calc(64px + var(--safe-bottom));
  visibility: hidden;
}
.js .panel.is-active { visibility: visible; pointer-events: auto; }
.js .panel.is-leaving { visibility: visible; }
.no-js .panels { position: static; pointer-events: auto; }
.no-js .panel { padding: 72px var(--gutter); }

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  filter: blur(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), filter 0.35s var(--ease);
}
.js .stage[data-dir="back"] [data-reveal] { transform: translate3d(0, -24px, 0); }
.js .panel.is-active [data-reveal] {
  opacity: 1; transform: none; filter: none;
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: calc(260ms + var(--i, 0) * 90ms);
}
.js .panel.is-leaving [data-reveal] { transform: translate3d(0, -14px, 0); }
.js .stage[data-dir="back"] .panel.is-leaving [data-reveal] { transform: translate3d(0, 14px, 0); }

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 64px); line-height: 1.0625; font-weight: 600; letter-spacing: -0.009em;
}
.panel-sub {
  max-width: 620px; margin: 12px auto 0;
  color: var(--text-2); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.381; letter-spacing: 0.011em;
  text-wrap: balance;
}
.panel-sub cite { font-style: normal; color: var(--text); }
.panel-sub .dot { color: var(--text-3); }
.panel-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px;
  margin-top: 22px;
}
.panel-links a { font-size: clamp(17px, 1.5vw, 19px); letter-spacing: -0.01em; white-space: nowrap; }
.panel-links a::after { content: "\00a0\203A"; transition: margin 0.3s var(--ease); }
.panel-links a.out::after { content: "\00a0\2197"; font-size: 0.85em; }
.panel-links sup a::after { content: none; } /* footnote numbers take no arrow */
.panel-links a:hover { text-decoration: underline; }
.panel-cta { margin-top: 26px; }

/* Hero: the name waits until "hello" has been written */
.js .panel-hero.is-active:not(.is-ready) [data-reveal] { opacity: 0; transform: translate3d(0, 20px, 0); filter: blur(8px); }
.panel-hero .panel-title { font-size: clamp(32px, 4vw, 48px); }
.js .panel-hero { padding-bottom: calc(104px + var(--safe-bottom)); }

.scroll-cue {
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translateX(-50%);
  font-size: 15px; letter-spacing: -0.01em; white-space: nowrap;
  opacity: 0; transition: opacity 1s var(--ease) 0.8s;
}
.scroll-cue:hover { text-decoration: none; }
.panel-hero.is-active.is-ready .scroll-cue { opacity: 1; }
.panel-hero:not(.is-active) .scroll-cue { transition: opacity 0.2s; }
/* "slide to unlock" shimmer: a soft band of light rises through dim text, bottom to top */
.cue-text {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.32) 44%, #fff 50%, rgba(255, 255, 255, 0.32) 56%, rgba(255, 255, 255, 0.32) 100%);
  background-size: 100% 300%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: unlock 2.4s linear infinite;
}
@keyframes unlock { from { background-position: 0 0%; } to { background-position: 0 100%; } }
.cue-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .cue-pointer { display: none; } .cue-touch { display: inline; } }
.cue-chevron {
  width: 14px; height: 7px; fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  animation: cue-bob 3s var(--ease) infinite;
}
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(4px); opacity: 1; } }
.no-js .scroll-cue { display: none; }

/* ---------------- Responsive ---------------- */

@media (max-width: 734px) {
  .js .panel { padding-bottom: calc(44px + var(--safe-bottom)); }
  .panel-title { font-size: 36px; line-height: 1.11; }
  .panel-sub { font-size: 17px; line-height: 1.41; }
  .panel-links { gap: 6px 20px; margin-top: 18px; }
  .panel-cta { margin-top: 20px; }
  .panel-links a { font-size: 17px; }
  .panel-hero .panel-title { font-size: 32px; }
  .panel-hero .panel-sub { font-size: clamp(14px, 4vw, 17px); letter-spacing: -0.01em; }
  .js .panel-hero { padding-bottom: calc(96px + var(--safe-bottom)); }

  .rail { left: max(10px, env(safe-area-inset-left)); }
  .rail-list button { gap: 0; padding: 2.5px 0; }
  .rail-tick { width: 5px; height: 5px; }
  .rail-list .is-active .rail-tick { height: 13px; }
  .rail-label { display: none; }
  .veil i:nth-child(2) { display: none; } /* one fewer full-screen blur pass on phones */
}

@media (max-height: 520px) and (orientation: landscape) {
  .js .panel { padding-bottom: calc(18px + var(--safe-bottom)); }
  .panel-title { font-size: 30px; }
  .panel-sub { margin-top: 6px; font-size: 15px; }
  .panel-links { margin-top: 10px; }
  .panel-cta { margin-top: 12px; }
  .panel-cta .button { padding: 8px 16px; font-size: 15px; }
  .js .panel-hero { padding-bottom: calc(24px + var(--safe-bottom)); }
  .rail, .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js .stage[data-dir="back"] [data-reveal], .js .panel.is-leaving [data-reveal] { transform: none !important; filter: none !important; }
  .js .panel.is-active [data-reveal] { transition: opacity 0.4s linear; transition-delay: 0s; }
  .cue-text { animation: none; background: none; color: rgba(255, 255, 255, 0.6); }
  .cue-chevron { animation: none; }
}

/* ---------------- Hero greeting: thin type, a bold name, a rotating line ---------------- */

.hero-title { font-weight: 100; letter-spacing: -0.005em; }
.hero-light { font-weight: 100; } /* SF Ultralight on Apple devices */
.hero-roles .hero-light { font-weight: 300; color: var(--text-2); }

/* The English name retains the greeting's bold styling. */
.hero-name {
  display: inline-block; vertical-align: baseline; white-space: nowrap;
  font: inherit; font-weight: 600; letter-spacing: inherit; text-align: left;
}

/* the rotating line, with a pen stroke drawn underneath. The box eases to
   each phrase's width, so "I'm" glides instead of jumping. */
.hero-roles { font-weight: 300; }
.role-wrap {
  position: relative; display: inline-block; vertical-align: top;
  height: 1lh; padding-bottom: 10px; box-sizing: content-box;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.role { color: var(--text); font-weight: 300; white-space: nowrap; }
.js .role { position: absolute; left: 0; top: 0; line-height: inherit; }
.no-js .role-wrap { height: auto; }
.role .ch { display: inline-block; white-space: pre; will-change: transform, opacity, filter; }
.role.is-entering .ch {
  animation: role-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d, 0) * 16ms);
}
.role.is-leaving { animation: role-out 0.45s cubic-bezier(0.4, 0, 0.6, 1) both; }
@keyframes role-in { from { opacity: 0; transform: translate3d(0, 0.45em, 0); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes role-out { from { opacity: 1; transform: none; filter: none; } to { opacity: 0; transform: translate3d(0, -0.35em, 0); filter: blur(6px); } }
.role-line {
  position: absolute; left: -2%; bottom: 0; width: 104%; height: 12px; overflow: visible;
  fill: none; stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(160, 190, 255, 0.55));
}
.role-line path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.role-line.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s cubic-bezier(0.45, 0, 0.2, 1); }
.role-line.is-erasing path { stroke-dashoffset: -1; transition: stroke-dashoffset 0.4s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .role-wrap { transition: none; }
  .role .ch, .role.is-leaving { animation: none !important; }
  .role-line path { stroke-dashoffset: 0 !important; transition: none !important; }
}
