/* ============================================================
   INTRO SECTION — Two-column layout + Terminal UI Component
   ============================================================
   MERGE INSTRUCTIONS:
   ─ Grid/layout rules (.intro-section, .intro-grid) → layout.css
   ─ Component rules (.intro-terminal*, .intro-text, etc.) → components.css
   ─ Media queries at the bottom → responsive.css
   ============================================================ */

/* ── LAYOUT (→ layout.css) ─────────────────────────────── */

.intro-section {
  /* Inherits .content-section padding; no extra needed */
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

/* ── TEXT COLUMN (→ components.css) ────────────────────── */

.intro-text .section-tag {
  margin-bottom: var(--space-sm);
}

.intro-text .section-title {
  margin-bottom: var(--space-md);
}

.intro-body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.intro-body em {
  color: var(--color-text-primary);
  font-style: normal;
  font-weight: 600;
}

.intro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.intro-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ── TERMINAL WRAPPER (→ components.css) ─────────────── */

.intro-terminal-wrap {
  position: relative;
}

/* Subtle glow behind the terminal for depth */
.intro-terminal-wrap::before {
  content: "";
  position: absolute;
  inset: -24px;
  background: radial-gradient(
    ellipse at 60% 40%,
    var(--color-primary-light) 0%,
    transparent 70%
  );
  border-radius: var(--radius-xl);
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.intro-terminal {
  position: relative;
  z-index: 1;
  background: var(--color-surface-code);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--color-border);
  overflow: hidden;
  font-family: var(--font-code);
  font-size: var(--text-sm);

  /* Syntax: clamp(min, preferred, max) */
  /* height: clamp(400px, 500, 600px); */
  height: 420px;
  width: 100%;
}

/* ── TERMINAL TITLE BAR ────────────────────────────────── */

.intro-terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: color-mix(in srgb, var(--color-surface-code) 80%, white 20%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.intro-terminal-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.dot-red {
  background: #ff5f56;
}
.dot-yellow {
  background: #ffbd2e;
}
.dot-green {
  background: #27c93f;
}

.intro-terminal-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  margin-left: var(--space-sm);
  flex: 1;
  text-align: center;
  text-transform: lowercase;
}

/* ── TERMINAL BODY ─────────────────────────────────────── */

.intro-terminal-body {
  padding: var(--space-md) var(--space-lg);
  min-height: 320px;
  max-height: 380px;
  overflow-y: auto;
  scroll-behavior: smooth;

  /* Hide scrollbar visually, keep it functional */
  scrollbar-width: none;
}

.intro-terminal-body::-webkit-scrollbar {
  display: none;
}

/* ── TERMINAL LINES ────────────────────────────────────── */

.term-line {
  line-height: 1.7;
  white-space: pre-wrap; /* Changed from: pre */
  color: var(--color-text-code);
  transition: opacity var(--transition-fast);
  word-break: break-word; /* Optional: ensures very long words also break if needed */
}

.term-prompt {
  color: #27c93f; /* terminal green — intentional one-off for authenticity */
  font-weight: 700;
  margin-top: var(--space-md);
}

.term-prompt:first-child {
  margin-top: 0;
}

.term-output {
  color: rgba(255, 255, 255, 0.65);
  padding-left: var(--space-md);
}

/* Blinking cursor on the line currently being typed */
.term-cursor-line::after {
  content: "▋";
  display: inline-block;
  color: #27c93f;
  animation: blink-cursor 0.75s step-end infinite;
  margin-left: 1px;
}

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

/* ── DARK THEME ADJUSTMENTS ────────────────────────────── */

[data-theme="dark"] .intro-terminal-wrap::before {
  opacity: 0.25;
}

[data-theme="dark"] .intro-terminal {
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-float);
}

/* ── RESPONSIVE (→ responsive.css) ─────────────────────── */

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .intro-terminal-wrap {
    order: -1; /* terminal above text on tablet/mobile */
  }

  .intro-terminal-body {
    min-height: 240px;
    max-height: 280px;
  }
}

@media (max-width: 480px) {
  .intro-terminal {
    font-size: var(--text-xs);
  }

  .intro-terminal-body {
    padding: var(--space-md);
    min-height: 200px;
    max-height: 240px;
  }

  .intro-body {
    font-size: var(--text-base);
  }
}
