/* ============================================
   BrainyStack — Dark Premium Theme
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-elevated: #181818;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.12);
  --accent-glow: rgba(0, 212, 170, 0.25);
  --text: #e8e8e8;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: #222222;
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* ---- Layout ---- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

/* ---- Hero ---- */

.hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.hero .badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 32px;
  background: var(--accent-dim);
  animation: fadeInUp 0.6s ease both;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  position: relative;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .subline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

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

/* ---- Stats Bar ---- */

.stats {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.stat-item .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-item .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Section Headers ---- */

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ---- Cards Grid ---- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: border-color 0.3s, transform 0.3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ---- Proof of Work ---- */

.proof-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.proof-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s;
}

.proof-item:hover {
  border-color: var(--accent);
}

.proof-item .marker {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.proof-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.proof-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---- Conviction Quote ---- */

.conviction {
  text-align: center;
  padding: 100px 24px;
}

.conviction blockquote {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
  color: var(--text);
  position: relative;
}

.conviction blockquote::before {
  content: '\201C';
  font-size: 5rem;
  color: var(--accent);
  position: absolute;
  top: -40px;
  left: -10px;
  opacity: 0.4;
  line-height: 1;
}

.conviction .attribution {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer .footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

footer a {
  color: var(--text-muted);
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent);
}

/* ---- Chat Widget ---- */

.chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 212, 170, 0.35);
  transition: transform 0.3s, box-shadow 0.3s;
  z-index: 1000;
}

.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(0, 212, 170, 0.5);
}

.chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: #0a0a0a;
}

.chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-height: 520px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  z-index: 999;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}

.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.chat-header .status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-header .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
  animation: msgIn 0.25s ease both;
}

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

.msg.bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text);
}

.msg.user {
  background: var(--accent);
  color: #0a0a0a;
  align-self: flex-end;
  font-weight: 500;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.chat-input input::placeholder {
  color: var(--text-dim);
}

.chat-input input:focus {
  border-color: var(--accent);
}

.chat-input button {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.chat-input button:hover {
  opacity: 0.85;
}

.chat-input button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-input button svg {
  width: 18px;
  height: 18px;
  fill: #0a0a0a;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

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

  .chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 96px;
    max-height: 65vh;
  }

  .chat-toggle {
    bottom: 20px;
    right: 20px;
  }

  section {
    padding: 60px 0;
  }

  .hero {
    min-height: 70vh;
    padding: 80px 24px 40px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-item .number {
    font-size: 1.5rem;
  }

  .proof-item {
    padding: 20px;
  }
}
