/* ==========================================================================
   空域工作室 Kongyu Studio — Site Stylesheet
   ========================================================================== */

:root {
  --bg:            #ffffff;
  --bg-alt:        #f7f7f8;
  --surface:       #ffffff;
  --surface-2:     #f4f4f5;
  --line:          rgba(0,0,0,.10);
  --line-strong:   rgba(0,0,0,.20);
  --text:          #0a0a0a;
  --text-dim:      #3f3f46;
  --text-faint:    #71717a;
  --accent:        #0369a1;
  --accent-2:      #6d28d9;
  --bos:           #0369a1;
  --ssg:           #c2410c;
  --bosx:          #15803d;
  --radius:        16px;
  --radius-sm:     10px;
  --maxw:          1180px;
  --shadow:        0 14px 36px rgba(0,0,0,.10);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* Dark theme (optional via toggle) */
html[data-theme="dark"] {
  --bg:          #070a12;
  --bg-alt:      #0b101c;
  --surface:     #111827;
  --surface-2:   #161f33;
  --line:        rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --text:        #e8edf7;
  --text-dim:    #a3afc7;
  --text-faint:  #6b7893;
  --accent:      #35d0ff;
  --accent-2:    #7c5cff;
  --bos:         #35d0ff;
  --ssg:         #ff6b3d;
  --bosx:        #4ade80;
  --shadow:      0 18px 48px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0 0 1.1em; }
code { font-family: var(--mono); font-size: .9em; }

.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

/* ---------------------------------------------------------------- Navbar */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand__mark {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  background: #0a0a0a; color: #ffffff;
  display: grid; place-items: center;
}
.brand__sub { font-size: 11px; color: var(--text-faint); font-weight: 500; letter-spacing: .16em; }
.nav__links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav__links a { font-size: 14.5px; color: var(--text-dim); transition: color .18s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__toggle {
  margin-left: 14px; width: 36px; height: 36px; flex: none; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim);
  display: grid; place-items: center; padding: 0;
}
.nav__toggle:hover { color: var(--text); border-color: var(--line-strong); }
.burger { display: none; }

/* ------------------------------------------------------------------ Hero */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(700px 340px at 12% -6%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(620px 320px at 88% 4%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; background: var(--surface);
  margin-bottom: 22px;
}
.eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.hero h1 { font-size: clamp(36px, 6vw, 62px); margin-bottom: 18px; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { font-size: 18px; color: var(--text-dim); max-width: 640px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: .18s;
}
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #ffffff; }
.btn--primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }

.stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 52px; }
.stat__num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat__lbl { font-size: 13px; color: var(--text-faint); letter-spacing: .04em; }

/* ------------------------------------------------------------- Sections */
.section { padding: 76px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { max-width: 660px; margin-bottom: 44px; }
.section__head h2 { font-size: clamp(26px, 3.6vw, 38px); }
.section__head p { color: var(--text-dim); font-size: 16.5px; margin: 0; }

/* --------------------------------------------------------------- Cards */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.proj {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; overflow: hidden;
  transition: .22s;
}
.proj:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.proj::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--tone, var(--accent)), transparent);
}
.proj__top { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.proj__icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 32%, transparent);
  color: var(--tone, var(--accent)); font-weight: 800; font-size: 17px;
}
.proj__title { font-size: 19px; font-weight: 700; margin: 0; }
.proj__kicker { font-size: 12.5px; color: var(--text-faint); letter-spacing: .06em; }
.proj p { color: var(--text-dim); font-size: 15px; flex: 1; }
.proj__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 36%, transparent);
  color: var(--tone, var(--accent));
  background: color-mix(in srgb, var(--tone, var(--accent)) 12%, transparent);
}
.badge--done { --tone: var(--bosx); }
.badge--wip  { --tone: #f5b642; }

.link-more { color: var(--tone, var(--accent)); font-weight: 600; font-size: 14.5px; }
.link-more:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Download */
.dl-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dl-head, .dl-row {
  display: grid; grid-template-columns: 1.6fr 1fr auto auto;
  gap: 16px; align-items: center; padding: 15px 22px;
}
.dl-head {
  background: var(--surface-2); font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--line);
}
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-row:hover { background: var(--surface-2); }
.dl-name { font-weight: 600; font-size: 15px; }
.dl-note { font-size: 13px; color: var(--text-faint); }
.dl-meta { font-size: 13.5px; color: var(--text-dim); font-family: var(--mono); }
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 17px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--tone, var(--accent)) 15%, transparent);
  color: var(--tone, var(--accent));
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 38%, transparent);
  transition: .18s;
}
.dl-btn:hover { background: color-mix(in srgb, var(--tone, var(--accent)) 26%, transparent); transform: translateY(-1px); }
.dl-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; --tone: var(--text-faint); }
.dl-btn[aria-disabled="true"]:hover { transform: none; background: transparent; }

