/* ==========================================================================
 * MetaFish Labs — shared theme + tokens
 * Used by: index.html, deposit-addiction.html, portfolio/*.html
 * ========================================================================== */

:root {
  /* Dark (default) */
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #161616;
  --ink: #ffffff;
  --ink-2: rgba(255,255,255,0.72);
  --ink-3: rgba(255,255,255,0.48);
  --ink-4: rgba(255,255,255,0.22);
  --rule: rgba(255,255,255,0.10);
  --rule-strong: rgba(255,255,255,0.18);
  --mint: #1abc9c;
  --mint-dim: rgba(26,188,156,0.28);
  --mint-soft: rgba(26,188,156,0.06);
  --nav-bg: rgba(10,10,10,0.88);
  --nav-bg-scrolled: rgba(10,10,10,0.94);
  --card: #111111;
  --shadow-lg: 0 40px 80px rgba(0,0,0,0.45);
  /* Wordmark gradient stops for the inline SVG logo (dark theme) */
  --logo-text-start: #ffffff;
  --logo-text-end:   #82dcff;
}

html[data-theme="light"] {
  --bg: #f7f6f2;
  --bg-2: #ffffff;
  --bg-3: #eeece5;
  --ink: #0b0b0b;
  --ink-2: rgba(11,11,11,0.72);
  --ink-3: rgba(11,11,11,0.52);
  --ink-4: rgba(11,11,11,0.22);
  --rule: rgba(11,11,11,0.10);
  --rule-strong: rgba(11,11,11,0.22);
  --mint: #0f8f74;
  --mint-dim: rgba(15,143,116,0.32);
  --mint-soft: rgba(15,143,116,0.07);
  --nav-bg: rgba(247,246,242,0.88);
  --nav-bg-scrolled: rgba(247,246,242,0.96);
  --card: #ffffff;
  --shadow-lg: 0 30px 70px rgba(11,11,11,0.12);
  /* Wordmark gradient stops for the inline SVG logo (light theme) */
  --logo-text-start: #013353;
  --logo-text-end:   #0a67a7;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  transition: background-color 280ms ease, color 280ms ease;
  /* Kill any accidental horizontal overflow on every page using this theme.
     `overflow-x: clip` (vs hidden) keeps position: sticky working. */
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: 'Poppins','Noto Sans SC','PingFang SC',sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ----- Type tokens ----- */
.serif { font-family: 'Playfair Display','Noto Serif SC', serif; }
.mono  { font-family: 'JetBrains Mono', monospace; }
.mint  { color: var(--mint); }
.en-sub { color: var(--ink-3); font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; }

.t-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--mint); font-weight: 500;
  display: inline-flex; align-items: center; gap: 14px;
}
.t-kicker::before {
  content: ""; display: inline-block;
  width: 36px; height: 1px; background: var(--mint);
}
.t-h1 {
  font-family: 'Playfair Display','Noto Serif SC', serif;
  font-weight: 700; font-size: clamp(38px, 5.4vw, 76px);
  line-height: 1.06; letter-spacing: -1px; margin: 0;
}
.t-h2 {
  font-family: 'Playfair Display','Noto Serif SC', serif;
  font-weight: 700; font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1; letter-spacing: -0.5px; margin: 0;
}
.t-sub {
  font-size: clamp(16px, 1.3vw, 22px); font-weight: 300;
  color: var(--ink-2); line-height: 1.55; letter-spacing: 0.2px;
}
.t-body { font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.t-small { font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.keep { word-break: keep-all; overflow-wrap: break-word; }
/* On narrow screens, allow CJK to break at any character so long titles
   (e.g. "在游戏、区块链、AI 三条赛道上都跑过的团") don't overflow the viewport. */
@media (max-width: 760px) {
  .keep { word-break: normal; overflow-wrap: anywhere; }
}

/* ==========================================================================
 * UNIFIED NAVIGATION
 * ========================================================================== */
.mf-nav {
  display: block !important; /* override legacy `nav { display:none }` in css/style.css */
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 16px 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 220ms ease, border-color 220ms ease;
  border-bottom: 1px solid transparent;
}
.mf-nav.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom-color: var(--rule);
}
.mf-nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}
.mf-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mf-brand img { height: 28px; width: auto; display: block; }
/* Inline animated SVG logo (see js/mf-nav.js → buildLogoSVG).
   Sized by height; wordmark gradient uses --logo-text-* so it flips with
   the theme. Per-path fade + cluster float + breathing loop keyframes below. */
