/* ============================================================
   vir-prerender pages — post, project, blog list.
   Loaded by /post/:id, /p/:slug, /blog[/lang]. Never used by
   the Flutter Web app. Matches VIR.GROUP dark aesthetic.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-deep: #03061A;
  --bg-surface: #070B22;
  --bg-card: #0B112A;
  --bg-card-2: #0E1535;
  --border: rgba(106, 162, 255, 0.10);
  --border-strong: rgba(106, 162, 255, 0.22);
  --text: #E6ECFF;
  --text-muted: #8896C2;
  --text-dim: #5A6794;
  --brand: #4FACFE;
  --brand-2: #00F2FE;
  --brand-3: #6364FF;
  --accent-grad: linear-gradient(135deg, #6364FF 0%, #4FACFE 45%, #00F2FE 100%);
}
html, body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.prerender { min-height: 100vh; overflow-x: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* Header / nav / brand / footer styles inherited verbatim from
   vir-landing.css (loaded before this file in <head>). Prerender
   pages use the same DOM: <header class="site"><div class="container
   site-inner">…</div></header> — so users don't see chrome shift
   when navigating between landing and /post /p /blog /projects. */

/* ---- Layout — narrower reading column for prerender content ---- */
main.container.prerender-main { max-width: 800px; margin: 0 auto; padding: 40px 24px 80px; }
@media (max-width: 640px) { main.container.prerender-main { padding: 24px 16px 48px; } }
/* Wider column for grid pages (blog list, projects grid) */
main.container.prerender-wide { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }
@media (max-width: 640px) { main.container.prerender-wide { padding: 24px 16px 48px; } }

