/**
 * Component Styles
 * Reusable components for case studies and blog posts
 */

/* ── Hero Section ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 50%, rgba(212, 160, 83, 0.06) 0%, transparent 60%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(212, 160, 83, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #f0c987);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  max-width: 600px;
  font-size: 1.15rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  margin-bottom: 2.5rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  animation: bounce 2s infinite;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ── Section Layout ── */
section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ── Divider ── */
.divider {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

.divider hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Credentials ── */
.creds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.cred {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.cred .icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translateX(-4px);
}

.timeline-item h3 {
  color: var(--text);
}

.timeline-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-phase {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* ── Tech Grid ── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

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

.tech-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.tech-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.75rem;
  font-weight: 500;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.stat {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #f0c987);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Architecture Diagram ── */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
}

.arch-diagram .highlight { color: var(--accent); font-weight: 500; }
.arch-diagram .green { color: var(--green); }
.arch-diagram .blue { color: var(--blue); }
.arch-diagram .purple { color: var(--purple); }
.arch-diagram .pink { color: var(--pink); }

/* ── Challenges ── */
.challenge-list {
  list-style: none;
  margin-top: 1.5rem;
}

.challenge-list li {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.challenge-list li strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.challenge-list li span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero {
    min-height: 80vh;
  }

  section {
    padding: 3rem 1rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .creds {
    flex-direction: column;
  }

  .timeline {
    padding-left: 1.5rem;
  }
}
