/* ============================================================
   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 ---- */
header.site {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(3, 6, 26, 0.8);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 6px 18px rgba(79,172,254,0.4);
}
.brand-text em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
nav.primary { display: flex; gap: 24px; align-items: center; }
nav.primary a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
nav.primary a:hover { color: var(--text); text-decoration: none; }
.header-cta {
  padding: 9px 18px; border-radius: 999px;
  background: var(--accent-grad); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 14px rgba(79,172,254,0.35);
}
.header-cta:hover { text-decoration: none; transform: translateY(-1px); }
@media (max-width: 760px) { nav.primary { display: none; } }

/* ---- Layout ---- */
main.container { max-width: 800px; margin: 0 auto; padding: 40px 24px 80px; }
@media (max-width: 640px) { main.container { 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; }

/* ---- 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);
}
