/* Components - Buttons, Badges, Terminal, Interactive Elements */

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font: var(--type-label);
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: var(--color-background);
  color: var(--color-text);
  min-width: 180px;
}

.btn:hover {
  background-color: #FAFAFA;
  opacity: 1;
}

.btn:active {
  background-color: #F5F5F5;
}

/* Primary Button — Uses red accent (1 of 2 red elements) */
.btn-primary {
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--color-accent);
  color: var(--color-background);
}

.btn-primary:active {
  background-color: #C03528;
}

/* Badge/Pills */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font: var(--type-label);
  background-color: var(--color-background);
}

/* Platform Badges */
.badge-group {
  display: inline-flex;
  gap: var(--space-xs);
}

.badge-platform {
  padding: 6px var(--space-sm);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Status Badge — Uses red accent (2 of 2 red elements) */
.badge-status {
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

/* ================================================
   TERMINAL MOCKUP — Pure CSS, no images
   ================================================ */
.terminal {
  background-color: var(--color-terminal-bg);
  border-radius: 6px;
  overflow: hidden;
  transform: perspective(1200px) rotateY(-2deg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background-color: #1A1A1A;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #333333;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #666666;
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #CCCCCC;
}

.terminal-line {
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-prompt {
  color: #FFFFFF;
  font-weight: 600;
}

.terminal-prompt .terminal-caret {
  color: #666666;
}

.terminal-comment {
  color: #666666;
  font-style: italic;
}

.terminal-response {
  color: #AAAAAA;
}

.terminal-diff-add {
  background-color: rgba(255, 255, 255, 0.06);
  color: #CCCCCC;
  display: inline;
}

.terminal-diff-remove {
  background-color: rgba(255, 255, 255, 0.03);
  color: #777777;
  text-decoration: line-through;
  display: inline;
}

.terminal-file {
  color: #FFFFFF;
  font-weight: 600;
}

.terminal-muted {
  color: #555555;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #FFFFFF;
  vertical-align: text-bottom;
}

/* Terminal variant for feature sections */
.terminal--small {
  transform: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.terminal--small .terminal-body {
  padding: 16px;
  font-size: 12px;
}

/* ================================================
   PIPELINE DIAGRAM — CSS-only boxes + lines
   ================================================ */
.pipeline {
  display: flex;
  align-items: center;
  gap: 0;
}

.pipeline-stage {
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  background-color: var(--color-background);
  white-space: nowrap;
}

.pipeline-arrow {
  width: 32px;
  height: 1px;
  background-color: var(--color-border);
  flex-shrink: 0;
  position: relative;
}

.pipeline-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-border);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* ================================================
   TIMELINE — Horizontal resilience visualization
   ================================================ */
.timeline {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
}

.timeline-segment {
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.timeline-label {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: var(--space-xs);
}

.timeline-bar {
  height: 2px;
  background-color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.timeline-status {
  font: var(--type-label);
  color: var(--color-gray-light);
}

/* ================================================
   IDENTITY ROW — Weight-varied typography
   ================================================ */
.identity-row {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  align-items: baseline;
}

.identity-name {
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--color-gray-light);
}

.identity-name--w400 { font-weight: 400; }
.identity-name--w500 { font-weight: 500; }
.identity-name--w600 { font-weight: 600; }
.identity-name--w700 { font-weight: 700; }
.identity-name--w800 { font-weight: 800; color: var(--color-text); }

/* ================================================
   SPEC TABLE — Architecture section
   ================================================ */
.spec-table td:first-child {
  color: var(--color-gray-light);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Responsive Components */
@media (max-width: 1024px) {
  .pipeline {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .pipeline-arrow {
    width: 20px;
  }

  .identity-row {
    gap: var(--space-lg);
  }

  .identity-name {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .btn {
    width: 100%;
    min-width: unset;
  }

  .badge-group {
    flex-wrap: wrap;
  }

  .terminal {
    transform: none;
  }

  .terminal-body {
    padding: 16px;
    font-size: 12px;
  }

  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-arrow {
    width: 1px;
    height: 20px;
    align-self: center;
  }

  .pipeline-arrow::after {
    right: -3px;
    top: auto;
    bottom: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 6px solid var(--color-border);
    border-bottom: none;
  }

  .timeline {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .timeline-segment {
    min-width: unset;
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-sm);
    align-items: center;
  }

  .timeline-bar {
    height: 2px;
    margin-bottom: 0;
  }

  .identity-row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .identity-name {
    font-size: 24px;
  }
}
