/* ─── komoxbuild-cf · shared base · 黑白蓝极简 ─── */

:root {
  /* surface */
  --bg:        #ffffff;
  --bg-alt:    #f5f6f8;
  --bg-deep:   #0a0a0c;       /* inverted blocks */
  /* ink */
  --ink:       #0a0a0c;
  --ink2:      #2a2c30;
  --mid:       #6b6f76;
  --dim:       #a8acb3;
  --faint:     #c9ccd2;
  --line:      #e8eaee;
  --line2:     #d6dae0;
  /* accent */
  --blue:      #002FA7;     /* International Klein Blue (IKB) */
  --blue-deep: #001A6E;
  --blue-soft: #e6ebf5;
  --black:     #000000;
  --white:     #ffffff;
  /* easing */
  --ease-out-expo: cubic-bezier(0.16,1,0.3,1);
  --ease-in-out:   cubic-bezier(0.65,0,0.35,1);
}

*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01","cv11";
  font-size: 15px;
  line-height: 1.6;
  cursor: none;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="zh"] body {
  font-family: 'Noto Sans SC', 'Inter', system-ui, sans-serif;
}

a { color: inherit; }

/* hairline grid bg — barely visible */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, rgba(10,10,12,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,12,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

/* ─── CURSOR ─── */
#cursor {
  position: fixed; top:0; left:0; z-index:9999;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
  pointer-events: none;
  transform: translate(-50%,-50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              background 0.3s ease,
              opacity 0.2s ease;
}
#cursor-ring {
  position: fixed; top:0; left:0; z-index:9998;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--ink);
  pointer-events: none;
  transform: translate(-50%,-50%);
  transition: width 0.5s var(--ease-out-expo),
              height 0.5s var(--ease-out-expo),
              border-color 0.3s ease,
              opacity 0.3s ease;
  opacity: 0.3;
}
body.hovering #cursor      { width: 16px; height: 16px; background: var(--ink); }
body.hovering #cursor-ring { width: 48px; height: 48px; opacity: 0.15; border-color: var(--blue); }
body.clicking #cursor      { width: 6px; height: 6px; }

/* ─── NAV ─── */
nav.site-nav {
  position: fixed; top:0; left:0; right:0; z-index:100;
  padding: 18px 56px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
nav.site-nav.scrolled {
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--line);
}
.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--ink);
  text-decoration: none;
}
.nav-logo em { color: var(--blue); font-style: normal; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mid); text-decoration: none;
  position: relative; padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-link::after {
  content:''; position:absolute; bottom:0; left:0;
  width:0; height:1px; background:var(--blue);
  transition: width 0.3s var(--ease-out-expo);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--ink); }
.nav-link.active::after { width: 100%; background: var(--ink); }

/* lang toggle */
.lang-toggle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 100px;
  cursor: none;
  transition: all 0.2s ease;
}
.lang-toggle:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }
.lang-toggle b { color: var(--blue); font-weight: 700; }
.lang-toggle:hover b { color: var(--white); }

/* ─── REVEAL ─── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.06s; }
.reveal-d2 { transition-delay: 0.12s; }
.reveal-d3 { transition-delay: 0.18s; }
.reveal-d4 { transition-delay: 0.24s; }
.reveal-d5 { transition-delay: 0.30s; }
.reveal-d6 { transition-delay: 0.36s; }
.reveal-d7 { transition-delay: 0.42s; }
.reveal-d8 { transition-delay: 0.48s; }
.reveal-d9 { transition-delay: 0.54s; }
.reveal-d10 { transition-delay: 0.60s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── BACK TO TOP ─── */
.back-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: none; color: var(--white); font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: all 0.3s var(--ease-out-expo);
}
.back-top.show { opacity: 1; pointer-events: all; }
.back-top:hover { transform: translateY(-3px); background: var(--blue); }

/* ─── RESPONSIVE BASE ─── */
@media (max-width: 900px) {
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
  nav.site-nav { padding: 14px 20px; gap: 12px; }
  .nav-links { gap: 18px; }
  .nav-link { font-size: 10px; letter-spacing: 0.1em; }
}
@media (max-width: 560px) {
  .nav-links .nav-link:not(.lang-toggle):not(.always-show) { display: none; }
}
