@font-face {
  font-family: 'Barlow';
  src: url('/offmenu/fonts/Barlow/Barlow-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow';
  src: url('/offmenu/fonts/Barlow/Barlow-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow';
  src: url('/offmenu/fonts/Barlow/Barlow-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Mango Grotesque';
  src: url('/offmenu/fonts/Mango Grotesque/MangoGrotesque-Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

html,
body {
  overscroll-behavior: none;
}

html[lang='zh-CN'] body {
  font-family: 'Barlow', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-weight: 500;
  letter-spacing: -0.018em;
}

html[lang='zh-CN'] main h1 {
  width: min(32rem, 84vw);
  max-width: none !important;
  font-family: 'Mango Grotesque', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  font-size: clamp(2rem, 3.15vw, 3.15rem) !important;
  font-weight: 800;
  line-height: 1.08 !important;
  letter-spacing: 0.015em;
  text-wrap: balance;
  transition: opacity 280ms ease-out;
}

html[lang='zh-CN'] main h1 > span:nth-child(-n + 4) {
  display: block;
}

html[lang='zh-CN'] main h1 > span:nth-child(3) {
  margin-top: 0.2em;
}

html[lang='zh-CN'] main h1 > span:nth-child(4) {
  font-size: 0.95em;
}

html[lang='zh-CN'] main h1 > span:nth-child(n + 5) {
  display: none;
}

html[lang='zh-CN'] main h1 > span > span {
  transform: translateY(0) !important;
}

html[lang='zh-CN'][data-hero-scroll-active] main h1 {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html[lang='zh-CN'] main h1 {
    transition: none;
  }
}

html[lang='zh-CN'] main h2 {
  font-family: 'Mango Grotesque', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  letter-spacing: -0.045em;
}

html[lang='zh-CN'] header,
html[lang='zh-CN'] #chat-window-position {
  letter-spacing: -0.025em;
}

html[lang='zh-CN'] .nav-menu-wrapper {
  letter-spacing: 0.06em;
}

html[lang='zh-CN'] .nav-menu-inner > .flex {
  min-width: 18rem;
  gap: 0.9rem;
  padding: 1rem;
}

html[lang='zh-CN'] [class~='group/links'] {
  gap: 0.32rem;
  font-size: 1.25rem;
  line-height: 1.18;
}

html[lang='zh-CN'] [class~='group/links'] a {
  padding-bottom: 0.08em;
}

#work {
  --foxhud-field-line: rgba(12, 12, 12, 0.07);
  isolation: isolate;
}

#work::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--foxhud-field-line) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), var(--foxhud-field-line) 50%, transparent calc(50% + 0.5px)),
    radial-gradient(circle at center, transparent 0 18vmin, var(--foxhud-field-line) calc(18vmin + 1px), transparent calc(18vmin + 2px)),
    radial-gradient(circle at center, transparent 0 30vmin, var(--foxhud-field-line) calc(30vmin + 1px), transparent calc(30vmin + 2px)),
    radial-gradient(circle at center, transparent 0 42vmin, var(--foxhud-field-line) calc(42vmin + 1px), transparent calc(42vmin + 2px));
  mask-image: radial-gradient(circle at center, #000 0 44vmin, transparent 70vmin);
}

#work::after {
  content: '靠近 / SCROLL';
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  z-index: 11;
  transform: translateX(-50%);
  color: var(--color-foreground);
  font: 600 0.65rem/1 'Barlow', 'PingFang SC', sans-serif;
  letter-spacing: 0.18em;
  opacity: 0.38;
  pointer-events: none;
}

html.dark #work {
  --foxhud-field-line: rgba(255, 255, 255, 0.09);
}

body[data-local-runtime-ready='false']::before {
  content: 'FOXHUD 正在醒来…';
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10000;
  transform: translate(-50%, -50%);
  font: 600 14px/1.2 'Barlow', sans-serif;
  letter-spacing: -0.02em;
}
/* FOXHUD header brand */
.foxhud-header-logo {
  display: block;
  width: 5rem;
  height: 5rem;
  object-fit: contain;
}

html.dark .foxhud-header-logo {
  filter: invert(1);
}

@media (max-width: 767px) {
  html[lang='zh-CN'] header {
    padding: 0.75rem;
    opacity: 1 !important;
  }

  .foxhud-header-logo {
    width: 3.5rem;
    height: 3.5rem;
  }

  html[lang='zh-CN'] .nav-menu-inner > .flex {
    min-width: min(18rem, calc(100vw - 1.5rem));
  }

  header.foxhud-mobile-menu-open .nav-menu-wrapper {
    grid-template-rows: 1fr;
    opacity: 1;
    filter: blur(0);
  }

  header.foxhud-mobile-menu-open .nav-menu-inner {
    margin-top: 0.5rem;
    border-radius: 1rem;
    color: var(--color-background);
    background: var(--color-foreground);
    box-shadow: 0 1.25rem 3rem rgb(0 0 0 / 18%);
  }

  header.foxhud-mobile-menu-open [class~='group/links'],
  header.foxhud-mobile-menu-open [class~='group/links'] a {
    color: var(--color-background) !important;
  }

  #work > div:first-child {
    opacity: 1 !important;
  }

  #work > div:nth-child(2) {
    z-index: 20;
  }

  html[lang='zh-CN'] main h1 {
    width: min(24rem, calc(100vw - 3rem));
    font-size: clamp(1.85rem, 8.2vw, 2.25rem) !important;
    line-height: 1.04 !important;
    text-shadow: 0 0 1.2rem var(--color-background);
  }

  #work [data-sphere-index] {
    width: clamp(5.5rem, 26vw, 7.5rem) !important;
    height: clamp(5.5rem, 26vw, 7.5rem) !important;
    opacity: 0.92;
    animation: foxhud-mobile-float 8s ease-in-out infinite alternate;
    will-change: transform;
  }

  #work [data-sphere-index='0'] { --mobile-x: -35vw; --mobile-y: -30vh; --mobile-scale: 0.72; animation-delay: -1s; }
  #work [data-sphere-index='1'] { --mobile-x: 32vw; --mobile-y: -26vh; --mobile-scale: 0.58; animation-delay: -3s; }
  #work [data-sphere-index='2'] { --mobile-x: -38vw; --mobile-y: -4vh; --mobile-scale: 0.64; animation-delay: -5s; }
  #work [data-sphere-index='3'] { --mobile-x: 38vw; --mobile-y: 0vh; --mobile-scale: 0.74; animation-delay: -7s; }
  #work [data-sphere-index='4'] { --mobile-x: -28vw; --mobile-y: 26vh; --mobile-scale: 0.60; animation-delay: -2s; }
  #work [data-sphere-index='5'] { --mobile-x: 30vw; --mobile-y: 28vh; --mobile-scale: 0.70; animation-delay: -4s; }
  #work [data-sphere-index='6'] { --mobile-x: -10vw; --mobile-y: 40vh; --mobile-scale: 0.50; animation-delay: -6s; }
  #work [data-sphere-index='7'] { --mobile-x: 8vw; --mobile-y: -42vh; --mobile-scale: 0.46; animation-delay: -8s; }
  #work [data-sphere-index='8'] { --mobile-x: 40vw; --mobile-y: 42vh; --mobile-scale: 0.54; animation-delay: -1.5s; }
}

@keyframes foxhud-mobile-float {
  from {
    transform: translate(var(--mobile-x), calc(var(--mobile-y) - 0.45rem)) scale(var(--mobile-scale));
  }

  to {
    transform: translate(var(--mobile-x), calc(var(--mobile-y) + 0.45rem)) scale(calc(var(--mobile-scale) * 1.04));
  }
}
