/* ============================================
   FORGE ECOSYSTEM — 10X PRODUCTION CSS
   Premium product showcase, holographic cards,
   animated gradients, and platform visualization
   ============================================ */

/* === COLOR EXTENSIONS === */
:root {
  --ember: #ff6b4a;
  --ember-glow: rgba(255, 107, 74, .12);
  --blue: #4a9eff;
  --blue-glow: rgba(74, 158, 255, .12);
  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, .12);
  --cyan: #22d3ee;
  --cyan-glow: rgba(34, 211, 238, .12);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, .12);
}

/* === ANIMATED GRADIENT BORDER UTILITY === */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateGradient {
  to { --angle: 360deg; }
}

/* === PRODUCT ECOSYSTEM SECTION === */
.ecosystem {
  padding: 180px 48px;
  position: relative;
  overflow: hidden;
}

.ecosystem-header {
  text-align: center;
  margin-bottom: 100px;
  position: relative;
  z-index: 2;
}

.ecosystem-header .s-label {
  justify-content: center;
}

.ecosystem-header .s-title {
  margin: 0 auto;
  max-width: 900px;
}

.ecosystem-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 24px auto 0;
  line-height: 1.7;
}

/* === PRODUCT GRID === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1340px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.product-card {
  background: rgba(12, 12, 18, .6);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: all .7s cubic-bezier(.16, 1, .3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 40%, var(--card-accent, var(--accent)) 50%, transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .6s;
  animation: rotateGradient 4s linear infinite;
}

.product-card:hover::before {
  opacity: 1;
}

.product-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--card-glow, var(--accent-glow)), transparent 45%);
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}

.product-card:hover::after {
  opacity: 1;
}

.product-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 0 80px var(--card-glow, var(--accent-glow));
}

/* All products use brand green */
.product-card[data-product="agent"],
.product-card[data-product="vault"],
.product-card[data-product="voice"],
.product-card[data-product="desk"],
.product-card[data-product="studio"] {
  --card-accent: var(--accent);
  --card-glow: var(--accent-glow);
}

/* Product Icon */
.product-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.product-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.5px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-card .product-icon {
  background: rgba(196, 244, 59, .1);
  color: var(--accent);
}

/* Product badge */
.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.product-card .product-badge {
  background: rgba(196, 244, 59, .06);
  color: var(--accent);
  border: 1px solid rgba(196, 244, 59, .15);
}

.product-name {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
}

.product-tagline {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.product-desc {
  font-size: .9rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.product-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}

.product-features li {
  font-size: .82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-features li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.product-card .product-features li::before { background: var(--accent); }

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .78rem;
  text-decoration: none;
  transition: all .3s;
  position: relative;
  z-index: 2;
  letter-spacing: .03em;
}

.product-card .product-cta { color: var(--accent); }

.product-cta:hover {
  gap: 14px;
}

/* Featured card (spans 2 cols) */
.product-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.product-card.featured .product-visual {
  position: relative;
  height: 100%;
  min-height: 280px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
}

/* === PLATFORM ARCHITECTURE SECTION === */
.platform-section {
  padding: 180px 48px;
  position: relative;
  overflow: hidden;
}

.platform-header {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
  z-index: 2;
}

.platform-header .s-label {
  justify-content: center;
}

.platform-header .s-title {
  margin: 0 auto;
}

.platform-viz {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Architecture diagram */
.arch-diagram {
  display: flex;
  flex-direction: column;
  gap: 60px;
  align-items: center;
}

.arch-layer {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.arch-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 32px;
  text-align: center;
  min-width: 160px;
  transition: all .5s cubic-bezier(.16, 1, .3, 1);
  position: relative;
  overflow: hidden;
}

.arch-node:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.arch-node-name {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.arch-node-desc {
  font-size: .7rem;
  color: var(--text-dim);
}

.arch-connector {
  display: flex;
  justify-content: center;
  position: relative;
}

.arch-connector::before {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

/* Hub node (center) */
.arch-node.hub {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(196, 244, 59, .06), var(--surface));
  min-width: 240px;
}

.arch-node.hub .arch-node-name {
  color: var(--accent);
  font-size: .82rem;
}

/* === FORGE PRODUCTS NAV DROPDOWN === */
.nav-products {
  position: relative;
}

.nav-products-trigger {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .82rem;
  letter-spacing: .03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .3s;
  background: none;
  border: none;
  font-family: var(--sans);
}

.nav-products-trigger:hover {
  color: var(--text);
}

.nav-products-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform .3s;
}

.nav-products:hover .nav-products-trigger svg {
  transform: rotate(180deg);
}

.products-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 480px;
  background: rgba(12, 12, 18, .95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: all .4s cubic-bezier(.16, 1, .3, 1);
  z-index: 1001;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nav-products:hover .products-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  transition: all .3s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, .04);
}

.dropdown-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropdown-icon {
  background: rgba(196, 244, 59, .1);
  color: var(--accent);
}

.dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-name {
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
}

.dropdown-desc {
  font-size: .68rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* === HERO UPGRADE === */
.hero-ecosystem-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(12, 12, 18, .7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: .72rem;
  color: var(--text-dim);
  margin-bottom: 48px;
  position: relative;
  z-index: 10;
}

.hero-ecosystem-badge .badge-products {
  display: flex;
  gap: 4px;
}

.hero-ecosystem-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}

.badge-dot { background: var(--accent); }
.badge-dot:nth-child(2) { animation-delay: .5s; }
.badge-dot:nth-child(3) { animation-delay: 1s; }
.badge-dot:nth-child(4) { animation-delay: 1.5s; }
.badge-dot:nth-child(5) { animation-delay: 2s; }

/* === STATS UPGRADE === */
.hero-stat-val {
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === FORGE PRODUCT MARQUEE === */
.product-marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  overflow: hidden;
  background: rgba(5, 5, 8, .5);
}

.product-marquee-track {
  display: flex;
  gap: 48px;
  animation: marquee 25s linear infinite;
  width: max-content;
}

.product-marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pmi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pmi-dot { background: var(--accent); }

.product-marquee-item .pmi-name {
  color: var(--text);
}

.product-marquee-item .pmi-tag {
  color: var(--text-dim);
}

/* === HOLOGRAPHIC CARD EFFECT === */
.holo-card {
  position: relative;
  overflow: hidden;
}

.holo-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from var(--angle, 0deg),
    var(--accent),
    var(--blue),
    var(--purple),
    var(--ember),
    var(--cyan),
    var(--accent)
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity .6s;
  animation: rotateGradient 6s linear infinite;
  z-index: -1;
}

