:root {
  --bg: #08090b;
  --surface: #111318;
  --line: #2a2d33;
  --text: #ece8e1;
  --muted: #9a958c;
  --accent: #e8c9a0;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 8;
  padding: 8px 12px;
  background: var(--accent);
  color: #1a140c;
  text-decoration: none;
  transform: translateY(-140%);
}

.skip:focus {
  transform: none;
}

.top,
main,
footer {
  position: relative;
  z-index: 1;
}

.top {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: calc(14px + var(--safe-top)) 24px 14px;
  background: rgba(8, 9, 11, 0.88);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.mark {
  margin: 0;
  color: inherit;
  text-decoration: none;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.menu {
  margin-left: auto;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

#site-nav {
  display: none;
  flex-basis: 100%;
  flex-direction: column;
  gap: 4px;
}

#site-nav a {
  display: block;
  min-height: 44px;
  padding: 10px 4px;
  color: var(--muted);
  text-decoration: none;
}

#site-nav a.is-current {
  color: var(--accent);
}

.top.is-open #site-nav {
  display: flex;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 40px;
  align-items: center;
  min-height: 100svh;
  padding: 48px 24px 72px;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-photo {
  position: absolute;
  inset: -4%;
  z-index: 0;
  background: #08090b url("./assets/hero-bg.png") 82% center / cover no-repeat;
  animation: ken 18s ease-in-out infinite alternate;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(8, 9, 11, 0.78) 0%,
    rgba(8, 9, 11, 0.42) 34%,
    rgba(8, 9, 11, 0.12) 58%,
    rgba(8, 9, 11, 0.18) 100%
  );
}

#hero-field {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  filter: blur(80px);
}

.glow-a {
  width: min(70vw, 720px);
  height: min(70vw, 720px);
  right: -12%;
  top: 8%;
  opacity: 0.35;
  background: radial-gradient(circle, rgba(232, 201, 160, 0.22), transparent 68%);
  animation: glow-drift 16s ease-in-out infinite;
}

.glow-b {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  left: -8%;
  bottom: -18%;
  opacity: 0.28;
  background: radial-gradient(circle, rgba(90, 122, 140, 0.18), transparent 70%);
  animation: glow-drift 21s ease-in-out infinite reverse;
}

.hero-copy {
  position: relative;
  z-index: 5;
}

.hero-float {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.hero-float i,
.hero-float .spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--accent);
  font-size: clamp(16px, 2vw, 26px);
  opacity: 0.55;
  filter: drop-shadow(0 0 12px rgba(232, 201, 160, 0.55));
  animation: hero-drift 8s ease-in-out infinite;
  will-change: transform, opacity;
}

.hero-float i:nth-child(2n) {
  animation-duration: 10s;
  animation-delay: -2s;
}

.hero-float i:nth-child(3n) {
  animation-duration: 7s;
  animation-delay: -4s;
  animation-direction: reverse;
}

.hero-float .spark {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 4px rgba(232, 201, 160, 0.6);
  animation: hero-spark 3.6s ease-in-out infinite;
}

.hero-float .spark:nth-child(even) {
  animation-delay: -1.4s;
  animation-duration: 4.4s;
}

@keyframes ken {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-2.4%, 1.6%, 0);
  }
}

@keyframes hero-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.32;
  }
  50% {
    transform: translate3d(36px, -44px, 0) rotate(12deg);
    opacity: 0.92;
  }
  100% {
    transform: translate3d(-28px, 24px, 0) rotate(-10deg);
    opacity: 0.38;
  }
}

@keyframes hero-spark {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(0.65);
    opacity: 0.18;
  }
  50% {
    transform: translate3d(12px, -30px, 0) scale(1.35);
    opacity: 1;
  }
}

