/* ==============================================================================
   PrintKrlo Knowledge Hub — Design System & Typography
   High-performance, modern dark aesthetic, mobile-first responsive layout
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-main: #030712;
  --bg-card: #0b1120;
  --bg-card-hover: #111827;
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  --border-active: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.12);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  line-height: 1.75;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
body::before {
  content: "";
  position: fixed;
  top: -15%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(3, 7, 18, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: -20%;
  right: 15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(3, 7, 18, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Scroll progress bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Header & Nav */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(3, 7, 18, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
}

.hub-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-btn-outline {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.nav-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

/* Container Layout */
.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
  position: relative;
  z-index: 10;
}

/* Article Hero Header */
.article-hero {
  max-width: 860px;
  margin: 0 auto 48px auto;
  text-align: center;
}

.article-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.article-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.85rem;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: #ffffff;
}

.article-hero h1 span.gradient-text {
  background: linear-gradient(135deg, #a5b4fc, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-subtitle {
  font-size: 1.18rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Article Grid Layout with Sidebar */
.article-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

@media (max-width: 992px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    display: none;
  }
  .article-hero h1 {
    font-size: 2.15rem;
  }
}

/* Sidebar Table of Contents */
.article-sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.toc-link:hover, .toc-link.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding-left: 12px;
}

/* Article Content Body */
.article-body {
  max-width: 820px;
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.85;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 48px 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 32px 0 14px 0;
}

.article-body p {
  margin-bottom: 22px;
}

.article-body strong {
  color: #ffffff;
  font-weight: 600;
}

.article-body ul, .article-body ol {
  margin: 0 0 24px 24px;
}

.article-body li {
  margin-bottom: 10px;
  padding-left: 4px;
}

/* Callouts / Info Boxes */
.callout {
  margin: 32px 0;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  background: var(--bg-card);
  position: relative;
}

.callout-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-info {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.06);
}
.callout-info .callout-title { color: #38bdf8; }

.callout-success {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.06);
}
.callout-success .callout-title { color: #34d399; }

.callout-warning {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.06);
}
.callout-warning .callout-title { color: #fbbf24; }

.callout-danger {
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.06);
}
.callout-danger .callout-title { color: #fb7185; }

/* Comparison Table */
.table-container {
  overflow-x: auto;
  margin: 32px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.custom-table th {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Highlight Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 32px 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hub Cards Grid (for index.html) */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.hub-card:hover::before {
  opacity: 1;
}

.card-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 16px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 12px;
}

.card-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.card-read-more {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Footer */
.hub-footer {
  border-top: 1px solid var(--border-subtle);
  background: #020617;
  padding: 60px 24px 40px 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.footer-col h4 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
}