/* ---- Post ---- */
article.post {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.post-author { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.post-author:hover { text-decoration: none; }
.post-avatar { width: 48px; height: 48px; border-radius: 50%; }
.post-avatar-sm { width: 28px; height: 28px; border-radius: 50%; }
.post-author-info strong { display: block; font-weight: 700; }
.post-handle { display: block; font-size: 13px; color: var(--text-muted); }
.post-head time { color: var(--text-muted); font-size: 13px; font-family: 'JetBrains Mono', monospace; }

.post-content { font-size: 16.5px; line-height: 1.7; color: var(--text); margin: 12px 0; }
.post-content p { margin-bottom: 10px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content a {
  color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.post-content .invisible { position: absolute !important; left: -9999px !important; }
.post-content .ellipsis::after { content: '…'; }
.post-content .mention.hashtag,
.post-content a.hashtag { color: var(--brand-2); }

.post-media {
  margin: 16px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}
.post-media img, .post-media video { width: 100%; height: auto; display: block; }
.post-media figcaption {
  padding: 8px 12px; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}
.post-media figcaption:empty { display: none; }

.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.post-tags a {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(79,172,254,0.12); color: var(--brand);
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
}
.post-tags a:hover { text-decoration: none; background: rgba(79,172,254,0.22); }

.post-actions {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.post-stat { color: var(--text-muted); font-size: 14px; font-family: 'JetBrains Mono', monospace; }
.post-actions .btn { margin-left: auto; }

/* ---- Project ---- */
article.project {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.project-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.project-author { display: inline-flex; align-items: center; gap: 12px; }
.project-author strong { display: block; font-weight: 700; color: var(--text); }
.project-author small { color: var(--text-muted); font-size: 13px; }
.project-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-verified { background: rgba(34,197,94,0.15); color: #34D399; border-color: rgba(34,197,94,0.3); }
.badge-funded { background: rgba(255,215,0,0.15); color: #FFD700; border-color: rgba(255,215,0,0.3); }
.badge-paid { background: rgba(99,100,255,0.15); color: var(--brand-3); border-color: rgba(99,100,255,0.3); }

article.project h1 {
  font-size: clamp(24px, 3.5vw, 34px); line-height: 1.15;
  letter-spacing: -0.015em; font-weight: 800; margin: 8px 0 12px;
}
.project-pitch {
  font-size: 17px; color: var(--text-muted); margin-bottom: 20px;
  padding: 14px 16px; border-left: 3px solid var(--brand);
  background: rgba(79,172,254,0.05); border-radius: 6px;
}
.project-content { font-size: 16px; line-height: 1.7; color: var(--text); }
.project-content h2 { font-size: 22px; margin: 20px 0 10px; font-weight: 700; }
.project-content h3 { font-size: 18px; margin: 16px 0 8px; font-weight: 700; }
.project-content p { margin: 8px 0; }
.project-content ul, .project-content ol { margin: 8px 0 8px 24px; }

/* ---- Blog list ---- */
.section-head {
  margin: 20px 0 40px;
  text-align: center;
}
.section-head h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 12px;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head p { color: var(--text-muted); font-size: 16px; max-width: 640px; margin: 0 auto; }
.lang-switch {
  display: inline-block; margin-top: 12px; font-size: 13px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 1.2px;
  color: var(--brand-2);
}

.blog-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px;
}
@media (min-width: 720px) { .blog-grid { grid-template-columns: 1fr 1fr; } }

.blog-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.blog-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.blog-card-cover img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
}
.blog-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.blog-card-author {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 13px;
}
.blog-card-author time { margin-left: auto; font-family: 'JetBrains Mono', monospace; }
.blog-card h2 {
  font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; margin-top: 4px;
}
.blog-card h2 a { color: var(--text); }
.blog-card h2 a:hover { color: var(--brand); text-decoration: none; }
.blog-card p { color: var(--text-muted); font-size: 14.5px; line-height: 1.55; margin: 4px 0; }
.blog-card-more { color: var(--brand); font-size: 14px; font-weight: 600; margin-top: auto; }

.blog-footer { text-align: center; margin-top: 20px; }

/* ---- Projects grid ---- */
.proj-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  margin-top: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  flex-wrap: wrap; justify-content: center;
}
.proj-tabs a {
  padding: 8px 16px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.proj-tabs a:hover { color: var(--text); text-decoration: none; }
.proj-tabs a.active { background: var(--accent-grad); color: #fff; }

.proj-grid {
  display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 32px;
}
@media (min-width: 640px) { .proj-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .proj-grid { grid-template-columns: 1fr 1fr 1fr; } }

.proj-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.proj-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-grad); opacity: 0.7;
}
.proj-card-invest::before { background: linear-gradient(90deg, #F59E0B, #EAB308); }
.proj-card-crowd::before  { background: linear-gradient(90deg, #34D399, #06B6D4); }
.proj-card-sale::before   { background: linear-gradient(90deg, #A78BFA, #EC4899); }
.proj-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.proj-card-link {
  display: block; padding: 22px 22px 20px;
  color: var(--text);
  height: 100%;
}
.proj-card-link:hover { text-decoration: none; }
.proj-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.proj-card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.proj-card-author strong { display: block; font-size: 14px; font-weight: 600; }
.proj-card-author time {
  font-size: 12px; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.3px;
}
.proj-card-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.proj-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.proj-chip-invest    { color: #FCD34D; border-color: rgba(245,158,11,0.4); }
.proj-chip-crowd     { color: #6EE7B7; border-color: rgba(52,211,153,0.4); }
.proj-chip-sale      { color: #F0ABFC; border-color: rgba(236,72,153,0.4); }
.proj-chip-verified  { color: #4ADE80; border-color: rgba(74,222,128,0.4); }
.proj-chip-funded    { color: #F59E0B; border-color: rgba(245,158,11,0.4); }
.proj-card h2 {
  font-size: 16.5px; line-height: 1.35; letter-spacing: -0.01em;
  margin: 4px 0 8px; font-weight: 700;
}
.proj-card-excerpt {
  color: var(--text-muted); font-size: 13.5px; line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.proj-card-progress {
  position: relative; height: 6px;
  background: rgba(255,255,255,0.06); border-radius: 4px;
  margin-bottom: 12px; overflow: hidden;
}
.proj-card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #34D399, #06B6D4);
  border-radius: 4px;
}
.proj-card-progress-label {
  position: absolute; right: 8px; top: -18px;
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.proj-card-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim);
}
.proj-card-price {
  color: #FCD34D; font-weight: 700; font-family: 'JetBrains Mono', monospace;
}
.proj-card-stat { font-family: 'JetBrains Mono', monospace; }
.proj-card-more {
  margin-left: auto; color: var(--brand); font-weight: 600; font-size: 13px;
}

.proj-footer {
  text-align: center; margin-top: 20px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); font-size: 15px;
}
.empty-state a { color: var(--brand); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 6px 20px rgba(79,172,254,0.4);
}
.btn-primary:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(79,172,254,0.5); }

/* ---- Promo — "open in app" ---- */
.promo-open {
  margin-top: 28px; padding: 24px;
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px; text-align: center;
}
.promo-open h2 { font-size: 20px; margin-bottom: 8px; }
.promo-open p { color: var(--text-muted); margin-bottom: 14px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-row a {
  padding: 10px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: var(--text);
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--border-strong);
}
.cta-row a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

/* ---- Footer ---- */
footer.site {
  border-top: 1px solid var(--border);
  padding: 40px 24px 30px;
  margin-top: 60px;
  color: var(--text-muted);
}
.footer-grid {
  max-width: 960px; margin: 0 auto 30px;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
footer h4 {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 12px;
}
footer p { font-size: 14px; margin-top: 8px; color: var(--text-muted); max-width: 320px; }
footer a { display: block; padding: 4px 0; color: var(--text-muted); font-size: 14px; }
footer a:hover { color: var(--text); text-decoration: none; }
footer .meta {
  max-width: 960px; margin: 0 auto;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--text-dim);
}
