:root {
  --bg: #07090f;
  --surface: rgba(15, 20, 32, 0.72);
  --surface-strong: rgba(20, 27, 45, 0.92);
  --border: rgba(148, 163, 184, 0.14);
  --border-glow: rgba(56, 189, 248, 0.35);
  --text: #eef2ff;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --green: #34d399;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient Background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 25%, #000 35%, transparent 82%);
  pointer-events: none;
  z-index: -2;
}
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.24;
  pointer-events: none;
  z-index: -1;
}
.bg-glow-1 { width: 520px; height: 520px; background: var(--cyan); top: -160px; left: -120px; }
.bg-glow-2 { width: 460px; height: 460px; background: var(--violet); top: 180px; right: -140px; }

.container { width: min(1080px, 92%); margin: 0 auto; }

/* Nav */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(7, 9, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.98rem;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px var(--cyan);
}
.brand-tag { color: var(--cyan); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-glow);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan) !important;
  font-family: var(--mono);
  font-size: 0.84rem !important;
}
.nav-cta:hover {
  background: rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

/* Hero */
.hero {
  padding: 88px 0 56px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.hero-title {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(110deg, #38bdf8 0%, #818cf8 52%, #e879f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.06rem;
  margin-bottom: 32px;
}
.hero-desc strong { color: var(--text); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  box-shadow: 0 8px 26px rgba(56, 189, 248, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 12px 34px rgba(99, 102, 241, 0.42);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-glow); }

/* Sections */
.section { padding: 48px 0; }
.section-head { margin-bottom: 24px; }
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.section-head h2 {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

/* Studio Card */
.studio-card {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 28px;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border-glow);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(15, 18, 35, 0.65));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}
.studio-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.studio-left h3 { font-size: 1.45rem; margin-bottom: 10px; }
.studio-left p { color: var(--muted); font-size: 0.96rem; margin-bottom: 18px; }
.studio-left code, .bento-card code, .modal-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 5px;
}
.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.spec-chips span {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.studio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.hint { font-size: 0.84rem; color: var(--muted); }

/* Terminal widget */
.terminal {
  height: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #05070c;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}
.terminal-bar span:nth-child(1) { background: #fb7185; }
.terminal-bar span:nth-child(2) { background: #fbbf24; }
.terminal-bar span:nth-child(3) { background: #34d399; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.terminal-body {
  padding: 18px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: #cbd5e1;
  overflow-x: auto;
}
.t-dim { color: #64748b; }
.t-cyan { color: var(--cyan); font-weight: 600; }
.t-green { color: var(--green); font-weight: 600; }

/* Blog */
.blog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-btn {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
}
.tag-btn:hover, .tag-btn.active {
  border-color: var(--border-glow);
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.post-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  background: var(--surface-strong);
}
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.post-tag {
  color: var(--violet);
  background: rgba(167, 139, 250, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}
.post-card h3 {
  font-size: 1.12rem;
  line-height: 1.4;
  margin-bottom: 10px;
}
.post-card p {
  font-size: 0.92rem;
  color: var(--muted);
  flex: 1;
}
.post-more {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}

/* Bento About */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.bento-card {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.bento-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}
.bento-card p { font-size: 0.92rem; color: var(--muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border-glow);
  background: #0d1220;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
}
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}
.modal-close:hover { border-color: var(--border-glow); }
.modal-card h2 { font-size: 1.6rem; margin-bottom: 20px; line-height: 1.3; }
.modal-body p { color: #cbd5e1; margin-bottom: 14px; font-size: 0.98rem; }
.modal-body h3 { color: var(--text); font-size: 1.15rem; margin: 22px 0 10px; }
.modal-body ul { padding-left: 20px; margin-bottom: 14px; color: #cbd5e1; }
.modal-body li { margin-bottom: 6px; }
.modal-body pre {
  background: #05070c;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.modal-body pre code { background: none; padding: 0; color: #e2e8f0; }

/* Footer */
.footer {
  margin-top: 32px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--cyan); }
.sep { margin: 0 8px; }

@media (max-width: 820px) {
  .studio-card { grid-template-columns: 1fr; padding: 24px; }
  .bento-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
}
