/* ------------------------------------------------------------------
   REFRACT
   全屏 WebGL 流场 + 大字号动态排版
   只用系统字体，不引用任何外部资源
   ------------------------------------------------------------------ */

:root {
  --bg: #08070a;
  --fg: #f5f5f7;
  --dim: #9b9ba6;
  --mute: #64646f;
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);
  --lime: #c8ff4d;
  --cyan: #2ee6c8;
  --amber: #ffb44a;
  --sans: ui-sans-serif, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --wrap: 1240px;
  --bar: 64px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
  font-weight: 650;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol, li, dl, dd {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

canvas {
  display: block;
}

::selection {
  background: var(--lime);
  color: #08070a;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

/* 斜向字幕带旋转后外框会宽出 1px，裁掉以免出现横向滚动 */
main {
  overflow-x: clip;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  padding: 10px 16px;
  background: var(--lime);
  color: #08070a;
  border-radius: 4px;
  font-size: 14px;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* --------------------------- 背景与光标 --------------------------- */

.gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--bg);
  opacity: 0.32;
  pointer-events: none;
  transition: opacity 0.5s linear;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease,
    margin 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.cursor span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--lime);
}

.cursor.is-hot {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.08);
}

body.cursor-on .cursor {
  opacity: 1;
}

body.cursor-on,
body.cursor-on a,
body.cursor-on button {
  cursor: none;
}

/* ------------------------------ 顶部栏 ------------------------------ */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  background: rgba(8, 7, 10, 0.55);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(0);
  transition: transform 0.35s ease;
}

.topbar.is-hidden {
  transform: translateY(-100%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--bar);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.mark-glyph {
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--lime);
  transform: rotate(45deg);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mark:hover .mark-glyph {
  transform: rotate(225deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--dim);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a i {
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  color: var(--mute);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.nav a.is-active i {
  color: var(--lime);
}

.nav a.nav-ext i {
  color: var(--lime);
}

.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.rail {
  height: 1px;
  background: transparent;
}

.rail i {
  display: block;
  height: 1px;
  width: 0;
  background: var(--lime);
}

/* -------------------------------- 首屏 -------------------------------- */

.hero {
  position: relative;
  z-index: 2;
  min-height: min(88svh, 860px);
  display: flex;
  align-items: center;
  padding: calc(var(--bar) + 72px) 0 84px;
}

/* 只在文字这一侧压暗，右边的流场保持通透 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(8, 7, 10, 0.88) 0%,
    rgba(8, 7, 10, 0.62) 32%,
    rgba(8, 7, 10, 0.12) 58%,
    rgba(8, 7, 10, 0) 74%
  );
}

.hero-inner {
  width: 100%;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-shadow: 0 2px 14px rgba(8, 7, 10, 0.85);
}

.kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--lime);
}

.display {
  font-size: 1rem;
  font-weight: 700;
}

.line {
  display: block;
  overflow: hidden;
}

.line-inner {
  display: inline-block;
  white-space: nowrap;
}

.line-latin .line-inner {
  font-size: 7rem;
  font-weight: 800;
  line-height: 0.92;
}

.line-latin .ch {
  text-shadow: 2px 0 0 rgba(46, 230, 200, 0.22), -2px 0 0 rgba(255, 180, 74, 0.22),
    0 12px 40px rgba(8, 7, 10, 0.35);
}

.line-zh {
  margin-top: 14px;
}

.line-zh .line-inner {
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(245, 245, 247, 0.82);
  text-shadow: 0 2px 18px rgba(8, 7, 10, 0.9);
}

.ch {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.35s ease;
}

.is-in .ch {
  transform: none;
}

.line-latin .ch:hover {
  color: var(--lime);
  text-shadow: 3px 0 0 rgba(46, 230, 200, 0.85), -3px 0 0 rgba(255, 180, 74, 0.85);
}

.hero-sub {
  max-width: 44ch;
  margin-top: 34px;
  font-size: 1.02rem;
  color: rgba(245, 245, 247, 0.8);
  text-shadow: 0 2px 16px rgba(8, 7, 10, 0.9);
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 54px;
}

.cue {
  position: relative;
  display: block;
  width: 1px;
  height: 54px;
  background: var(--line);
  overflow: hidden;
}

.cue i {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 18px;
  background: var(--lime);
  animation: cue 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes cue {
  0% { transform: translateY(-20px); }
  60%, 100% { transform: translateY(56px); }
}

.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-shadow: 0 2px 14px rgba(8, 7, 10, 0.9);
}

/* ------------------------------ 斜向字幕带 ------------------------------ */

.band {
  position: relative;
  z-index: 2;
  padding: 26px 0;
  overflow: hidden;
  transform: rotate(-1.2deg);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 7, 10, 0.82);
}

.band-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: band 34s linear infinite;
}

.band-half {
  display: flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
}

.band-half span {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(245, 245, 247, 0.72);
  white-space: nowrap;
}

.band-half i {
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--lime);
  transform: rotate(45deg);
}