.whisper,
.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.kicker i {
  margin-right: 8px;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(36px, 6vw, 72px);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.lede,
.split-copy p,
.band-copy p,
.close-band p {
  max-width: 38rem;
  color: var(--muted);
}

.lede {
  margin: 20px 0 0;
  font-size: 17px;
}

.orbit {
  width: min(72vw, 340px);
  margin-inline: auto;
  animation: spin 28s linear infinite;
}

.ring {
  display: block;
  width: 100%;
  height: auto;
}

.ring-outer,
.ring-inner {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
}

.ring-outer {
  opacity: 0.75;
}

.ring-inner {
  opacity: 0.28;
}

.pip {
  fill: var(--accent);
}

.band,
.split,
.close-band {
  padding: 72px 24px;
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  gap: 40px;
}

.split-copy p,
.band-copy p,
.close-band p {
  margin: 16px 0 0;
}

.caption {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.meters,
.flow,
.legend,
.ticks {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.meters li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.meter {
  display: block;
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.meter::after {
  content: "";
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
}

.in .meter::after {
  width: calc(var(--n) * 100%);
  transition: width 700ms var(--ease-out);
}

.night {
  display: flex;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.seg {
  width: 0;
  height: 100%;
}

.in .seg {
  width: var(--w);
  transition: width 800ms var(--ease-out);
}

.awake {
  background: #5c5852;
}

.light {
  background: #c4b49a;
}

.deep {
  background: #8a7354;
}

.rem {
  background: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.gauge-wrap {
  text-align: center;
  color: var(--muted);
}

.gauge {
  width: min(100%, 220px);
  height: auto;
}

.gauge-track,
.gauge-value {
  fill: none;
  stroke-width: 8;
  transform: rotate(-90deg);
  transform-origin: 100px 100px;
}

.gauge-track {
  stroke: var(--line);
}

.gauge-value {
  stroke: var(--accent);
  stroke-dasharray: 490;
  stroke-dashoffset: 490;
  stroke-linecap: round;
}

.in .gauge-value {
  stroke-dashoffset: 180;
  transition: stroke-dashoffset 900ms var(--ease-out);
}

.wave {
  width: 100%;
  height: 120px;
}

.wave-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
}

.in .wave-path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease-out);
}

.ticks {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
}

.ticks li {
  flex: 1;
  height: 28%;
  background: var(--line);
  transform: scaleY(0.2);
  transform-origin: bottom;
}

.ticks .on {
  background: var(--accent);
  height: 78%;
}

.in .ticks li {
  transform: none;
  transition: transform 500ms var(--ease-out);
}

.flow {
  display: grid;
  gap: 12px;
}

.flow li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  color: var(--text);
}

.close-band {
  padding-bottom: 96px;
}

footer {
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

.beian {
  margin-top: 10px;
  letter-spacing: 0.04em;
}

.beian a {
  color: var(--muted);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow-drift {
  50% {
    transform: translate(3%, -4%) scale(1.06);
  }
}

@media (min-width: 900px) {
  .menu {
    display: none;
  }

  #site-nav,
  .top.is-open #site-nav {
    display: flex;
    flex-basis: auto;
    flex-direction: row;
    margin-left: auto;
    gap: 8px 22px;
  }

  #site-nav a {
    min-height: auto;
    padding: 8px 0;
  }

  .hero,
  .band,
  .split,
  .close-band,
  .top,
  footer {
    padding-inline: 64px;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 72px;
  }

  .split.reverse .split-copy {
    order: 2;
  }

  .orbit {
    width: min(36vw, 380px);
  }

  .flow {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (hover: hover) and (pointer: fine) {
  #site-nav a:hover,
  .mark:hover,
  .beian a:hover {
    color: var(--text);
  }

  .menu:hover {
    border-color: var(--accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-grid {
    transform: none;
  }

  .orbit,
  .reveal,
  .reveal.in,
  .in .meter::after,
  .in .seg,
  .in .gauge-value,
  .in .wave-path,
  .in .ticks li {
    animation: none;
    transition: none;
    transform: none;
    opacity: 1;
    width: var(--w, auto);
  }

  .in .meter::after {
    width: calc(var(--n) * 100%);
  }

  .in .gauge-value {
    stroke-dashoffset: 180;
  }

  .in .wave-path {
    stroke-dashoffset: 0;
  }
}
