/* ========================================
   MINDBLOWING ENHANCEMENTS STYLESHEET
   ======================================== */

/* === MEGA MENU === */
.mega-menu-trigger {
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mega-menu-trigger:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.mega-menu-trigger .menu-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transition: background 0.2s;
}
.mega-menu-trigger:hover .menu-dot {
  background: #000;
}

.mega-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--accent);
  z-index: 9998;
  padding: 120px 60px 60px;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  max-height: 100vh;
  overflow-y: auto;
}
.mega-menu.active {
  transform: translateY(0);
}
.mega-menu-close {
  position: absolute;
  top: 40px;
  right: 60px;
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.mega-menu-close:hover {
  background: #ff3366;
  border-color: #ff3366;
  transform: rotate(90deg);
}
.mega-menu-grid {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
}
.mega-menu-column h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-800);
}
.mega-menu-column ul {
  list-style: none;
  padding: 0;
}
.mega-menu-column li {
  margin-bottom: 16px;
}
.mega-menu-column a {
  color: var(--fg);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 500;
  display: block;
  transition: all 0.2s;
  position: relative;
  padding-left: 0;
}
.mega-menu-column a:hover {
  color: var(--accent);
  padding-left: 16px;
}
.mega-menu-column a:hover::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.mega-menu-column .item-desc {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 400;
  margin-top: 4px;
  font-family: var(--font-mono);
}
.mega-menu-footer {
  max-width: 1600px;
  margin: 60px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--gray-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 0.15em;
}
.mega-menu-footer .status-live {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mega-menu-footer .live-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* === LIVE FEED TICKER === */
.live-feed {
  position: fixed;
  bottom: 120px;
  left: 30px;
  background: var(--bg);
  border: 1px solid var(--accent);
  padding: 16px 20px;
  max-width: 340px;
  z-index: 9996;
  transform: translateX(-120%);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0, 255, 136, 0.25);
}
.live-feed.visible {
  transform: translateX(0);
}
.live-feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.live-feed-content {
  flex: 1;
  min-width: 0;
}
.live-feed-name {
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.live-feed-action {
  color: var(--gray-300);
  font-size: 12px;
  font-family: var(--font-mono);
}
.live-feed-action .time {
  color: var(--accent);
}
.live-feed-close {
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}
.live-feed-close:hover {
  color: var(--fg);
}

/* === ANIMATED TERMINAL === */
.hero-terminal {
  width: 100%;
  max-width: 560px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: 0 30px 80px rgba(0, 255, 136, 0.15), 0 0 0 1px rgba(0, 255, 136, 0.3) inset;
}
.hero-terminal-header {
  background: var(--gray-800);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--gray-800);
}
.terminal-dots {
  display: flex;
  gap: 6px;
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title {
  color: var(--gray-300);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-left: 8px;
}
.hero-terminal-body {
  padding: 20px;
  min-height: 200px;
  color: var(--accent);
  line-height: 1.8;
}
.terminal-line {
  opacity: 0;
  transform: translateY(4px);
}
.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}
.terminal-prompt {
  color: var(--accent);
  margin-right: 8px;
}
.terminal-success { color: var(--accent); }
.terminal-warn { color: #febc2e; }
.terminal-info { color: var(--gray-300); }
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  animation: blink 1s infinite;
  vertical-align: middle;
  margin-left: 4px;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* === MAGNETIC BUTTONS === */
.magnetic {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.magnetic-inner {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* === 3D CARD TILTS === */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}
.tilt-card-content {
  transform: translateZ(30px);
}

/* === SCROLL PROGRESS INDICATOR === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}
.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff3366);
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent);
}

/* === STICKY SYSTEM SCROLL === */
.system-sticky-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1400px;
  margin: 80px 0;
}
.system-sticky-left {
  position: sticky;
  top: 200px;
  align-self: start;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-800);
  border: 1px solid var(--gray-800);
  overflow: hidden;
}
.system-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  padding: 40px;
}
.system-visual.active {
  opacity: 1;
}
.system-visual svg {
  max-width: 100%;
  max-height: 100%;
}
.system-scroll-steps {
  display: flex;
  flex-direction: column;
  gap: 120px;
}
.system-scroll-step {
  min-height: 400px;
  padding: 40px 0;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}
.system-scroll-step.active {
  opacity: 1;
}
.system-scroll-step .step-num {
  font-family: var(--font-mono);
  font-size: 60px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 20px;
  font-weight: 700;
}
.system-scroll-step h3 {
  font-size: 40px;
  color: var(--fg);
  margin-bottom: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.1;
}
.system-scroll-step p {
  color: var(--gray-300);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.system-scroll-step .step-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.step-tag {
  background: var(--gray-800);
  border: 1px solid var(--gray-700, #333);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-300);
  letter-spacing: 0.1em;
}

.step-details {
  list-style: none;
  padding: 0;
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-details li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-500);
  padding-left: 20px;
  position: relative;
  transition: color 0.3s ease;
}

.system-scroll-step.active .step-details li {
  color: var(--gray-300);
}

.step-details li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.system-scroll-step.active .step-details li::before {
  opacity: 1;
}

/* ===== 11. DASHBOARD MODE UI ===== */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10001;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0, 255, 136, 0.2);
  animation: slideDown 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.protocol-status {
  color: var(--accent);
  font-weight: 700;
}

