/* ============================================
   METATECH SOFTWARE — Hero Section
   ============================================ */

/* --- Particle Canvas --- */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Hero Layout --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 140px var(--space-3xl) var(--space-4xl);
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(243,126,1,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(243,126,1,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 90% 60%, rgba(21,101,192,0.04) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1800px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: var(--space-3xl);
}

.hero-text {
  text-align: left;
}

.hero-visual {
  animation: fadeInUp 1s ease 0.6s both;
}

/* --- Badge --- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 20px;
  background: rgba(243,126,1,0.1);
  border: 1px solid rgba(243,126,1,0.2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary-400);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-xl);
  animation: fadeInDown 0.8s ease both;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--primary-500);
  border-radius: var(--radius-full);
  animation: pulse-dot 2s ease infinite;
}

/* --- Title & Subtitle --- */
.hero-title {
  font-size: clamp(72px, 12vw, 100px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: var(--space-sm);
  animation: fadeInUp 0.8s ease 0.15s both;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500), var(--primary-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-dots {
  display: inline;
}
.hero-dots span {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: dotStep 3s ease-in-out infinite;
}
.hero-dots .dot1 { animation-delay: 0s; }
.hero-dots .dot2 { animation-delay: 0.6s; }
.hero-dots .dot3 { animation-delay: 1.2s; }

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--neutral-300);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.5px;
  line-height: 1.4;
  animation: fadeInUp 0.8s ease 0.3s both;
}
.hero-subtitle-en {
  font-size: clamp(13px, 1.4vw, 15px);
  color: var(--neutral-400);
  font-style: italic;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* --- Hero Buttons --- */
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-md);
  margin-bottom: 0;
  animation: fadeInUp 0.8s ease 0.5s both;
}

