/* SHARDOCHAIN // modern professional theme.
 * Inspired by Stripe, Vercel, Linear, Tailwind docs.
 * Dark base, multi-accent palette, glassmorphism.
 */

:root {
  /* Backgrounds */
  --bg-base: #0a0b14;
  --bg-elevated: #11131e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-code: #0d0f1a;

  /* Borders + lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  /* Accent palette — rich, intentional */
  --indigo: #6366f1;
  --indigo-glow: rgba(99, 102, 241, 0.5);
  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.5);
  --pink: #ec4899;
  --pink-glow: rgba(236, 72, 153, 0.5);
  --rose: #f43f5e;
  --orange: #f97316;
  --amber: #f59e0b;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.5);
  --teal: #14b8a6;
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.5);
  --yellow: #fcee0a;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --grad-accent:  linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --grad-hot:     linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --grad-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-bg:      radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15), transparent 50%),
                  radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.1), transparent 50%);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  background-image: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ----- NAV ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 20, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: white;
  box-shadow: 0 0 20px var(--indigo-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--indigo); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: var(--grad-primary);
  color: white !important;
  border-radius: 8px;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  box-shadow: 0 4px 16px var(--indigo-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--indigo-glow);
}

/* ----- HERO ----- */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
}
.hero-badge .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}
.hero h1 .gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.55;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 6px 24px var(--indigo-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px var(--indigo-glow);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ----- LIVE STATS ----- */
.stats-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.3rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.stat-card.indigo  .value { color: var(--indigo);  }
.stat-card.violet  .value { color: var(--violet);  }
.stat-card.pink    .value { color: var(--pink);    }
.stat-card.emerald .value { color: var(--emerald); }
.stat-card.cyan    .value { color: var(--cyan);    }
.stat-card.amber   .value { color: var(--amber);   }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.45rem 0.95rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.status-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.5s ease-in-out infinite;
}
.status-pill.error {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
}
.status-pill.error .dot {
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
}

/* ----- FEATURES ----- */
.features {
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 2rem;
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.8rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}
.feat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 1.7rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.feat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: white;
}
.feat-icon.indigo  { background: var(--grad-primary); box-shadow: 0 4px 18px var(--indigo-glow); }
.feat-icon.cyan    { background: var(--grad-accent);  box-shadow: 0 4px 18px var(--cyan-glow);   }
.feat-icon.pink    { background: var(--grad-hot);     box-shadow: 0 4px 18px var(--pink-glow);   }
.feat-icon.emerald { background: var(--grad-emerald); box-shadow: 0 4px 18px var(--emerald-glow);}
.feat-icon.amber   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.feat-icon.violet  { background: linear-gradient(135deg, #8b5cf6, #d946ef); box-shadow: 0 4px 18px var(--violet-glow); }
.feat-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.feat-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ----- DOWNLOAD ----- */
.download {
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 2rem;
}
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.dl-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  filter: blur(80px);
}
.dl-card:hover { border-color: var(--indigo); transform: translateY(-4px); }
.dl-card:hover::after { opacity: 0.08; }
.dl-card > * { position: relative; z-index: 1; }
.dl-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.dl-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo);
  font-weight: 600;
}
.dl-tag.platform { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.dl-tag.size     { background: rgba(245, 158, 11, 0.15); color: var(--amber); }

.dl-card h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}
.dl-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.dl-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  background: var(--grad-primary);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 6px 20px var(--indigo-glow);
  transition: all 0.18s ease;
}
.dl-button:hover { transform: translateY(-1px); box-shadow: 0 10px 28px var(--indigo-glow); }

/* ----- CODE ----- */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: auto;
  margin: 1rem 0;
}
.code-block .c { color: var(--text-muted); }
.code-block .k { color: var(--pink); }
.code-block .s { color: var(--emerald); }
.code-block .n { color: var(--cyan); }
.code-block .v { color: var(--amber); }

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--cyan);
}

/* ----- DOCS LAYOUT ----- */
.docs-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  min-height: calc(100vh - 70px);
}
.docs-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 1rem;
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.docs-sidebar h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.6rem;
  font-weight: 600;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.docs-sidebar a {
  display: block;
  padding: 0.45rem 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.92rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}
.docs-sidebar a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.docs-sidebar a.active {
  color: var(--indigo);
  background: rgba(99, 102, 241, 0.1);
  border-left-color: var(--indigo);
  font-weight: 600;
}

.docs-main {
  min-width: 0;
}
.docs-main .crumbs {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}
.docs-main h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}
.docs-main .lede {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 720px;
  line-height: 1.55;
}
.docs-main h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.docs-main h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.7rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.docs-main p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
  max-width: 760px;
}
.docs-main ul, .docs-main ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  max-width: 760px;
}
.docs-main li { margin-bottom: 0.4rem; line-height: 1.6; }
.docs-main a {
  color: var(--indigo);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.docs-main a:hover { border-bottom-color: var(--indigo); }
.docs-main strong { color: var(--text-primary); font-weight: 600; }

.docs-main table {
  width: 100%;
  max-width: 760px;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.93rem;
}
.docs-main th, .docs-main td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.docs-main th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
}
.docs-main td:first-child { color: var(--text-primary); }
.docs-main td code { color: var(--cyan); }

.callout {
  border-left: 4px solid;
  padding: 1rem 1.3rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  max-width: 760px;
  background: var(--bg-card);
}
.callout.info    { border-color: var(--cyan); }
.callout.warn    { border-color: var(--amber); }
.callout.success { border-color: var(--emerald); }
.callout.danger  { border-color: var(--rose); }
.callout strong { color: var(--text-primary); }

/* ----- FOOTER ----- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  padding: 3rem 2rem 4rem;
  background: rgba(10, 11, 20, 0.5);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.footer-brand p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  max-width: 320px;
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-col a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  max-width: 1280px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .nav-inner { padding: 0.85rem 1.2rem; }
  .nav-links { gap: 1.2rem; }
  .nav-links li:not(:last-child) { display: none; }
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }
  .docs-sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
    max-height: none;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
