/* Fix: keep animated canvas visible across entire page and keep content above it */
:root{
  --bg:#070b14;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.04);
  --line: rgba(255,255,255,0.10);
  --text:#ecf2ff;
  --muted:#a7b2cc;
  --accent:#7c5cff;
  --accent2:#00d4ff;
  --shadow: 0 18px 70px rgba(0,0,0,0.55);
  --radius: 20px;
  --radius2: 26px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  background: var(--bg); /* base behind everything */
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  line-height:1.55;
  overflow-x:hidden;
}

/* Animated background */
#bg{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  display:block;
  pointer-events:none;
}

/* Optional overlay gradients above canvas, below content */
.bg-overlay{
  position:fixed;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    radial-gradient(900px 600px at 20% 0%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(700px 500px at 80% 10%, rgba(0,212,255,.14), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(124,92,255,.10), transparent 55%);
  opacity: 1;
}

/* Ensure site UI sits above background layers everywhere */
.site-header, main, footer{
  position:relative;
  z-index: 2;
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.98}

.container{width:min(1120px, calc(100% - 32px)); margin:0 auto}
.muted{color:var(--muted)}
.small{font-size:13px}
code{
  padding:2px 7px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
}

.sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  border:0;
}

.site-header{
  position:sticky; top:0;
  backdrop-filter: blur(12px);
  background: rgba(7,11,20,0.55);
  border-bottom:1px solid var(--line);
}
.header-inner{display:flex; align-items:center; justify-content:space-between; padding: 14px 0}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.2px}
.brand-mark{
  width:14px;height:14px;border-radius:7px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 7px rgba(124,92,255,.14);
}
.brand-text{font-size:16px}
.nav{display:flex;gap:14px;align-items:center}
.nav-link{color:var(--muted); padding:8px 10px; border-radius: 12px; border:1px solid transparent}
.nav-link:hover{color:var(--text); border-color: var(--line); background: rgba(255,255,255,0.04)}
.nav-link.is-active{color:var(--text)}

.hero{padding: 34px 0 16px}
.hero-inner{display:grid; grid-template-columns: 1.25fr .75fr; gap: 16px; align-items:stretch}
.hero-left{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: var(--shadow);
  padding: 22px;
  position:relative;
  overflow:hidden;
}
.pill{
  display:inline-flex; align-items:center; gap:10px;
  padding: 8px 12px;
  border:1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
}
.pill-dot{
  width:9px;height:9px;border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 6px rgba(0,212,255,.10);
}
h1{margin: 12px 0 10px; font-size: clamp(30px, 3.2vw, 44px); line-height:1.08; letter-spacing:-0.02em}
.lead{margin:0 0 14px; max-width: 58ch}

.search-row{display:flex; gap:10px; margin-top: 14px}
.input,.select{
  width:100%; padding: 12px 12px;
  border-radius: 14px; border:1px solid var(--line);
  background: rgba(10,14,26,0.70);
  color:var(--text); outline:none;
}
.input:focus,.select:focus{border-color: rgba(124,92,255,.50); box-shadow: 0 0 0 4px rgba(124,92,255,.14)}
.select{max-width: 210px}

.hero-stats{display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; margin-top: 14px}
.stat{border:1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: 16px; padding: 10px 12px}
.stat-k{color:var(--muted);font-size:12px}
.stat-v{font-size:18px;font-weight:800;margin-top:2px}
.meta-note{margin-top: 10px; color:var(--muted); font-size: 13px}

.hero-right{display:flex; flex-direction:column; gap: 14px}
.panel{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel.mini{padding: 14px}
.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:10px}
.panel-title{font-weight:900}
.panel-sub{color:var(--muted);font-size:12px}
.latest-card{display:block; border:1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: 18px; overflow:hidden}
.latest-cover{height: 150px; background-size: cover; background-position: center; border-bottom: 1px solid var(--line)}
.latest-body{padding: 12px}
.latest-title{font-weight:900; margin:0 0 8px; line-height:1.2}
.latest-excerpt{color:var(--muted);margin:0 0 10px; font-size: 14px}
.latest-tags{display:flex;flex-wrap:wrap;gap:6px}

.mini-body{display:flex;flex-direction:column;gap:10px}
.mini-row{display:flex;gap:10px;align-items:center}
.mini-badge{font-size: 12px; padding: 4px 8px; border-radius: 999px; border:1px solid var(--line); background: rgba(124,92,255,0.12)}
.mini-text{color:var(--muted);font-size:13px}

.content{padding: 14px 0 18px}
.content.soft{
  padding: 18px 0 26px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,0.015); /* keep transparent so animation remains visible */
}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; gap: 12px; margin: 10px 0 14px}
h2{margin:0; font-size: 22px}
h3{margin:0 0 10px; font-size: 18px}

