/* =========================================================
   NOCTURNE — 个人博客
   Design tokens → utilities → components → sections → states
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* color */
  --bg: #05060b;
  --bg-soft: #090c14;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);

  --text: #e9edf7;
  --text-2: #a6b0c6;
  --text-3: #8b93a8;

  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --violet: #a855f7;
  --violet-soft: #c084fc;
  --magenta: #f472b6;

  --grad-hero: linear-gradient(104deg, #67e8f9 0%, #a855f7 52%, #f472b6 100%);
  --grad-line: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), rgba(168, 85, 247, 0.5), transparent);

  /* type */
  --font-sans: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-display: clamp(2.2rem, 5vw, 3.5rem);
  --fs-h2: clamp(1.85rem, 3.4vw, 2.75rem);
  --fs-h3: clamp(1.12rem, 1.6vw, 1.28rem);
  --fs-lead: clamp(1rem, 1.25vw, 1.12rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;
  --fs-label: 0.72rem;

  /* space (4px scale) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --section-y: clamp(80px, 11vw, 150px);
  --gutter: clamp(20px, 5vw, 48px);
  --maxw: 1180px;

  /* shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  /* elevation */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --shadow-float: 0 0 0 1px rgba(34, 211, 238, 0.18), 0 20px 60px -20px rgba(34, 211, 238, 0.25);
  --glow-cyan: 0 0 32px rgba(34, 211, 238, 0.22);
  --glow-violet: 0 0 40px rgba(168, 85, 247, 0.25);

  --ease: cubic-bezier(0.22, 0.7, 0.24, 1);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  letter-spacing: 0.01em;
  background: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

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

strong {
  color: #f4f7ff;
  font-weight: 600;
}

::selection {
  background: rgba(168, 85, 247, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 只在 JS 可用时隐藏待入场元素，避免无脚本时白屏 */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s var(--ease) var(--d, 0ms),
    transform 0.8s var(--ease) var(--d, 0ms);
  will-change: opacity, transform;
}

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

/* ---------- 3. Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  mix-blend-mode: screen;
  will-change: transform;
}

.bg__aurora--cyan {
  width: 62vw;
  height: 62vw;
  top: -22vw;
  left: -14vw;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.55), transparent 62%);
  animation: drift-a 24s var(--ease) infinite alternate;
}

.bg__aurora--violet {
  width: 58vw;
  height: 58vw;
  top: -10vw;
  right: -18vw;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.55), transparent 62%);
  animation: drift-b 30s var(--ease) infinite alternate;
}

.bg__aurora--magenta {
  width: 52vw;
  height: 52vw;
  bottom: -28vw;
  left: 18vw;
  opacity: 0.32;
  background: radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.5), transparent 65%);
  animation: drift-c 36s var(--ease) infinite alternate;
}

@keyframes drift-a {
  to { transform: translate3d(6vw, 5vw, 0) scale(1.12); }
}
@keyframes drift-b {
  to { transform: translate3d(-7vw, 6vw, 0) scale(1.08); }
}
@keyframes drift-c {
  to { transform: translate3d(4vw, -6vw, 0) scale(1.15); }
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.9;
}

.bg__noise {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

.bg__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* 鼠标跟随光晕，仅桌面端 */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.09), transparent 62%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-glow.is-on { opacity: 1; }
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad-hero);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