.mf-brand .mf-logo { height: 34px; width: auto; display: block; flex-shrink: 0; }
.mf-brand .mf-logo * { transition: none !important; }
@media (max-width: 900px) {
  .mf-brand .mf-logo { height: 30px; }
}
@keyframes mf-fish-float {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mf-logo .mf-fish-float {
  opacity: 0;
  animation: mf-fish-float 900ms cubic-bezier(.22, 1, .36, 1) forwards;
  transform-origin: 50% 50%;
}
@keyframes mf-fish-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.015); }
}
.mf-logo .mf-fish-breathe {
  transform-origin: 50% 50%;
  animation: mf-fish-breathe 3.6s ease-in-out 1.8s infinite;
}
@keyframes mf-fish-fade {
  from { opacity: 0.15; }
  to   { opacity: 1; }
}
.mf-logo .mf-fish-path {
  opacity: 0.15;
  animation: mf-fish-fade 500ms ease forwards;
}
@keyframes mf-word-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.mf-logo .mf-logo-text {
  opacity: 0;
  animation: mf-word-in 420ms ease 520ms forwards;
}
@media (prefers-reduced-motion: reduce) {
  .mf-logo .mf-fish-float,
  .mf-logo .mf-fish-path,
  .mf-logo .mf-logo-text { opacity: 1 !important; animation: none !important; transform: none !important; }
  .mf-logo .mf-fish-breathe { animation: none !important; }
}
.mf-brand-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint-dim);
}
.mf-brand-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2.5px; color: var(--ink-2);
  text-transform: uppercase;
}
.mf-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
}
.mf-nav ul a {
  color: var(--ink-3); transition: color 180ms ease;
  padding: 6px 0; display: inline-block; position: relative;
}
.mf-nav ul a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--mint); transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.mf-nav ul a:hover { color: var(--ink); }
.mf-nav ul a:hover::after,
.mf-nav ul a.current::after { transform: scaleX(1); }
.mf-nav ul a.current { color: var(--mint); }

.mf-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mf-lang {
  display: inline-flex; background: transparent;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 2px; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2px;
}
.mf-lang button {
  background: transparent; border: 0; color: var(--ink-3);
  padding: 5px 11px; cursor: pointer; border-radius: 999px;
  font-family: inherit; font-size: inherit; letter-spacing: inherit;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}
.mf-lang button.active { background: var(--mint); color: #000; }

.mf-theme-btn {
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent;
  color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.mf-theme-btn:hover { color: var(--mint); border-color: var(--mint-dim); }
.mf-theme-btn svg { width: 15px; height: 15px; }
.mf-theme-btn .sun, .mf-theme-btn .moon { display: none; }
html[data-theme="dark"] .mf-theme-btn .moon,
html:not([data-theme="light"]) .mf-theme-btn .moon { display: block; }
html[data-theme="light"] .mf-theme-btn .sun { display: block; }

.mf-burger {
  display: none;
  width: 34px; height: 34px; border: 1px solid var(--rule);
  border-radius: 999px; background: transparent; color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center;
}
.mf-burger svg { width: 15px; height: 15px; }

/* Mobile drawer */
.mf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 82%; max-width: 340px;
  background: var(--bg-2);
  border-left: 1px solid var(--rule);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
  padding: 72px 28px 28px;
  display: flex; flex-direction: column; gap: 2px;
}
.mf-drawer.open { transform: translateX(0); }
.mf-drawer a {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--ink-2);
}
.mf-drawer a.current { color: var(--mint); }
.mf-drawer-lang {
  display: inline-flex; margin-top: 22px;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 2px; align-self: flex-start;
}
.mf-drawer-lang button {
  background: transparent; border: 0; color: var(--ink-3);
  padding: 6px 14px; cursor: pointer; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}
.mf-drawer-lang button.active { background: var(--mint); color: #000; }
.mf-drawer-close {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border: 1px solid var(--rule);
  border-radius: 999px; background: transparent; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mf-drawer-close svg { width: 13px; height: 13px; }
.mf-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 99; opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.mf-scrim.open { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .mf-nav ul { display: none; }
  .mf-burger { display: inline-flex !important; }
  .mf-brand-name { display: none; }
  .mf-nav { padding: 14px 22px; }
}
/* Very narrow phones — give the burger breathing room by dropping
   the lang toggle (language switch stays accessible in the drawer). */
@media (max-width: 520px) {
  .mf-nav { padding: 12px 16px; }
  .mf-brand .mf-logo { height: 26px; }
  .mf-lang { display: none; }
  .mf-tools { gap: 6px; }
}

/* ==========================================================================
 * Nav link loading spinner — shown after link text while page navigates
 * ========================================================================== */
.mf-link-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mf-link-spin 650ms linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes mf-link-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mf-link-spinner { animation: none; border-top-color: currentColor; opacity: 0.5; }
}

/* ==========================================================================
 * Copy-to-clipboard button + toast
 * ========================================================================== */
.mf-copy-row {
  display: inline-flex; align-items: center; gap: 10px;
}
.mf-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--rule);
  border-radius: 6px; color: var(--ink-3);
  cursor: pointer; padding: 0;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.mf-copy-btn:hover { color: var(--mint); border-color: var(--mint-dim); background: var(--mint-soft); }
