/* ── BodhiForge — Futuristic Dark Theme ── */

:root {
  --bg: #0a0a0f;
  --bg-subtle: #12121a;
  --surface: #1a1a2e;
  --border: #2a2a3e;
  --text: #e0e0e8;
  --text-dim: #6a6a7e;
  --accent: #00e5ff;
  --accent-dim: #0099aa;
  --accent-glow: rgba(0, 229, 255, 0.15);
  --success: #00ff88;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Scan lines overlay ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── Grid canvas ── */
#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
}

/* ── Main layout ── */
main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Typography helpers ── */
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }

/* ── Status bar ── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success); }
  50% { opacity: 0.4; box-shadow: none; }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.logo-mark {
  margin-bottom: 32px;
}

.forge-icon {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.hex-outer {
  animation: rotate-slow 30s linear infinite;
  transform-origin: 60px 60px;
}

.hex-inner {
  animation: rotate-slow 30s linear infinite reverse;
  transform-origin: 60px 60px;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Sparks */
.spark {
  animation: spark-float 3s ease-in-out infinite;
}

.spark.s1 { animation-delay: 0s; }
.spark.s2 { animation-delay: 1s; }
.spark.s3 { animation-delay: 2s; }

@keyframes spark-float {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.title {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.title-bodhi {
  color: var(--text);
}

.title-forge {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
}

.tagline {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.divider-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}

.divider-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  transform: rotate(45deg);
}

.description {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── The Loop ── */
.loop-section {
  padding: 60px 0;
}

.loop-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 24px;
}

.loop {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.loop-step {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
  transition: all 0.3s ease;
  position: relative;
}

.loop-step:hover {
  border-color: var(--accent-dim);
  background: var(--surface);
  box-shadow: 0 0 20px var(--accent-glow);
}

.loop-step::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--border);
}

.loop-step:hover::before {
  background: var(--accent-dim);
}

.step-number {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 4px;
}

.step-name {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: block;
}

.loop-connector {
  padding: 8px 0 8px 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.connector-arrow {
  color: var(--accent-dim);
}

.loop-back {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}

.loop-back-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

/* ── Terminal ── */
.terminal-section {
  padding: 40px 0 60px;
}

.terminal {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.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 {
  margin-left: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 16px;
  font-size: 0.82rem;
  line-height: 1.8;
}

.term-line {
  white-space: nowrap;
  overflow: hidden;
}

.prompt {
  color: var(--accent);
}

.cmd {
  color: var(--text);
}

.term-line.output {
  color: var(--text-dim);
  padding-left: 16px;
}

.term-line.output.success {
  color: var(--success);
}

.blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Typewriter animation for terminal lines */
.term-line {
  opacity: 0;
  animation: fadeInLine 0.3s ease forwards;
}

.term-line:nth-child(1) { animation-delay: 0.2s; }
.term-line:nth-child(2) { animation-delay: 0.8s; }
.term-line:nth-child(3) { animation-delay: 1.4s; }
.term-line:nth-child(4) { animation-delay: 2.0s; }
.term-line:nth-child(5) { animation-delay: 2.6s; }
.term-line:nth-child(6) { animation-delay: 3.2s; }
.term-line:nth-child(7) { animation-delay: 3.8s; }

@keyframes fadeInLine {
  to { opacity: 1; }
}

/* ── Manifesto ── */
.manifesto {
  text-align: center;
  padding: 40px 0 60px;
}

blockquote {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

blockquote::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.manifesto-sub {
  margin-top: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

/* ── Contact ── */
.contact {
  padding: 40px 0 60px;
  text-align: center;
}

.contact-border {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 48px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
  transition: border-color 0.3s ease;
}

.contact-border:hover {
  border-color: var(--accent-dim);
}

.contact-border .mono {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.email-link {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  position: relative;
  transition: all 0.3s ease;
}

.email-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.email-link:hover {
  text-shadow: 0 0 20px var(--accent-glow);
}

.email-link:hover::after {
  width: 100%;
}

/* ── Footer ── */
footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
}

.footer-sep {
  color: var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  main {
    padding: 0 16px;
  }

  .hero {
    padding: 60px 0 40px;
  }

  .title {
    letter-spacing: 0.08em;
  }

  .loop {
    padding-left: 16px;
  }

  .contact-border {
    padding: 24px 32px;
  }

  .email-link {
    font-size: 0.95rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 4px;
  }

  .footer-sep {
    display: none;
  }
}

/* ── Scroll fade-in ── */
.loop-step,
.terminal,
.manifesto blockquote,
.contact-border {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.loop-step.visible,
.terminal.visible,
.manifesto blockquote.visible,
.contact-border.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger loop steps */
.loop-step:nth-child(1).visible { transition-delay: 0s; }
.loop-step:nth-child(3).visible { transition-delay: 0.1s; }
.loop-step:nth-child(5).visible { transition-delay: 0.2s; }
.loop-step:nth-child(7).visible { transition-delay: 0.3s; }
.loop-step:nth-child(9).visible { transition-delay: 0.4s; }