@keyframes band {
  to { transform: translateX(-50%); }
}

/* ------------------------------ 通用区块 ------------------------------ */

.section {
  position: relative;
  z-index: 2;
  padding: 118px 0;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 58px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sec-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--lime);
}

.sec-title {
  font-size: 2.3rem;
}

.sec-en {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

/* -------------------------------- 宣言 -------------------------------- */

.statements {
  border-top: 1px solid var(--line-soft);
}

.statement {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 26px;
  padding: 38px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.statement:hover {
  padding-left: 16px;
}

.statement-idx {
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.statement-zh {
  font-size: 2.35rem;
  font-weight: 650;
}

.statement-en {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  transition: color 0.3s ease;
}

.statement:hover .statement-en {
  color: var(--cyan);
}

/* ------------------------------- 实验场 ------------------------------- */

.stage {
  position: relative;
  z-index: 2;
  height: 540px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 7, 10, 0.42);
  overflow: hidden;
}

.stage-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  left: 24px;
  bottom: 22px;
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  pointer-events: none;
}

.hud b {
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.hud span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin-left: 20px;
  background: var(--line);
  vertical-align: -1px;
}

/* -------------------------------- 作品 -------------------------------- */

.works-list {
  border-top: 1px solid var(--line);
}

.work {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 260px 60px;
  align-items: center;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: opacity 0.35s ease;
}

.work::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work.is-hot::after {
  transform: scaleX(1);
}

.works-list.is-browsing .work:not(.is-hot) {
  opacity: 0.35;
}

.work-idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.work-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.7rem;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.work.is-hot .work-title {
  transform: translateX(16px);
}

.work-en {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.work-tags {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.work-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  text-align: right;
}

.peek {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 300px;
  height: 190px;
  pointer-events: none;
  will-change: transform;
}

.peek-inner {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  opacity: 0;
  mix-blend-mode: screen;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.peek.is-on .peek-inner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.peek canvas {
  width: 100%;
  height: 100%;
}

/* -------------------------------- 能力 -------------------------------- */

.marquees {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.marquee {
  overflow: hidden;
}

.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.mq-half {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
}

.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 40px;
}

.marquee-track span::after {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--lime);
  transform: rotate(45deg);
}

.marquee[data-dir="-1"] .marquee-track {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.42);
}

.marquee[data-dir="-1"] .marquee-track span::after {
  background: var(--cyan);
}

@keyframes mq-left {
  to { transform: translateX(-50%); }
}

@keyframes mq-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.marquee[data-dir="1"] .marquee-track {
  animation: mq-left 40s linear infinite;
}

.marquee[data-dir="-1"] .marquee-track {
  animation: mq-right 52s linear infinite;
}

.caps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  margin-top: 56px;
}

.cap {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.cap-num {
  display: block;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--lime);
}

.cap-title {
  font-size: 1.15rem;
}

.cap-desc {
  margin-top: 10px;
  font-size: 14px;
  color: var(--dim);
}

/* -------------------------------- 收尾 -------------------------------- */

.outro {
  position: relative;
  z-index: 2;
  min-height: 72svh;
  display: flex;
  align-items: center;
  padding: 120px 0;
  border-top: 1px solid var(--line-soft);
}

.outro-inner {
  display: grid;
  justify-items: start;
  gap: 40px;
}

.outro-line {
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 1.18;
  overflow: hidden;
}

