/* Display font for headings - Space Grotesk */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* Monospace font - JetBrains Mono for tech/code aesthetic */
.font-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 30px rgba(0, 229, 86, 0.2);
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  h2 {
    font-size: 1.875rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  p {
    font-size: 0.95rem;
    margin-bottom: 16px;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 6rem;
  }
}

/* Terminal Code Block Styling */
.terminal-code-block {
  background: #000;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 24px;
  font-size: 0.875rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  max-width: 750px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1.5em;
}

.terminal-code-block .terminal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: #111827;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  z-index: 1;
}

.terminal-code-block .terminal-header-dot {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
}

.terminal-code-block .terminal-header-dot.red {
  background: #ef4444;
}

.terminal-code-block .terminal-header-dot.yellow {
  background: #eab308;
}

.terminal-code-block .terminal-header-dot.green {
  background: #22c55e;
}

.terminal-code-block .terminal-content {
  padding: 24px;
  overflow-x: hidden;
  overflow-y: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  position: relative;
  line-height: 1.6;
  text-align: left;
  font-size: 0.875rem;
}

/* Standard line spacing - 8px between lines */
.terminal-code-block .terminal-content > div {
  margin: 0;
  margin-bottom: 8px;
  padding: 0;
  display: block;
  line-height: 1.6;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  font-size: inherit;
}

/* Remove margin from last child only if it doesn't have explicit margin */
.terminal-code-block .terminal-content > div:last-child:not([style*="margin-bottom"]) {
  margin-bottom: 0;
}

/* Quoted/important content with border-left - 16px margin top/bottom */
.terminal-code-block .terminal-content > div[style*="border-left"],
.terminal-code-block .terminal-content > div[style*="padding-left: 16px"][style*="border-left"] {
  margin-top: 16px !important;
  margin-bottom: 16px !important;
  padding-left: 16px !important;
}

/* Lines with 16px margin-bottom (typically before quoted content) */
.terminal-code-block .terminal-content > div[style*="margin-bottom: 16px"]:not([style*="border-left"]) {
  margin-bottom: 16px !important;
}

/* Lines with margin-top (typically after quoted content or section breaks) */
.terminal-code-block .terminal-content > div[style*="margin-top"] {
  margin-top: 16px !important;
}

/* Ensure copy button stays fixed during horizontal scroll */
.terminal-code-block {
  position: relative;
}

.terminal-code-block .terminal-code-block-copy,
pre.font-mono .terminal-code-block-copy {
  position: absolute;
  top: 32px;
  right: 16px;
  pointer-events: auto;
}

/* Support for pre.font-mono elements (legacy format) */
pre.font-mono {
  position: relative;
}

pre.font-mono .terminal-code-block-copy {
  z-index: 10;
}

.terminal-code-block .terminal-content pre {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow: hidden;
}

.terminal-code-block .terminal-content code {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow: hidden;
}

.terminal-code-block .terminal-content > * {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Copy Button */
.terminal-code-block-copy {
  position: absolute;
  top: 32px;
  right: 16px;
  background: rgba(0, 229, 86, 0.1);
  border: 1px solid rgba(0, 229, 86, 0.3);
  color: var(--primary);
  padding: 8px;
  border-radius: 4px;
  font-size: 0;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0.8;
  width: 32px;
  height: 32px;
  min-width: 32px;
  box-sizing: border-box;
}

.terminal-code-block-copy:hover {
  background: rgba(0, 229, 86, 0.2);
  border-color: var(--primary);
  opacity: 1;
}

.terminal-code-block-copy:active {
  transform: scale(0.95);
}

.terminal-code-block-copy.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #22c55e;
}

.terminal-code-block-copy .copy-icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  display: inline-block;
  line-height: 1;
}

.terminal-code-block-copy .copy-text {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .terminal-code-block {
    max-width: 100%;
    padding: 20px 16px;
    font-size: 0.8125rem;
  }

  .terminal-code-block .terminal-content {
    padding-top: 32px;
  }

  .terminal-code-block-copy,
  pre.font-mono .terminal-code-block-copy {
    top: 28px;
    right: 12px;
    padding: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .terminal-code-block-copy .copy-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }
}

