/* VoltchainHub — Global Styles */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --primary: #F5A623;
  --primary-dark: #d4881a;
  --primary-glow: rgba(245, 166, 35, 0.15);
  --green: #3fb950;
  --sidebar-w: 260px;
  --header-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

/* ── SCROLL PROGRESS ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #ffcc5c);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.logo span { color: var(--primary); }
.logo .bolt { font-size: 1.4rem; }

nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

nav a {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}

nav a.active {
  color: var(--primary);
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg2);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.roadmap-phase {
  margin-bottom: 1.25rem;
}

.phase-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--primary);
}

.phase-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem 0.2rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: default;
}

.phase-item:hover { background: var(--bg3); color: var(--text); }

.phase-item .check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.phase-item.done .check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.sidebar hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0.5rem;
}

/* ── MAIN LAYOUT ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── HERO (index.html only) ── */
.hero {
  padding: 5rem 3rem 4rem;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero h1 .accent { color: var(--primary); }

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

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

.btn-primary:hover {
  background: #ffb83d;
  text-decoration: none;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,166,35,0.4);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg2);
  text-decoration: none;
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ── STATS GRID ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 800px;
  margin: 0 3rem 3rem;
}

.stat-card {
  background: var(--bg2);
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

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

/* ── FEATURES ── */
.features {
  padding: 2rem 3rem 4rem;
  max-width: 900px;
}

.features h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.15s;
}

.feature-card:hover { border-color: var(--primary); }

.feature-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ── WHITEPAPER PAGE ── */
.wp-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow: hidden;
}

.wp-toc {
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  font-size: 0.8rem;
}

.wp-toc::-webkit-scrollbar { width: 3px; }
.wp-toc::-webkit-scrollbar-thumb { background: var(--border); }

.wp-toc .toc-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.wp-toc a {
  display: block !important;
  width: 100%;
  padding: 0.2rem 0.5rem;
  color: var(--text-muted);
  border-radius: 4px;
  line-height: 1.5;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wp-toc a:hover {
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}

.wp-toc a.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.wp-toc .toc-h3 { padding-left: 1rem; font-size: 0.75rem; }

.wp-body {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem;
  max-width: 800px;
  overflow-x: hidden;
}

/* ── ARTICLE TYPOGRAPHY ── */
.article h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article .meta span {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.78rem;
}

.article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
}

.article p {
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.75;
}

.article strong { color: var(--text); }

.article ul, .article ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.article li { margin-bottom: 0.4rem; color: var(--text); }

.article pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 1rem 0 1.5rem;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
}

.article pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.article code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
}

.article :not(pre) > code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--primary);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.article th {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

.article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  color: var(--text-muted);
}

.article tr:hover td { background: var(--bg2); color: var(--text); }

.article blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1.25rem;
  background: var(--primary-glow);
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.article .abstract {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.article .section-anchor {
  display: block;
  position: relative;
  top: calc(-1 * var(--header-h) - 20px);
  visibility: hidden;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg2);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--primary); }

.footer-links { display: flex; gap: 1rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .hero { padding: 3rem 1.5rem 2rem; }
  .hero h1 { font-size: 2rem; }
  .stats, .features { margin: 0 1.5rem 2rem; padding: 0 0 2rem; }
  .wp-toc { display: none; }
  .wp-body { padding: 1.5rem; }
  footer { padding: 1.5rem; }
}