.grid{display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px}
.card{
  display:flex; flex-direction:column;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transform: translateY(0);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  min-height: 330px;
}
.card:hover{transform: translateY(-2px); background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.16)}
.card-cover{height: 170px; background-size: cover; background-position:center; border-bottom:1px solid var(--line); position:relative}
.card-cover:after{content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 40%, rgba(7,11,20,.55))}
.card-body{padding: 14px; display:flex;flex-direction:column;gap:10px}
.card-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.card-title{margin:0; font-size: 16px; font-weight: 900; line-height:1.2}
.card-date{font-size: 12px; color: var(--muted); border:1px solid var(--line); padding: 4px 8px; border-radius: 999px; white-space: nowrap; background: rgba(255,255,255,0.03)}
.card-excerpt{margin:0;color:var(--muted);font-size:14px}
.tag{font-size:12px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,212,255,0.10)}
.card-tags{display:flex;flex-wrap:wrap;gap:6px}

.empty{
  margin-top: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius2);
  padding: 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.empty-title{font-weight:900}
.empty-text{color:var(--muted); font-size: 14px}

.btn{
  border:1px solid rgba(124,92,255,.55);
  background: rgba(124,92,255,.16);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{background: rgba(124,92,255,.22)}
.btn.ghost{border-color: var(--line); background: rgba(255,255,255,0.03)}
.btn.ghost:hover{background: rgba(255,255,255,0.06)}

.two-col{display:grid;grid-template-columns: 1fr 1fr;gap: 16px}
.cardlike{border:1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: var(--radius2); padding: 16px}
.bullets{margin: 10px 0 0 18px; color: var(--muted)}
.bullets li{margin: 6px 0}
.list{margin: 10px 0 0 18px; color: var(--muted)}
.list li{margin: 8px 0}
.hint{margin-top: 10px; color: var(--muted); font-size: 13px; border:1px dashed rgba(255,255,255,0.18); border-radius: 14px; padding: 10px 12px; background: rgba(255,255,255,0.02)}

.contact-card{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius2);
  padding: 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.contact-right{text-align:right}
.chip{display:inline-flex; padding: 6px 10px; border-radius: 999px; border:1px solid var(--line); background: rgba(0,212,255,0.10); font-weight:900}

.footer{
  border-top:1px solid var(--line);
  background: rgba(7,11,20,0.55);
  backdrop-filter: blur(10px);
  padding: 16px 0;
}
.footer-inner{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}

.post-wrap{padding: 20px 0 28px}
.back{display:inline-block;margin: 4px 0 12px;color:var(--muted)}
.back:hover{color:var(--text)}

.post{border:1px solid var(--line); border-radius: var(--radius2); background: rgba(255,255,255,0.03); box-shadow: var(--shadow); overflow:hidden}
.post-cover{height: 300px; background-size: cover; background-position: center; border-bottom:1px solid var(--line); position:relative}
.post-cover:after{content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 30%, rgba(7,11,20,.65))}
.post-body{padding: 18px}
.post-top{max-width: 150ch; text-align: center}
.post-meta{display:flex;align-items:center;gap:10px;color:var(--muted);margin-top: 8px}
.post-excerpt{margin: 12px 0 0; color: var(--muted)}
.post-content{margin-top: 16px; max-width: 150ch}
.post-content p{margin: 0 0 14px; color: var(--text); opacity: .92}
.post-footer{margin-top: 18px; padding-top: 14px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap: 12px; flex-wrap:wrap}

@media (max-width: 940px){
  .hero-inner{grid-template-columns: 1fr}
  .grid{grid-template-columns: repeat(2, 1fr)}
  .two-col{grid-template-columns: 1fr}
}
@media (max-width: 560px){
  .grid{grid-template-columns: 1fr}
  .search-row{flex-direction:column}
  .select{max-width: 100%}
  .hero-stats{grid-template-columns: 1fr}
}


.header-right{display:flex; align-items:center; gap: 12px;}
.lang-select{max-width: 84px;}
@media (max-width: 560px){
  .header-right{gap: 10px;}
  .lang-select{max-width: 96px;}
}

/* Share UI (post page) */
.post-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.share-pop{
  width:100%;
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
}

.share-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.share-row .input{
  flex:1;
  min-width: 220px;
}

.share-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}


/* -----------------------------
   Contextual ads
----------------------------- */
.ctx-intext { margin: 16px 0; }

.ctx-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  padding: 14px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.ctx-kicker { font-size: 12px; opacity: .75; margin-bottom: 6px; }
.ctx-title { font-weight: 700; margin-bottom: 6px; }
.ctx-text { opacity: .9; margin-bottom: 10px; }

.ctx-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  pointer-events: auto;
}

.ctx-modal { position: fixed; inset: 0; z-index: 10000; }
.ctx-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.ctx-modal__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 24px));
  background: rgba(15,15,15,.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.ctx-modal__close {
  position: absolute; right: 10px; top: 8px;
  background: transparent; border: 0; color: var(--text);
  font-size: 22px; cursor: pointer;
}