/* --- Floating Code Snippets --- */
.floating-snippets {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.snippet {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(243,126,1,0.15);
  white-space: pre;
  animation: float-drift 20s linear infinite;
  opacity: 0;
}
.snippet:nth-child(1) { top: 15%; left: -10%; animation-delay: 0s;  animation-duration: 25s; }
.snippet:nth-child(2) { top: 45%; right: -15%; animation-delay: 4s;  animation-duration: 30s; }
.snippet:nth-child(3) { top: 70%; left: -8%;  animation-delay: 8s;  animation-duration: 22s; }
.snippet:nth-child(4) { top: 25%; right: -12%; animation-delay: 12s; animation-duration: 28s; }
.snippet:nth-child(5) { top: 85%; left: -5%;  animation-delay: 2s;  animation-duration: 26s; }

/* --- Terminal --- */
.terminal-wrapper {
  animation: fadeInUp 1s ease 0.7s both;
  perspective: 1000px;
}
.hero-visual .terminal-wrapper {
  animation: fadeInUp 1s ease 0.7s both, terminal-float 6s ease-in-out 2s infinite;
}
.terminal {
  width: 100%;
  background: rgba(15,15,15,0.9);
  border: 6px solid var(--primary-500);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(30px);
  box-shadow:
    0 0 40px rgba(243,126,1,1),
    0 0 100px rgba(243,126,1,1),
    0 0 200px rgba(243,126,1,0.9),
    0 0 400px rgba(243,126,1,0.7),
    0 0 700px rgba(243,126,1,0.5),
    0 0 1200px rgba(243,126,1,0.3),
    0 40px 120px rgba(0,0,0,0.8),
    0 80px 200px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 20px rgba(243,126,1,0.1);
  transform: rotateX(2deg);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  animation: terminal-glow 4s ease-in-out infinite;
}
.terminal:hover {
  transform: rotateX(0deg);
  box-shadow:
    0 0 100px rgba(243,126,1,0.18),
    0 0 200px rgba(243,126,1,0.06),
    0 30px 80px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 18px 24px;
  background: rgba(30,30,30,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.terminal-dot {
  width: 14px; height: 14px;
  border-radius: var(--radius-full);
}
.terminal-dot.red    { background: #FF5F57; box-shadow: 0 0 6px rgba(255,95,87,0.4); }
.terminal-dot.yellow { background: #FFBD2E; box-shadow: 0 0 6px rgba(255,189,46,0.4); }
.terminal-dot.green  { background: #28CA41; box-shadow: 0 0 6px rgba(40,202,65,0.4); }
.terminal-tab {
  margin-left: var(--space-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--neutral-400);
  padding: var(--space-xs) var(--space-md);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
}

.terminal-body {
  padding: var(--space-xl) var(--space-xl);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 2;
  min-height: 340px;
}
.terminal-line {
  opacity: 0;
  animation: typeLine 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.terminal-line .success,
.terminal-line .string,
.terminal-line .info-blue {
  animation: lineGlow 3s ease-in-out infinite;
  animation-delay: inherit;
}
.terminal-line .prompt   { color: var(--primary-500); margin-right: var(--space-xs); text-shadow: 0 0 8px rgba(243,126,1,0.5); }
.terminal-line .command  { color: #fff; font-weight: 700; text-shadow: 0 0 6px rgba(255,255,255,0.15); }
.terminal-line .flag     { color: #FF6AC1; text-shadow: 0 0 8px rgba(255,106,193,0.3); }
.terminal-line .string   { color: #5AF78E; text-shadow: 0 0 8px rgba(90,247,142,0.3); }
.terminal-line .comment  { color: var(--neutral-500); font-style: italic; }
.terminal-line .output   { color: var(--neutral-300); }
.terminal-line .success  { color: #5AF78E; text-shadow: 0 0 10px rgba(90,247,142,0.4); }
.terminal-line .info-blue { color: #57C7FF; text-shadow: 0 0 8px rgba(87,199,255,0.4); }

.cursor-blink {
  display: inline-block;
  width: 10px; height: 20px;
  background: var(--primary-500);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: var(--space-2xs);
  box-shadow: 0 0 10px rgba(243,126,1,0.5);
}

/* --- Terminal Search --- */
.terminal-search {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid rgba(243,126,1,0.15);
  background:
    linear-gradient(135deg, rgba(243,126,1,0.08) 0%, rgba(15,15,15,0.8) 40%, rgba(87,199,255,0.05) 70%, rgba(90,247,142,0.05) 100%);
  background-size: 200% 200%;
  animation: searchPulse 6s ease infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
}
.terminal-search.visible {
  opacity: 1;
}
.terminal-search-prompt {
  color: var(--primary-500);
  font-family: var(--font-mono);
  font-size: 26px;
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(243,126,1,0.5);
}
.terminal-search .search-placeholder {
  position: absolute;
  left: 64px;
  font-family: var(--font-mono);
  font-size: 22px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.terminal-search .search-placeholder.hidden {
  opacity: 0;
}
.terminal-search .search-placeholder .cmd {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(255,255,255,0.15);
}
.terminal-search .search-placeholder .flag {
  color: #FF6AC1;
  text-shadow: 0 0 8px rgba(255,106,193,0.3);
}
.terminal-search .search-placeholder .str {
  color: #57C7FF;
  text-shadow: 0 0 8px rgba(87,199,255,0.3);
}
.terminal-search .search-placeholder .val {
  color: #5AF78E;
  text-shadow: 0 0 8px rgba(90,247,142,0.3);
}
.terminal-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--neutral-100);
  font-family: var(--font-mono);
  font-size: 22px;
  caret-color: var(--primary-500);
  position: relative;
  z-index: 1;
}
.terminal-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(20,20,20,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(243,126,1,0.15);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  display: none;
}
.terminal-search-results.active {
  display: block;
}
.terminal-search-result {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xl);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--neutral-300);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.terminal-search-result:hover,
.terminal-search-result.active {
  background: rgba(243,126,1,0.12);
  color: var(--primary-400);
}
.terminal-search-result .result-icon {
  color: var(--primary-500);
  font-size: 16px;
  text-shadow: 0 0 6px rgba(243,126,1,0.4);
}

/* --- Search Highlight on Target --- */
@keyframes search-glow {
  0% { box-shadow: 0 0 0 rgba(243,126,1,0); }
  30% { box-shadow: 0 0 30px rgba(243,126,1,0.3), 0 0 60px rgba(243,126,1,0.1); }
  100% { box-shadow: 0 0 0 rgba(243,126,1,0); }
}
.search-highlight {
  animation: search-glow 1.5s ease both;
}