.progress-track {
  height: 4px;
  background: var(--gray-800);
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--gray-600);
}

.p-step.active {
  color: var(--accent);
}

/* Onboarding Tool inside Card */
.onboarding-tool {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--gray-700);
  padding: 24px;
  margin: 24px 0;
  animation: fadeInScale 0.6s ease;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.tool-header {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-800);
  padding-bottom: 8px;
}

.tool-fields {
  display: flex;
  gap: 12px;
}

.tool-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--gray-700);
  color: #fff;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tool-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

/* Native Terminal Form */
.native-terminal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.native-terminal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.native-terminal-form label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.15em;
  opacity: 0.7;
}

.native-terminal-form input,
.native-terminal-form select {
  background: #050505;
  border: 1px solid var(--gray-800);
  padding: 14px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: 0;
  transition: all 0.3s ease;
}

.native-terminal-form input:focus,
.native-terminal-form select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

.protocol-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 18px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.protocol-btn:hover {
  background: #fff;
  transform: translateY(-2px);
}

.protocol-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Hide old system grid on desktop — we'll use the new sticky one */
@media (min-width: 900px) {
  .system-section .system-grid.legacy-hide {
    display: none;
  }
}
@media (max-width: 899px) {
  .system-sticky-wrapper {
    display: none;
  }
}

/* === ANIMATED GRAIN === */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9994;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='1'/></svg>");
}

/* === LIGHT MODE ADJUSTMENTS === */
.light-mode .mega-menu {
  background: #fff;
}
.light-mode .hero-terminal {
  background: rgba(255, 255, 255, 0.95);
}
.light-mode .live-feed {
  background: #fff;
}

/* Responsive */
@media (max-width: 900px) {
  .mega-menu {
    padding: 100px 30px 40px;
  }
  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hero-terminal {
    display: block;
    max-width: 100%;
  }
  .live-feed {
    left: 16px;
    right: 16px;
    max-width: none;
    bottom: 140px;
  }
}

/* === TERMINAL SECTION === */
.terminal-section {
  padding: 120px 40px;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--gray-800);
  border-bottom: 1px solid var(--gray-800);
  position: relative;
  overflow: hidden;
}
.terminal-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(0, 255, 136, 0.06), transparent 70%);
  pointer-events: none;
}
.terminal-section-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
  position: relative;
}
.terminal-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.25em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.terminal-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.terminal-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 28px;
  text-wrap: balance;
}
.terminal-headline .accent { color: var(--accent); }
.terminal-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--gray-300);
  max-width: 520px;
  margin-bottom: 40px;
}
.terminal-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.terminal-meta-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-300);
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--gray-800);
}
.terminal-meta-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
.terminal-meta-item .dot.warn {
  background: #febc2e;
}

@media (max-width: 900px) {
  .terminal-section {
    padding: 80px 20px;
  }
  .terminal-section-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-terminal {
    display: block;
  }
}

/* === ASSESSMENT COMPONENT === */
.assessment-container {
  padding: 60px;
  background: var(--bg);
  border: 1px solid var(--accent);
  max-width: 800px;
  width: 100%;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 255, 136, 0.1);
}

.step-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 40px;
}

.progress-track {
  width: 100%;
  height: 2px;
  background: var(--gray-800);
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--accent);
}

.question-text {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 48px;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option-btn {
  background: transparent;
  border: 1px solid var(--gray-800);
  padding: 24px 30px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.02);
}

.option-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-500);
}

.option-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}

.assessment-loading {
  padding: 100px 60px;
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 2px solid var(--gray-800);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 32px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.loading-subtext {
  font-size: 14px;
  color: var(--gray-500);
}

.assessment-result {
  padding: 60px;
  text-align: center;
}

.terminal-header {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 0.3em;
  margin-bottom: 48px;
}

.score-display {
  margin-bottom: 48px;
}

.score-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

.score-value {
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

.score-status {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.result-desc {
  font-size: 18px;
  color: var(--gray-300);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 48px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--fg);
}

/* Assessment Modal */
#assessment-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#assessment-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-close {
  position: absolute;
  top: 40px;
  right: 60px;
  background: transparent;
  border: 1px solid var(--gray-700);
  color: var(--fg);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  .question-text {
    font-size: 28px;
  }
  .score-value {
    font-size: 80px;
  }
  .modal-close {
    top: 20px;
    right: 20px;
  }
}