.mf-copy-btn:active { transform: scale(0.92); }
.mf-copy-btn svg { width: 14px; height: 14px; display: block; }
.mf-copy-btn.copied { color: var(--mint); border-color: var(--mint); }

.mf-toast {
  position: fixed; left: 50%; bottom: 36px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg);
  padding: 12px 22px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  z-index: 200;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.2,.8,.2,1);
  display: inline-flex; align-items: center; gap: 10px;
}
.mf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mf-toast svg { width: 14px; height: 14px; color: var(--mint); }

/* ==========================================================================
 * i18n visibility
 * ========================================================================== */
html[data-lang="en"] [data-i18n-hide="en"] { display: none !important; }
html[data-lang="zh"] [data-i18n-hide="zh"] { display: none !important; }
[data-en] { display: none; }
html[data-lang="en"] [data-zh] { display: none; }
html[data-lang="en"] [data-en] { display: inline; }
html[data-lang="en"] [data-en-block] { display: block; }

/* ==========================================================================
 * Reveal animations
 * ========================================================================== */
[data-anim] {
  opacity: 0; will-change: transform, opacity;
  transition:
    opacity 700ms cubic-bezier(.2,.7,.2,1),
    transform 820ms cubic-bezier(.2,.8,.2,1);
}
[data-anim="fade-up"]    { transform: translateY(28px); }
[data-anim="fade-right"] { transform: translateX(-24px); }
[data-anim="fade-left"]  { transform: translateX(24px); }
[data-anim="fade"] { }
[data-anim].is-in { opacity: 1; transform: none; }

[data-delay="1"] { transition-delay: 80ms; }
[data-delay="2"] { transition-delay: 160ms; }
[data-delay="3"] { transition-delay: 240ms; }
[data-delay="4"] { transition-delay: 320ms; }
[data-delay="5"] { transition-delay: 400ms; }
[data-delay="6"] { transition-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
  [data-anim] { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
 * Buttons / pills (shared)
 * ========================================================================== */
.mf-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--rule);
  transition: all 200ms ease;
  cursor: pointer;
}
.mf-btn-primary { background: var(--mint); color: #000; border-color: var(--mint); font-weight: 600; position: relative; overflow: hidden; }
.mf-btn-primary:hover { background: transparent; color: var(--mint); }
.mf-btn-secondary { background: transparent; color: var(--ink-2); }
.mf-btn-secondary:hover { color: var(--ink); border-color: var(--mint); }
.mf-btn .arrow { transition: transform 200ms ease; }
.mf-btn:hover .arrow { transform: translateX(4px); }

/* Primary CTA — shimmer sweep on reveal (matches deposit-addiction) */
.mf-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.is-in .mf-btn-primary::after,
.mf-btn-primary.is-in::after {
  animation: mfBtnShine 2600ms ease-in-out 1400ms 1;
}
@keyframes mfBtnShine {
  to { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .is-in .mf-btn-primary::after,
  .mf-btn-primary.is-in::after { animation: none !important; }
}

.pill {
  padding: 7px 14px; border: 1px solid var(--mint-dim); border-radius: 999px;
  color: var(--mint); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  display: inline-block;
}

/* ==========================================================================
 * Shared footer
 * ========================================================================== */
.mf-foot {
  padding: 40px 22px 48px;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2px;
}
.mf-foot .line { margin-bottom: 6px; }
.mf-foot a { color: var(--ink-3); }
.mf-foot a:hover { color: var(--mint); }

/* ==========================================================================
 * Mobile-safe section defaults
 * ========================================================================== */
.mf-container {
  max-width: 1280px; margin: 0 auto; width: 100%;
  padding: 0 28px;
}
section.mf-section { padding: 120px 0; border-top: 1px solid var(--rule); position: relative; }
.mf-section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px; margin-bottom: 56px; flex-wrap: wrap;
}
.mf-section-head .slide-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 3px; color: var(--ink-4);
}

@media (max-width: 760px) {
  .mf-container { padding: 0 20px; }
  section.mf-section { padding: 80px 0; }
  .mf-section-head { margin-bottom: 36px; }
}