.holo-card:hover::before {
  opacity: .6;
}

.holo-card > * {
  position: relative;
  z-index: 1;
}

/* === NUMBER TICKER UPGRADE === */
.ticker-val {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1;
}

/* === GLASS PANEL === */
.glass-panel {
  background: rgba(12, 12, 18, .6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
}

/* === GLOW TEXT === */
.glow-text {
  text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(196, 244, 59, .05);
}

/* === ANIMATED UNDERLINE === */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--accent));
  background-size: 200% 100%;
  animation: shimmerLine 3s linear infinite;
}

@keyframes shimmerLine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === PLATFORM FLOW LINES === */
.flow-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.flow-line {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 8 8;
  animation: dashFlow 20s linear infinite;
  opacity: .15;
}

@keyframes dashFlow {
  to { stroke-dashoffset: -200; }
}

/* === MAGNETIC BUTTON === */
.btn-magnetic {
  position: relative;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}

/* === SECTION DIVIDER === */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), var(--accent), var(--border), transparent);
  max-width: 1340px;
  margin: 0 auto;
}

/* === LOGO CLOUD === */
.logo-cloud {
  display: flex;
  justify-content: center;
  gap: 64px;
  align-items: center;
  padding: 60px 48px;
  opacity: .4;
  transition: opacity .5s;
}

.logo-cloud:hover {
  opacity: .7;
}

.logo-cloud span {
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-dim);
}

/* === ARCHITECTURE NODE VARIANTS === */
.arch-node.node-voice,
.arch-node.node-desk,
.arch-node.node-studio,
.arch-node.node-agent {
  border-color: rgba(196, 244, 59, .3);
}
.arch-node.node-voice .arch-node-name,
.arch-node.node-desk .arch-node-name,
.arch-node.node-studio .arch-node-name,
.arch-node.node-agent .arch-node-name {
  color: var(--accent);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .ecosystem {
    padding: 100px 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card.featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .products-dropdown {
    display: none;
  }

  .platform-section {
    padding: 100px 20px;
  }

  .arch-layer {
    flex-direction: column;
    align-items: center;
  }

  .logo-cloud {
    flex-wrap: wrap;
    gap: 32px;
  }
}

/* === FOOTER PRODUCTS === */
.ft-products {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.ft-product-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all .3s;
}

.ft-product-link:hover {
  background: rgba(255, 255, 255, .03);
}

.ft-product-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ft-product-name {
  font-size: .82rem;
  color: var(--text-dim);
  transition: color .3s;
}

.ft-product-link:hover .ft-product-name {
  color: var(--text);
}

.ft-product-dot { background: var(--accent); }

@media (max-width: 900px) {
  .ft-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === HERO NUMBER ANIMATION === */
@keyframes countGlow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 30px var(--accent-glow); }
}

/* === ENHANCED PRELOADER === */
.preloader-forge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.preloader-text {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent);
  opacity: .6;
  animation: preloaderPulse 1.5s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: .3; }
  50% { opacity: .8; }
}

/* === COMPARISON SECTION ENHANCEMENT === */
.product-comparison {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 2fr repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
}

.comparison-grid .cg-header {
  background: var(--surface);
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.comparison-grid .cg-header:first-child {
  justify-content: flex-start;
}

.comparison-grid .cg-cell {
  padding: 16px 24px;
  font-size: .82rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-grid .cg-cell:first-child {
  justify-content: flex-start;
}

.cg-check {
  color: var(--accent);
  font-size: 1.1rem;
}

.cg-dash {
  color: var(--text-dim);
  opacity: .3;
}
