:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #06b6d4;
  --primary-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);
  --purple-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.18);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Top Announcement Banner */
.top-banner {
  background: linear-gradient(90deg, #0f172a, #1e1b4b, #0f172a);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  font-size: 0.82rem;
  text-align: center;
  color: var(--text-muted);
}
.top-banner a {
  color: #38bdf8;
  font-weight: 600;
  margin-left: 6px;
}
.top-banner a:hover {
  text-decoration: underline;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
}
.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}
.logo-tag {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-link {
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: 2px;
}
.btn-shop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 600;
  font-size: 0.86rem;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.btn-shop-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.lang-switch-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Main Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Hero Section */
.hero-section {
  padding: 55px 0 40px;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 0.85rem;
  color: #38bdf8;
  margin-bottom: 20px;
  font-weight: 600;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.hero-gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 740px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

/* Search Bar */
.search-wrapper {
  max-width: 660px;
  margin: 0 auto 36px;
  position: relative;
}
.search-input-box {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}
.search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: rgba(30, 41, 59, 0.9);
}
.search-icon {
  color: var(--text-dim);
  margin-right: 12px;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.98rem;
  padding: 8px 0;
}
.search-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 4px;
}

/* Matrix Synergy Cards (Trilogy Interconnection) */
.matrix-section {
  margin-bottom: 50px;
}
.matrix-header {
  text-align: center;
  margin-bottom: 24px;
}
.matrix-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}
.matrix-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}
.matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.matrix-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.8;
}
.matrix-card.card-dev::before { background: var(--primary-gradient); }
.matrix-card.card-visual::before { background: var(--purple-gradient); }
.matrix-card.card-hub::before { background: linear-gradient(135deg, #06b6d4, #10b981); }
.matrix-card.card-shop::before { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.matrix-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}
.mcard-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.mcard-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.mcard-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.mcard-link {
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.matrix-card.card-dev .mcard-link { color: #38bdf8; }
.matrix-card.card-visual .mcard-link { color: #c084fc; }
.matrix-card.card-hub .mcard-link { color: #34d399; }
.matrix-card.card-shop .mcard-link { color: #fbbf24; }

/* Category Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 35px;
}
.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}
.filter-pill.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* Workflow & Agent Grid */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
  margin-bottom: 60px;
}
.workflow-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  backdrop-filter: blur(10px);
}
.workflow-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}
.badge-swarm { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-dev { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-ecom { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-visual { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-mcp { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}
.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
  flex-grow: 1;
}
.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.tag-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
}
.card-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-copy-config {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-copy-config:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-tutorial-link {
  font-size: 0.82rem;
  color: #38bdf8;
  font-weight: 600;
}
.btn-tutorial-link:hover {
  text-decoration: underline;
}

/* Interactive Tools Section */
.tools-section {
  margin-bottom: 60px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
}
.section-head {
  text-align: center;
  margin-bottom: 35px;
}
.section-tag {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}
.tools-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}
.tool-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.tool-tab-btn.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}
.tool-panel {
  display: none;
}
.tool-panel.active {
  display: block;
}

/* Calculator Card Form */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}
.calc-inputs {
  background: rgba(30, 41, 59, 0.4);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-select, .form-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.92rem;
}
.form-select:focus, .form-input:focus {
  border-color: var(--primary);
}
.calc-results {
  background: rgba(30, 41, 59, 0.4);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.res-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.res-val {
  font-size: 1.3rem;
  font-weight: 800;
}
.res-val.highlight {
  color: #10b981;
}
.res-val.compare {
  color: #ef4444;
}

/* MCP Generator Panel */
.mcp-container {
  max-width: 900px;
  margin: 0 auto;
}
.mcp-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.mcp-checkbox-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.mcp-checkbox-item input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.code-box {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  position: relative;
  overflow-x: auto;
}
.copy-code-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.copy-code-btn:hover {
  background: var(--primary);
}

/* Store Showcase Section */
.store-banner-section {
  margin-bottom: 60px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.store-text h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.store-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}
.btn-store-big {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}
.btn-store-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.5);
}

/* Site Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.95);
  padding: 45px 0 30px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 35px;
}
.footer-brand h4 {
  font-size: 1.2rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}
.footer-col h5 {
  font-size: 0.92rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a:hover {
  color: #fff;
}
.footer-bottom {
  text-align: center;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}
.bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  gap: 3px;
}
.bottom-item svg {
  width: 20px;
  height: 20px;
}
.bottom-item.active, .bottom-item:hover {
  color: var(--primary);
}
.bottom-item.highlight {
  color: #f59e0b;
}

/* Responsive Breakpoints */
@media (max-width: 868px) {
  .hero-title { font-size: 2.1rem; }
  .main-nav { display: none; }
  .mobile-toggle { display: block; }
  .calc-container { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mobile-bottom-bar { display: flex; }
  body { padding-bottom: 65px; }
}
@media (max-width: 580px) {
  .hero-title { font-size: 1.75rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; }
}
