/* ============================================================
   Distributed Messaging Research – Global Styles
   ============================================================ */

:root {
  --color-primary: #1a365d;
  --color-primary-light: #2b6cb0;
  --color-accent: #2f855a;
  --color-accent-light: #48bb78;
  --color-bg: #ffffff;
  --color-bg-alt: #f7fafc;
  --color-bg-card: #ffffff;
  --color-text: #2d3748;
  --color-text-light: #718096;
  --color-border: #e2e8f0;
  --color-hero-bg: #1a365d;
  --color-hero-text: #ffffff;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1120px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── Reset ──────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent);
}

/* ── Typography ─────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.3;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* ── Layout ─────────────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

/* ── Navigation ─────────────────────────────────────────────── */

.nav {
  background: var(--color-primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
}

.nav__brand {
  color: var(--color-hero-text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav__links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover,
.nav__links a.active {
  color: #ffffff;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform 0.3s;
}

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2c5282 100%);
  color: var(--color-hero-text);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  color: var(--color-hero-text);
  max-width: 800px;
  margin: 0 auto 1.25rem;
  font-size: 2.25rem;
}

.hero__subtitle {
  color: rgba(255, 255, 255, 0.8);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

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

.btn--primary:hover {
  background: #276749;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

/* ── Cards ──────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.card__icon--accent {
  background: #f0fff4;
  color: var(--color-accent);
}

.card__icon--blue {
  background: #ebf8ff;
  color: var(--color-primary-light);
}

.card h3 {
  color: var(--color-primary);
}

.card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ── Content Sections ───────────────────────────────────────── */

.content-block {
  margin-bottom: 3rem;
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h2 {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.content-block ul {
  list-style: none;
  padding: 0;
}

.content-block li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  line-height: 1.6;
}

.content-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ── Steps / Pipeline ───────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.step {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.step h4 {
  color: var(--color-primary);
}

.step p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ── Architecture Diagram Placeholder ───────────────────────── */

.diagram-placeholder {
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin: 2rem 0;
}

/* ── Page Header (for sub-pages) ────────────────────────────── */

.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2c5282 100%);
  color: var(--color-hero-text);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  color: var(--color-hero-text);
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__note {
  font-size: 0.85rem;
  font-style: italic;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.footer__links a:hover {
  color: #fff;
}

.footer__copy {
  width: 100%;
  text-align: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
}

/* ── Shield / Badge Row ─────────────────────────────────────── */

.badges {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.badge__dot--blue {
  background: var(--color-primary-light);
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }

  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.4rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

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

  .section {
    padding: 2.5rem 0;
  }
}
