/* ============================================================
   base.css — tokens, reset, scene, typography, utilities
   FKOX心灵 / FKOX Mind
   ============================================================ */

:root {
  /* surfaces */
  --bg: #05080f;
  --bg-deep: #03050a;
  --panel: rgba(13, 19, 32, 0.72);
  --panel-strong: rgba(15, 22, 38, 0.92);
  --panel-soft: rgba(20, 29, 48, 0.55);
  --stroke: rgba(150, 180, 222, 0.13);
  --stroke-strong: rgba(150, 180, 222, 0.26);
  --fill: rgba(255, 255, 255, 0.045);
  --fill-hover: rgba(255, 255, 255, 0.085);

  /* text */
  --text: #eaf1fb;
  --text-2: #a8b8ce;
  --text-3: #6d7f99;

  /* accents */
  --accent: #6db3ee;
  --accent-deep: #3f7fd6;
  --accent-soft: rgba(109, 179, 238, 0.16);
  --aurora: #6fe3c9;
  --warm: #f0b27a;
  --danger: #ef8181;
  --like: #ff8fa0;

  /* geometry */
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  /* depth */
  --shadow-panel: 0 34px 90px -34px rgba(0, 0, 0, 0.92), 0 1px 0 0 rgba(255, 255, 255, 0.045) inset;
  --shadow-pop: 0 24px 60px -22px rgba(0, 0, 0, 0.85), 0 1px 0 0 rgba(255, 255, 255, 0.06) inset;
  --blur: saturate(140%) blur(22px);

  /* motion */
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.16s;
  --t: 0.26s;
  --t-slow: 0.55s;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", "Noto Color Emoji", "Apple Color Emoji",
    "Segoe UI Emoji", sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}

/* night mode: pulled deeper into the dark */
body.night {
  --panel: rgba(7, 11, 19, 0.82);
  --panel-strong: rgba(9, 14, 24, 0.95);
  --stroke: rgba(150, 180, 222, 0.1);
  --text: #dfe8f5;
  --text-2: #93a3b8;
  --accent: #7fbdf3;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body { max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-theme="cosmos"] body { background: radial-gradient(120% 90% at 50% 10%, #0a1424 0%, #060a13 45%, #03050a 100%); }

body[data-scroll="1"] { overflow: hidden; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.28; letter-spacing: 0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #a6d3f8; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea { border: 0; background: none; outline: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
hr { border: 0; height: 1px; background: var(--stroke); }
::selection { background: rgba(109, 179, 238, 0.32); color: #fff; }

:focus-visible {
  outline: 2px solid rgba(130, 195, 245, 0.9);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(150, 180, 222, 0.28) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150, 180, 222, 0.24); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(150, 180, 222, 0.42); }

/* ---------- icon system ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke-width: 1.6;
  pointer-events: none;
}
.icon.tick { width: 16px; height: 16px; opacity: 0; color: var(--accent); }
.icon.chev { width: 16px; height: 16px; opacity: 0.6; transition: transform var(--t) var(--ease); }

/* ---------- scene ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #04070d; }
.scene-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-nebula {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(48% 44% at 18% 22%, rgba(47, 96, 168, 0.26), transparent 68%),
    radial-gradient(40% 38% at 82% 16%, rgba(96, 70, 168, 0.18), transparent 70%),
    radial-gradient(56% 50% at 62% 88%, rgba(28, 118, 132, 0.18), transparent 72%),
    radial-gradient(30% 30% at 32% 74%, rgba(168, 96, 60, 0.07), transparent 70%);
  filter: blur(20px);
  animation: nebula-drift 46s var(--ease) infinite alternate;
}
.scene-noise {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.5'/></svg>");
}

.globe-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.globe-canvas.is-dragging { cursor: grabbing; }

.globe-fallback[hidden] { display: none !important; }
.globe-fallback {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.fallback-earth {
  width: min(56vh, 46vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #8fd8e8 0%, #4293b8 38%, #17456f 72%, #0a2340 100%);
  box-shadow: 0 0 90px rgba(90, 169, 230, 0.35), inset -22px -18px 60px rgba(0, 0, 0, 0.55);
  animation: float 9s ease-in-out infinite;
}
.orbit-ring {
  position: absolute;
  width: min(84vh, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(140, 190, 235, 0.16);
  transform: rotateX(72deg);
}

.globe-caption {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(168, 190, 214, 0.5);
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.8s var(--ease);
  white-space: nowrap;
}
.globe-caption.is-hidden { opacity: 0; }
.caption-line { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, rgba(168, 190, 214, 0.45)); }

/* ---------- utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.block { width: 100%; justify-content: center; }
.hidden { display: none !important; }
.dot-sep { opacity: 0.4; margin: 0 6px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.live-dot {
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 0 0 rgba(111, 227, 201, 0.65);
  animation: live-pulse 2.4s var(--ease) infinite;
}

/* ---------- animations ---------- */
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 227, 201, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(111, 227, 201, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 227, 201, 0); }
}
@keyframes nebula-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); }
}
@keyframes float {
  0%, 100% { transform: translateY(-1.2%); }
  50% { transform: translateY(1.2%); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer {
  from { background-position: -160% 0; }
  to { background-position: 260% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq-bar {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}
@keyframes ring-out {
  0% { transform: scale(0.7); opacity: 0.65; }
  100% { transform: scale(2.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .scene-nebula { animation: none; }
}

/* ---------- noscript ---------- */
.noscript {
  position: fixed;
  inset: auto 0 0;
  z-index: 99;
  padding: 14px 20px;
  text-align: center;
  font-size: 13px;
  background: rgba(120, 40, 40, 0.9);
}

/* ---------- boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: radial-gradient(90% 70% at 50% 40%, #0a1322 0%, #050810 60%, #03050a 100%);
  transition: opacity 0.55s var(--ease);
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.boot-orb {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 14px 36px rgba(90, 169, 230, 0.5));
  animation: float 4.5s ease-in-out infinite;
}
.boot-text {
  font-size: 10.5px;
  letter-spacing: 0.32em;
  color: var(--text-3);
  text-transform: uppercase;
}
.boot-bar {
  width: 136px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 45%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(140, 200, 245, 0.95), transparent);
  animation: boot-slide 1.4s var(--ease) infinite;
}
@keyframes boot-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(330%); }
}