/* ------------------------------------------------------------- Feature */
.feature { display: flex; flex-direction: column; gap: 14px; }
.feature__item {
  display: flex; gap: 14px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.feature__ic { flex: none; width: 30px; height: 30px; color: var(--tone, var(--accent)); }
.feature__t { font-weight: 650; font-size: 15.5px; margin-bottom: 3px; }
.feature__d { font-size: 14.5px; color: var(--text-dim); margin: 0; }

/* ----------------------------------------------------------- Page hero */
.page-hero { padding: 66px 0 44px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(620px 260px at 20% -20%, color-mix(in srgb, var(--tone, var(--accent)) 22%, transparent), transparent 70%);
}
.page-hero__inner { position: relative; z-index: 1; }
.crumb { font-size: 13.5px; color: var(--text-faint); margin-bottom: 16px; }
.crumb a:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.page-hero .lead { color: var(--text-dim); font-size: 17.5px; max-width: 660px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.pill {
  font-size: 12.5px; padding: 5px 13px; border-radius: 999px; font-family: var(--mono);
  border: 1px solid var(--line); color: var(--text-dim); background: var(--surface);
}

/* ------------------------------------------------------------ Code box */
.term {
  background: #0d1424; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.term__bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 15px;
  background: rgba(255,255,255,.045); border-bottom: 1px solid var(--line);
}
.term__dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.18); }
.term__title { margin-left: 8px; font-family: var(--mono); font-size: 12.5px; color: #7d8aa5; }
.term pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.85; color: #c8d3e8;
}
.term .c-key { color: #35d0ff; }
.term .c-str { color: #9ae6a4; }
.term .c-dim { color: #5b6880; }

/* ------------------------------------------------------------ Roadmap */
.road { position: relative; padding-left: 30px; }
.road::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.road__i { position: relative; padding-bottom: 26px; }
.road__i:last-child { padding-bottom: 0; }
.road__i::before {
  content: ""; position: absolute; left: -27px; top: 8px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong);
}
.road__i.is-done::before { background: var(--bosx); border-color: var(--bosx); }
.road__i.is-now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.road__t { font-weight: 650; font-size: 15.5px; }
.road__d { font-size: 14.5px; color: var(--text-dim); margin: 0; }

/* -------------------------------------------------------------- Notice */
.notice {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ssg) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--ssg) 28%, transparent);
  font-size: 14.5px; color: var(--text);
}
.notice strong { color: var(--ssg); }

/* -------------------------------------------------------------- Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0 34px; background: var(--bg-alt); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; align-items: flex-start; }
.footer p { font-size: 14px; color: var(--text-faint); margin: 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__links a { font-size: 14px; color: var(--text-dim); }
.footer__links a:hover { color: var(--accent); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 940px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .nav__links { gap: 16px; }
}
@media (max-width: 720px) {
  .hero { padding: 62px 0 48px; }
  .stats { gap: 26px; }
  .stat__num { font-size: 24px; }
  .dl-head { display: none; }
  .dl-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 18px; }
  .dl-btn { justify-self: start; }
  .footer__inner { flex-direction: column; }
}
@media (max-width: 620px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; left: 20px; right: 20px; top: 66px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow);
  }
  .nav__links.is-open a { padding: 10px 12px; border-radius: 8px; }
  .nav__links.is-open a:hover { background: var(--surface-2); }
  .burger {
    display: grid; place-items: center; margin-left: auto;
    width: 36px; height: 36px; cursor: pointer; padding: 0;
    border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text);
  }
}
