:root {
  --bg: #05060f;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(0, 229, 255, 0.18);
  --cyan: #00e5ff;
  --purple: #b24bff;
  --text: #e6f1ff;
  --muted: #8a9bb8;
}

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

html { scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  overflow-x: hidden;
}

body { background: radial-gradient(ellipse at top, #0b1030 0%, var(--bg) 60%); }

#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 5%;
  background: rgba(5, 6, 15, 0.45);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 900; font-size: 1.5rem; text-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }
.logo span { color: var(--purple); }
.menu { display: flex; gap: 22px; }
.menu a { color: var(--muted); text-decoration: none; font-weight: 700; transition: color .2s; }
.menu a:hover { color: var(--cyan); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; }
#bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 12px var(--cyan);
}

/* ---------- Scroll scenes (3D depth is applied by JS) ---------- */
.scroll-root { position: relative; }

.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 6%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transform-origin: 50% 50%;
}

.hero-inner { text-align: center; margin: 0 auto; max-width: 900px; }

.eyebrow { color: var(--cyan); letter-spacing: 1px; font-weight: 700; margin-bottom: 14px; }

.hero h1, .s-news h2, .s-feat h2 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 900;
  line-height: 1.3;
}

.grad {
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite;
}

.lead { color: var(--muted); margin: 18px 0 30px; font-size: 1.1rem; }

.cta {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 14px;
  color: #000;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.35);
}

/* Features */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}
.feat {
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, box-shadow .3s;
}
.feat:hover { border-color: var(--cyan); box-shadow: 0 0 30px rgba(0, 229, 255, 0.2); }
.feat h3 { color: var(--cyan); margin-bottom: 10px; font-size: 1.25rem; }
.feat p { color: var(--muted); line-height: 1.9; }

/* News */
.s-news { min-height: auto; padding-top: 120px; }

.news-head { text-align: center; margin-bottom: 30px; }
.stats { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.stats span { color: var(--cyan); font-weight: 700; }

.tools { display: flex; gap: 10px; justify-content: center; margin: 22px 0 14px; flex-wrap: wrap; }

#search {
  width: min(420px, 80%);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 18px;
  outline: none;
  transition: box-shadow .3s, border-color .3s;
}
#search:focus { border-color: var(--cyan); box-shadow: 0 0 20px rgba(0, 229, 255, 0.25); }

.btn {
  font-family: inherit;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--cyan);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 18px rgba(0, 229, 255, 0.5); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-family: inherit;
  font-size: .85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s;
}
.chip:hover { color: var(--text); border-color: var(--cyan); }
.chip.active {
  color: #000;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.status { text-align: center; color: var(--muted); min-height: 24px; margin-top: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  max-width: 1300px;
  margin: 0 auto;
  perspective: 1000px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transition: transform .15s ease-out, box-shadow .3s, border-color .3s;
  animation: cardIn .7s ease both;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0, 229, 255, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--cyan); box-shadow: 0 20px 50px rgba(0, 229, 255, 0.15); }

.card-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.card-source { color: var(--purple); font-weight: 700; direction: ltr; }

.card h2 {
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 700;
  transform: translateZ(30px);
}
.card h2 a { color: var(--text); text-decoration: none; transition: color .2s; }
.card h2 a:hover { color: var(--cyan); }

.card-foot { margin-top: auto; display: flex; justify-content: flex-end; font-size: .85rem; }
.card-foot a { color: var(--cyan); text-decoration: none; font-weight: 700; }
.card-foot a:hover { text-decoration: underline; }

footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--border);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) rotateX(-25deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0); }
}
@keyframes shine { to { background-position: 200% center; } }

@media (max-width: 600px) {
  .menu { gap: 12px; font-size: .9rem; }
  .scene { padding: 90px 5%; }
}