.outro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 550;
  background: rgba(8, 7, 10, 0.5);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--lime);
  transform: rotate(45deg);
}

.btn:hover {
  border-color: var(--lime);
  color: #08070a;
  background: var(--lime);
}

.btn:hover::before {
  background: #08070a;
}

.btn-accent {
  border-color: var(--lime);
  background: var(--lime);
  color: #08070a;
}

.btn-accent::before {
  background: #08070a;
}

.btn-accent:hover {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.12);
  color: var(--fg);
}

.btn-accent:hover::before {
  background: var(--lime);
}

/* -------------------------------- 页脚 -------------------------------- */

.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 7, 10, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.footer-time {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 滚动揭示 ------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 1080px) {
  .work {
    grid-template-columns: 54px minmax(0, 1fr) 200px 52px;
    gap: 18px;
  }

  .caps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 30px;
  }

  .marquee-track {
    font-size: 2.8rem;
  }
}

@media (max-width: 880px) {
  .wrap {
    padding: 0 22px;
  }

  .nav a {
    padding: 8px 10px;
  }

  .nav a span {
    display: none;
  }

  .nav a i {
    font-size: 12px;
    color: var(--dim);
  }

  .hero {
    min-height: min(84svh, 720px);
    padding: calc(var(--bar) + 48px) 0 64px;
  }

  /* 窄屏文字占满整行，改成上下压暗 */
  .hero::before {
    background: linear-gradient(
      180deg,
      rgba(8, 7, 10, 0.82) 0%,
      rgba(8, 7, 10, 0.44) 40%,
      rgba(8, 7, 10, 0.3) 68%,
      rgba(8, 7, 10, 0.58) 100%
    );
  }

  .line-zh .line-inner {
    font-size: 1.6rem;
  }

  .hero-sub {
    margin-top: 26px;
    font-size: 0.96rem;
  }

  .hero-foot {
    margin-top: 40px;
  }

  .section {
    padding: 84px 0;
  }

  .sec-head {
    margin-bottom: 42px;
  }

  .sec-title {
    font-size: 1.9rem;
  }

  .statement {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;
    padding: 28px 0;
  }

  .statement-zh {
    font-size: 1.6rem;
  }

  .statement:hover {
    padding-left: 0;
  }

  .stage {
    height: 420px;
  }

  .work {
    grid-template-columns: 42px minmax(0, 1fr) 56px;
  }

  .work-tags {
    display: none;
  }

  .work-title {
    font-size: 1.35rem;
  }

  .peek {
    display: none;
  }

  .marquee-track {
    font-size: 2.1rem;
  }

  .mq-half {
    gap: 26px;
    padding-right: 26px;
  }

  .marquee-track span {
    gap: 26px;
  }

  .outro {
    min-height: 60svh;
    padding: 90px 0;
  }

  .outro-line {
    font-size: 2rem;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .clock {
    display: none;
  }

  .kicker {
    font-size: 11px;
  }

  .line-zh {
    margin-top: 10px;
  }

  .line-zh .line-inner {
    font-size: 1.28rem;
  }

  .hero-sub {
    max-width: 100%;
  }

  .band {
    padding: 22px 0;
  }

  .statement {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .statement-idx {
    padding-top: 0;
  }

  .statement-zh {
    font-size: 1.34rem;
  }

  .statement-en {
    font-size: 11px;
  }

  .stage {
    height: 340px;
  }

  .hud {
    left: 16px;
    bottom: 14px;
    gap: 12px;
    font-size: 10px;
  }

  .hud span:not(:last-child)::after {
    margin-left: 12px;
  }

  .work {
    grid-template-columns: 34px minmax(0, 1fr) 48px;
    gap: 12px;
    padding: 20px 0;
  }

  .work-title {
    display: block;
    font-size: 1.2rem;
  }

  .work-en {
    display: block;
    margin-top: 6px;
  }

  .work.is-hot .work-title {
    transform: translateX(8px);
  }

  .caps {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-top: 40px;
  }

  .marquee-track {
    font-size: 1.6rem;
  }

  .outro-line {
    font-size: 1.6rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .ch {
    transform: none;
  }

  .band-track,
  .marquee-track {
    animation: none !important;
  }
}