/* ---------- 4. Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main,
footer.footer {
  position: relative;
  z-index: 2;
}

.section {
  padding-block: var(--section-y);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.section__label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section__label span {
  color: var(--cyan);
}

.section__title {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section__note {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.section__note strong {
  color: var(--text-2);
  font-family: var(--font-mono);
}

.empty[hidden] {
  display: none;
}

.section__foot {
  display: flex;
  justify-content: center;
  margin-top: var(--s7);
}

/* ---------- 5. Buttons / chips / tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0.8rem 1.4rem;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.btn__icon {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease);
}

.btn--primary {
  position: relative;
  color: #05060b;
  background: var(--grad-hero);
  background-size: 180% 100%;
  box-shadow: 0 8px 30px -10px rgba(34, 211, 238, 0.55), 0 8px 30px -14px rgba(168, 85, 247, 0.6);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 12px 40px -10px rgba(34, 211, 238, 0.65), 0 12px 40px -14px rgba(168, 85, 247, 0.7);
}

.btn--primary:hover .btn__icon {
  transform: translateX(3px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--glass,
.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.btn--glass:hover,
.btn--ghost:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.07);
  transform: translateY(-2px);
}

.btn--ghost {
  padding: 0.62rem 1.1rem;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.btn--ghost:hover {
  color: var(--text);
}

.chip {
  padding: 0.42rem 0.95rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  transition: all 0.3s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

.chip.is-active {
  color: #05060b;
  background: linear-gradient(120deg, var(--cyan-soft), var(--violet-soft));
  border-color: transparent;
  box-shadow: 0 0 24px -6px rgba(34, 211, 238, 0.5);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.tag {
  padding: 0.18rem 0.6rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.tag-row--lg .tag {
  padding: 0.32rem 0.85rem;
  font-size: var(--fs-xs);
  color: var(--text-2);
  background: var(--surface);
}

.pulse {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse-ring 2.4s var(--ease) infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- 6. Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: rgba(5, 6, 11, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s5);
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  box-shadow: var(--glow-cyan);
}

.brand__name {
  font-size: 0.92rem;
}

.brand__dot {
  color: var(--cyan);
}

.nav__nav {
  margin-left: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.nav__links a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transform: translateX(-50%);
  transition: width 0.35s var(--ease);
}

.nav__links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav__links a[aria-current="true"] {
  color: var(--text);
}

.nav__links a[aria-current="true"]::after {
  width: 18px;
}

.nav__cta {
  margin-left: var(--s3);
}

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  place-items: center;
  gap: 6px;
  flex-direction: column;
}

.nav__toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

body.menu-open .nav__toggle span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

body.menu-open .nav__toggle span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  align-content: center;
  gap: var(--s6);
  padding: var(--s8) var(--gutter);
  background: rgba(5, 6, 11, 0.94);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .mobile-menu {
  opacity: 1;
  visibility: visible;
}

.mobile-menu ul {
  display: grid;
  gap: 2px;
}

.mobile-menu li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.mobile-menu__index {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

.mobile-menu ul a {
  display: inline-block;
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mobile-menu ul a:hover {
  color: var(--cyan-soft);
}

.mobile-menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.mobile-menu__mail {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

body.menu-open .mobile-menu li {
  animation: mm-in 0.55s var(--ease) both;
}

body.menu-open .mobile-menu li:nth-child(2) {
  animation-delay: 0.07s;
}

body.menu-open .mobile-menu li:nth-child(3) {
  animation-delay: 0.14s;
}

@keyframes mm-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.mobile-menu__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  color: var(--text-3);
}

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding-top: clamp(110px, 15vh, 170px);
  padding-bottom: clamp(72px, 12vh, 130px);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hero__inner > .terminal {
  align-self: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: var(--text-2);
}

.hero__title {
  margin-top: var(--s5);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__line {
  display: block;
}

.hero__line--grad {
  background: var(--grad-hero);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shift 9s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.22));
}

/* 行内渐变文字（不换行） */
.text-grad {
  background: var(--grad-hero);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shift 9s ease-in-out infinite;
}

@keyframes grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__lead {
  max-width: 34em;
  margin-top: var(--s5);
  font-size: var(--fs-lead);
  color: var(--text-2);
  line-height: 1.85;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s6);
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__stats strong {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero__stats span {
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  transform: translateX(-50%);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
}

.scroll-hint__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, transparent, var(--cyan));
  animation: scroll-line 2.4s var(--ease) infinite;
}

@keyframes scroll-line {
  0% { transform: scaleY(0.1); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  70% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0.1); transform-origin: bottom; opacity: 0; }
}

/* ---------- 8. Terminal ---------- */
.terminal {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(18, 23, 38, 0.92), rgba(8, 10, 18, 0.95));
  box-shadow: var(--shadow-card), 0 0 80px -40px rgba(34, 211, 238, 0.5);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.7s var(--ease), border-color 0.5s var(--ease);
}

.terminal:hover {
  transform: perspective(1400px) rotateY(-2deg) rotateX(0deg) translateY(-4px);
  border-color: rgba(34, 211, 238, 0.3);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.terminal__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.85;
}

