:root {
  --bg-deep: #0a0910;
  --bg-panel: rgba(18, 16, 28, 0.72);
  --bg-panel-hover: rgba(28, 24, 42, 0.88);
  --gold: #c9a962;
  --gold-light: #e8c87a;
  --gold-dim: rgba(201, 169, 98, 0.35);
  --cyan: #4ecdc4;
  --cyan-dim: rgba(78, 205, 196, 0.25);
  --violet: #8b7cf6;
  --text: #e8e4f0;
  --text-muted: #9a94a8;
  --border: rgba(201, 169, 98, 0.18);
  --glow-gold: 0 0 40px rgba(201, 169, 98, 0.15);
  --glow-cyan: 0 0 32px rgba(78, 205, 196, 0.12);
  --font-display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

#grid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.page {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(10, 9, 16, 0.92) 0%, rgba(10, 9, 16, 0.6) 100%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, #8a7340 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  box-shadow: var(--glow-gold);
}

.logo-text {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.logo-text span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--gold-light);
}

.nav-cta {
  color: var(--gold-light) !important;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(201, 169, 98, 0.08);
}

.nav-cta:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 98, 0.14);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(78, 205, 196, 0.08);
  border: 1px solid rgba(78, 205, 196, 0.25);
  color: var(--cyan);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Hero */
.hero {
  padding: 9rem 0 5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border);
  background: rgba(201, 169, 98, 0.06);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold-light), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-primary {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: 1px solid var(--gold);
  box-shadow: var(--glow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: var(--bg-deep);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--gold-dim);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.metric {
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  min-width: 140px;
}

.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--gold-light);
  font-weight: 600;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Architecture diagram */
.arch-section {
  padding: 4rem 0 6rem;
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.section-head p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.diagram-wrap {
  position: relative;
  padding: 2rem;
  border-radius: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--glow-gold);
}

.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-line {
  fill: none;
  stroke: var(--gold-dim);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  animation: dash 24s linear infinite;
  opacity: 0.6;
  transition: opacity 0.3s, stroke 0.3s;
}

.diagram-line.active {
  stroke: var(--cyan);
  opacity: 1;
  stroke-dasharray: none;
}

@keyframes dash {
  to { stroke-dashoffset: -200; }
}

.node-group {
  cursor: pointer;
}

.node-rect {
  fill: rgba(22, 20, 32, 0.95);
  stroke: var(--border);
  stroke-width: 1.5;
  rx: 12;
  transition: stroke 0.25s, filter 0.25s;
}

.node-group:hover .node-rect,
.node-group.focused .node-rect {
  stroke: var(--gold);
  filter: drop-shadow(0 0 12px rgba(201, 169, 98, 0.35));
}

.node-group.hub .node-rect {
  stroke: var(--gold);
  stroke-width: 2;
}

.node-title {
  fill: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
}

.node-sub {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
}

.node-badge {
  font-size: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.badge-live { fill: var(--cyan); }
.badge-phase { fill: var(--gold); }

.hub-pulse {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0;
  animation: hubPulse 3s ease-out infinite;
}

@keyframes hubPulse {
  0% { r: 70; opacity: 0.5; }
  100% { r: 110; opacity: 0; }
}

/* Stack cards */
.stack-section {
  padding: 2rem 0 5rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.stack-card {
  padding: 1.75rem;
  border-radius: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.stack-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
  background: var(--bg-panel-hover);
}

.stack-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  background: rgba(201, 169, 98, 0.1);
  border: 1px solid var(--border);
}

.stack-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.stack-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.tag.live {
  color: var(--cyan);
  border-color: rgba(78, 205, 196, 0.3);
  background: rgba(78, 205, 196, 0.08);
}

.tag.roadmap {
  color: var(--gold);
  border-color: var(--border);
}

/* Ecosystem narrative */
.ecosystem-section {
  padding: 3rem 0 4rem;
}

.ecosystem-tree {
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.8vw, 0.82rem);
  line-height: 1.55;
  padding: 1.5rem 1.25rem;
  margin: 0 0 2rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--border);
  color: var(--gold-light);
  overflow-x: auto;
  white-space: pre;
}

.ecosystem-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .ecosystem-split { grid-template-columns: 1fr; }
}

.ecosystem-visual {
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.visual-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}

.brand-tree,
.brand-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}

.brand-tree > li { padding-left: 0; }

.brand-tree li {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.brand-tree span {
  color: var(--gold-light);
  font-weight: 600;
}

.brand-tree em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.tree-root > span { color: var(--text); font-size: 0.95rem; }
.tree-roadmap span { opacity: 0.75; }

.identity-fan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.identity-hub {
  text-align: center;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold-light);
}

.identity-hub code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
}

.identity-spokes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.identity-spokes li {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.12);
  border: 1px solid rgba(78, 205, 196, 0.25);
  color: var(--text);
}

.identity-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.layers-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.layer-stack {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
}

.layer-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 16, 28, 0.6);
}

.layer-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  min-width: 1.5rem;
}

.layer-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.layer-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.layer-legal { border-left: 3px solid rgba(154, 148, 168, 0.5); }
.layer-platform { border-left: 3px solid var(--gold); }
.layer-brands { border-left: 3px solid var(--violet); }
.layer-products { border-left: 3px solid var(--cyan); }

.moat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.moat-card {
  padding: 1.5rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(24, 20, 36, 0.92), rgba(14, 12, 22, 0.96));
  border: 1px solid var(--border);
}

.moat-card.moat-corpus {
  border-color: rgba(201, 169, 98, 0.35);
  box-shadow: var(--glow-gold);
}

.moat-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.moat-tagline {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.moat-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.moat-card code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--gold-light);
}

/* B2B modules */
.modules-section {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--border);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.module-card {
  padding: 1.35rem;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(28, 24, 42, 0.95), rgba(12, 10, 20, 0.98));
  border: 1px solid var(--border);
}

.module-card.module-roadmap {
  opacity: 0.88;
  border-style: dashed;
}

.module-id {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.module-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.module-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

.module-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--gold-light);
}

.hub-pulse-secondary {
  opacity: 0.45;
  r: 55;
}

.node-group.gateway .node-rect {
  stroke: rgba(78, 205, 196, 0.35);
}

.stack-card.stack-corpus {
  border-color: rgba(201, 169, 98, 0.4);
}

.surface-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.surface-tab {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.surface-tab-active {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(201, 169, 98, 0.35);
}

/* Integration */
.integration-section {
  padding: 3rem 0 5rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.platform-card {
  padding: 1.5rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(24, 20, 36, 0.9), rgba(14, 12, 22, 0.95));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.platform-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.platform-header h3 {
  font-size: 1rem;
}

.platform-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--cyan-dim);
}

.platform-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Security */
.security-section {
  padding: 2rem 0 5rem;
}

.security-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem;
  border-radius: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  align-items: center;
}

.security-panel h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.security-panel p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  color: var(--text-muted);
}

.code-block .key { color: var(--cyan); }
.code-block .val { color: var(--gold-light); }
.code-block .comment { color: #6b6578; }

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.footer-infra {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.65;
}

/* Detail panel (mobile diagram tap) */
.detail-panel {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.detail-panel.visible {
  display: block;
}

.detail-panel strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-actions { margin-bottom: 2rem; }
  .security-panel { grid-template-columns: 1fr; }
  .hero { padding-top: 7rem; }
  .diagram-wrap { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .diagram-line,
  .status-dot,
  .hub-pulse {
    animation: none;
  }
}
