/* ==========================================================================
   CROWNATE ENTERPRISE ECOSYSTEM — INTERACTIVE GATEWAY STYLES
   Version: 3.0.0
   Design: High-Contrast European Minimalist Luxury (Obsidian, Warm Gold, Pure White)
   Accessibility: WCAG 2.2 AA Compliant
   ========================================================================== */

/* 1. Main Gateway Container */
.ecosystem-gateway-wrapper {
  position: relative;
  background-color: #08090c;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: calc(80px + var(--space-8)) 0 var(--space-16) 0;
  overflow: hidden;
}

/* 2. Welcome & Intent Bar */
.gateway-welcome-bar {
  text-align: center;
  max-width: 960px;
  margin: 0 auto var(--space-10) auto;
  animation: gatewayFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gateway-badge-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 999px;
  margin-bottom: var(--space-4);
}

.gateway-badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseStatus 2s infinite ease-in-out;
}

.gateway-badge-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #d4af37;
  text-transform: uppercase;
  font-weight: 600;
}

.gateway-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: var(--space-3);
}

.gateway-title .accent-gold {
  color: #d4af37;
  background: linear-gradient(135deg, #ffffff 20%, #d4af37 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gateway-subtext {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: #a1a1aa;
  max-width: 760px;
  margin: 0 auto var(--space-6) auto;
  line-height: 1.6;
}

/* Quick Filter / Exploration Pills */
.gateway-explore-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #71717a;
  text-transform: uppercase;
}

.gateway-filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.gateway-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gateway-filter-btn:hover,
.gateway-filter-btn:focus-visible {
  background: rgba(212, 175, 55, 0.12);
  border-color: #d4af37;
  color: #ffffff;
  transform: translateY(-2px);
  outline: none;
}

.gateway-filter-btn.ai-quick-btn {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: #fef08a;
}

.gateway-filter-btn.ai-quick-btn:hover {
  background: #d4af37;
  color: #08090c;
  font-weight: 600;
}

/* 3. The Tree Ecosystem Structure (Desktop) */
.ecosystem-tree-container {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Top Anchor Box */
.tree-anchor-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 5;
  margin-bottom: 30px;
}

.tree-anchor-card {
  background: #11141a;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  padding: var(--space-4) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.1);
  max-width: 440px;
  width: 100%;
}

.tree-anchor-card:hover,
.tree-anchor-card:focus-visible {
  border-color: #d4af37;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.25);
  transform: translateY(-3px);
  outline: 2px solid #d4af37;
  outline-offset: 4px;
}

.tree-anchor-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: 4px;
}

.tree-anchor-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.tree-anchor-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #d4af37;
  text-transform: uppercase;
  font-weight: 600;
}

/* SVG Line System between Anchor and 3 Branches */
.tree-svg-connectors {
  width: 100%;
  height: 50px;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.tree-track-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
}

.tree-pulse-line {
  fill: none;
  stroke: #d4af37;
  stroke-width: 2;
  stroke-dasharray: 8 200;
  animation: treePulseFlow 3s linear infinite;
}

@keyframes treePulseFlow {
  0% { stroke-dashoffset: 208; }
  100% { stroke-dashoffset: 0; }
}

/* 4. Three Primary Column Pillars */
.tree-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  position: relative;
  z-index: 4;
}

/* Pillar Card */
.tree-node-card {
  background: #0f1217;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tree-node-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.tree-node-card:hover,
.tree-node-card:focus-visible {
  background: #141820;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  outline: 2px solid #d4af37;
  outline-offset: 4px;
}

/* Active Core Node Variant: Studio (Emerald) */
.tree-node-card.node-studio::before {
  background: #10b981;
}

.tree-node-card.node-studio:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(16, 185, 129, 0.1);
}

/* Active Core Node Variant: Construction (Gold) */
.tree-node-card.node-construction::before {
  background: #d4af37;
}

.tree-node-card.node-construction:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.12);
}

/* Planned Future Node Variant (Amber/Cyan) */
.tree-node-card.node-future::before {
  background: #38bdf8;
}

.tree-node-card.node-future:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.1);
}

/* Card Header */
.tree-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.tree-card-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.tree-card-badge.active-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tree-card-badge.planned-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.tree-card-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.2;
}

.tree-card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: #a1a1aa;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.tree-card-desc {
  font-size: 0.875rem;
  color: #d4d4d8;
  line-height: 1.6;
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

/* Capability Chips Grid */
.tree-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-6);
}

.tree-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* Card Actions */
.tree-card-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tree-explore-btn {
  flex: 1;
  background: #ffffff;
  color: #08090c;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.tree-explore-btn:hover {
  background: #d4af37;
  color: #08090c;
}

.tree-inspect-btn {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8125rem;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tree-inspect-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
}

/* 5. Future Enterprises Expanded Mini-Grid */
.future-entities-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: var(--space-6);
}

.future-entity-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 8px;
  border-radius: 4px;
}

.future-entity-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f4f4f5;
  display: block;
}

.future-entity-status {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: #7dd3fc;
  letter-spacing: 0.08em;
}

/* 6. Interactive Node Inspection Drawer / Modal */
.ecosystem-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ecosystem-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.ecosystem-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 540px;
  background: #0d1015;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 99995;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ecosystem-drawer-panel.active {
  transform: translateX(0);
}

.drawer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: #0d1015;
  z-index: 10;
}

.drawer-top-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.drawer-close-trigger {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close-trigger:hover,
.drawer-close-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

.drawer-content-body {
  padding: var(--space-6);
  flex-grow: 1;
}

.drawer-node-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.drawer-node-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #d4af37;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.drawer-node-desc {
  font-size: 0.9375rem;
  color: #d4d4d8;
  line-height: 1.65;
  margin-bottom: var(--space-6);
}

.drawer-section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #a1a1aa;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.drawer-caps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: var(--space-8);
}

.drawer-cap-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #f4f4f5;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.drawer-cap-item svg {
  color: #d4af37;
  flex-shrink: 0;
}

.drawer-actions-footer {
  padding: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0c10;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  bottom: 0;
}

.drawer-ai-prompt-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-ai-prompt-text {
  font-size: 0.8125rem;
  color: #fef08a;
  line-height: 1.4;
}

/* 7. Return to Ecosystem Sticky Control */
.return-ecosystem-bar {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(13, 16, 21, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  text-decoration: none;
}

.return-ecosystem-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.return-ecosystem-bar:hover,
.return-ecosystem-bar:focus-visible {
  background: #d4af37;
  color: #08090c;
  transform: translateY(-2px);
  outline: none;
}

/* 8. Responsive Adjustments */
@media (max-width: 1024px) {
  .tree-pillars-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .tree-svg-connectors {
    display: none;
  }
  
  .tree-anchor-card {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .ecosystem-gateway-wrapper {
    padding-top: calc(70px + var(--space-4));
  }
  
  .gateway-title {
    font-size: 2rem;
  }
  
  .gateway-filter-row {
    gap: 6px;
  }
  
  .future-entities-list {
    grid-template-columns: 1fr;
  }
  
  .ecosystem-drawer-panel {
    max-width: 100%;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .gateway-welcome-bar,
  .tree-pulse-line,
  .gateway-badge-dot {
    animation: none;
  }
}