.terminal__dot--r { background: #ff5f57; }
.terminal__dot--y { background: #febc2e; }
.terminal__dot--g { background: #28c840; }

.terminal__title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.terminal__body {
  margin: 0;
  padding: 1.15rem 1.3rem 1.5rem;
  min-height: 250px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.95;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__body .t-prompt { color: #34d399; }
.terminal__body .t-cmd { color: #e9edf7; }
.terminal__body .t-out { color: #8b93a8; }
.terminal__body .t-acc { color: var(--cyan-soft); }
.terminal__body .t-note { color: var(--violet-soft); }

.terminal__caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--cyan);
  animation: blink 1.05s steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- 9. Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  padding-block: var(--s4);
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__track span {
  padding-inline: var(--s5);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.marquee__track span:nth-child(4n + 2) {
  color: rgba(34, 211, 238, 0.5);
}

@keyframes marquee {
  to { transform: translate3d(-50%, 0, 0); }
}

/* ---------- 10. Articles ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s6);
}

.featured {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(20, 26, 44, 0.9), rgba(9, 12, 20, 0.94));
  box-shadow: var(--shadow-card);
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.featured:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 40px 100px -50px rgba(168, 85, 247, 0.6);
}

.featured__art {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 25% 20%, rgba(34, 211, 238, 0.22), transparent 60%),
    radial-gradient(80% 80% at 80% 80%, rgba(168, 85, 247, 0.28), transparent 60%),
    #070a12;
  border-right: 1px solid var(--line);
}

.featured__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 78%);
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 78%);
}

.featured__orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #22d3ee, #a855f7, #f472b6, #22d3ee);
  filter: blur(2px);
  opacity: 0.9;
  animation: spin 18s linear infinite;
  box-shadow: 0 0 90px rgba(168, 85, 247, 0.45);
}

.featured__orb::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #070a12;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.featured__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  animation: spin 40s linear infinite reverse;
}

.featured__index {
  position: absolute;
  right: 18px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: clamp(4rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.06);
}

.featured__badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 0.24rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(244, 114, 182, 0.4);
  background: rgba(244, 114, 182, 0.12);
  color: #f9a8d4;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

.featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s3);
  padding: clamp(24px, 4vw, 48px);
}

.featured__meta {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.featured__title {
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.featured__title a {
  background-image: linear-gradient(var(--cyan-soft), var(--cyan-soft));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.5s var(--ease), color 0.3s var(--ease);
}

.featured:hover .featured__title a,
.featured__title a:focus-visible {
  color: var(--cyan-soft);
  background-size: 100% 1px;
}

.featured__excerpt {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.85;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  width: fit-content;
  margin-top: var(--s2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--cyan-soft);
}

.text-link span {
  transition: transform 0.35s var(--ease);
}

.text-link:hover span {
  transform: translateX(4px);
}

/* 文章卡片 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

.post-card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
  transform-style: preserve-3d;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.65), rgba(168, 85, 247, 0.5) 45%, transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: 0 30px 70px -40px rgba(34, 211, 238, 0.65);
}

.post-card:hover::before,
.post-card:focus-within::before {
  opacity: 1;
}

.post-card__hit {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  height: 100%;
  padding: var(--s5);
  border-radius: inherit;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.post-card__title {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
  transition: color 0.35s var(--ease);
}

.post-card:hover .post-card__title {
  color: var(--cyan-soft);
}

.post-card__excerpt {
  flex: 1;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--text-3);
}

.post-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.post-card__arrow {
  font-size: 1.05rem;
  color: var(--text-3);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}

.post-card:hover .post-card__arrow {
  color: var(--cyan);
  transform: translate(3px, -3px);
}

.post-card.is-hidden,
.featured.is-hidden {
  display: none;
}

/* 空状态 */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
  padding: clamp(48px, 8vw, 88px) var(--s5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  text-align: center;
  background: rgba(255, 255, 255, 0.012);
}

.empty__glyph {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  color: var(--text-3);
  letter-spacing: 0.2em;
}

.empty__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.empty__text {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.empty .btn {
  margin-top: var(--s3);
}

/* ---------- 11. About ---------- */
.section--about .section__label {
  margin-bottom: var(--s6);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.about__visual {
  display: grid;
  justify-items: center;
  gap: var(--s5);
}

.orb {
  position: relative;
  width: min(360px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.orb__core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(103, 232, 249, 0.55), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.6), transparent 60%),
    #0a0e18;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 0 70px rgba(34, 211, 238, 0.22),
    inset 0 0 40px rgba(168, 85, 247, 0.18);
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.82);
  text-indent: 0.18em;
}

.orb__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.orb__ring--1 {
  inset: 8%;
  border-style: dashed;
  animation: spin 34s linear infinite;
}

.orb__ring--2 {
  inset: 0;
  border-color: rgba(34, 211, 238, 0.14);
  animation: spin 48s linear infinite reverse;
}

.orb__ring--1::after,
.orb__ring--2::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.orb__chip {
  position: absolute;
  z-index: 3;
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: rgba(9, 12, 20, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-2);
  animation: float 6s var(--ease) infinite alternate;
}

.orb__chip--a { top: 8%; left: 2%; animation-delay: -1s; }
.orb__chip--b { top: 30%; right: -4%; animation-delay: -3s; }
.orb__chip--c { bottom: 12%; left: 6%; animation-delay: -5s; }

@keyframes float {
  to { transform: translateY(-9px); }
}

.about__caption {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  color: var(--text-3);
}

.about__text .section__title {
  margin-bottom: var(--s5);
}

.about__text p {
  max-width: 36em;
  margin-bottom: var(--s4);
  color: var(--text-2);
  line-height: 1.9;
}

.about__subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.about__skills {
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.now {
  margin-top: var(--s6);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.now__list {
  display: grid;
  gap: var(--s3);
}

.now__list li {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: var(--s3);
  align-items: baseline;
  font-size: var(--fs-sm);
}

.now__k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.now__v {
  color: var(--text-2);
}

/* ---------- 12. Contact ---------- */
.section--contact {
  padding-bottom: clamp(64px, 8vw, 110px);
}

.contact {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(168, 85, 247, 0.16), transparent 55%),
    rgba(9, 12, 20, 0.75);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.contact__glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 65%);
  filter: blur(50px);
  pointer-events: none;
}

.contact__main {
  position: relative;
  min-width: 0;
}

.contact__aside {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--line);
}

.facts {
  display: grid;
  width: 100%;
}

.facts li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-block: 14px;
  border-bottom: 1px dashed var(--line);
}

.facts li:last-child {
  border-bottom: 0;
}

.facts__k {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.facts__v {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.94rem;
  color: var(--text);
}

.contact__title {
  position: relative;
  margin-bottom: var(--s4);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.contact__lead {
  max-width: 34em;
  font-size: var(--fs-lead);
  color: var(--text-2);
  line-height: 1.85;
}

.contact__email {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.contact__address {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.02em;
  color: var(--text);
  background-image: linear-gradient(var(--cyan), var(--cyan));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: color 0.3s var(--ease);
}

.contact__address:hover {
  color: var(--cyan-soft);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  transition: all 0.3s var(--ease);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.copy-btn:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.copy-btn.is-done {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}

.socials {
  position: relative;
  display: flex;
  gap: var(--s2);
  margin-top: var(--s6);
}

.social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: all 0.35s var(--ease);
}

.social svg {
  width: 17px;
  height: 17px;
}

.social:hover {
  color: var(--cyan-soft);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-3px);
  box-shadow: var(--glow-cyan);
}

/* ---------- 13. Footer / toast / skip ---------- */
.footer {
  padding-block: var(--s6);
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 11, 0.6);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.footer__meta {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}

.footer__top:hover {
  color: var(--cyan-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 150;
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(9, 12, 20, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 30px -10px rgba(34, 211, 238, 0.4);
  font-size: var(--fs-sm);
  color: var(--text);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--cyan);
  color: #05060b;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 1080px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__inner > .terminal {
    grid-column: 1;
    grid-row: auto;
    margin-top: var(--s7);
    max-width: 560px;
    width: 100%;
    transform: none;
  }

  .hero__inner > .terminal:hover {
    transform: translateY(-4px);
  }

  .about {
    grid-template-columns: minmax(0, 1fr);
  }

  .about__visual {
    order: -1;
  }
}

@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .contact__aside {
    padding-left: 0;
    padding-top: var(--s5);
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .featured__art {
    min-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .nav__nav,
  .nav__cta {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .hero {
    padding-top: 108px;
  }

  .hero__stats {
    gap: var(--s5);
  }

  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section__head {
    align-items: flex-start;
  }

  .featured__body {
    gap: var(--s2);
  }

  .contact__email {
    align-items: flex-start;
  }

  .scroll-hint {
    display: none;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 小屏手机（320–360px） */
@media (max-width: 360px) {
  .hero__title {
    font-size: clamp(1.7rem, 8.8vw, 2.2rem);
  }

  .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s4) var(--s3);
    width: 100%;
  }

  .hero__actions {
    width: 100%;
  }

  .hero__actions .btn {
    flex: 1;
  }
}

/* ---------- 15. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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

  .marquee__track {
    animation: none;
  }
}

/* ---------- 16. Print ---------- */
@media print {
  :root {
    --bg: #ffffff;
    --text: #111318;
    --text-2: #33383f;
    --text-3: #565c66;
    --line: #d9dce2;
    --line-strong: #b9bec7;
    --surface: transparent;
    --surface-2: transparent;
  }

  .bg,
  .cursor-glow,
  .scroll-progress,
  .marquee,
  .nav,
  .mobile-menu,
  .toast,
  .scroll-hint,
  .copy-btn,
  .filters,
  .orb__chip {
    display: none !important;
  }

  html,
  body {
    background: #fff;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__line--grad,
  .text-grad {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #111318 !important;
    filter: none !important;
    animation: none !important;
  }

  .post-card,
  .featured,
  .contact,
  .now,
  .terminal {
    background: #fff;
    border-color: #d9dce2;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .featured,
  .post-card,
  .contact {
    break-inside: avoid;
  }

  .terminal {
    display: none;
  }
}
