/* ============================================================
   OpenEAGO — GitHub Pages Stylesheet
   Inspired by openemcp-com (janrockdev)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { color: #475569; }

.gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-outline {
  background: transparent;
  color: #0f172a;
  border-color: #e2e8f0;
}
.btn-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-white {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
}
.btn-white:hover {
  background: #f1f5f9;
}

.btn-outline-light {
  background: transparent;
  color: #e2e8f0;
  border-color: #475569;
}
.btn-outline-light:hover {
  border-color: #94a3b8;
  background: rgba(255,255,255,0.05);
}

/* ---------- Icons ---------- */
.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.icon-right { margin-left: 0.125rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #64748b;
  text-decoration: none;
}

.logo-img {
  height: 2rem;
  width: auto;
}

.logo-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748b;
}

.main-nav {
  display: none;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.main-nav a:hover { color: #0f172a; }

.header-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #64748b;
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile nav open state */
.nav-open .main-nav {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 4rem;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
  gap: 1rem;
}

.nav-open .header-actions {
  display: flex;
  position: absolute;
  top: calc(4rem + 9.5rem);
  left: 0;
  right: 0;
  flex-direction: column;
  background: #fff;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }
  .header-actions {
    display: flex;
  }
  .nav-toggle {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #eff6ff, #fff);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 3rem;
  padding: 5rem 1.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 5rem 1.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.hero-content h1 {
  color: #0f172a;
}

.hero-description {
  font-size: 1.125rem;
  color: #475569;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.stat-label {
  font-size: 0.875rem;
  color: #64748b;
}

/* Hero Card */
.hero-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 440px;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.hero-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.05em;
}

.hero-card-version {
  font-size: 0.75rem;
  font-weight: 500;
  color: #2563eb;
  background: #eff6ff;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.hero-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.spec-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  font-size: 0.875rem;
  color: #475569;
}

.spec-block-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

/* ---------- Logos Bar ---------- */
.logos-bar {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  padding: 3rem 0;
}

.logos-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.logos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo-link img {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
}

.logo-fallback {
  font-size: 1.125rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.logos-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 0;
}

.bg-slate { background: #f8fafc; }

.section-dark {
  background: #0f172a;
  color: #fff;
}

.section-header {
  max-width: 42rem;
  margin-bottom: 3rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 0.75rem;
}

.section-label-light {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.0625rem;
  color: #64748b;
  max-width: 56ch;
}

.section-description-light {
  font-size: 1.0625rem;
  color: #94a3b8;
  max-width: 56ch;
}

/* ---------- Cards Grid ---------- */
.cards-grid {
  display: grid;
  gap: 1.5rem;
}

.cards-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.cards-grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #2563eb;
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.card p {
  font-size: 0.875rem;
  color: #64748b;
}

/* ---------- Adopters Bar ---------- */
.adopters-bar {
  background: #dbeafe;
  padding: 3rem 0;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
}

.adopter-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* ---------- Architecture ---------- */
.arch-inner {
  display: grid;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .arch-inner {
    grid-template-columns: 1fr 1.1fr;
  }
}

.arch-content h2 {
  margin-bottom: 1rem;
}

.arch-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
  list-style: none;
}

.arch-steps li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
  border-radius: 9999px;
  font-size: 0.9375rem;
}

.arch-steps strong {
  display: block;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.arch-steps p {
  font-size: 0.875rem;
  color: #64748b;
}

/* Code Card */
.arch-code-wrap {
  position: sticky;
  top: 5rem;
}

.code-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.code-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.code-card-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.code-card-sub {
  font-size: 0.8125rem;
  color: #64748b;
}

.code-block {
  background: #0f172a;
  padding: 1.25rem 1.5rem;
}

.code-filename {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #64748b;
  margin-bottom: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.code-block pre {
  overflow-x: auto;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  line-height: 1.7;
  white-space: pre;
}

/* ---------- Use Cases ---------- */
.usecases-inner {
  display: grid;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .usecases-inner {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.usecases-left h2 {
  margin-bottom: 1rem;
}

.usecase-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.usecase-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.usecase-card strong {
  display: block;
  font-size: 0.9375rem;
  color: #0f172a;
  margin-bottom: 0.375rem;
}

.usecase-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.why-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  position: sticky;
  top: 5rem;
}

.why-card h3 {
  margin-bottom: 1.5rem;
  color: #0f172a;
}

.why-items {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.why-item strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.why-item p {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
}

/* ---------- Blog ---------- */
.blog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.blog-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.blog-card-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #2563eb;
}

.blog-card h4 {
  font-size: 0.9375rem;
  color: #0f172a;
  line-height: 1.4;
}

.blog-card p {
  font-size: 0.8125rem;
  color: #64748b;
  flex: 1;
}

.blog-date {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: auto;
}

/* ---------- Community ---------- */
.community-inner {
  display: grid;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .community-inner {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.community-content h2 {
  margin-bottom: 1rem;
  color: #fff;
}

.community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.community-checklist {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1.5rem;
  padding: 2rem;
}

.community-checklist h3 {
  color: #f1f5f9;
  margin-bottom: 1.25rem;
}

.community-checklist ul {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.community-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
}

.check-icon {
  width: 1rem;
  height: 1rem;
  color: #34d399;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: #94a3b8;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
  justify-content: center;
}

.footer-nav a:hover { color: #0f172a; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
